diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-29 12:36:34 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-29 12:36:34 +0000 |
commit | 428bf0cbd77813a43094cb5c984436deff251936 (patch) | |
tree | d7dfa8971153d53a849e45c942be97fe5b90b7ec | |
parent | 82ef17ca5286f58ae7af604fb9518e8dc496b7c3 (diff) |
no more TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17143 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
868 files changed, 4906 insertions, 5204 deletions
diff --git a/include/deprecated/m_errors.h b/include/deprecated/m_errors.h index c714ba4e87..ab2a37626d 100644 --- a/include/deprecated/m_errors.h +++ b/include/deprecated/m_errors.h @@ -31,12 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MERR_DEFAULT_ERROR 0x08
#define MERR_DEFAULT_ALL 0x0E
-#ifdef _UNICODE
- #define MERR_TCHAR MERR_UNICODE
-#else
- #define MERR_TCHAR 0
-#endif
-
// Error notifications are sorted according to this level
#define MERR_LEVEL_INFO 1
#define MERR_LEVEL_WARNING 2
diff --git a/include/m_awaymsg.h b/include/m_awaymsg.h index 3b5ab38c26..0217dddeef 100644 --- a/include/m_awaymsg.h +++ b/include/m_awaymsg.h @@ -38,10 +38,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //returns status msg. Remember to free the return value using mir_free/ptrW
#define MS_AWAYMSG_GETSTATUSMSGW "SRAway/GetStatusMessageW"
-#ifdef _UNICODE
-#define MS_AWAYMSG_GETSTATUSMSGT MS_AWAYMSG_GETSTATUSMSGW
-#else
-#define MS_AWAYMSG_GETSTATUSMSGT not implemented
-#endif
-
#endif // M_AWAYMSG_H__
diff --git a/include/m_button.h b/include/m_button.h index ba75f72aee..6b754333af 100644 --- a/include/m_button.h +++ b/include/m_button.h @@ -61,11 +61,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // lParam = BATF_* flags combination
// Usage: SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)LPGEN("My Tip"), 0);
#define BATF_UNICODE 1
-#if defined(_UNICODE)
- #define BATF_TCHAR BATF_UNICODE
-#else
- #define BATF_TCHAR 0
-#endif
#define BUTTONADDTOOLTIP (WM_USER+5)
diff --git a/include/m_chat_int.h b/include/m_chat_int.h index b0007d519d..b37c6e7ef1 100644 --- a/include/m_chat_int.h +++ b/include/m_chat_int.h @@ -395,7 +395,7 @@ struct CHAT_MANAGER void (*ReloadSettings)(void);
void (*ColorChooser)(SESSION_INFO *si, BOOL bFG, HWND hwndDlg, HWND hwndTarget, HWND hwndChooser);
- int (*DoRtfToTags)(CMString &pszText, int iNumColors, COLORREF *pColors);
+ int (*DoRtfToTags)(CMStringW &pszText, int iNumColors, COLORREF *pColors);
int logPixelSY, logPixelSX;
char *szActiveWndModule;
diff --git a/include/m_cluiframes.h b/include/m_cluiframes.h index 894ab40b8f..746792f8c8 100644 --- a/include/m_cluiframes.h +++ b/include/m_cluiframes.h @@ -66,11 +66,6 @@ typedef struct tagCLISTFrame { #define F_NO_SUBCONTAINER 1024 //Support skining no subcontainer needed
#define F_SKINNED 2048 // skinned frame (for owned subframe only)
#define F_UNICODE 32768 //Use unicode text
-#ifdef _UNICODE
-# define F_TCHAR F_UNICODE
-#else
-# define F_TCHAR 0
-#endif
// frame alignment
#define alTop 0x00000001
@@ -99,12 +94,6 @@ typedef struct tagCLISTFrame { #define FO_FLOATING 0x000a //Change floating mode
#define FO_UNICODETEXT 0x8000 // flag for FO_NAME,FO_TBNAME, FO_TBTIPNAME set/get lPAram as unicode wchar_t
-#ifdef _UNICODE
- #define FO_TCHAR FO_UNICODETEXT
-#else
- #define FO_TCHAR 0x0000
-#endif
-
//////////////////////////////////////////////////////////////////////////
//want show tooltip for statusbar
diff --git a/include/m_crypto.h b/include/m_crypto.h index 1fcb7999bd..427925d56b 100644 --- a/include/m_crypto.h +++ b/include/m_crypto.h @@ -63,12 +63,6 @@ typedef MICryptoEngine* (__cdecl *pfnCryptoProviderFactory)(void); #define CPF_UNICODE 1
-#if defined(_UNICODE)
- #define CPF_TCHAR CPF_UNICODE
-#else
- #define CPF_TCHAR 0
-#endif
-
typedef struct tagCRYPTOPROVIDER
{
DWORD dwSize;
diff --git a/include/m_database.h b/include/m_database.h index d5cc35208c..fa0dcc74f3 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -59,11 +59,7 @@ extern "C" #define DBVT_BLOB 254 // cpbVal and pbVal are valid
#define DBVT_UTF8 253 // pszVal is valid
#define DBVT_WCHAR 252 // pwszVal is valid
-#if defined(_UNICODE)
-#define DBVT_TCHAR DBVT_WCHAR
-#else
-#define DBVT_TCHAR DBVT_ASCIIZ
-#endif
+
#define DBVTF_VARIABLELENGTH 0x80
typedef struct
@@ -323,18 +319,6 @@ MIR_CORE_DLL(BOOL) db_set_resident(LPCSTR szModule, const char *szService, BOOL #define db_get_ws(a,b,c,d) db_get_s(a,b,c,d,DBVT_WCHAR)
#define db_get_utf(a,b,c,d) db_get_s(a,b,c,d,DBVT_UTF8)
-#ifdef _UNICODE
-#define db_get_ts(a,b,c,d) db_get_s(a,b,c,d,DBVT_WCHAR)
-#define db_get_tsa db_get_wsa
-#define db_set_ts db_set_ws
-#define db_get_tstatic db_get_wstatic
-#else
-#define db_get_ts(a,b,c,d) db_get_s(a,b,c,d,DBVT_ASCIIZ)
-#define db_get_tsa db_get_sa
-#define db_set_ts db_set_s
-#define db_get_tstatic db_get_static
-#endif
-
#if defined(__cplusplus)
}
#endif
@@ -365,17 +349,10 @@ pszName is a pointer to the buffer that receives the path of the profile cbSize is the size in characters of the pszName buffer
Returns 0 on success or nonzero otherwise
*/
+
#define MS_DB_GETPROFILEPATH "DB/GetProfilePath"
#define MS_DB_GETPROFILEPATHW "DB/GetProfilePathW"
-#if defined(_UNICODE)
- #define MS_DB_GETPROFILEPATHT MS_DB_GETPROFILEPATHW
- #define MS_DB_GETPROFILENAMET MS_DB_GETPROFILENAMEW
-#else
- #define MS_DB_GETPROFILEPATHT MS_DB_GETPROFILEPATH
- #define MS_DB_GETPROFILENAMET MS_DB_GETPROFILENAME
-#endif
-
/* DB/SetDefaultProfile service
Sets the default profile name programmatically
Analog of Database/DefaultProfile in mirandaboot.ini
@@ -555,12 +532,6 @@ __forceinline WCHAR* DbGetEventTextW(DBEVENTINFO* dbei, int codepage) return (WCHAR*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&temp);
}
-__forceinline TCHAR* DbGetEventTextT(DBEVENTINFO* dbei, int codepage)
-{
- DBEVENTGETTEXT temp = { dbei, DBVT_TCHAR, codepage };
- return (TCHAR*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&temp);
-}
-
/* DB/Event/GetIcon (0.7.0.1+)
Retrieves the event's icon
wParam = (WPARAM)(int)flags - use LR_SHARED for shared HICON
diff --git a/include/m_descbutton.h b/include/m_descbutton.h index 3f11bcd866..0c3a0ce94c 100644 --- a/include/m_descbutton.h +++ b/include/m_descbutton.h @@ -31,11 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MDBCF_SHAREDICON 0x01
#define MDBCF_UNICODE 0x02
-#ifdef _UNICODE
- #define MDBCF_TCHAR MDBCF_UNICODE
-#else
- #define MDBCF_TCHAR 0
-#endif
#define DBCM_FIRST (WM_USER+1024)
#define DBCM_LAST (ITCM_FIRST+64)
@@ -45,9 +40,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define DBCM_SETICON (DBCM_FIRST+3) //WPARAM is set of flags, LPARAM icon handle
#define MDescButton_SetTitle(hwnd, title) \
- (SendMessage((hwnd), DBCM_SETTITLE, MDBCF_TCHAR, (LPARAM)(title)))
+ (SendMessage((hwnd), DBCM_SETTITLE, MDBCF_UNICODE, (LPARAM)(title)))
#define MDescButton_SetDescription(hwnd, title) \
- (SendMessage((hwnd), DBCM_SETDESCRIPTION, MDBCF_TCHAR, (LPARAM)(title)))
+ (SendMessage((hwnd), DBCM_SETDESCRIPTION, MDBCF_UNICODE, (LPARAM)(title)))
#define MDescButton_SetIcon(hwnd, hicon) \
(SendMessage((hwnd), DBCM_SETICON, 0, (LPARAM)(hicon)))
#define MDescButton_SetIconShared(hwnd, hicon) \
diff --git a/include/m_fontservice.h b/include/m_fontservice.h index a0667721c9..10fb006760 100644 --- a/include/m_fontservice.h +++ b/include/m_fontservice.h @@ -57,12 +57,6 @@ typedef struct FontSettingsW_tag }
FontSettingsW;
-#if defined( _UNICODE )
- #define FontSettingsT FontSettingsW
-#else
- #define FontSettingsT FontSettings
-#endif
-
// a font identifier structure - used for registering a font, and getting one out again
// WARNING: do not use Translate(TS) for name or group as they
@@ -100,12 +94,6 @@ typedef struct FontIDW_tag }
FontIDW;
-#if defined( _UNICODE )
- #define FontIDT FontIDW
-#else
- #define FontIDT FontID
-#endif
-
// register a font
// wparam = (FontID *)&font_id
// lparam = hLangpack
@@ -120,14 +108,6 @@ __forceinline void FontRegisterW( FontIDW* pFontID ) { CallService("Font/RegisterW", (WPARAM)pFontID, hLangpack);
}
-#if defined( _UNICODE )
- #define MS_FONT_REGISTERT MS_FONT_REGISTERW
- #define FontRegisterT FontRegisterW
-#else
- #define MS_FONT_REGISTERT MS_FONT_REGISTER
- #define FontRegisterT FontRegister
-#endif
-
// get a font
// will fill the logfont structure passed in with the user's choices, or the default if it was set and the user has not chosen a font yet,
// or the global default font settings otherwise (i.e. no user choice and default set, or font not registered)
@@ -138,12 +118,6 @@ __forceinline void FontRegisterW( FontIDW* pFontID ) #define MS_FONT_GET "Font/Get"
#define MS_FONT_GETW "Font/GetW"
-#if defined( _UNICODE )
- #define MS_FONT_GETT MS_FONT_GETW
-#else
- #define MS_FONT_GETT MS_FONT_GET
-#endif
-
// fired when a user modifies font settings, so reload your fonts
// wparam = lparam = 0
#define ME_FONT_RELOAD "Font/Reload"
@@ -186,12 +160,6 @@ typedef struct ColourIDW_tag }
ColourIDW;
-#if defined( _UNICODE )
- #define ColourIDT ColourIDW
-#else
- #define ColourIDT ColourID
-#endif
-
// register a colour (this should be used for everything except actual text colour for registered fonts)
// [note - a colour with name 'Background' [translated!] has special meaning and will be used as the background colour of
// the font list box in the options, for the given group]
@@ -206,26 +174,12 @@ __forceinline void ColourRegisterW(ColourIDW* pColorID) { CallService("Colour/RegisterW", (WPARAM)pColorID, hLangpack);
}
-#if defined( _UNICODE )
- #define MS_COLOUR_REGISTERT MS_COLOUR_REGISTERW
- #define ColourRegisterT ColourRegisterW
-#else
- #define MS_COLOUR_REGISTERT MS_COLOUR_REGISTER
- #define ColourRegisterT ColourRegister
-#endif
-
// get a colour
// wparam = (ColourID *)&colour_id (only name and group matter)
// rerturns the colour (as COLORREF), or -1 if not found
#define MS_COLOUR_GET "Colour/Get"
#define MS_COLOUR_GETW "Colour/GetW"
-#if defined( _UNICODE )
- #define MS_COLOUR_GETT MS_COLOUR_GETW
-#else
- #define MS_COLOUR_GETT MS_COLOUR_GET
-#endif
-
// fired when a user modifies font settings, so reget your fonts and colours
// wparam = lparam = 0
#define ME_COLOUR_RELOAD "Colour/Reload"
@@ -275,12 +229,6 @@ typedef struct EffectIDW_tag }
EffectIDW;
-#if defined( _UNICODE )
- #define EffectIDT EffectIDW
-#else
- #define EffectIDT EffectID
-#endif
-
// register an effect
// wparam = (EffectID *)&effect_id
// lparam = 0
@@ -293,14 +241,6 @@ __forceinline void EffectRegisterW(EffectIDW* pEffectID) { CallService("Effect/RegisterW", (WPARAM)pEffectID, hLangpack);
}
-#if defined( _UNICODE )
- #define MS_EFFECT_REGISTERT MS_EFFECT_REGISTERW
- #define EffectRegisterT EffectRegisterW
-#else
- #define MS_EFFECT_REGISTERT MS_EFFECT_REGISTER
- #define EffectRegisterT EffectRegister
-#endif
-
// get a effect
// wparam = (EffectID *)&effect_id (only name and group matter)
// lparam = (FONTEFFECT *)&effect
@@ -308,12 +248,6 @@ __forceinline void EffectRegisterW(EffectIDW* pEffectID) #define MS_EFFECT_GET "Effect/Get"
#define MS_EFFECT_GETW "Effect/GetW"
-#if defined( _UNICODE )
- #define MS_EFFECT_GETT MS_EFFECT_GETW
-#else
- #define MS_EFFECT_GETT MS_EFFECT_GET
-#endif
-
// fired when a user modifies font settings, so reget your fonts and colours
// wparam = lparam = 0
#define ME_EFFECT_RELOAD "Effect/Reload"
diff --git a/include/m_genmenu.h b/include/m_genmenu.h index 15a7ded349..aa442e6ae3 100644 --- a/include/m_genmenu.h +++ b/include/m_genmenu.h @@ -30,14 +30,7 @@ #define CMIF_NOTOFFLIST 0x0040 // item won't appear on contacts that have the 'NotOnList' setting
#define CMIF_UNMOVABLE 0x0080 // item's position cannot be changed
#define CMIF_SYSTEM 0x0100 // item's presence & position cannot be changed
-
#define CMIF_UNICODE 0x0200 // will use wchar_t* instead of char*
-#if defined(_UNICODE)
-#define CMIF_TCHAR CMIF_UNICODE
-#else
-#define CMIF_TCHAR 0
-#endif
-
#define CMIF_KEEPUNTRANSLATED 0x0400 // don't translate a menu item
#define CMIF_CUSTOM 0x0800 // custom menu item. doesn't exist in a code
#define CMIF_DEFAULT 0x1000 // this menu item is the default one
diff --git a/include/m_gui.h b/include/m_gui.h index 9090efc69a..c37b37bd8b 100644 --- a/include/m_gui.h +++ b/include/m_gui.h @@ -356,7 +356,7 @@ private: public:
__forceinline CMOptionLink(CMOption<T> &option) :
- CDataLink(DBVT_TCHAR), m_option(&option)
+ CDataLink(DBVT_WCHAR), m_option(&option)
{}
__forceinline DWORD LoadInt() { return 0; }
diff --git a/include/m_hotkeys.h b/include/m_hotkeys.h index a732dda242..913d586242 100644 --- a/include/m_hotkeys.h +++ b/include/m_hotkeys.h @@ -29,23 +29,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define HKD_UNICODE 0x0001
-#if defined(_UNICODE)
- #define HKD_TCHAR HKD_UNICODE
-#else
- #define HKD_TCHAR 0
-#endif
-
typedef struct
{
int cbSize;
const char *pszName; /* name to refer to hotkey when playing and in db */
union {
const char *pszDescription; /* description for options dialog */
- const wchar_t *ptszDescription;
+ const wchar_t *pwszDescription;
};
union {
const char *pszSection; /* section name used to group sounds (NULL is acceptable) */
- const wchar_t *ptszSection;
+ const wchar_t *pwszSection;
};
const char *pszService; /* Service to call when HotKey Pressed */
WORD DefHotKey; /* default hot key for action */
diff --git a/include/m_icolib.h b/include/m_icolib.h index cdef7dfae6..6e9efe6e5d 100644 --- a/include/m_icolib.h +++ b/include/m_icolib.h @@ -41,16 +41,6 @@ extern int hLangpack; #define SIDF_PATH_UNICODE 0x200 // Default File is in UCS-2
#define SIDF_ALL_UNICODE SIDF_PATH_UNICODE | SIDF_UNICODE
-#if defined(_UNICODE)
- #define SIDF_TCHAR SIDF_UNICODE
- #define SIDF_PATH_TCHAR SIDF_PATH_UNICODE
- #define SIDF_ALL_TCHAR SIDF_ALL_UNICODE
-#else
- #define SIDF_TCHAR 0
- #define SIDF_PATH_TCHAR 0
- #define SIDF_ALL_TCHAR 0
-#endif
-
struct SKINICONDESC
{
MAllStrings section; // section name used to group icons
diff --git a/include/m_iconheader.h b/include/m_iconheader.h index 715ce3408b..d577f00bd6 100644 --- a/include/m_iconheader.h +++ b/include/m_iconheader.h @@ -31,11 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MITCF_SHAREDICON 0x01
#define MITCF_UNICODE 0x02
-#ifdef _UNICODE
- #define MITCF_TCHAR MITCF_UNICODE
-#else
- #define MITCF_TCHAR 0
-#endif
#define ITCM_FIRST (WM_USER+1024)
#define ITCM_LAST (ITCM_FIRST+64)
@@ -74,7 +69,7 @@ typedef struct { static __forceinline void MIcoTab_AddItem(HWND hwnd, TCHAR *lptzName, HICON hIcon, LPARAM data, BOOL bSharedIcon)
{
MIcoTab mit = {0};
- mit.flag = (bSharedIcon?MITCF_SHAREDICON:0)|MITCF_TCHAR;
+ mit.flag = (bSharedIcon?MITCF_SHAREDICON:0)| MITCF_UNICODE;
mit.hIcon = hIcon;
mit.tcsName = lptzName;
mit.data = data;
diff --git a/include/m_imgsrvc.h b/include/m_imgsrvc.h index 0d829a7551..005eb67422 100644 --- a/include/m_imgsrvc.h +++ b/include/m_imgsrvc.h @@ -344,18 +344,6 @@ typedef struct _tagFI_interface { } FI_INTERFACE;
-#if defined(UNICODE) || defined(_UNICODE)
-#define FI_GetFIFFromFilenameT FI_GetFIFFromFilenameU
-#define FI_GetFileTypeT FI_GetFileTypeU
-#define FI_LoadT FI_LoadU
-#define FI_OpenMultiBitmapT FI_OpenMultiBitmapU
-#else
-#define FI_GetFIFFromFilenameT FI_GetFIFFromFilename
-#define FI_GetFileTypeT FI_GetFileType
-#define FI_LoadT FI_Load
-#define FI_OpenMultiBitmapT FI_OpenMultiBitmap
-#endif
-
/*
* image services
*
@@ -398,12 +386,6 @@ typedef struct _tagFI_interface { #define IMGL_WCHAR 2 // filename is wchar_t
-#if defined(UNICODE) || defined(_UNICODE)
- #define IMGL_TCHAR IMGL_WCHAR
-#else
- #define IMGL_TCHAR 0
-#endif
-
// load an image from disk
// wParam = full path and filename to the image
// lParam = IMGL_* flags
diff --git a/include/m_langpack.h b/include/m_langpack.h index 56f8c5b9ce..3262c62bc5 100644 --- a/include/m_langpack.h +++ b/include/m_langpack.h @@ -54,14 +54,6 @@ EXTERN_C MIR_CORE_DLL(void) TranslateDialog_LP(HWND hDlg, int hLang); #define TranslateT(s) TranslateW_LP(_A2W(s), hLangpack)
#define TranslateDialogDefault(h) TranslateDialog_LP(h,hLangpack)
-#ifdef _UNICODE
- #define TranslateTS(s) TranslateW_LP(s,hLangpack)
- #define TranslateTH(l,s) TranslateW_LP(s,l)
-#else
- #define TranslateTS(s) TranslateA_LP(s,hLangpack)
- #define TranslateTH(l,s) TranslateA_LP(s,l)
-#endif
-
// If you're storing some string for calling later-on Translate or using it
// with an API call that does translation automatically marked with
// [TRANSLATED-BY-CORE] please wrap it with one of LPGEN macros in order to
diff --git a/include/m_message.h b/include/m_message.h index 224384437a..5c68940eaa 100644 --- a/include/m_message.h +++ b/include/m_message.h @@ -40,12 +40,6 @@ extern int hLangpack; #define MS_MSG_SENDMESSAGE "SRMsg/SendCommand"
#define MS_MSG_SENDMESSAGEW "SRMsg/SendCommandW"
-#ifdef _UNICODE
-#define MS_MSG_SENDMESSAGET MS_MSG_SENDMESSAGEW
-#else
-#define MS_MSG_SENDMESSAGET MS_MSG_SENDMESSAGE
-#endif
-
#define ME_MSG_WINDOWEVENT "MessageAPI/WindowEvent"
//wparam = 0
//lparam = (WPARAM)(MessageWindowEventData*)hWindowEvent;
@@ -166,12 +160,6 @@ typedef struct { #define MBF_HIDDEN 0x02
#define MBF_UNICODE 0x04
-#ifdef _UNICODE
- #define MBF_TCHAR MBF_UNICODE
-#else
- #define MBF_TCHAR 0
-#endif
-
typedef struct {
int cbSize; // must be equal to sizeof(StatusIconData)
char *szModule; // used in combo with the dwId below to create a unique identifier
diff --git a/include/m_netlib.h b/include/m_netlib.h index 577eb3b2a9..e5dbc7ca00 100644 --- a/include/m_netlib.h +++ b/include/m_netlib.h @@ -90,12 +90,6 @@ typedef struct { #define NUF_UNICODE 0x40 // if set ptszDescriptiveName points to Unicode, otherwise it points to ANSI string
#define MS_NETLIB_REGISTERUSER "Netlib/RegisterUser"
-#if defined(_UNICODE)
- #define NUF_TCHAR NUF_UNICODE
-#else
- #define NUF_TCHAR 0
-#endif
-
/////////////////////////////////////////////////////////////////////////////////////////
// Assign a Netlib user handle a set of dynamic HTTP headers to be used with all
//
diff --git a/include/m_options.h b/include/m_options.h index 50dd7e1627..3e0f4243b6 100644 --- a/include/m_options.h +++ b/include/m_options.h @@ -92,12 +92,6 @@ typedef struct { #define ODPF_USERINFOTAB 16 // options page is tabbed
#define ODPF_DONTTRANSLATE 32 // do not translate option page title
-#if defined(_UNICODE)
- #define ODPF_TCHAR ODPF_UNICODE
-#else
- #define ODPF_TCHAR 0
-#endif
-
#define PSM_GETBOLDFONT (WM_USER+102) //returns HFONT used for group box titles
__forceinline INT_PTR Options_AddPage(WPARAM wParam, OPTIONSDIALOGPAGE* odp)
diff --git a/include/m_popup.h b/include/m_popup.h index 87d69bb297..d19054520f 100644 --- a/include/m_popup.h +++ b/include/m_popup.h @@ -61,14 +61,8 @@ typedef struct // this data, however you MUST NOT chahge that.
// unicode or ansi mode
-#define PU2_ANSI 0x00
-#define PU2_UNICODE 0x01
-#if defined(UNICODE) || defined(_UNICODE)
-#define PU2_TCHAR PU2_UNICODE
-#else
-#define PU2_TCHAR PU2_ANSI
-#endif
-
+#define PU2_ANSI 0x00
+#define PU2_UNICODE 0x01
#define PU2_CUSTOM_POPUP 0x02
typedef struct
diff --git a/include/m_protocols.h b/include/m_protocols.h index f1cb75c125..cc19e7e8b1 100644 --- a/include/m_protocols.h +++ b/include/m_protocols.h @@ -106,12 +106,6 @@ typedef struct { #define PFTS_UNICODE 2
#define PFTS_UTF 4
-#if defined(_UNICODE)
- #define PFTS_TCHAR PFTS_UNICODE
-#else
- #define PFTS_TCHAR 0
-#endif
-
typedef struct tagPROTOFILETRANSFERSTATUS
{
size_t cbSize;
diff --git a/include/m_protoint.h b/include/m_protoint.h index 10bb8d3685..5bf7092524 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -182,18 +182,6 @@ struct MIR_APP_EXPORT PROTO_INTERFACE : public MZeroedObject __forceinline void setWString(const char *name, const WCHAR* value) { db_set_ws(NULL, m_szModuleName, name, value); }
__forceinline void setWString(MCONTACT hContact, const char *name, const WCHAR* value) { db_set_ws(hContact, m_szModuleName, name, value); }
- #if defined(_UNICODE)
- #define debugLog debugLogW
- #define getTString getWString
- #define getTStringA getWStringA
- #define setTString setWString
- #else
- #define debugLog debugLogA
- #define getTString getString
- #define getTStringA getStringA
- #define setTString setString
- #endif
-
//////////////////////////////////////////////////////////////////////////////////////
// Virtual functions
diff --git a/include/m_protosvc.h b/include/m_protosvc.h index 831aa08d91..86708741e9 100644 --- a/include/m_protosvc.h +++ b/include/m_protosvc.h @@ -338,12 +338,6 @@ static __inline unsigned long Proto_Status2Flag(int status) #define PSR_UNICODE 0x0001 // all strings go in UTF16-LE
#define PSR_UTF8 0x0002 // all strings go in UTF8
-#if defined(_UNICODE)
- #define PSR_TCHAR PSR_UNICODE
-#else
- #define PSR_TCHAR 0
-#endif
-
typedef struct {
int cbSize;
MAllStrings nick;
@@ -518,11 +512,6 @@ typedef struct { // Remember to mir_free the return value
#define SGMA_UNICODE 1 // return Unicode status
-#if defined(_UNICODE)
- #define SGMA_TCHAR SGMA_UNICODE
-#else
- #define SGMA_TCHAR 0
-#endif
#define PS_GETMYAWAYMSG "/GetMyAwayMsg"
@@ -533,11 +522,6 @@ typedef struct { // return = 0 for success
#define SMNN_UNICODE 1 // return Unicode status
-#if defined(_UNICODE)
- #define SMNN_TCHAR SMNN_UNICODE
-#else
- #define SMNN_TCHAR 0
-#endif
#define PS_SETMYNICKNAME "/SetNickname"
@@ -552,11 +536,6 @@ typedef struct { // WAYD = What are you doing
#define WAYD_UNICODE 1 // return Unicode texts
-#if defined(_UNICODE)
- #define WAYD_TCHAR WAYD_UNICODE
-#else
- #define WAYD_TCHAR 0
-#endif
///////////////////////////////////////////////////////////////////////////////
// Get the WAYD message for the user
@@ -821,11 +800,6 @@ __forceinline INT_PTR Proto_AuthRecv(const char *szProtoName, PROTORECVEVENT *pc // lParam = (LPARAM)(PROTORECVFILET*)&prf
#define PRFF_UNICODE 1
-#if defined(_UNICODE)
- #define PRFF_TCHAR PRFF_UNICODE
-#else
- #define PRFF_TCHAR 0
-#endif
typedef struct {
DWORD dwFlags; // PRFF_*
diff --git a/include/m_skin.h b/include/m_skin.h index b31f6ada56..d198a308d3 100644 --- a/include/m_skin.h +++ b/include/m_skin.h @@ -129,26 +129,20 @@ EXTERN_C MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, #define SSDF_UNICODE 0x0001
-#if defined(_UNICODE)
- #define SSDF_TCHAR SSDF_UNICODE
-#else
- #define SSDF_TCHAR 0
-#endif
-
typedef struct {
int cbSize;
const char *pszName; // name to refer to sound when playing and in db
union {
const char *pszDescription; // [TRANSLATED-BY-CORE] description for options dialog
- const TCHAR *ptszDescription;
+ const wchar_t *pwszDescription;
};
union {
const char *pszDefaultFile; // default sound file to use
- const TCHAR *ptszDefaultFile;
+ const wchar_t *pwszDefaultFile;
};
union {
const char *pszSection; // [TRANSLATED-BY-CORE] section name used to group sounds (NULL is acceptable)
- const TCHAR *ptszSection;
+ const wchar_t *pwszSection;
};
DWORD dwFlags;
}
@@ -165,15 +159,15 @@ __forceinline INT_PTR SkinAddNewSoundEx(const char *name, const char *section, c return CallService("Skin/Sounds/AddNew", hLangpack, (LPARAM)&ssd);
}
-__forceinline INT_PTR SkinAddNewSoundExT(const char *name, const TCHAR *section, const TCHAR *description, const TCHAR *defaultFile = NULL)
+__forceinline INT_PTR SkinAddNewSoundExW(const char *name, const wchar_t *section, const wchar_t *description, const wchar_t *defaultFile = NULL)
{
SKINSOUNDDESCEX ssd = { 0 };
ssd.cbSize = sizeof(ssd);
- ssd.dwFlags = SSDF_TCHAR;
+ ssd.dwFlags = SSDF_UNICODE;
ssd.pszName = name;
- ssd.ptszSection = section;
- ssd.ptszDescription = description;
- ssd.ptszDefaultFile = defaultFile;
+ ssd.pwszSection = section;
+ ssd.pwszDescription = description;
+ ssd.pwszDefaultFile = defaultFile;
return CallService("Skin/Sounds/AddNew", hLangpack, (LPARAM)&ssd);
}
@@ -182,7 +176,7 @@ __forceinline INT_PTR Skin_AddSound(SKINSOUNDDESCEX *ssd) return CallService("Skin/Sounds/AddNew", hLangpack, (LPARAM)ssd);
}
-#define MS_SKIN_PLAYSOUND "Skin/Sounds/Play"
+#define MS_SKIN_PLAYSOUND "Skin/Sounds/Play"
/////////////////////////////////////////////////////////////////////////////////////////
// plays a named sound event
@@ -194,13 +188,13 @@ __forceinline INT_PTR SkinPlaySound(const char *name) { return CallService(MS_SKIN_PLAYSOUND, 0, (LPARAM)name);
}
-#define MS_SKIN_PLAYSOUNDFILE "Skin/Sounds/PlayFile"
+#define MS_SKIN_PLAYSOUNDFILE "Skin/Sounds/PlayFile"
/////////////////////////////////////////////////////////////////////////////////////////
// plays any sound file
// wParam = 0
-// lParam = (LPARAM)(const TCHAR*)ptszFileName
-__forceinline INT_PTR SkinPlaySoundFile(const TCHAR *ptszFileName) {
+// lParam = (LPARAM)(const wchar_t*)ptszFileName
+__forceinline INT_PTR SkinPlaySoundFile(const wchar_t *ptszFileName) {
return CallService(MS_SKIN_PLAYSOUNDFILE, 0, (LPARAM)ptszFileName);
}
@@ -212,14 +206,14 @@ EXTERN_C MIR_APP_DLL(void) KillModuleSounds(int hLangpack); // sent when the icons DLL has been changed in the options dialog, and everyone
// should re-make their image lists
// wParam = lParam = 0
-#define ME_SKIN_ICONSCHANGED "Skin/IconsChanged"
+#define ME_SKIN_ICONSCHANGED "Skin/IconsChanged"
/////////////////////////////////////////////////////////////////////////////////////////
// wParam: 0 when playing sound (1 when sound is being previewed)
-// lParam: (TCHAR*) pszSoundFile
+// lParam: (wchar_t*) pszSoundFile
// Affect: This hook is fired when the sound module needs to play a sound
// Note : This event has default processing, if no one HookEvent()'s this event then it will
// use the default hook code, which uses PlaySound()
-#define ME_SKIN_PLAYINGSOUND "Skin/Sounds/Playing"
+#define ME_SKIN_PLAYINGSOUND "Skin/Sounds/Playing"
#endif //M_SKIN_H__
diff --git a/include/m_string.h b/include/m_string.h index 15d34aac8a..6bcdbd3c5f 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -961,10 +961,4 @@ MIR_CORE_EXPORT CMStringT<BaseType, StringTraits> CALLBACK operator+(char ch1, c typedef CMStringT< wchar_t, ChTraitsCRT< wchar_t > > CMStringW;
typedef CMStringT< char, ChTraitsCRT< char > > CMStringA;
-#ifdef _UNICODE
- typedef CMStringW CMString;
-#else
- typedef CMStringA CMString;
-#endif
-
#endif // M_STRING_H__
diff --git a/include/m_utils.h b/include/m_utils.h index c7eef10006..c8e4cac76f 100644 --- a/include/m_utils.h +++ b/include/m_utils.h @@ -284,8 +284,6 @@ EXTERN_C MIR_CORE_DLL(int) PathToAbsolute(const char *pszSrc, char *pszOut, cons EXTERN_C MIR_CORE_DLL(int) PathToAbsoluteW(const wchar_t *pwszSrc, wchar_t *pwszOut, const wchar_t* pwszBase);
#endif
-#define PathToAbsoluteT PathToAbsoluteW
-
/////////////////////////////////////////////////////////////////////////////////////////
// Creates a directory tree (even more than one directories levels are missing)
// Returns 0 on success or an error code otherwise
@@ -293,8 +291,6 @@ EXTERN_C MIR_CORE_DLL(int) PathToAbsoluteW(const wchar_t *pwszSrc, wchar_t *pwsz EXTERN_C MIR_CORE_DLL(int) CreateDirectoryTree(const char *pszDir);
EXTERN_C MIR_CORE_DLL(int) CreateDirectoryTreeW(const wchar_t *pwszDir);
-#define CreateDirectoryTreeT CreateDirectoryTreeW
-
/////////////////////////////////////////////////////////////////////////////////////////
// Creates all subdirectories required to create a file with the file name given
// Returns 0 on success or an error code otherwise
@@ -302,8 +298,6 @@ EXTERN_C MIR_CORE_DLL(int) CreateDirectoryTreeW(const wchar_t *pwszDir); EXTERN_C MIR_CORE_DLL(void) CreatePathToFile(char *wszFilePath);
EXTERN_C MIR_CORE_DLL(void) CreatePathToFileW(wchar_t *wszFilePath);
-#define CreatePathToFileT CreatePathToFileW
-
/////////////////////////////////////////////////////////////////////////////////////////
// Checks if a file name is absolute or not
// returns TRUE if yes or FALSE if not
@@ -311,8 +305,6 @@ EXTERN_C MIR_CORE_DLL(void) CreatePathToFileW(wchar_t *wszFilePath); EXTERN_C MIR_CORE_DLL(int) PathIsAbsolute(const char *pSrc);
EXTERN_C MIR_CORE_DLL(int) PathIsAbsoluteW(const wchar_t *pSrc);
-#define PathIsAbsoluteT PathIsAbsoluteW
-
/////////////////////////////////////////////////////////////////////////////////////////
// Generates Random number of any length
// wParam = size - length of the random number to generate
@@ -384,8 +376,6 @@ EXTERN_C MIR_APP_DLL(wchar_t*) Utils_ReplaceVarsW(const wchar_t *szData, MCONTAC ptrW(Utils_ReplaceVarsW(str))
{}
};
-
- typedef VARSW VARST;
#endif
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/include/m_xstatus.h b/include/m_xstatus.h index 7ef91f2123..89d34aee27 100644 --- a/include/m_xstatus.h +++ b/include/m_xstatus.h @@ -38,12 +38,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define CSSF_STR_SIZES 0x0200 // returns sizes of custom status name & message (wParam & lParam members) in chars
#define CSSF_UNICODE 0x1000 // strings are in UCS-2
-#if defined(_UNICODE)
- #define CSSF_TCHAR CSSF_UNICODE
-#else
- #define CSSF_TCHAR 0
-#endif
-
typedef struct {
int cbSize; // size of the structure
int flags; // combination of CSSF_*
diff --git a/include/newpluginapi.h b/include/newpluginapi.h index 157549f2c1..418c928234 100644 --- a/include/newpluginapi.h +++ b/include/newpluginapi.h @@ -30,13 +30,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define PLUGIN_MAKE_VERSION(a, b, c, d) (((((DWORD)(a))&0xFF)<<24)|((((DWORD)(b))&0xFF)<<16)|((((DWORD)(c))&0xFF)<<8)|(((DWORD)(d))&0xFF))
#define MAXMODULELABELLENGTH 64
-#if defined(_UNICODE)
- #define UNICODE_AWARE 0x0001
-#else
- #define UNICODE_AWARE 0x0000
-#endif
-
-#define STATIC_PLUGIN 0x0002
+#define UNICODE_AWARE 0x0001
+#define STATIC_PLUGIN 0x0002
/////////////////////////////////////////////////////////////////////////////////////////
// The UUID structure below is used to for plugin UUID's and module type definitions
diff --git a/libs/libjson/src/JSONNode.h b/libs/libjson/src/JSONNode.h index 2f5119ef90..8c48d24dbe 100644 --- a/libs/libjson/src/JSONNode.h +++ b/libs/libjson/src/JSONNode.h @@ -118,7 +118,7 @@ public: json_string as_string(void) const;
#if defined(M_STRING_H__)
- CMString as_mstring(void) const;
+ CMStringW as_mstring(void) const;
#endif
long as_int(void) const;
double as_float(void) const;
diff --git a/libs/libjson/src/JSONNode.inl b/libs/libjson/src/JSONNode.inl index b012ffdbb2..48c1b9ec4f 100644 --- a/libs/libjson/src/JSONNode.inl +++ b/libs/libjson/src/JSONNode.inl @@ -101,7 +101,7 @@ inline json_string JSONNode::as_string(void) const JSON_CHECK_INTERNAL();
return internal -> as_string();
}
-inline CMString JSONNode::as_mstring(void) const
+inline CMStringW JSONNode::as_mstring(void) const
{
JSON_CHECK_INTERNAL();
return internal->as_mstring();
diff --git a/libs/libjson/src/internalJSONNode.h b/libs/libjson/src/internalJSONNode.h index 05f89b6220..c77e502543 100644 --- a/libs/libjson/src/internalJSONNode.h +++ b/libs/libjson/src/internalJSONNode.h @@ -87,7 +87,7 @@ public: json_string getcomment(void) const;
#endif
json_string as_string(void) const;
- CMString as_mstring(void) const;
+ CMStringW as_mstring(void) const;
long as_int(void) const;
json_number as_float(void) const;
bool as_bool(void) const;
@@ -288,9 +288,9 @@ inline json_string internalJSONNode::as_string(void) const { return _string;
}
-inline CMString internalJSONNode::as_mstring(void) const {
+inline CMStringW internalJSONNode::as_mstring(void) const {
Fetch();
- return CMString(ptrW(mir_utf8decodeW(_string.c_str())));
+ return CMStringW(ptrW(mir_utf8decodeW(_string.c_str())));
}
inline long internalJSONNode::as_int(void) const {
diff --git a/plugins/AVS/src/acc.cpp b/plugins/AVS/src/acc.cpp index 38e62a954f..1e57d38f08 100644 --- a/plugins/AVS/src/acc.cpp +++ b/plugins/AVS/src/acc.cpp @@ -248,11 +248,11 @@ void StartAnimatedGif(ACCData* data) if (format != PA_FORMAT_GIF)
return;
- FREE_IMAGE_FORMAT fif = fei->FI_GetFileTypeT(ace->szFilename, 0);
+ FREE_IMAGE_FORMAT fif = fei->FI_GetFileTypeU(ace->szFilename, 0);
if (fif == FIF_UNKNOWN)
- fif = fei->FI_GetFIFFromFilenameT(ace->szFilename);
+ fif = fei->FI_GetFIFFromFilenameU(ace->szFilename);
- data->ag.multi = fei->FI_OpenMultiBitmapT(fif, ace->szFilename, FALSE, TRUE, FALSE, GIF_LOAD256);
+ data->ag.multi = fei->FI_OpenMultiBitmapU(fif, ace->szFilename, FALSE, TRUE, FALSE, GIF_LOAD256);
if (data->ag.multi == NULL)
return;
@@ -469,7 +469,7 @@ static LRESULT CALLBACK ACCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP return TRUE;
case AVATAR_SETNOAVATARTEXT:
- mir_wstrncpy(data->noAvatarText, TranslateTS((wchar_t*)lParam), _countof(data->noAvatarText));
+ mir_wstrncpy(data->noAvatarText, TranslateW((wchar_t*)lParam), _countof(data->noAvatarText));
Invalidate(hwnd);
return TRUE;
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp index 2f521cc01d..6bd8f97177 100644 --- a/plugins/AVS/src/cache.cpp +++ b/plugins/AVS/src/cache.cpp @@ -136,7 +136,7 @@ void NotifyMetaAware(MCONTACT hContact, CacheNode *node, AVATARCACHEENTRY *ace) if (szProto != NULL) {
DBVARIANT dbv = { 0 };
if (!db_get_s(hContact, szProto, "AvatarHash", &dbv)) {
- if (dbv.type == DBVT_TCHAR)
+ if (dbv.type == DBVT_WCHAR)
wcsncpy_s(cacn.hash, dbv.ptszVal, _TRUNCATE);
else if (dbv.type == DBVT_ASCIIZ)
wcsncpy_s(cacn.hash, _A2T(dbv.pszVal), _TRUNCATE);
diff --git a/plugins/AVS/src/image_utils.cpp b/plugins/AVS/src/image_utils.cpp index 70fe12713e..6219f7d8f5 100644 --- a/plugins/AVS/src/image_utils.cpp +++ b/plugins/AVS/src/image_utils.cpp @@ -164,7 +164,7 @@ HBITMAP BmpFilterLoadBitmap(BOOL *bIsTransparent, const wchar_t *ptszFilename) if (fei == NULL)
return 0;
- FIBITMAP *dib = (FIBITMAP*)CallService(MS_IMG_LOAD, (WPARAM)ptszFilename, IMGL_RETURNDIB | IMGL_TCHAR);
+ FIBITMAP *dib = (FIBITMAP*)CallService(MS_IMG_LOAD, (WPARAM)ptszFilename, IMGL_RETURNDIB | IMGL_WCHAR);
if (dib == NULL)
return 0;
@@ -209,7 +209,7 @@ int BmpFilterSaveBitmap(HBITMAP hBmp, const wchar_t *ptszFile, int flags) return -1;
wchar_t tszFilename[MAX_PATH];
- if (!PathToAbsoluteT(ptszFile, tszFilename))
+ if (!PathToAbsoluteW(ptszFile, tszFilename))
wcsncpy_s(tszFilename, ptszFile, _TRUNCATE);
if (mir_wstrlen(tszFilename) <= 4)
@@ -222,7 +222,7 @@ int BmpFilterSaveBitmap(HBITMAP hBmp, const wchar_t *ptszFile, int flags) i.dwMask = IMGI_HBITMAP;
i.fif = FIF_UNKNOWN;
- return !CallService(MS_IMG_SAVE, (WPARAM)&i, MAKELONG(IMGL_TCHAR, flags));
+ return !CallService(MS_IMG_SAVE, (WPARAM)&i, MAKELONG(IMGL_WCHAR, flags));
}
// Other utilities ////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index a52cd78b6a..1fe80d8d71 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -381,7 +381,7 @@ static int LoadAvatarModule() InitServices();
InitPolls();
- wcsncpy_s(g_szDataPath, _countof(g_szDataPath), VARST(L"%miranda_userdata%\\"), _TRUNCATE);
+ wcsncpy_s(g_szDataPath, _countof(g_szDataPath), VARSW(L"%miranda_userdata%\\"), _TRUNCATE);
wcslwr(g_szDataPath);
return 0;
}
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index cead97c735..11f36dfb1e 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -121,7 +121,7 @@ static void SetProtoPic(char *szProto) wchar_t szNewPath[MAX_PATH]; PathToRelativeT(FileName, szNewPath, g_szDataPath); - db_set_ts(NULL, PPICT_MODULE, szProto, szNewPath); + db_set_ws(NULL, PPICT_MODULE, szProto, szNewPath); if (!mir_strcmp(AVS_DEFAULT, szProto)) { for (int i = 0; i < g_ProtoPictures.getCount(); i++) { @@ -385,8 +385,8 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar g_selectedProto = GetProtoFromList(hwndDlg, iItem); if (g_selectedProto) { DBVARIANT dbv; - if (!db_get_ts(NULL, PPICT_MODULE, g_selectedProto, &dbv)) { - if (!PathIsAbsoluteT(VARST(dbv.ptszVal))) { + if (!db_get_ws(NULL, PPICT_MODULE, g_selectedProto, &dbv)) { + if (!PathIsAbsoluteW(VARSW(dbv.ptszVal))) { wchar_t szFinalPath[MAX_PATH]; mir_snwprintf(szFinalPath, L"%%miranda_path%%\\%s", dbv.ptszVal); SetDlgItemText(hwndDlg, IDC_PROTOAVATARNAME, szFinalPath); @@ -576,7 +576,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA ProtectAvatar(hContact, 0); if (MessageBox(0, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) { DBVARIANT dbv = { 0 }; - if (!db_get_ts(hContact, "ContactPhoto", "File", &dbv)) { + if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) { DeleteFile(dbv.ptszVal); db_free(&dbv); } @@ -601,7 +601,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA if (MessageBox(0, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) { DBVARIANT dbv = { 0 }; ProtectAvatar(hContact, 0); - if (!db_get_ts(hContact, "ContactPhoto", "File", &dbv)) { + if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) { DeleteFile(dbv.ptszVal); db_free(&dbv); } @@ -666,15 +666,15 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA szFinalName[0] = 0; - if (is_locked && !db_get_ts(hContact, "ContactPhoto", "Backup", &dbv)) { + if (is_locked && !db_get_ws(hContact, "ContactPhoto", "Backup", &dbv)) { MyPathToAbsolute(dbv.ptszVal, szFinalName); db_free(&dbv); } - else if (!db_get_ts(hContact, "ContactPhoto", "RFile", &dbv)) { + else if (!db_get_ws(hContact, "ContactPhoto", "RFile", &dbv)) { MyPathToAbsolute(dbv.ptszVal, szFinalName); db_free(&dbv); } - else if (!db_get_ts(hContact, "ContactPhoto", "File", &dbv)) { + else if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) { MyPathToAbsolute(dbv.ptszVal, szFinalName); db_free(&dbv); } @@ -822,7 +822,7 @@ static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wPa ProtectAvatar(hContact, 0); if (MessageBox(0, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) { DBVARIANT dbv = { 0 }; - if (!db_get_ts(hContact, "ContactPhoto", "File", &dbv)) { + if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) { DeleteFile(dbv.ptszVal); db_free(&dbv); } @@ -846,7 +846,7 @@ static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wPa ProtectAvatar(hContact, 0); if (MessageBox(0, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) { DBVARIANT dbv = { 0 }; - if (!db_get_ts(hContact, "ContactPhoto", "File", &dbv)) { + if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) { DeleteFile(dbv.ptszVal); db_free(&dbv); } diff --git a/plugins/AVS/src/poll.cpp b/plugins/AVS/src/poll.cpp index 226bb12278..1b02acda79 100644 --- a/plugins/AVS/src/poll.cpp +++ b/plugins/AVS/src/poll.cpp @@ -143,7 +143,7 @@ void ProcessAvatarInfo(MCONTACT hContact, int type, PROTO_AVATAR_INFORMATION *pa db_unset(hContact, "ContactPhoto", "RFile");
if (!db_get_b(hContact, "ContactPhoto", "Locked", 0))
db_unset(hContact, "ContactPhoto", "Backup");
- db_set_ts(hContact, "ContactPhoto", "File", pai->filename);
+ db_set_ws(hContact, "ContactPhoto", "File", pai->filename);
db_set_w(hContact, "ContactPhoto", "Format", pai->format);
if (pai->format == PA_FORMAT_PNG || pai->format == PA_FORMAT_JPEG
diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp index 817c15630e..cb27c8d98e 100644 --- a/plugins/AVS/src/services.cpp +++ b/plugins/AVS/src/services.cpp @@ -161,10 +161,10 @@ static INT_PTR avSetAvatar(MCONTACT hContact, wchar_t *tszPath) // file exists...
wchar_t szBackupName[MAX_PATH];
PathToRelativeT(szFinalName, szBackupName, g_szDataPath);
- db_set_ts(hContact, "ContactPhoto", "Backup", szBackupName);
+ db_set_ws(hContact, "ContactPhoto", "Backup", szBackupName);
db_set_b(hContact, "ContactPhoto", "Locked", is_locked);
- db_set_ts(hContact, "ContactPhoto", "File", szFinalName);
+ db_set_ws(hContact, "ContactPhoto", "File", szFinalName);
MakePathRelative(hContact, szFinalName);
// Fix cache
@@ -214,7 +214,7 @@ static int InternalRemoveMyAvatar(char *protocol) if (ret == 0) {
// Has global avatar?
DBVARIANT dbv = { 0 };
- if (!db_get_ts(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv)) {
+ if (!db_get_ws(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv)) {
db_free(&dbv);
db_set_b(NULL, AVS_MODULE, "GlobalUserAvatarNotConsistent", 1);
DeleteGlobalUserAvatar();
@@ -253,7 +253,7 @@ static int InternalRemoveMyAvatar(char *protocol) return ret;
}
-static void FilterGetStrings(CMString &filter, BOOL xml, BOOL swf)
+static void FilterGetStrings(CMStringW &filter, BOOL xml, BOOL swf)
{
filter.AppendFormat(L"%s (*.bmp;*.jpg;*.gif;*.png", TranslateT("All files"));
if (swf) filter.Append(L";*.swf");
@@ -510,7 +510,7 @@ static int InternalSetMyAvatar(char *protocol, wchar_t *szFinalName, SetMyAvatar }
else {
// Try to open if is not a flash or XML
- hBmp = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFinalName, IMGL_TCHAR);
+ hBmp = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFinalName, IMGL_WCHAR);
if (hBmp == NULL)
return -4;
}
@@ -590,9 +590,9 @@ static int InternalSetMyAvatar(char *protocol, wchar_t *szFinalName, SetMyAvatar if (saved) {
wchar_t relFile[1024];
if (PathToRelativeT(globalFile, relFile, g_szDataPath))
- db_set_ts(NULL, AVS_MODULE, "GlobalUserAvatarFile", relFile);
+ db_set_ws(NULL, AVS_MODULE, "GlobalUserAvatarFile", relFile);
else
- db_set_ts(NULL, AVS_MODULE, "GlobalUserAvatarFile", globalFile);
+ db_set_ws(NULL, AVS_MODULE, "GlobalUserAvatarFile", globalFile);
db_set_b(NULL, AVS_MODULE, "GlobalUserAvatarNotConsistent", 0);
}
@@ -661,7 +661,7 @@ INT_PTR avSetMyAvatar(char* protocol, wchar_t* tszPath) if (tszPath == NULL) {
data.protocol = protocol;
- CMString filter;
+ CMStringW filter;
FilterGetStrings(filter, allAcceptXML, allAcceptSWF);
wchar_t inipath[1024];
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index 4cfc38d67f..7fcbd8435f 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -30,7 +30,7 @@ void mir_sleep(int time) void MyPathToAbsolute(const wchar_t *ptszPath, wchar_t *ptszDest)
{
- PathToAbsoluteT(VARST(ptszPath), ptszDest, g_szDataPath);
+ PathToAbsoluteW(VARSW(ptszPath), ptszDest, g_szDataPath);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -44,9 +44,9 @@ void MakePathRelative(MCONTACT hContact, wchar_t *path) size_t result = PathToRelativeT(path, szFinalPath, g_szDataPath);
if (result && szFinalPath[0] != '\0') {
- db_set_ts(hContact, "ContactPhoto", "RFile", szFinalPath);
+ db_set_ws(hContact, "ContactPhoto", "RFile", szFinalPath);
if (!db_get_b(hContact, "ContactPhoto", "Locked", 0))
- db_set_ts(hContact, "ContactPhoto", "Backup", szFinalPath);
+ db_set_ws(hContact, "ContactPhoto", "Backup", szFinalPath);
}
}
@@ -56,7 +56,7 @@ void MakePathRelative(MCONTACT hContact, wchar_t *path) void MakePathRelative(MCONTACT hContact)
{
- ptrW tszPath(db_get_tsa(hContact, "ContactPhoto", "File"));
+ ptrW tszPath(db_get_wsa(hContact, "ContactPhoto", "File"));
if (tszPath)
MakePathRelative(hContact, tszPath);
}
@@ -82,20 +82,20 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) if (proto == NULL || !db_get_b(NULL, AVS_MODULE, proto, 1))
return -1;
- if (db_get_b(hContact, "ContactPhoto", "Locked", 0) && (tszValue = db_get_tsa(hContact, "ContactPhoto", "Backup")))
+ if (db_get_b(hContact, "ContactPhoto", "Locked", 0) && (tszValue = db_get_wsa(hContact, "ContactPhoto", "Backup")))
MyPathToAbsolute(tszValue, tszFilename);
- else if (tszValue = db_get_tsa(hContact, "ContactPhoto", "RFile"))
+ else if (tszValue = db_get_wsa(hContact, "ContactPhoto", "RFile"))
MyPathToAbsolute(tszValue, tszFilename);
- else if (tszValue = db_get_tsa(hContact, "ContactPhoto", "File"))
+ else if (tszValue = db_get_wsa(hContact, "ContactPhoto", "File"))
MyPathToAbsolute(tszValue, tszFilename);
else return -2;
}
else {
if (hContact == 0) { // create a protocol picture in the proto picture cache
- if (tszValue = db_get_tsa(NULL, PPICT_MODULE, szProto))
+ if (tszValue = db_get_wsa(NULL, PPICT_MODULE, szProto))
MyPathToAbsolute(tszValue, tszFilename);
else if (mir_strcmp(szProto, AVS_DEFAULT)) {
- if (tszValue = db_get_tsa(NULL, PPICT_MODULE, AVS_DEFAULT))
+ if (tszValue = db_get_wsa(NULL, PPICT_MODULE, AVS_DEFAULT))
MyPathToAbsolute(tszValue, tszFilename);
if (!strstr(szProto, "Global avatar for")) {
@@ -104,7 +104,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) return -1;
char key[MAX_PATH];
mir_snprintf(key, "Global avatar for %s accounts", pdescr->szProtoName);
- if (tszValue = db_get_tsa(NULL, PPICT_MODULE, key))
+ if (tszValue = db_get_wsa(NULL, PPICT_MODULE, key))
MyPathToAbsolute(tszValue, tszFilename);
}
}
@@ -114,7 +114,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) // startup and everytime they are changed.
if (szProto[0] == '\0') {
// Global avatar
- if (tszValue = db_get_tsa(NULL, AVS_MODULE, "GlobalUserAvatarFile"))
+ if (tszValue = db_get_wsa(NULL, AVS_MODULE, "GlobalUserAvatarFile"))
MyPathToAbsolute(tszValue, tszFilename);
else
return -10;
@@ -130,7 +130,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) else
MultiByteToWideChar(CP_ACP, 0, szFileName, -1, tszFilename, _countof(tszFilename));
}
- else if (tszValue = db_get_tsa(NULL, szProto, "AvatarFile"))
+ else if (tszValue = db_get_wsa(NULL, szProto, "AvatarFile"))
MyPathToAbsolute(tszValue, tszFilename);
else return -1;
}
@@ -139,7 +139,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) if (mir_wstrlen(tszFilename) < 4)
return -1;
- wcsncpy_s(tszFilename, VARST(tszFilename), _TRUNCATE);
+ wcsncpy_s(tszFilename, VARSW(tszFilename), _TRUNCATE);
if (_waccess(tszFilename, 4) == -1)
return -2;
@@ -432,7 +432,7 @@ int ChangeAvatar(MCONTACT hContact, bool fLoad, bool fNotifyHist, int pa_format) void DeleteGlobalUserAvatar()
{
DBVARIANT dbv = { 0 };
- if (db_get_ts(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv))
+ if (db_get_ws(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv))
return;
wchar_t szFilename[MAX_PATH];
diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp index 84b1ae5768..4af8e5ca10 100644 --- a/plugins/AddContactPlus/src/addcontact.cpp +++ b/plugins/AddContactPlus/src/addcontact.cpp @@ -263,7 +263,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) psr->cbSize = sizeof(PROTOSEARCHRESULT);
}
- psr->flags = PSR_TCHAR;
+ psr->flags = PSR_UNICODE;
psr->id.w = mir_wstrdup(szUserId);
acs->psr = psr;
@@ -277,7 +277,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) wchar_t szHandle[256];
if (GetDlgItemText(hdlg, IDC_MYHANDLE, szHandle, _countof(szHandle)))
- db_set_ts(hContact, "CList", "MyHandle", szHandle);
+ db_set_ws(hContact, "CList", "MyHandle", szHandle);
int item = SendDlgItemMessage(hdlg, IDC_GROUP, CB_GETCURSEL, 0, 0);
if (item > 0) {
diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp index 2e9191ba85..1fb4cc51bf 100644 --- a/plugins/AddContactPlus/src/main.cpp +++ b/plugins/AddContactPlus/src/main.cpp @@ -95,7 +95,7 @@ static int OnAccListChanged(WPARAM, LPARAM) CMenuItem mi;
SET_UID(mi, 0xb19db907, 0x870e, 0x49fa, 0xa7, 0x1e, 0x43, 0x5e, 0xa8, 0xe5, 0x9b, 0xbd);
mi.position = 500020001;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = icon.hIcolib;
mi.name.w = LPGENW("&Add contact...");
mi.pszService = MS_ADDCONTACTPLUS_SHOW;
@@ -127,10 +127,10 @@ static int CreateButton(WPARAM, LPARAM) static int OnModulesLoaded(WPARAM, LPARAM)
{
HOTKEYDESC hkd = { sizeof(hkd) };
- hkd.dwFlags = HKD_TCHAR;
+ hkd.dwFlags = HKD_UNICODE;
hkd.pszName = "AddContactPlus_OpenDialog";
- hkd.ptszDescription = LPGENW("Open add contact dialog");
- hkd.ptszSection = LPGENW("Main");
+ hkd.pwszDescription = LPGENW("Open add contact dialog");
+ hkd.pwszSection = LPGENW("Main");
hkd.pszService = MS_ADDCONTACTPLUS_SHOW;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, 'C') | HKF_MIRANDA_LOCAL;
Hotkey_Register(&hkd);
diff --git a/plugins/Alarms/src/alarm_win.cpp b/plugins/Alarms/src/alarm_win.cpp index 4052bc7f79..5dfe6730cb 100644 --- a/plugins/Alarms/src/alarm_win.cpp +++ b/plugins/Alarms/src/alarm_win.cpp @@ -6,8 +6,8 @@ #define SPEACH_REPEAT_PERIOD 15000 // milliseconds
MWindowList hAlarmWindowList = 0;
-FontIDT title_font_id, window_font_id;
-ColourIDT bk_colour_id;
+FontIDW title_font_id, window_font_id;
+ColourIDW bk_colour_id;
HFONT hTitleFont = 0, hWindowFont = 0;
COLORREF title_font_colour, window_font_colour;
HBRUSH hBackgroundBrush = 0;
@@ -331,15 +331,15 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar int ReloadFonts(WPARAM, LPARAM)
{
LOGFONT log_font;
- title_font_colour = CallService(MS_FONT_GETT, (WPARAM)&title_font_id, (LPARAM)&log_font);
+ title_font_colour = CallService(MS_FONT_GETW, (WPARAM)&title_font_id, (LPARAM)&log_font);
DeleteObject(hTitleFont);
hTitleFont = CreateFontIndirect(&log_font);
- window_font_colour = CallService(MS_FONT_GETT, (WPARAM)&window_font_id, (LPARAM)&log_font);
+ window_font_colour = CallService(MS_FONT_GETW, (WPARAM)&window_font_id, (LPARAM)&log_font);
DeleteObject(hWindowFont);
hWindowFont = CreateFontIndirect(&log_font);
- COLORREF bkCol = CallService(MS_COLOUR_GETT, (WPARAM)&bk_colour_id, 0);
+ COLORREF bkCol = CallService(MS_COLOUR_GETW, (WPARAM)&bk_colour_id, 0);
DeleteObject(hBackgroundBrush);
hBackgroundBrush = CreateSolidBrush(bkCol);
@@ -349,7 +349,7 @@ int ReloadFonts(WPARAM, LPARAM) int AlarmWinModulesLoaded(WPARAM, LPARAM)
{
- title_font_id.cbSize = sizeof(FontIDT);
+ title_font_id.cbSize = sizeof(FontIDW);
mir_wstrcpy(title_font_id.group, LPGENW("Alarms"));
mir_wstrcpy(title_font_id.name, LPGENW("Title"));
mir_strcpy(title_font_id.dbSettingsGroup, MODULE);
@@ -358,9 +358,9 @@ int AlarmWinModulesLoaded(WPARAM, LPARAM) mir_wstrcpy(title_font_id.backgroundName, LPGENW("Background"));
title_font_id.flags = 0;
title_font_id.order = 0;
- FontRegisterT(&title_font_id);
+ FontRegisterW(&title_font_id);
- window_font_id.cbSize = sizeof(FontIDT);
+ window_font_id.cbSize = sizeof(FontIDW);
mir_wstrcpy(window_font_id.group, LPGENW("Alarms"));
mir_wstrcpy(window_font_id.name, LPGENW("Window"));
mir_strcpy(window_font_id.dbSettingsGroup, MODULE);
@@ -369,9 +369,9 @@ int AlarmWinModulesLoaded(WPARAM, LPARAM) mir_wstrcpy(window_font_id.backgroundName, LPGENW("Background"));
window_font_id.flags = 0;
window_font_id.order = 1;
- FontRegisterT(&window_font_id);
+ FontRegisterW(&window_font_id);
- bk_colour_id.cbSize = sizeof(ColourIDT);
+ bk_colour_id.cbSize = sizeof(ColourIDW);
mir_strcpy(bk_colour_id.dbSettingsGroup, MODULE);
mir_wstrcpy(bk_colour_id.group, LPGENW("Alarms"));
mir_wstrcpy(bk_colour_id.name, LPGENW("Background"));
@@ -380,7 +380,7 @@ int AlarmWinModulesLoaded(WPARAM, LPARAM) bk_colour_id.flags = 0;
bk_colour_id.order = 0;
- ColourRegisterT(&bk_colour_id);
+ ColourRegisterW(&bk_colour_id);
ReloadFonts(0, 0);
HookEvent(ME_FONT_RELOAD, ReloadFonts);
diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp index e108e04132..cc41317231 100644 --- a/plugins/Alarms/src/alarmlist.cpp +++ b/plugins/Alarms/src/alarmlist.cpp @@ -190,12 +190,12 @@ void LoadAlarms() { memset(&alarm, 0, sizeof(ALARM));
mir_snprintf(buff, "Title%d", i);
- if (!db_get_ts(0, MODULE, buff, &dbv)) {
+ if (!db_get_ws(0, MODULE, buff, &dbv)) {
alarm.szTitle = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
}
mir_snprintf(buff, "Desc%d", i);
- if (!db_get_ts(0, MODULE, buff, &dbv)) {
+ if (!db_get_ws(0, MODULE, buff, &dbv)) {
alarm.szDesc = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -244,11 +244,11 @@ void LoadAlarms() { alarm.action = (unsigned short)db_get_dw(0, MODULE, buff, AAF_POPUP | AAF_SOUND);
if (alarm.action & AAF_COMMAND) {
mir_snprintf(buff, "ActionCommand%d", i);
- if (!db_get_ts(0, MODULE, buff, &dbv)) {
+ if (!db_get_ws(0, MODULE, buff, &dbv)) {
alarm.szCommand = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
mir_snprintf(buff, "ActionParams%d", i);
- if (!db_get_ts(0, MODULE, buff, &dbv)) {
+ if (!db_get_ws(0, MODULE, buff, &dbv)) {
alarm.szCommandParams = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -289,9 +289,9 @@ void SaveAlarms() { ALARM *i;
for(alarms.reset(); i = alarms.current(); alarms.next(), index++) {
mir_snprintf(buff, "Title%d", index);
- db_set_ts(0, MODULE, buff, i->szTitle);
+ db_set_ws(0, MODULE, buff, i->szTitle);
mir_snprintf(buff, "Desc%d", index);
- db_set_ts(0, MODULE, buff, i->szDesc);
+ db_set_ws(0, MODULE, buff, i->szDesc);
mir_snprintf(buff, "Occ%d", index);
db_set_w(0, MODULE, buff, i->occurrence);
@@ -328,10 +328,10 @@ void SaveAlarms() { if (i->action & AAF_COMMAND) {
if (mir_wstrlen(i->szCommand)) {
mir_snprintf(buff, "ActionCommand%d", index);
- db_set_ts(0, MODULE, buff, i->szCommand);
+ db_set_ws(0, MODULE, buff, i->szCommand);
if (mir_wstrlen(i->szCommandParams)) {
mir_snprintf(buff, "ActionParams%d", index);
- db_set_ts(0, MODULE, buff, i->szCommandParams);
+ db_set_ws(0, MODULE, buff, i->szCommandParams);
}
}
}
diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp index 7ad231858c..9fd38fb638 100644 --- a/plugins/Alarms/src/frame.cpp +++ b/plugins/Alarms/src/frame.cpp @@ -508,7 +508,7 @@ int CreateFrame() Frame.tname = TranslateT("Alarms");
Frame.hWnd = hwnd_plugin;
Frame.align = alBottom;
- Frame.Flags = F_TCHAR | F_VISIBLE | F_SHOWTB | F_SHOWTBTIP;
+ Frame.Flags = F_UNICODE | F_VISIBLE | F_SHOWTB | F_SHOWTBTIP;
Frame.height = 30;
Frame.hIcon = hIconMenuSet;
frame_id = CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&Frame,0);
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index 7305022b0b..d50b40b464 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -66,7 +66,7 @@ static void SetAssocEnabled(const ASSOCDATA *assoc, BOOL fEnabled) if (GetModuleFileName(assoc->hInstance, szBuf, _countof(szBuf)))
if (PathToRelativeT(szBuf, szDLL)) {
mir_snprintf(szSetting, "module_%s", assoc->pszClassName);
- db_set_ts(NULL, "AssocMgr", szSetting, szDLL);
+ db_set_ws(NULL, "AssocMgr", szSetting, szDLL);
}
}
@@ -96,8 +96,8 @@ void CleanupAssocEnabledSettings(void) for (i = 0; i < nSettingsCount; ++i) {
pszSuffix = &ppszSettings[i][8];
mir_snprintf(szSetting, "module_%s", pszSuffix);
- if (!db_get_ts(NULL, "AssocMgr", szSetting, &dbv)) {
- if (PathToAbsoluteT(dbv.ptszVal, szDLL)) {
+ if (!db_get_ws(NULL, "AssocMgr", szSetting, &dbv)) {
+ if (PathToAbsoluteW(dbv.ptszVal, szDLL)) {
// file still exists?
hFile = CreateFile(szDLL, 0, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
if (hFile == INVALID_HANDLE_VALUE) {
@@ -980,7 +980,7 @@ void InitAssocList(void) ftd.cbSize = sizeof(FILETYPEDESC);
ftd.pszFileExt = ".dat";
ftd.pszMimeType = NULL;
- ftd.ptszDescription = TranslateT("Miranda NG database");
+ ftd.pwszDescription = TranslateT("Miranda NG database");
ftd.hInstance = hInst;
ftd.nIconResID = IDI_MIRANDAFILE;
ftd.ptszVerbDesc = NULL;
diff --git a/plugins/AssocMgr/src/reg.cpp b/plugins/AssocMgr/src/reg.cpp index 842ce654a3..84d1705f63 100644 --- a/plugins/AssocMgr/src/reg.cpp +++ b/plugins/AssocMgr/src/reg.cpp @@ -127,7 +127,7 @@ wchar_t *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile) {
wchar_t szDbFile[MAX_PATH], szExe[MAX_PATH], *pszFmt;
if (fFixedDbProfile) {
- if ( CallService(MS_DB_GETPROFILENAMET, _countof(szDbFile), (LPARAM)szDbFile))
+ if ( CallService(MS_DB_GETPROFILENAMEW, _countof(szDbFile), (LPARAM)szDbFile))
return NULL;
wchar_t *p = wcsrchr(szDbFile, '.');
if (p)
diff --git a/plugins/AssocMgr/src/test.cpp b/plugins/AssocMgr/src/test.cpp index f0d60e6276..2722545302 100644 --- a/plugins/AssocMgr/src/test.cpp +++ b/plugins/AssocMgr/src/test.cpp @@ -42,7 +42,7 @@ __inline static int AssocMgr_AddNewFileTypeT(const char *ext, const char *mime, ftd.cbSize = sizeof(FILETYPEDESC);
ftd.pszFileExt = ext;
ftd.pszMimeType = mime;
- ftd.ptszDescription = desc;
+ ftd.pwszDescription = desc;
ftd.hInstance = hinst;
ftd.nIconResID = iconid;
ftd.ptszVerbDesc = verb;
diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp index e5eef4db77..9d971a72c7 100644 --- a/plugins/AuthState/src/main.cpp +++ b/plugins/AuthState/src/main.cpp @@ -180,7 +180,7 @@ extern "C" int __declspec(dllexport) Load(void) CMenuItem mi;
SET_UID(mi, 0xc5a784ea, 0x8b07, 0x4b95, 0xa2, 0xb2, 0x84, 0x9d, 0x87, 0x43, 0x7e, 0xda);
mi.position = -1999901005;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.name.w = LPGENW("Enable AuthState icons");
mi.pszService = "AuthState/MenuItem";
hUserMenu = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/AutoRun/src/main.cpp b/plugins/AutoRun/src/main.cpp index eddc483179..0ec952d756 100644 --- a/plugins/AutoRun/src/main.cpp +++ b/plugins/AutoRun/src/main.cpp @@ -27,7 +27,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) void GetProfilePath(wchar_t *res, size_t resLen)
{
wchar_t dbname[MAX_PATH], exename[MAX_PATH];
- CallService(MS_DB_GETPROFILENAMET, _countof(dbname), (LPARAM)dbname);
+ CallService(MS_DB_GETPROFILENAMEW, _countof(dbname), (LPARAM)dbname);
GetModuleFileName(NULL, exename, _countof(exename));
wchar_t *p = wcsrchr(dbname, '.');
diff --git a/plugins/AutoShutdown/src/options.cpp b/plugins/AutoShutdown/src/options.cpp index 358f3e04af..267959c1d6 100644 --- a/plugins/AutoShutdown/src/options.cpp +++ b/plugins/AutoShutdown/src/options.cpp @@ -113,7 +113,7 @@ static int ShutdownOptInit(WPARAM wParam, LPARAM) odp.pwszGroup = LPGENW("Events"); /* autotranslated */
odp.pwszTitle = LPGENW("Automatic shutdown"); /* autotranslated */
odp.pwszTab = LPGENW("Automatic shutdown"); /* autotranslated, can be made a tab */
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pfnDlgProc = ShutdownOptDlgProc;
Options_AddPage(wParam, &odp);
return 0;
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index 0488ef6a65..ce4504eb4d 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -121,7 +121,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L SendMessage(hwndCombo, CB_SETLOCALE, (WPARAM)locale, 0); /* sort order */
SendMessage(hwndCombo, CB_INITSTORAGE, _countof(unitNames), _countof(unitNames) * 16); /* approx. */
for (int i = 0; i < _countof(unitNames); ++i) {
- int index = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)TranslateTS(unitNames[i]));
+ int index = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)TranslateW(unitNames[i]));
if (index != LB_ERR) {
SendMessage(hwndCombo, CB_SETITEMDATA, index, (LPARAM)unitValues[i]);
if (i == 0 || unitValues[i] == lastUnit) SendMessage(hwndCombo, CB_SETCURSEL, index, 0);
@@ -130,7 +130,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L }
{
DBVARIANT dbv;
- if (!db_get_ts(NULL, "AutoShutdown", "Message", &dbv)) {
+ if (!db_get_ws(NULL, "AutoShutdown", "Message", &dbv)) {
SetDlgItemText(hwndDlg, IDC_EDIT_MESSAGE, dbv.ptszVal);
mir_free(dbv.ptszVal);
}
@@ -355,7 +355,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L wchar_t *pszText = (wchar_t*)mir_alloc(len*sizeof(wchar_t));
if (pszText != NULL && GetWindowText(hwndEdit, pszText, len + 1)) {
TrimString(pszText);
- db_set_ts(NULL, "AutoShutdown", "Message", pszText);
+ db_set_ws(NULL, "AutoShutdown", "Message", pszText);
}
mir_free(pszText); /* does NULL check */
}
@@ -460,7 +460,7 @@ void SetShutdownMenuItem(bool fActive) mi.name.w = LPGENW("Automatic &shutdown...");
}
mi.pszService = "AutoShutdown/MenuCommand";
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
if (hMainMenuItem != NULL)
Menu_ModifyItem(hMainMenuItem, mi.name.w, mi.hIcolibItem);
else
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index e8ba15d8a0..d21934975e 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -384,7 +384,7 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L case M_UPDATE_COUNTDOWN: /* lParam=(WORD)countdown */
{
wchar_t szText[256];
- mir_snwprintf(szText, TranslateTS(desc[shutdownType - 1]), lParam);
+ mir_snwprintf(szText, TranslateW(desc[shutdownType - 1]), lParam);
SetDlgItemText(hwndDlg, IDC_TEXT_HEADER, szText);
/* countdown finished */
if (!lParam)
@@ -477,7 +477,7 @@ INT_PTR ServiceGetTypeDescription(WPARAM wParam, LPARAM lParam) if (!wParam || (BYTE)wParam > SDSDT_MAX) return 0;
/* select description */
wchar_t *pszDesc = (wchar_t*)((lParam&GSTDF_LONGDESC) ? apszLong : apszShort)[wParam - 1];
- if (!(lParam&GSTDF_UNTRANSLATED)) pszDesc = TranslateTS(pszDesc);
+ if (!(lParam&GSTDF_UNTRANSLATED)) pszDesc = TranslateW(pszDesc);
/* convert as needed */
if (!(lParam&GSTDF_UNICODE)) {
static char szConvBuf[128];
@@ -496,7 +496,7 @@ void InitShutdownSvc(void) {
/* Shutdown Dialog */
hwndShutdownDlg = NULL;
- SkinAddNewSoundExT("AutoShutdown_Countdown", LPGENW("Alerts"), LPGENW("Automatic shutdown countdown"));
+ SkinAddNewSoundExW("AutoShutdown_Countdown", LPGENW("Alerts"), LPGENW("Automatic shutdown countdown"));
/* Events */
hEventOkToShutdown = CreateHookableEvent(ME_AUTOSHUTDOWN_OKTOSHUTDOWN);
diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp index c6724ab982..d071125a2c 100644 --- a/plugins/AutoShutdown/src/utils.cpp +++ b/plugins/AutoShutdown/src/utils.cpp @@ -210,10 +210,10 @@ void AddHotkey() {
HOTKEYDESC hkd = { 0 };
hkd.cbSize = sizeof(hkd);
- hkd.dwFlags = HKD_TCHAR;
+ hkd.dwFlags = HKD_UNICODE;
hkd.pszName = "AutoShutdown_Toggle";
- hkd.ptszDescription = LPGENW("Toggle automatic shutdown");
- hkd.ptszSection = LPGENW("Main");
+ hkd.pwszDescription = LPGENW("Toggle automatic shutdown");
+ hkd.pwszSection = LPGENW("Main");
hkd.pszService = "AutoShutdown/MenuCommand";
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, 'T') | HKF_MIRANDA_LOCAL;
hkd.lParam = FALSE;
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index 65a69c73f9..8a7301518b 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -100,7 +100,7 @@ static int MsgEventAdded(WPARAM, LPARAM hDbEvent) if (!db_event_get(hDbEvent, &dbe))
if (dbe.eventType == EVENTTYPE_MESSAGE && !(dbe.flags & DBEF_SENT)) {
DBVARIANT dbv;
- if (!db_get_ts(NULL, "AutoShutdown", "Message", &dbv)) {
+ if (!db_get_ws(NULL, "AutoShutdown", "Message", &dbv)) {
TrimString(dbv.ptszVal);
wchar_t *pszMsg = GetMessageText(&dbe.pBlob, &dbe.cbBlob);
if (pszMsg != NULL && wcsstr(pszMsg, dbv.ptszVal) != NULL)
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index ebd5c219a7..c645d9f9fc 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -441,7 +441,7 @@ int FillAvatarListFromDB(HWND list, MCONTACT hContact) // Get file in disk
wchar_t path[MAX_PATH];
ptrW tszStoredPath(mir_utf8decodeW((char*)dbei.pBlob));
- PathToAbsoluteT(tszStoredPath, path);
+ PathToAbsoluteW(tszStoredPath, path);
// Add to list
ListEntry *le = new ListEntry();
@@ -478,7 +478,7 @@ bool UpdateAvatarPic(HWND hwnd) }
SetDlgItemText(hwnd,IDC_AVATARPATH,le->filename);
- HBITMAP avpic = (HBITMAP) CallService(MS_IMG_LOAD, (WPARAM)le->filename, IMGL_TCHAR);
+ HBITMAP avpic = (HBITMAP) CallService(MS_IMG_LOAD, (WPARAM)le->filename, IMGL_WCHAR);
bool found_image = (avpic != NULL);
@@ -515,7 +515,7 @@ void InitMenuItem() CMenuItem mi;
SET_UID(mi,0x2fb5c7eb, 0xa606, 0x4145, 0x9e, 0x86, 0x73, 0x88, 0x73, 0x1d, 0xe7, 0x5c);
mi.name.w = LPGENW("View Avatar History");
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.position = 1000090010;
mi.hIcolibItem = createDefaultOverlayedIcon(FALSE);
mi.pszService = MS_AVATARHISTORY_SHOWDIALOG;
@@ -562,7 +562,7 @@ int ShowSaveDialog(HWND hwnd, wchar_t* fn, MCONTACT hContact) ofn.lpstrDefExt = wcsrchr(fn, '.')+1;
DBVARIANT dbvInitDir = {0};
- if (!db_get_ts(hContact,MODULE_NAME,"SavedAvatarFolder",&dbvInitDir))
+ if (!db_get_ws(hContact,MODULE_NAME,"SavedAvatarFolder",&dbvInitDir))
{
ofn.lpstrInitialDir = dbvInitDir.ptszVal;
db_free(&dbvInitDir);
@@ -574,7 +574,7 @@ int ShowSaveDialog(HWND hwnd, wchar_t* fn, MCONTACT hContact) if (GetSaveFileName(&ofn))
{
CopyFile(fn, file, FALSE);
- db_set_ts(hContact,MODULE_NAME,"SavedAvatarFolder",file);
+ db_set_ws(hContact,MODULE_NAME,"SavedAvatarFolder",file);
}
return 0;
}
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index a678580bcc..d6bb00dc21 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -116,7 +116,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) return 0;
DBVARIANT dbvOldHash = {0};
- bool ret = (db_get_ts(hContact,MODULE_NAME,"AvatarHash",&dbvOldHash) == 0);
+ bool ret = (db_get_ws(hContact,MODULE_NAME,"AvatarHash",&dbvOldHash) == 0);
CONTACTAVATARCHANGEDNOTIFICATION* avatar = (CONTACTAVATARCHANGEDNOTIFICATION*)lParam;
if (avatar == NULL) {
@@ -130,7 +130,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) SkinPlaySound("avatar_removed");
// Is a flash avatar or avs could not load it
- db_set_ts(hContact, MODULE_NAME, "AvatarHash", L"-");
+ db_set_ws(hContact, MODULE_NAME, "AvatarHash", L"-");
if (ContactEnabled(hContact, "AvatarPopups", AVH_DEF_AVPOPUPS) && opts.popup_show_removed)
ShowPopup(hContact, NULL, opts.popup_removed);
@@ -143,7 +143,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) return 0;
}
SkinPlaySound("avatar_changed");
- db_set_ts(hContact, "AvatarHistory", "AvatarHash", avatar->hash);
+ db_set_ws(hContact, "AvatarHistory", "AvatarHash", avatar->hash);
wchar_t history_filename[MAX_PATH] = L"";
@@ -343,11 +343,11 @@ extern "C" __declspec(dllexport) int Load(void) CreateServiceFunction(MS_AVATARHISTORY_ENABLED, IsEnabled);
CreateServiceFunction(MS_AVATARHISTORY_GET_CACHED_AVATAR, GetCachedAvatar);
- if (CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)profilePath) != 0)
+ if (CallService(MS_DB_GETPROFILEPATHW, MAX_PATH, (LPARAM)profilePath) != 0)
mir_wstrcpy(profilePath, L"."); // Failed, use current dir
- SkinAddNewSoundExT("avatar_changed",LPGENW("Avatar History"),LPGENW("Contact changed avatar"));
- SkinAddNewSoundExT("avatar_removed",LPGENW("Avatar History"),LPGENW("Contact removed avatar"));
+ SkinAddNewSoundExW("avatar_changed",LPGENW("Avatar History"),LPGENW("Contact changed avatar"));
+ SkinAddNewSoundExW("avatar_removed",LPGENW("Avatar History"),LPGENW("Contact removed avatar"));
hAvatarWindowsList = WindowList_Create();
diff --git a/plugins/AvatarHistory/src/options.cpp b/plugins/AvatarHistory/src/options.cpp index 976c9174cd..63e4680071 100644 --- a/plugins/AvatarHistory/src/options.cpp +++ b/plugins/AvatarHistory/src/options.cpp @@ -152,7 +152,7 @@ int OptInit(WPARAM wParam, LPARAM) odp.pwszTitle = LPGENW("Avatar"); // name of the item
odp.pfnDlgProc = OptionsDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
Options_AddPage(wParam, &odp);
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
@@ -160,7 +160,7 @@ int OptInit(WPARAM wParam, LPARAM) odp.pwszTitle = LPGENW("Avatar Change");
odp.pfnDlgProc = PopupsDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPS);
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
Options_AddPage(wParam, &odp);
}
return 0;
diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp index e3c7bbe109..2a97cf3d2f 100644 --- a/plugins/AvatarHistory/src/utils.cpp +++ b/plugins/AvatarHistory/src/utils.cpp @@ -93,7 +93,7 @@ wchar_t* GetHistoryFolder(wchar_t *fn) {
if (fn == NULL) return NULL;
FoldersGetCustomPathT(hFolder, fn, MAX_PATH, basedir);
- CreateDirectoryTreeT(fn);
+ CreateDirectoryTreeW(fn);
return fn;
}
@@ -105,7 +105,7 @@ wchar_t* GetProtocolFolder(wchar_t *fn, char *proto) proto = Translate("Unknown Protocol");
mir_snwprintf(fn, MAX_PATH, L"%s\\%S", fn, proto);
- CreateDirectoryTreeT(fn);
+ CreateDirectoryTreeW(fn);
return fn;
}
@@ -119,7 +119,7 @@ wchar_t* GetContactFolder(wchar_t *fn, MCONTACT hContact) wcsncpy_s(uin, (id == NULL) ? TranslateT("Unknown UIN") : id, _TRUNCATE);
ConvertToFilename(uin, MAX_PATH); //added so that weather id's like "yw/CI0000" work
mir_snwprintf(fn, MAX_PATH, L"%s\\%s", fn, uin);
- CreateDirectoryTreeT(fn);
+ CreateDirectoryTreeW(fn);
#ifdef DBGPOPUPS
wchar_t log[1024];
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index b8d688bb1c..8d3fbac9dd 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -198,7 +198,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara SendDlgItemMessage(hwndDlg, IDC_OUTDEVICE, CB_SETCURSEL, 0, 0);
BASS_DEVICEINFO info;
- ptrW tszDeviceName(db_get_tsa(NULL, ModuleName, OPT_OUTDEVICE));
+ ptrW tszDeviceName(db_get_wsa(NULL, ModuleName, OPT_OUTDEVICE));
for (int i = 1; BASS_GetDeviceInfo(i + newBass, &info); i++) {
SendDlgItemMessage(hwndDlg, IDC_OUTDEVICE, CB_ADDSTRING, 0, _A2T(info.name));
if (!mir_wstrcmp(tszDeviceName, _A2T(info.name)))
@@ -227,7 +227,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara SYSTEMTIME systime = { 0 };
GetDlgItemText(hwndDlg, IDC_OUTDEVICE, tmp, _countof(tmp));
- db_set_ts(NULL, ModuleName, OPT_OUTDEVICE, tmp);
+ db_set_ws(NULL, ModuleName, OPT_OUTDEVICE, tmp);
Volume = (DWORD)SendDlgItemMessage(hwndDlg, IDC_VOLUME, TBM_GETPOS, 0, 0);
db_set_b(NULL, ModuleName, OPT_VOLUME, Volume);
@@ -424,11 +424,11 @@ static LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR int ReloadColors(WPARAM, LPARAM)
{
- ColourIDT colourid = { 0 };
+ ColourIDW colourid = { 0 };
colourid.cbSize = sizeof(colourid);
mir_wstrcpy(colourid.group, _A2W(ModuleName));
mir_wstrcpy(colourid.name, LPGENW("Frame background"));
- clBack = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, 0);
+ clBack = CallService(MS_COLOUR_GETW, (WPARAM)&colourid, 0);
if (hBkgBrush)
DeleteObject(hBkgBrush);
@@ -460,13 +460,13 @@ void CreateFrame() Frame.tname = TranslateT("Bass Interface");
Frame.hWnd = hwnd_plugin;
Frame.align = alBottom;
- Frame.Flags = F_TCHAR | F_VISIBLE | F_SHOWTB | F_SHOWTBTIP;
+ Frame.Flags = F_UNICODE | F_VISIBLE | F_SHOWTB | F_SHOWTBTIP;
Frame.height = 22;
Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
frame_id = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
- ColourIDT colourid = { 0 };
- colourid.cbSize = sizeof(ColourIDT);
+ ColourIDW colourid = { 0 };
+ colourid.cbSize = sizeof(ColourIDW);
strcpy_s(colourid.dbSettingsGroup, ModuleName);
strcpy_s(colourid.setting, "ColorFrame");
@@ -474,7 +474,7 @@ void CreateFrame() wcscpy_s(colourid.group, _A2W(ModuleName));
colourid.defcolour = GetSysColor(COLOR_3DFACE);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
HookEvent(ME_COLOUR_RELOAD, ReloadColors);
ReloadColors(0, 0);
@@ -499,7 +499,7 @@ void LoadBassLibrary(const wchar_t *ptszPath) DBVARIANT dbv = { 0 };
BASS_DEVICEINFO info;
- if (!db_get_ts(NULL, ModuleName, OPT_OUTDEVICE, &dbv))
+ if (!db_get_ws(NULL, ModuleName, OPT_OUTDEVICE, &dbv))
for (size_t i = 1; BASS_GetDeviceInfo((DWORD)i, &info); i++)
if (!mir_wstrcmp(dbv.ptszVal, _A2T(info.name)))
device = (int)i;
@@ -550,9 +550,9 @@ int OnModulesLoaded(WPARAM, LPARAM) }
else {
DBVARIANT dbv;
- if (db_get_ts(NULL, ModuleName, OPT_BASSPATH, &dbv)) {
- mir_wstrncpy(CurrBassPath, VARST(L"Plugins\\Bass\\bass.dll"), _countof(CurrBassPath));
- db_set_ts(NULL, ModuleName, OPT_BASSPATH, CurrBassPath);
+ if (db_get_ws(NULL, ModuleName, OPT_BASSPATH, &dbv)) {
+ mir_wstrncpy(CurrBassPath, VARSW(L"Plugins\\Bass\\bass.dll"), _countof(CurrBassPath));
+ db_set_ws(NULL, ModuleName, OPT_BASSPATH, CurrBassPath);
}
else {
mir_wstrcpy(CurrBassPath, dbv.ptszVal);
diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp index 91150ad439..8c91b57629 100644 --- a/plugins/BasicHistory/src/BasicHistory.cpp +++ b/plugins/BasicHistory/src/BasicHistory.cpp @@ -143,7 +143,7 @@ void InitTaskMenuItems() int pos = (int)taskMenus.size();
for (; taskIt != Options::instance->taskOptions.end(); ++taskIt) {
CMenuItem mi;
- mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.pszService = MS_HISTORY_EXECUTE_TASK;
mi.root = hTaskMainMenu;
mi.name.w = (wchar_t*)taskIt->taskName.c_str();
diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index bea541c11a..932242a65d 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -448,7 +448,7 @@ std::wstring HistoryEventList::GetContactId() static void GetMessageDescription(DBEVENTINFO *dbei, wchar_t* buf, int cbBuf)
{
- wchar_t *msg = DbGetEventTextT(dbei, CP_ACP);
+ wchar_t *msg = DbGetEventTextW(dbei, CP_ACP);
wcsncpy_s(buf, cbBuf, msg ? msg : TranslateT("Invalid Message"), _TRUNCATE);
buf[cbBuf - 1] = 0;
mir_free(msg);
diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp index be1dac8781..6d5017ce14 100644 --- a/plugins/BasicHistory/src/HistoryWindow.cpp +++ b/plugins/BasicHistory/src/HistoryWindow.cpp @@ -505,7 +505,7 @@ void __stdcall ShowMessageWindow(void* arg) if (dt->m_str.empty())
CallService(MS_MSG_SENDMESSAGE, dt->m_hContact, 0);
else
- CallService(MS_MSG_SENDMESSAGET, dt->m_hContact, (LPARAM)dt->m_str.c_str());
+ CallService(MS_MSG_SENDMESSAGEW, dt->m_hContact, (LPARAM)dt->m_str.c_str());
delete dt;
}
@@ -566,14 +566,14 @@ INT_PTR CALLBACK HistoryWindow::DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wP if (HIWORD(wParam) == BN_CLICKED) {
if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SHOWHIDE)) & BST_CHECKED) {
SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)historyWindow->minusIco);
- SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Hide Contacts"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Hide Contacts"), BATF_UNICODE);
historyWindow->isContactList = true;
ShowWindow(GetDlgItem(hwndDlg, IDC_LIST_CONTACTS), SW_SHOW);
ShowWindow(historyWindow->splitterYhWnd, SW_SHOW);
}
else {
SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)historyWindow->plusIco);
- SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show Contacts"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show Contacts"), BATF_UNICODE);
historyWindow->isContactList = false;
ShowWindow(GetDlgItem(hwndDlg, IDC_LIST_CONTACTS), SW_HIDE);
ShowWindow(historyWindow->splitterYhWnd, SW_HIDE);
@@ -988,13 +988,13 @@ void HistoryWindow::Initialise() SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BUTTONSETASFLATBTN, TRUE, 0);
if (m_hContact == NULL || Options::instance->showContacts) {
SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)minusIco);
- SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Hide Contacts"), BATF_TCHAR);
+ SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Hide Contacts"), BATF_UNICODE);
Button_SetCheck(GetDlgItem(m_hWnd, IDC_SHOWHIDE), BST_CHECKED);
isContactList = true;
}
else {
SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)plusIco);
- SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show Contacts"), BATF_TCHAR);
+ SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show Contacts"), BATF_UNICODE);
Button_SetCheck(GetDlgItem(m_hWnd, IDC_SHOWHIDE), BST_UNCHECKED);
ShowWindow(GetDlgItem(m_hWnd, IDC_LIST_CONTACTS), SW_HIDE);
ShowWindow(splitterYhWnd, SW_HIDE);
diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index 4e243c3682..f27b62597d 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -122,7 +122,7 @@ int Options::InitOptions(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 100000000;
odp.hInstance = hInst;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pwszTitle = LPGENW("History");
odp.pwszTab = LPGENW("Group list");
@@ -174,8 +174,8 @@ struct ColorOptionsList { struct HotkeyOptionsList {
const char *pszName;
- const wchar_t *ptszDescription;
- const wchar_t *ptszSection;
+ const wchar_t *pwszDescription;
+ const wchar_t *pwszSection;
const char *pszService;
WORD DefHotKey;
LPARAM lParam;
@@ -231,11 +231,11 @@ const int g_hotkeysSize = _countof(g_HotkeyOptionsList); void Options::Load(void)
{
- FontIDT fid = {0};
- ColourIDT cid = {0};
+ FontIDW fid = {0};
+ ColourIDW cid = {0};
HOTKEYDESC hid = {0};
- fid.cbSize = sizeof(FontIDT);
- cid.cbSize = sizeof(ColourIDT);
+ fid.cbSize = sizeof(FontIDW);
+ cid.cbSize = sizeof(ColourIDW);
hid.cbSize = sizeof(HOTKEYDESC);
strncpy_s(fid.dbSettingsGroup, "BasicHistory_Fonts", _TRUNCATE);
wcsncpy_s(fid.backgroundGroup, L"History", _TRUNCATE);
@@ -251,7 +251,7 @@ void Options::Load(void) wcsncpy_s(fid.name, g_FontOptionsList[i].szDescr, _TRUNCATE);
wcsncpy_s(fid.backgroundName, g_FontOptionsList[i].szBackgroundName, _TRUNCATE);
fid.flags = FIDF_DEFAULTVALID | FIDF_CLASSGENERAL | g_FontOptionsList[i].flags;
- FontRegisterT(&fid);
+ FontRegisterW(&fid);
}
strncpy_s(cid.dbSettingsGroup, "BasicHistory_Fonts", _TRUNCATE);
@@ -261,14 +261,14 @@ void Options::Load(void) mir_snprintf(cid.setting, _countof(cid.setting), "Color%d", i);
cid.order = i;
cid.defcolour = g_ColorOptionsList[i].def;
- ColourRegisterT(&cid);
+ ColourRegisterW(&cid);
}
- hid.dwFlags = HKD_TCHAR;
+ hid.dwFlags = HKD_UNICODE;
for (int i = 0; i < g_hotkeysSize; ++i) {
hid.pszName = g_HotkeyOptionsList[i].pszName;
- hid.ptszDescription = g_HotkeyOptionsList[i].ptszDescription;
- hid.ptszSection = g_HotkeyOptionsList[i].ptszSection;
+ hid.pwszDescription = g_HotkeyOptionsList[i].pwszDescription;
+ hid.pwszSection = g_HotkeyOptionsList[i].pwszSection;
hid.pszService = g_HotkeyOptionsList[i].pszService;
hid.DefHotKey = g_HotkeyOptionsList[i].DefHotKey;
hid.lParam = g_HotkeyOptionsList[i].lParam;
@@ -408,20 +408,20 @@ void Options::Load(void) COLORREF Options::GetFont(Fonts fontId, PLOGFONT font)
{
- FontIDT fid = {0};
- fid.cbSize = sizeof(FontIDT);
+ FontIDW fid = {0};
+ fid.cbSize = sizeof(FontIDW);
wcsncpy_s(fid.group, LPGENW("History"), _TRUNCATE);
wcsncpy_s(fid.name, g_FontOptionsList[fontId].szDescr, _TRUNCATE);
- return (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)font);
+ return (COLORREF)CallService(MS_FONT_GETW, (WPARAM)&fid, (LPARAM)font);
}
COLORREF Options::GetColor(Colors colorId)
{
- ColourIDT cid = {0};
- cid.cbSize = sizeof(ColourIDT);
+ ColourIDW cid = {0};
+ cid.cbSize = sizeof(ColourIDW);
wcsncpy_s(cid.group, LPGENW("History"), _TRUNCATE);
wcsncpy_s(cid.name, g_ColorOptionsList[colorId].tszName, _TRUNCATE);
- return (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, NULL);
+ return (COLORREF)CallService(MS_COLOUR_GETW, (WPARAM)&cid, NULL);
}
void Options::Save()
@@ -780,7 +780,7 @@ void ReloadEventLB(HWND hwndLB, const FilterOptions &sel) mir_snwprintf(buf, L"%d", *it);
ListBox_AddString(hwndLB, buf);
}
- else ListBox_AddString(hwndLB, TranslateTS(EventNames[selCpIdx].name));
+ else ListBox_AddString(hwndLB, TranslateW(EventNames[selCpIdx].name));
}
}
@@ -872,7 +872,7 @@ INT_PTR CALLBACK Options::DlgProcOptsMain(HWND hwndDlg, UINT msg, WPARAM wParam, ComboBox_AddString(events, TranslateT("Incoming events"));
ComboBox_AddString(events, TranslateT("Outgoing events"));
for (int i = 0 ; i < _countof(EventNames); ++i)
- ComboBox_AddString(events, TranslateTS(EventNames[i].name));
+ ComboBox_AddString(events, TranslateW(EventNames[i].name));
ComboBox_AddString(defFilter, TranslateT("Default history events"));
ComboBox_AddString(defFilter, TranslateT("All events"));
@@ -1276,7 +1276,7 @@ void InitCodepageCB(HWND hwndCB, unsigned int codepage, const std::wstring& name int selCpIdx = -1;
ComboBox_LimitText(hwndCB, 256);
for (int i = 0; i < cpCount; ++i) {
- ComboBox_AddString(hwndCB, TranslateTS(cpTable[i].cpName));
+ ComboBox_AddString(hwndCB, TranslateW(cpTable[i].cpName));
if (cpTable[i].cpId == codepage && name == cpTable[i].cpName)
selCpIdx = i;
}
diff --git a/plugins/BasicHistory/src/Scheduler.cpp b/plugins/BasicHistory/src/Scheduler.cpp index 238a65cfdf..9c391dce1a 100644 --- a/plugins/BasicHistory/src/Scheduler.cpp +++ b/plugins/BasicHistory/src/Scheduler.cpp @@ -74,7 +74,7 @@ void InitScheduler() test.flags = PCF_TCHAR;
test.hIcon = Skin_LoadIcon(SKINICON_OTHER_HISTORY);
test.iSeconds = 10;
- test.ptszDescription = TranslateT("History task");
+ test.pwszDescription = TranslateT("History task");
test.pszName = MODULE;
if (hPopupClass = Popup_RegisterClass(&test))
HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown);
diff --git a/plugins/BasicHistory/src/Searcher.cpp b/plugins/BasicHistory/src/Searcher.cpp index 97158d7796..a2f09eb24c 100644 --- a/plugins/BasicHistory/src/Searcher.cpp +++ b/plugins/BasicHistory/src/Searcher.cpp @@ -302,7 +302,7 @@ void Searcher::Find() mir_snwprintf(buf, TranslateT("\"%s\" not found"), str);
MessageBox(context->m_hWnd, buf, TranslateT("Search"), MB_OK | MB_ICONINFORMATION);
}
- else MessageBox(context->m_hWnd, TranslateTS(onlyGroup ? LPGENW("You have reached the end of the group.") : LPGENW("You have reached the end of the history.")), TranslateT("Search"), MB_OK | MB_ICONINFORMATION);
+ else MessageBox(context->m_hWnd, TranslateW(onlyGroup ? LPGENW("You have reached the end of the group.") : LPGENW("You have reached the end of the history.")), TranslateT("Search"), MB_OK | MB_ICONINFORMATION);
}
bool Searcher::IsInSel(int sel, wchar_t *strFind)
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index ebe6dd21d6..42278611c0 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -218,7 +218,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDbEvent) return 0;
DBEVENTGETTEXT egt;
egt.codepage = CP_ACP;
- egt.datatype = DBVT_TCHAR;
+ egt.datatype = DBVT_WCHAR;
egt.dbei = &dbei;
wchar_t* s = (wchar_t*)(void*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&egt);
free(dbei.pBlob);
@@ -312,7 +312,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR if (bTranslated)
Config.WarnText = c;
else
- Config.WarnText = TranslateTS(DEFAULT_WARN_TEXT);
+ Config.WarnText = TranslateW(DEFAULT_WARN_TEXT);
}
return TRUE;
}
@@ -369,9 +369,9 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = GetParent(hwndDlg);
- wchar_t *mind = TranslateTS(MIND_FILE_DESC);
- wchar_t *anyfile = TranslateTS(ALL_FILES_DESC);
- CMString filt(FORMAT, MIND_DIALOG_FILTER, mind, anyfile);
+ wchar_t *mind = TranslateW(MIND_FILE_DESC);
+ wchar_t *anyfile = TranslateW(ALL_FILES_DESC);
+ CMStringW filt(FORMAT, MIND_DIALOG_FILTER, mind, anyfile);
filt.Replace('\1', '\0');
ofn.lpstrFilter = filt;
@@ -407,8 +407,8 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP bTranslated = blInit = LoadMind(c, line);
if (!bTranslated) {
wchar_t message[5000];
- mir_snwprintf(message, TranslateTS(FAILED_TO_LOAD_BASE), line, c);
- MessageBox(NULL, message, TranslateTS(BOLTUN_ERROR), MB_ICONERROR | MB_TASKMODAL | MB_OK);
+ mir_snwprintf(message, TranslateW(FAILED_TO_LOAD_BASE), line, c);
+ MessageBox(NULL, message, TranslateW(BOLTUN_ERROR), MB_ICONERROR | MB_TASKMODAL | MB_OK);
}
}
break;
@@ -575,8 +575,8 @@ extern "C" int __declspec(dllexport) Load(void) blInit = LoadMind(Config.MindFileName, line);
if (!blInit) {
wchar_t path[2000];
- mir_snwprintf(path, TranslateTS(FAILED_TO_LOAD_BASE), line, (const wchar_t*)Config.MindFileName);
- MessageBox(NULL, path, TranslateTS(BOLTUN_ERROR), MB_ICONERROR | MB_TASKMODAL | MB_OK);
+ mir_snwprintf(path, TranslateW(FAILED_TO_LOAD_BASE), line, (const wchar_t*)Config.MindFileName);
+ MessageBox(NULL, path, TranslateW(BOLTUN_ERROR), MB_ICONERROR | MB_TASKMODAL | MB_OK);
}
return 0;
}
@@ -593,8 +593,8 @@ extern "C" int __declspec(dllexport) Unload(void) //So in case of saving error we will remain silent
#if 0
wchar_t path[MAX_PATH];
- mir_snwprintf(path, TranslateTS(FAILED_TO_SAVE_BASE), (const wchar_t*)Config.MindFileName);
- wchar_t* err = TranslateTS(BOLTUN_ERROR);
+ mir_snwprintf(path, TranslateW(FAILED_TO_SAVE_BASE), (const wchar_t*)Config.MindFileName);
+ wchar_t* err = TranslateW(BOLTUN_ERROR);
MessageBox(NULL, path, err, MB_ICONERROR | MB_TASKMODAL | MB_OK); */
#endif
}
diff --git a/plugins/Boltun/src/config.cpp b/plugins/Boltun/src/config.cpp index 68d6035315..7137a8af1a 100644 --- a/plugins/Boltun/src/config.cpp +++ b/plugins/Boltun/src/config.cpp @@ -40,7 +40,7 @@ inline wchar_t* GetString(char* key, const wchar_t* def) {
DBVARIANT dbv;
wchar_t* val;
- if (!db_get_ts(NULL, BOLTUN_KEY, key, &dbv))
+ if (!db_get_ws(NULL, BOLTUN_KEY, key, &dbv))
{
size_t len = mir_wstrlen(dbv.ptszVal) + 1;
val = new wchar_t[len];
@@ -61,7 +61,7 @@ inline const wchar_t* SetString(char* key, const wchar_t* value) size_t len = mir_wstrlen(value) + 1;
wchar_t* val = new wchar_t[len];
wcscpy_s(val, len, value);
- db_set_ts(NULL, BOLTUN_KEY, key, val);
+ db_set_ws(NULL, BOLTUN_KEY, key, val);
return val;
}
@@ -97,7 +97,7 @@ BUILDINTETTERS(AnswerPauseTime, DB_WAIT_TIME, 2); BUILDINTETTERS(AnswerThinkTime, DB_THINK_TIME, 4);
BUILDETTERS(PauseDepends, DB_PAUSE_DEPENDS, TRUE);
BUILDETTERS(PauseRandom, DB_PAUSE_RANDOM, TRUE);
-BUILDSTRETTERS(WarnText, DB_WARN_TEXT, TranslateTS(DEFAULT_WARN_TEXT));
+BUILDSTRETTERS(WarnText, DB_WARN_TEXT, TranslateW(DEFAULT_WARN_TEXT));
BUILDSTRETTERS(MindFileName, DB_MIND_FILE_NAME, DEFAULT_MIND_FILE);
BUILDETTERS(EngineStaySilent, DB_ENGINE_SILENT, FALSE);
BUILDETTERS(EngineMakeLowerCase, DB_ENGINE_LOWERCASE, FALSE);
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index d1e1fab75e..745cabb98c 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -196,7 +196,7 @@ BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM) wchar_t* GetDefStatusMsg(unsigned uStatus, const char* szProto)
{
- return (wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, uStatus, (LPARAM)szProto);
+ return (wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGW, uStatus, (LPARAM)szProto);
}
void SetStatus(const char* szProto, unsigned status, wchar_t *tszAwayMsg)
@@ -221,7 +221,7 @@ static int ChangeAllProtoStatuses(unsigned statusMode, wchar_t *msg) if (g_wMask & OPT_SETONLINEBACK){ // need to save old statuses & status messages
oldStatus[i] = status;
if (ProtoServiceExists(proto[i]->szModuleName, PS_GETMYAWAYMSG))
- oldStatusMsg[i] = (wchar_t*)CallProtoService(proto[i]->szModuleName, PS_GETMYAWAYMSG, 0, SGMA_TCHAR);
+ oldStatusMsg[i] = (wchar_t*)CallProtoService(proto[i]->szModuleName, PS_GETMYAWAYMSG, 0, SGMA_UNICODE);
else
oldStatusMsg[i] = GetDefStatusMsg(status, proto[i]->szModuleName);
}
@@ -253,7 +253,7 @@ static void CreateTrayIcon(bool create) {
NOTIFYICONDATA nim;
DBVARIANT dbVar;
- if (!db_get_ts(NULL, MOD_NAME, "ToolTipText", &dbVar)) {
+ if (!db_get_ws(NULL, MOD_NAME, "ToolTipText", &dbVar)) {
wcsncpy_s(nim.szTip, dbVar.ptszVal, _TRUNCATE);
db_free(&dbVar);
}
@@ -319,7 +319,7 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara BYTE bReqMode = db_get_b(NULL, MOD_NAME, "stattype", 2);
unsigned uMode = (STATUS_ARR_TO_ID[bReqMode]);
DBVARIANT dbVar;
- if (g_wMask & OPT_USEDEFMSG || db_get_ts(NULL, MOD_NAME, "statmsg", &dbVar))
+ if (g_wMask & OPT_USEDEFMSG || db_get_ws(NULL, MOD_NAME, "statmsg", &dbVar))
{
wchar_t *ptszDefMsg = GetDefStatusMsg(uMode, 0);
ChangeAllProtoStatuses(uMode, ptszDefMsg);
@@ -532,7 +532,7 @@ void BossKeyMenuItemInit(void) // Add menu item {
CMenuItem mi;
SET_UID(mi, 0x42428114, 0xfac7, 0x44c2, 0x9a, 0x11, 0x18, 0xbe, 0x81, 0xd4, 0xa9, 0xe3);
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.position = 2000100000;
mi.hIcolibItem = IcoLib_GetIcon("hidemim");
mi.name.w = LPGENW("Hide");
diff --git a/plugins/BossKeyPlus/src/Options.cpp b/plugins/BossKeyPlus/src/Options.cpp index fab96b3e27..682689a7df 100644 --- a/plugins/BossKeyPlus/src/Options.cpp +++ b/plugins/BossKeyPlus/src/Options.cpp @@ -82,7 +82,7 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam wchar_t tszMsg[1025];
GetDlgItemText(hwndDlg, IDC_MAINOPT_STATMSG, tszMsg, _countof(tszMsg));
if (tszMsg[0] != 0)
- db_set_ts(NULL, MOD_NAME, "statmsg", tszMsg);
+ db_set_ws(NULL, MOD_NAME, "statmsg", tszMsg);
else // delete current setting
db_unset(NULL, MOD_NAME, "statmsg");
}
@@ -123,7 +123,7 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam else {
DBVARIANT dbVar;
SendDlgItemMessage(hwndDlg, IDC_MAINOPT_STATMSG, EM_LIMITTEXT, 1024, 0);
- if (!db_get_ts(NULL, MOD_NAME, "statmsg", &dbVar)) {
+ if (!db_get_ws(NULL, MOD_NAME, "statmsg", &dbVar)) {
SetDlgItemText(hwndDlg, IDC_MAINOPT_STATMSG, dbVar.ptszVal);
db_free(&dbVar);
}
@@ -326,7 +326,7 @@ int OptsDlgInit(WPARAM wParam, LPARAM) optDi.pwszTitle = LPGENW("BossKey");
optDi.pwszGroup = LPGENW("Events");
optDi.pwszTab = LPGENW("Main");
- optDi.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ optDi.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
Options_AddPage(wParam, &optDi);
optDi.pfnDlgProc = AdvOptDlg;
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 4fc8a9e978..027ce00eff 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -344,7 +344,7 @@ INT_PTR MissYouAction(WPARAM wParam, LPARAM lParam) }
else hContact = wParam;
- CallService(MS_MSG_SENDMESSAGET, hContact, 0);
+ CallService(MS_MSG_SENDMESSAGEW, hContact, 0);
return 0;
}
@@ -361,7 +361,7 @@ INT_PTR ContactReturnedAction(WPARAM hContact, LPARAM lParam) }
if (options.iShowMessageWindow > 0)
- CallService(MS_MSG_SENDMESSAGET, hContact, 0);
+ CallService(MS_MSG_SENDMESSAGEW, hContact, 0);
if (options.iShowUDetails > 0)
CallService(MS_USERINFO_SHOWDIALOG, hContact, 0);
@@ -593,10 +593,10 @@ int ModulesLoaded(WPARAM, LPARAM) HookEvent(ME_USERINFO_INITIALISE, UserinfoInit);
// add sounds support
- SkinAddNewSoundExT("buddyExpectatorReturn", LPGENW("BuddyExpectator"), LPGENW("Contact returned"));
- SkinAddNewSoundExT("buddyExpectatorStillAbsent", LPGENW("BuddyExpectator"), LPGENW("Contact still absent"));
- SkinAddNewSoundExT("buddyExpectatorMissYou", LPGENW("BuddyExpectator"), LPGENW("Miss you event"));
- SkinAddNewSoundExT("buddyExpectatorHide", LPGENW("BuddyExpectator"), LPGENW("Hide contact event"));
+ SkinAddNewSoundExW("buddyExpectatorReturn", LPGENW("BuddyExpectator"), LPGENW("Contact returned"));
+ SkinAddNewSoundExW("buddyExpectatorStillAbsent", LPGENW("BuddyExpectator"), LPGENW("Contact still absent"));
+ SkinAddNewSoundExW("buddyExpectatorMissYou", LPGENW("BuddyExpectator"), LPGENW("Miss you event"));
+ SkinAddNewSoundExW("buddyExpectatorHide", LPGENW("BuddyExpectator"), LPGENW("Hide contact event"));
timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours
@@ -609,7 +609,7 @@ int ModulesLoaded(WPARAM, LPARAM) CMenuItem mi;
SET_UID(mi, 0xc48c31d4, 0x56b6, 0x48c6, 0x8e, 0xe9, 0xe6, 0x57, 0xb5, 0x80, 0xb8, 0x1e);
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = iconList[2].hIcolib;
mi.position = 200000;
mi.name.w = LPGENW("Enable Miss You");
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index c2bdeb591c..269ec50eaf 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -437,7 +437,7 @@ static int OptionsInit(WPARAM wParam, LPARAM) odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSPANEL);
odp.pwszTitle = LPGENW("Buddy Expectator");
odp.pfnDlgProc = OptionsFrameProc;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
Options_AddPage(wParam, &odp);
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
@@ -531,7 +531,7 @@ int UserinfoInit(WPARAM wparam, LPARAM lparam) OPTIONSDIALOGPAGE uip = { sizeof(uip) };
uip.hInstance = hInst;
uip.pszTemplate = MAKEINTRESOURCEA(IDD_USERINFO);
- uip.flags = ODPF_TCHAR;
+ uip.flags = ODPF_UNICODE;
uip.pwszTitle = LPGENW("Buddy Expectator");
uip.pfnDlgProc = UserinfoDlgProc;
UserInfo_AddPage(wparam, &uip);
diff --git a/plugins/BuddyPounce/src/dialog.cpp b/plugins/BuddyPounce/src/dialog.cpp index 12a70ba570..ed2d9f0a85 100644 --- a/plugins/BuddyPounce/src/dialog.cpp +++ b/plugins/BuddyPounce/src/dialog.cpp @@ -65,11 +65,11 @@ void hideAll(HWND hwnd) void getDefaultMessage(HWND hwnd, UINT control, MCONTACT hContact)
{
DBVARIANT dbv;
- if (!db_get_ts(hContact, modname, "PounceMsg", &dbv)) {
+ if (!db_get_ws(hContact, modname, "PounceMsg", &dbv)) {
SetDlgItemText(hwnd, control, dbv.ptszVal);
db_free(&dbv);
}
- else if (!db_get_ts(NULL, modname, "PounceMsg", &dbv)) {
+ else if (!db_get_ws(NULL, modname, "PounceMsg", &dbv)) {
SetDlgItemText(hwnd, control, dbv.ptszVal);
db_free(&dbv);
}
@@ -224,7 +224,7 @@ INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, L if (length>1) {
wchar_t *text = (wchar_t*)_alloca(length*sizeof(wchar_t));
GetDlgItemText(hwnd, IDC_MESSAGE, text, length);
- db_set_ts(hContact, modname, "PounceMsg", text);
+ db_set_ws(hContact, modname, "PounceMsg", text);
}
else db_unset(hContact, modname, "PounceMsg");
}
@@ -510,7 +510,7 @@ INT_PTR CALLBACK SendPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)spdps);
{
DBVARIANT dbv;
- if (db_get_ts(spdps->hContact, modname, "PounceMsg", &dbv))
+ if (db_get_ws(spdps->hContact, modname, "PounceMsg", &dbv))
DestroyWindow(hwnd);
else {
SetDlgItemText(hwnd,IDC_MESSAGE, dbv.ptszVal);
@@ -567,7 +567,7 @@ INT_PTR CALLBACK PounceSentDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP hContact = lParam;
{
DBVARIANT dbv;
- if (db_get_ts(hContact, modname, "PounceMsg", &dbv))
+ if (db_get_ws(hContact, modname, "PounceMsg", &dbv))
DestroyWindow(hwnd);
else {
SetDlgItemText(hwnd, IDC_MESSAGE, dbv.ptszVal);
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index 35e6f5d9ba..dc69bbb53d 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -67,7 +67,7 @@ int MsgAck(WPARAM, LPARAM lParam) DBEVENTINFO dbei = { 0 };
DBVARIANT dbv;
int reuse = db_get_b(ack->hContact,modname, "Reuse", 0);
- if (!db_get_ts(ack->hContact, modname, "PounceMsg", &dbv) && (dbv.ptszVal[0] != '\0')) {
+ if (!db_get_ws(ack->hContact, modname, "PounceMsg", &dbv) && (dbv.ptszVal[0] != '\0')) {
T2Utf pszUtf(dbv.ptszVal);
dbei.cbSize = sizeof(dbei);
dbei.eventType = EVENTTYPE_MESSAGE;
@@ -95,7 +95,7 @@ int MsgAck(WPARAM, LPARAM lParam) int BuddyPounceOptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.pwszGroup = LPGENW("Message sessions");
@@ -160,7 +160,7 @@ int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) if (newStatus != oldStatus && hContact != NULL && newStatus != ID_STATUS_OFFLINE) {
DBVARIANT dbv;
- if (!db_get_ts(hContact, modname, "PounceMsg", &dbv) && (dbv.ptszVal[0] != '\0')) {
+ if (!db_get_ws(hContact, modname, "PounceMsg", &dbv) && (dbv.ptszVal[0] != '\0')) {
// check my status
if (statusCheck(db_get_w(hContact, modname, "SendIfMyStatusIsFLAG", 0), CallProtoService(szProto, PS_GETSTATUS,0,0))
// check the contacts status
@@ -213,7 +213,7 @@ INT_PTR AddToPounce(WPARAM wParam, LPARAM lParam) MCONTACT hContact = wParam;
wchar_t* message = (wchar_t*)lParam;
DBVARIANT dbv;
- if (!db_get_ts(hContact, modname, "PounceMsg",&dbv))
+ if (!db_get_ws(hContact, modname, "PounceMsg",&dbv))
{
wchar_t* newPounce = (wchar_t*)mir_alloc(mir_wstrlen(dbv.ptszVal) + mir_wstrlen(message) + 1);
if (!newPounce) return 1;
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index ecb5941fea..22937da7fa 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -129,7 +129,7 @@ extern "C" __declspec(dllexport) int Load() SKINICONDESC sid = { 0 }; sid.defaultFile.w = tszFile; - sid.flags = SIDF_ALL_TCHAR; + sid.flags = SIDF_ALL_UNICODE; sid.section.w = MODULENAME; for (int i = 0; i < _countof(forms); i++) { @@ -164,10 +164,10 @@ extern "C" __declspec(dllexport) int Unload() void RegisterHotkeys(char buf[200], wchar_t* accName, int Number) { HOTKEYDESC hotkey = { sizeof(hotkey) }; - hotkey.dwFlags = HKD_TCHAR; + hotkey.dwFlags = HKD_UNICODE; hotkey.pszName = buf; - hotkey.ptszDescription = accName; - hotkey.ptszSection = LPGENW("Custom Status List"); + hotkey.pwszDescription = accName; + hotkey.pwszSection = LPGENW("Custom Status List"); hotkey.pszService = buf; hotkey.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, '0' + Number); Hotkey_Register(&hotkey); @@ -188,7 +188,7 @@ void SetStatus(WORD code, StatusItem* item, char *szAccName) int statusToSet; CUSTOM_STATUS ics = { sizeof(CUSTOM_STATUS) }; - ics.flags = CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE | CSSF_TCHAR; + ics.flags = CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE | CSSF_UNICODE; if (code == IDC_CANCEL) { statusToSet = 0; @@ -238,7 +238,7 @@ void addProtoStatusMenuItem(char *protoName) CreateServiceFunctionParam(buf, showList, (LPARAM)protoName); CMenuItem mi; - mi.flags = CMIF_TCHAR; + mi.flags = CMIF_UNICODE; mi.hIcolibItem = forms[0].hIcoLibItem; mi.name.w = MODULENAME; mi.position = 2000040000; @@ -261,14 +261,14 @@ void importCustomStatuses(CSWindow* csw, int result) si->m_iIcon = i - 1; mir_snprintf(bufTitle, "XStatus%dName", i); - if (!db_get_ts(NULL, protoName, bufTitle, &dbv)) { + if (!db_get_ws(NULL, protoName, bufTitle, &dbv)) { mir_wstrcpy(si->m_tszTitle, dbv.ptszVal); db_free(&dbv); } else si->m_tszTitle[0] = 0; mir_snprintf(bufMessage, "XStatus%dMsg", i); - if (!db_get_ts(NULL, protoName, bufMessage, &dbv)) { + if (!db_get_ws(NULL, protoName, bufMessage, &dbv)) { mir_wstrcpy(si->m_tszMessage, dbv.ptszVal); db_free(&dbv); } @@ -366,7 +366,7 @@ void CSWindow::initButtons() SendDlgItemMessage(m_handle, forms[i].idc, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(forms[i].hIcoLibItem)); SendDlgItemMessage(m_handle, forms[i].idc, BUTTONSETASFLATBTN, TRUE, 0); //maybe set as BUTTONSETDEFAULT? - SendDlgItemMessage(m_handle, forms[i].idc, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(forms[i].ptszTitle), BATF_TCHAR); + SendDlgItemMessage(m_handle, forms[i].idc, BUTTONADDTOOLTIP, (WPARAM)TranslateW(forms[i].ptszTitle), BATF_UNICODE); } } @@ -486,7 +486,7 @@ void CSAMWindow::setCombo() WPARAM iStatus; wchar_t tszName[100]; CUSTOM_STATUS cs = { sizeof(cs) }; - cs.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR; + cs.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_UNICODE; cs.ptszName = tszName; cs.wParam = &iStatus; @@ -500,7 +500,7 @@ void CSAMWindow::setCombo() cbi.mask = CBEIF_TEXT | CBEIF_IMAGE | CBEIF_SELECTEDIMAGE; cbi.iItem = -1; cbi.iImage = cbi.iSelectedImage = i - 1; - cbi.pszText = TranslateTS(tszName); + cbi.pszText = TranslateW(tszName); SendMessage(m_hCombo, CBEM_INSERTITEM, 0, (LPARAM)&cbi); } SendMessage(m_hCombo, CB_SETCURSEL, 0, 0); // first 0 sets selection to top @@ -574,11 +574,11 @@ void CSAMWindow::checkItemValidity() wchar_t tszTitle[100]; CUSTOM_STATUS cs = { sizeof(cs) }; - cs.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR; + cs.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_UNICODE; cs.ptszName = tszTitle; cs.wParam = &i; if (CallProtoService(pdescr->szModuleName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&cs) == 0) - mir_wstrncpy(m_item->m_tszTitle, TranslateTS(tszTitle), _countof(m_item->m_tszTitle)); + mir_wstrncpy(m_item->m_tszTitle, TranslateW(tszTitle), _countof(m_item->m_tszTitle)); if (mir_wstrcmp(m_item->m_tszMessage, tszInputMessage)) mir_wstrcpy(m_item->m_tszMessage, tszInputMessage), m_bChanged = true; @@ -747,14 +747,14 @@ void CSItemsList::loadItems(char *protoName) item->m_iIcon = getByte(dbSetting, DEFAULT_ITEM_ICON); mir_snprintf(dbSetting, "%s_Item%dTitle", protoName, i); - if (!getTString(dbSetting, &dbv)) { + if (!getWString(dbSetting, &dbv)) { mir_wstrcpy(item->m_tszTitle, dbv.ptszVal); db_free(&dbv); } else item->m_tszTitle[0] = 0; mir_snprintf(dbSetting, "%s_Item%dMessage", protoName, i); - if (!getTString(dbSetting, &dbv)) { + if (!getWString(dbSetting, &dbv)) { mir_wstrcpy(item->m_tszMessage, dbv.ptszVal); db_free(&dbv); } @@ -781,9 +781,9 @@ void CSItemsList::saveItems(char *protoName) mir_snprintf(dbSetting, "%s_Item%dIcon", protoName, i); setByte(dbSetting, item->m_iIcon); mir_snprintf(dbSetting, "%s_Item%dTitle", protoName, i); - setTString(dbSetting, item->m_tszTitle); + setWString(dbSetting, item->m_tszTitle); mir_snprintf(dbSetting, "%s_Item%dMessage", protoName, i); - setTString(dbSetting, item->m_tszMessage); + setWString(dbSetting, item->m_tszMessage); mir_snprintf(dbSetting, "%s_Item%dFavourite", protoName, i); setByte(dbSetting, item->m_bFavourite); } @@ -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?"), TranslateTS(MODULENAME), MB_YESNO | MB_DEFBUTTON2 | MB_ICONQUESTION) == IDNO) + if (MessageBox(hwnd, TranslateT("Do you really want to delete selected item?"), TranslateW(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?"), - TranslateTS(MODULENAME), MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_ICONQUESTION); + TranslateW(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 e64119f5ea..7e80f4519f 100644 --- a/plugins/CSList/src/stdafx.h +++ b/plugins/CSList/src/stdafx.h @@ -90,8 +90,8 @@ #define setWord(setting, value) db_set_w(NULL, MODNAME, setting, value)
#define getDword(setting, error) db_get_dw(NULL, MODNAME, setting, error)
#define setDword(setting, value) db_set_dw(NULL, MODNAME, setting, value)
-#define getTString(setting, dest) db_get_ts(NULL, MODNAME, setting, dest)
-#define setTString(setting, value) db_set_ts(NULL, MODNAME, setting, value)
+#define getWString(setting, dest) db_get_ws(NULL, MODNAME, setting, dest)
+#define setWString(setting, value) db_set_ws(NULL, MODNAME, setting, value)
#define deleteSetting(setting) db_unset(NULL, MODNAME, setting)
// --
diff --git a/plugins/ChangeKeyboardLayout/src/hook_events.cpp b/plugins/ChangeKeyboardLayout/src/hook_events.cpp index be5c8f100d..9abe24c248 100644 --- a/plugins/ChangeKeyboardLayout/src/hook_events.cpp +++ b/plugins/ChangeKeyboardLayout/src/hook_events.cpp @@ -101,7 +101,7 @@ int ModulesLoaded(WPARAM, LPARAM) for (int i = 0; i < bLayNum; i++) {
LPTSTR ptszCurrLayout = GenerateLayoutString(hklLayouts[i]);
LPSTR ptszTemp = GetNameOfLayout(hklLayouts[i]);
- ptrW tszValue(db_get_tsa(NULL, ModuleName, ptszTemp));
+ ptrW tszValue(db_get_wsa(NULL, ModuleName, ptszTemp));
if (tszValue == 0)
ptszLayStrings[i] = ptszCurrLayout;
else if (!mir_wstrcmp(tszValue, ptszEmptySting))
diff --git a/plugins/ChangeKeyboardLayout/src/options.cpp b/plugins/ChangeKeyboardLayout/src/options.cpp index a610cef0fe..27540781fe 100644 --- a/plugins/ChangeKeyboardLayout/src/options.cpp +++ b/plugins/ChangeKeyboardLayout/src/options.cpp @@ -211,7 +211,7 @@ INT_PTR CALLBACK DlgMainProcOptions(HWND hWnd, UINT uiMessage, WPARAM wParam, LP pszNameLay = GetNameOfLayout(hklLayouts[i]);
if (mir_wstrcmp(ptszMemLay, ptszGenLay) != 0)
- db_set_ts(NULL, ModuleName, pszNameLay, ptszMemLay);
+ db_set_ws(NULL, ModuleName, pszNameLay, ptszMemLay);
else
db_unset(NULL, ModuleName, pszNameLay);
diff --git a/plugins/ClientChangeNotify/src/CString.cpp b/plugins/ClientChangeNotify/src/CString.cpp index 4f4064d60a..edee2fe0e6 100644 --- a/plugins/ClientChangeNotify/src/CString.cpp +++ b/plugins/ClientChangeNotify/src/CString.cpp @@ -280,7 +280,7 @@ CString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue)
{
- ptrW p( db_get_tsa(hContact, szModule, szSetting));
+ ptrW p( db_get_wsa(hContact, szModule, szSetting));
return TCString(p == NULL ? szDefaultValue : p);
}
diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index f70270d757..67f13a01a7 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -203,7 +203,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) return 0;
}
sd.OldMirVer = db_get_s(hContact, MOD_NAME, DB_OLDMIRVER, L"");
- db_set_ts(hContact, MOD_NAME, DB_OLDMIRVER, sd.MirVer); // we have to write it here, because we modify sd.OldMirVer and sd.MirVer to conform our settings later
+ db_set_ws(hContact, MOD_NAME, DB_OLDMIRVER, sd.MirVer); // we have to write it here, because we modify sd.OldMirVer and sd.MirVer to conform our settings later
if (sd.OldMirVer.IsEmpty()) // looks like it's the right way to do
return 0;
@@ -331,7 +331,7 @@ int MirandaLoaded(WPARAM, LPARAM) CMenuItem mi;
SET_UID(mi, 0xfabb9181, 0xdb92, 0x43f4, 0x86, 0x40, 0xca, 0xb6, 0x4c, 0x93, 0x34, 0x27);
mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 0);
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
if (g_PopupOptPage.GetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY))
mi.name.w = LPGENW("Disable c&lient change notification");
else
@@ -361,7 +361,7 @@ extern "C" int __declspec(dllexport) Load(void) TCString Str;
Str = db_get_s(NULL, MOD_NAME, DB_IGNORESUBSTRINGS, L"");
if (Str.GetLen()) // fix incorrect regexp from v0.1.1.0
- db_set_ts(NULL, MOD_NAME, DB_IGNORESUBSTRINGS, Str.Replace(L"/Miranda[0-9A-F]{8}/", L"/[0-9A-F]{8}(\\W|$)/"));
+ db_set_ws(NULL, MOD_NAME, DB_IGNORESUBSTRINGS, Str.Replace(L"/Miranda[0-9A-F]{8}/", L"/[0-9A-F]{8}(\\W|$)/"));
db_set_b(NULL, MOD_NAME, DB_SETTINGSVER, 1);
}
diff --git a/plugins/ClientChangeNotify/src/OptDlg.cpp b/plugins/ClientChangeNotify/src/OptDlg.cpp index 9ec69fe61c..ffc13577d3 100644 --- a/plugins/ClientChangeNotify/src/OptDlg.cpp +++ b/plugins/ClientChangeNotify/src/OptDlg.cpp @@ -87,8 +87,8 @@ INT_PTR CALLBACK PopupOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara HWND hLCombo = GetDlgItem(hwndDlg, IDC_POPUPOPTDLG_LCLICK_ACTION);
HWND hRCombo = GetDlgItem(hwndDlg, IDC_POPUPOPTDLG_RCLICK_ACTION);
for (int i = 0; i < _countof(PopupActions); i++) {
- SendMessage(hLCombo, CB_SETITEMDATA, SendMessage(hLCombo, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action);
- SendMessage(hRCombo, CB_SETITEMDATA, SendMessage(hRCombo, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action);
+ SendMessage(hLCombo, CB_SETITEMDATA, SendMessage(hLCombo, CB_ADDSTRING, 0, (LPARAM)TranslateW(PopupActions[i].Text)), PopupActions[i].Action);
+ SendMessage(hRCombo, CB_SETITEMDATA, SendMessage(hRCombo, CB_ADDSTRING, 0, (LPARAM)TranslateW(PopupActions[i].Text)), PopupActions[i].Action);
}
g_PopupOptPage.DBToMemToPage();
EnablePopupOptDlgControls();
@@ -168,7 +168,7 @@ int OptionsDlgInit(WPARAM wParam, LPARAM) optDi.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPOPTDLG);
optDi.hInstance = g_hInstance;
optDi.pwszGroup = LPGENW("Popups");
- optDi.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ optDi.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
Options_AddPage(wParam, &optDi);
}
return 0;
diff --git a/plugins/ClientChangeNotify/src/Options.cpp b/plugins/ClientChangeNotify/src/Options.cpp index 62463ea611..0a81d2f701 100644 --- a/plugins/ClientChangeNotify/src/Options.cpp +++ b/plugins/ClientChangeNotify/src/Options.cpp @@ -151,7 +151,7 @@ TCString COptItem::GetStrDBVal(const CString &sModule, CString *sDBSettingPrefix void COptItem::SetStrDBVal(const CString &sModule, TCString &Str, CString *sDBSettingPrefix)
{
if (sDBSetting != NULL && !m_bReadOnly) {
- db_set_ts(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting, Str);
+ db_set_ws(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting, Str);
}
}
@@ -331,7 +331,7 @@ void COptItem_TreeCtrl::MemToDB(const CString &sModule, CString *sDBSettingPrefi CString StrID;
_itoa(m_value[i].ID, StrID.GetBuffer(64), 10);
StrID.ReleaseBuffer();
- db_set_ts(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_TITLE + StrID, m_value[i].Title);
+ db_set_ws(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_TITLE + StrID, m_value[i].Title);
if (!(TreeFlags & TREECTRL_FLAG_IS_SINGLE_LEVEL))
db_set_w(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_PARENT + StrID, m_value[i].ParentID);
@@ -340,7 +340,7 @@ void COptItem_TreeCtrl::MemToDB(const CString &sModule, CString *sDBSettingPrefi db_set_b(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_FLAGS + StrID, m_value[i].Flags);
if (User_Str1_DBName != NULL && m_value[i].User_Str1 != NULL)
- db_set_ts(NULL, sModule, *sDBSettingPrefix + sDBSetting + User_Str1_DBName + StrID, m_value[i].User_Str1);
+ db_set_ws(NULL, sModule, *sDBSettingPrefix + sDBSetting + User_Str1_DBName + StrID, m_value[i].User_Str1);
}
COptItem::MemToDB(sModule, sDBSettingPrefix);
}
@@ -703,7 +703,7 @@ void COptItem_ListCtrl::MemToDB(const CString &sModule, CString *sDBSettingPrefi CString StrID;
_itoa(i, StrID.GetBuffer(64), 10);
StrID.ReleaseBuffer();
- db_set_ts(NULL, sModule, *sDBSettingPrefix + sDBSetting + LISTITEM_DBSTR_TEXT + StrID, m_value[i].Text);
+ db_set_ws(NULL, sModule, *sDBSettingPrefix + sDBSetting + LISTITEM_DBSTR_TEXT + StrID, m_value[i].Text);
}
COptItem::MemToDB(sModule, sDBSettingPrefix);
}
diff --git a/plugins/Clist_blind/src/clcopts.cpp b/plugins/Clist_blind/src/clcopts.cpp index 3a60f5c8cf..576d958b48 100644 --- a/plugins/Clist_blind/src/clcopts.cpp +++ b/plugins/Clist_blind/src/clcopts.cpp @@ -93,7 +93,7 @@ static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *value tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
for (int i = 0; i < nValues; i++) {
tvis.item.lParam = values[i].style;
- tvis.item.pszText = TranslateTS( values[i].szDescr );
+ tvis.item.pszText = TranslateW( values[i].szDescr );
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.state = INDEXTOSTATEIMAGEMASK((style & tvis.item.lParam) != 0 ? 2 : 1);
TreeView_InsertItem( hwndTree, &tvis);
@@ -233,13 +233,13 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam db_set_b(NULL, "CLC", "NoVScrollBar", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NOSCROLLBAR) ? 1 : 0));
GetDlgItemText(hwndDlg, IDC_T_CONTACT, tmp, _countof(tmp));
- db_set_ts(NULL, "CLC", "TemplateContact", tmp);
+ db_set_ws(NULL, "CLC", "TemplateContact", tmp);
GetDlgItemText(hwndDlg, IDC_T_GROUP, tmp, _countof(tmp));
- db_set_ts(NULL, "CLC", "TemplateGroup", tmp);
+ db_set_ws(NULL, "CLC", "TemplateGroup", tmp);
GetDlgItemText(hwndDlg, IDC_T_DIVIDER, tmp, _countof(tmp));
- db_set_ts(NULL, "CLC", "TemplateDivider", tmp);
+ db_set_ws(NULL, "CLC", "TemplateDivider", tmp);
GetDlgItemText(hwndDlg, IDC_T_INFO, tmp, _countof(tmp));
- db_set_ts(NULL, "CLC", "TemplateInfo", tmp);
+ db_set_ws(NULL, "CLC", "TemplateInfo", tmp);
pcli->pfnClcOptionsChanged();
return TRUE;
diff --git a/plugins/Clist_blind/src/cluiopts.cpp b/plugins/Clist_blind/src/cluiopts.cpp index bccb11eca6..34e804d442 100644 --- a/plugins/Clist_blind/src/cluiopts.cpp +++ b/plugins/Clist_blind/src/cluiopts.cpp @@ -72,7 +72,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L {
DBVARIANT dbv;
- if (!db_get_ts(NULL, "CList", "TitleText", &dbv)) {
+ if (!db_get_ws(NULL, "CList", "TitleText", &dbv)) {
SetDlgItemText(hwndDlg, IDC_TITLETEXT, dbv.ptszVal);
db_free(&dbv);
}
@@ -169,7 +169,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L {
wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
- db_set_ts(NULL, "CList", "TitleText", title);
+ db_set_ws(NULL, "CList", "TitleText", title);
SetWindowText(pcli->hwndContactList, title);
}
pcli->pfnLoadCluiGlobalOpts();
diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp index d1889144f1..d09979acad 100644 --- a/plugins/Clist_blind/src/init.cpp +++ b/plugins/Clist_blind/src/init.cpp @@ -182,7 +182,7 @@ wchar_t* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* set out[0] = '\0';
- if (!db_get_ts(hContact, module, setting, &dbv)) {
+ if (!db_get_ws(hContact, module, setting, &dbv)) {
if (dbv.type == DBVT_ASCIIZ)
MultiByteToWideChar(CP_ACP, 0, dbv.pszVal, -1, out, (int)len);
else if (dbv.type == DBVT_UTF8)
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp index 4cd01abef0..701715a7c3 100644 --- a/plugins/Clist_modern/src/cluiframes.cpp +++ b/plugins/Clist_modern/src/cluiframes.cpp @@ -678,7 +678,7 @@ static int LocateStorePosition(int Frameid, int maxstored) for (int i = 0; i < maxstored; i++) {
mir_snprintf(settingname, "Name%d", i);
DBVARIANT dbv = { 0 };
- if (db_get_ts(NULL, CLUIFrameModule, settingname, &dbv))
+ if (db_get_ws(NULL, CLUIFrameModule, settingname, &dbv))
continue;
if (mir_wstrcmpi(dbv.ptszVal, g_pfwFrames[Frameid].name) == 0) {
@@ -1502,7 +1502,7 @@ static int CLUIFramesLoadMainMenu() for (int i = 0; i < g_nFramesCount; i++) {
FRAMEWND &F = g_pfwFrames[i];
mi.hIcolibItem = F.TitleBar.hicon;
- mi.flags = CMIF_SYSTEM | CMIF_TCHAR;
+ mi.flags = CMIF_SYSTEM | CMIF_UNICODE;
mi.position = separator++;
mi.name.w = F.TitleBar.tbname ? F.TitleBar.tbname : F.name;
mi.pszService = 0;
@@ -2362,7 +2362,7 @@ int OnFrameTitleBarBackgroundChange(WPARAM, LPARAM) }
if (g_CluiData.fDisableSkinEngine) {
if (db_get_b(NULL, "FrameTitleBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- ptrW tszBitmapName(db_get_tsa(NULL, "FrameTitleBar", "BkBitmap"));
+ ptrW tszBitmapName(db_get_wsa(NULL, "FrameTitleBar", "BkBitmap"));
if (tszBitmapName)
sttBmpBackground = Bitmap_Load(tszBitmapName);
}
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index 2406754e47..f3c081c4b2 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -282,7 +282,7 @@ int GetStatusName(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xstat // Get XStatusName if (!noAwayMsg && !noXstatus && xstatus_has_priority && pdnce->hContact && pdnce->m_pszProto) { DBVARIANT dbv = { 0 }; - if (!db_get_ts(pdnce->hContact, pdnce->m_pszProto, "XStatusName", &dbv)) { + if (!db_get_ws(pdnce->hContact, pdnce->m_pszProto, "XStatusName", &dbv)) { //mir_wstrncpy(text, dbv.pszVal, text_size); CopySkipUnprintableChars(text, dbv.ptszVal, text_size - 1); db_free(&dbv); @@ -302,7 +302,7 @@ int GetStatusName(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xstat // Get XStatusName if (!noAwayMsg && !noXstatus && !xstatus_has_priority && pdnce->hContact && pdnce->m_pszProto) { DBVARIANT dbv = { 0 }; - if (!db_get_ts(pdnce->hContact, pdnce->m_pszProto, "XStatusName", &dbv)) { + if (!db_get_ws(pdnce->hContact, pdnce->m_pszProto, "XStatusName", &dbv)) { CopySkipUnprintableChars(text, dbv.ptszVal, text_size - 1); db_free(&dbv); @@ -324,7 +324,7 @@ void GetListeningTo(wchar_t *text, int text_size, ClcCacheEntry *pdnce) if (pdnce->m_iStatus == ID_STATUS_OFFLINE || pdnce->m_iStatus == 0) return; - ptrW tszValue(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "ListeningTo")); + ptrW tszValue(db_get_wsa(pdnce->hContact, pdnce->m_pszProto, "ListeningTo")); if (tszValue != NULL) CopySkipUnprintableChars(text, tszValue, text_size - 1); } @@ -345,7 +345,7 @@ int GetStatusMessage(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xs // Get XStatusMsg if (!noAwayMsg && xstatus_has_priority && pdnce->hContact && pdnce->m_pszProto) { - ptrW tszXStatusMsg(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusMsg")); + ptrW tszXStatusMsg(db_get_wsa(pdnce->hContact, pdnce->m_pszProto, "XStatusMsg")); if (tszXStatusMsg != NULL) { CopySkipUnprintableChars(text, tszXStatusMsg, text_size - 1); if (text[0] != '\0') @@ -355,7 +355,7 @@ int GetStatusMessage(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xs // Get StatusMsg if (pdnce->hContact && text[0] == '\0') { - ptrW tszStatusMsg(db_get_tsa(pdnce->hContact, "CList", "StatusMsg")); + ptrW tszStatusMsg(db_get_wsa(pdnce->hContact, "CList", "StatusMsg")); if (tszStatusMsg != NULL) { CopySkipUnprintableChars(text, tszStatusMsg, text_size - 1); if (text[0] != '\0') @@ -366,7 +366,7 @@ int GetStatusMessage(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xs // Get XStatusMsg if (!noAwayMsg && !xstatus_has_priority && pdnce->hContact && pdnce->m_pszProto && text[0] == '\0') { // Try to get XStatusMsg - ptrW tszXStatusMsg(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusMsg")); + ptrW tszXStatusMsg(db_get_wsa(pdnce->hContact, pdnce->m_pszProto, "XStatusMsg")); if (tszXStatusMsg != NULL) { CopySkipUnprintableChars(text, tszXStatusMsg, text_size - 1); if (text[0] != '\0') @@ -391,7 +391,7 @@ int Cache_GetLineText(ClcCacheEntry *pdnce, int type, LPTSTR text, int text_size LBL_Status: if (GetStatusName(text, text_size, pdnce, line.xstatus_has_priority) == -1 && line.use_name_and_message_for_xstatus) { // Try to get XStatusMsg - ptrW tszXStatusMsg(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusMsg")); + ptrW tszXStatusMsg(db_get_wsa(pdnce->hContact, pdnce->m_pszProto, "XStatusMsg")); if (tszXStatusMsg != NULL && tszXStatusMsg[0] != 0) { wchar_t *tmp = NEWWSTR_ALLOCA(text); mir_snwprintf(text, text_size, L"%s: %s", tmp, tszXStatusMsg); @@ -402,7 +402,7 @@ LBL_Status: case TEXT_NICKNAME: if (pdnce->hContact && pdnce->m_pszProto) { - ptrW tszNick(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "Nick")); + ptrW tszNick(db_get_wsa(pdnce->hContact, pdnce->m_pszProto, "Nick")); if (tszNick != NULL) { mir_wstrncpy(text, tszNick, text_size); CopySkipUnprintableChars(text, text, text_size - 1); @@ -413,7 +413,7 @@ LBL_Status: case TEXT_STATUS_MESSAGE: if (GetStatusMessage(text, text_size, pdnce, line.xstatus_has_priority) == -1 && line.use_name_and_message_for_xstatus) { // Try to get XStatusName - ptrW tszXStatusName(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusName")); + ptrW tszXStatusName(db_get_wsa(pdnce->hContact, pdnce->m_pszProto, "XStatusName")); if (tszXStatusName != NULL && tszXStatusName[0] != 0) { wchar_t *tmp = NEWWSTR_ALLOCA(text); mir_snwprintf(text, text_size, L"%s: %s", tszXStatusName, tmp); @@ -422,7 +422,7 @@ LBL_Status: } else if (line.use_name_and_message_for_xstatus && line.xstatus_has_priority) { // Try to get XStatusName - ptrW tszXStatusName(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusName")); + ptrW tszXStatusName(db_get_wsa(pdnce->hContact, pdnce->m_pszProto, "XStatusName")); if (tszXStatusName != NULL && tszXStatusName[0] != 0) { mir_wstrncpy(text, tszXStatusName, text_size); CopySkipUnprintableChars(text, text, text_size - 1); @@ -477,7 +477,7 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact) wchar_t *name = pcli->pfnGetContactDisplayName(contact->hContact, 0); if (dat->first_line_append_nick && !dat->bForceInDialog) { DBVARIANT dbv = { 0 }; - if (!db_get_ts(pdnce->hContact, pdnce->m_pszProto, "Nick", &dbv)) { + if (!db_get_ws(pdnce->hContact, pdnce->m_pszProto, "Nick", &dbv)) { wchar_t nick[_countof(contact->szText)]; mir_wstrncpy(nick, dbv.ptszVal, _countof(contact->szText)); db_free(&dbv); diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index ed48ac41bc..2f9b9d7f2c 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1567,7 +1567,7 @@ static int clcHookModulesLoaded(WPARAM, LPARAM) SKINICONDESC sid = { 0 };
sid.defaultFile.w = szMyPath;
- sid.flags = SIDF_PATH_TCHAR;
+ sid.flags = SIDF_PATH_UNICODE;
sid.section.a = LPGEN("Contact list");
sid.description.a = LPGEN("Listening to");
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index d23703ba0a..c9a86d389e 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -433,7 +433,7 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat) }
if (g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) {
- ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_wsa(hContact, "CList", "Group"));
if (tszGroup != NULL) {
wchar_t szGroupMask[256];
mir_snwprintf(szGroupMask, L"%s|", tszGroup);
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index bacc564cc9..3e0f9e51e9 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -123,8 +123,8 @@ void RegisterCLUIFonts(void) if (registered)
return;
- FontIDT fontid = { 0 };
- EffectIDT effectid = { 0 };
+ FontIDW fontid = { 0 };
+ EffectIDW effectid = { 0 };
char idstr[10];
int index = 0;
@@ -150,7 +150,7 @@ void RegisterCLUIFonts(void) fontid.deffontsettings.style = fontOptionsList[i].defStyle;
mir_wstrncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fontid.deffontsettings.szFace));
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
mir_wstrncpy(effectid.group, fontOptionsList[i].szGroup, _countof(effectid.group));
mir_wstrncpy(effectid.name, fontOptionsList[i].szDescr, _countof(effectid.name));
@@ -162,10 +162,10 @@ void RegisterCLUIFonts(void) effectid.defeffect.baseColour = fontOptionsList[i].defeffect.baseColour;
effectid.defeffect.secondaryColour = fontOptionsList[i].defeffect.secondaryColour;
- EffectRegisterT(&effectid);
+ EffectRegisterW(&effectid);
}
- ColourIDT colourid = { 0 };
+ ColourIDW colourid = { 0 };
colourid.cbSize = sizeof(colourid);
for (int i = 0; i < _countof(colourOptionsList); i++) {
@@ -175,7 +175,7 @@ void RegisterCLUIFonts(void) mir_strncpy(colourid.dbSettingsGroup, colourOptionsList[i].chGroup, _countof(colourid.dbSettingsGroup));
colourid.defcolour = colourOptionsList[i].defColour;
colourid.order = i + 1;
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
}
registered = true;
}
@@ -203,12 +203,12 @@ void GetFontSetting(int i, LOGFONT *lf, COLORREF *colour, BYTE *effect, COLORREF if (index == _countof(fontOptionsList))
return;
- FontIDT fontid = { 0 };
+ FontIDW fontid = { 0 };
fontid.cbSize = sizeof(fontid);
mir_wstrncpy(fontid.group, fontOptionsList[index].szGroup, _countof(fontid.group));
mir_wstrncpy(fontid.name, fontOptionsList[index].szDescr, _countof(fontid.name));
- COLORREF col = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)lf);
+ COLORREF col = CallService(MS_FONT_GETW, (WPARAM)&fontid, (LPARAM)lf);
if (colour)
*colour = col;
@@ -284,7 +284,7 @@ static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *value tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
for (int i = 0; i < nValues; i++) {
tvis.item.lParam = values[i].style;
- tvis.item.pszText = TranslateTS(values[i].szDescr);
+ tvis.item.pszText = TranslateW(values[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.state = INDEXTOSTATEIMAGEMASK((style & tvis.item.lParam) != 0 ? 2 : 1);
TreeView_InsertItem(hwndTree, &tvis);
@@ -508,11 +508,11 @@ static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam, int i, item;
int s1, s2, s3;
for (i = 0; i < _countof(sortby); i++) {
- item = SendDlgItemMessage(hwndDlg, IDC_CLSORT1, CB_ADDSTRING, 0, (LPARAM)TranslateTS(sortby[i]));
+ item = SendDlgItemMessage(hwndDlg, IDC_CLSORT1, CB_ADDSTRING, 0, (LPARAM)TranslateW(sortby[i]));
SendDlgItemMessage(hwndDlg, IDC_CLSORT1, CB_SETITEMDATA, item, 0);
- item = SendDlgItemMessage(hwndDlg, IDC_CLSORT2, CB_ADDSTRING, 0, (LPARAM)TranslateTS(sortby[i]));
+ item = SendDlgItemMessage(hwndDlg, IDC_CLSORT2, CB_ADDSTRING, 0, (LPARAM)TranslateW(sortby[i]));
SendDlgItemMessage(hwndDlg, IDC_CLSORT2, CB_SETITEMDATA, item, 0);
- item = SendDlgItemMessage(hwndDlg, IDC_CLSORT3, CB_ADDSTRING, 0, (LPARAM)TranslateTS(sortby[i]));
+ item = SendDlgItemMessage(hwndDlg, IDC_CLSORT3, CB_ADDSTRING, 0, (LPARAM)TranslateW(sortby[i]));
SendDlgItemMessage(hwndDlg, IDC_CLSORT3, CB_SETITEMDATA, item, 0);
}
@@ -1003,7 +1003,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP {
DBVARIANT dbv = { 0 };
wchar_t *s;
- if (!db_get_ts(NULL, "CList", "TitleText", &dbv))
+ if (!db_get_ws(NULL, "CList", "TitleText", &dbv))
s = dbv.ptszVal;
else
s = _A2W(MIRANDANAME);
@@ -1665,11 +1665,11 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar SendMessage(hwndDlg, WM_HSCROLL, 0x12345678, 0);
for (i = 0; i < _countof(sortby); i++) {
- item = SendDlgItemMessage(hwndDlg, IDC_CLSORT1, CB_ADDSTRING, 0, (LPARAM)TranslateTS(sortby[i]));
+ item = SendDlgItemMessage(hwndDlg, IDC_CLSORT1, CB_ADDSTRING, 0, (LPARAM)TranslateW(sortby[i]));
SendDlgItemMessage(hwndDlg, IDC_CLSORT1, CB_SETITEMDATA, item, 0);
- item = SendDlgItemMessage(hwndDlg, IDC_CLSORT2, CB_ADDSTRING, 0, (LPARAM)TranslateTS(sortby[i]));
+ item = SendDlgItemMessage(hwndDlg, IDC_CLSORT2, CB_ADDSTRING, 0, (LPARAM)TranslateW(sortby[i]));
SendDlgItemMessage(hwndDlg, IDC_CLSORT2, CB_SETITEMDATA, item, 0);
- item = SendDlgItemMessage(hwndDlg, IDC_CLSORT3, CB_ADDSTRING, 0, (LPARAM)TranslateTS(sortby[i]));
+ item = SendDlgItemMessage(hwndDlg, IDC_CLSORT3, CB_ADDSTRING, 0, (LPARAM)TranslateW(sortby[i]));
SendDlgItemMessage(hwndDlg, IDC_CLSORT3, CB_SETITEMDATA, item, 0);
}
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp index 1d99f11abf..96aead2961 100644 --- a/plugins/Clist_modern/src/modern_clcutils.cpp +++ b/plugins/Clist_modern/src/modern_clcutils.cpp @@ -560,7 +560,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) dat->secondLine.draw_smileys = db_get_b(NULL, "CList", "SecondLineDrawSmileys", SETTING_SECONDLINE_SMILEYS_DEFAULT);
dat->secondLine.type = db_get_w(NULL, "CList", "SecondLineType", SETTING_SECONDLINE_TYPE_DEFAULT);
- ptrW tszLineText(db_get_tsa(NULL, "CList", "SecondLineText"));
+ ptrW tszLineText(db_get_wsa(NULL, "CList", "SecondLineText"));
if (tszLineText)
mir_wstrncpy(dat->secondLine.text, tszLineText, _countof(dat->secondLine.text));
else
@@ -580,7 +580,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) dat->thirdLine.draw_smileys = db_get_b(NULL, "CList", "ThirdLineDrawSmileys", SETTING_THIRDLINE_SMILEYS_DEFAULT);
dat->thirdLine.type = db_get_w(NULL, "CList", "ThirdLineType", SETTING_THIRDLINE_TYPE_DEFAULT);
- ptrW tszLineText(db_get_tsa(NULL, "CList", "ThirdLineText"));
+ ptrW tszLineText(db_get_wsa(NULL, "CList", "ThirdLineText"));
if (tszLineText)
mir_wstrncpy(dat->thirdLine.text, tszLineText, _countof(dat->thirdLine.text));
else
@@ -608,7 +608,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) dat->MenuTextHiColor = cliGetColor("Menu", "SelTextColour", CLCDEFAULT_MODERN_SELTEXTCOLOUR);
if (db_get_b(NULL, "Menu", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- ptrW tszBitmap(db_get_tsa(NULL, "Menu", "BkBitmap"));
+ ptrW tszBitmap(db_get_wsa(NULL, "Menu", "BkBitmap"));
if (tszBitmap != NULL)
dat->hMenuBackground = Bitmap_Load(tszBitmap);
}
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index 2585918e00..7982455b5a 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -249,7 +249,7 @@ static int ehhEventAreaBackgroundSettingsChanged(WPARAM, LPARAM) if (g_CluiData.fDisableSkinEngine) {
event_area.bkColour = cliGetColor("EventArea", "BkColour", CLCDEFAULT_BKCOLOUR);
if (db_get_b(NULL, "EventArea", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- ptrW tszBitmap(db_get_tsa(NULL, "EventArea", "BkBitmap"));
+ ptrW tszBitmap(db_get_wsa(NULL, "EventArea", "BkBitmap"));
if (tszBitmap != NULL)
event_area.hBmpBackground = Bitmap_Load(tszBitmap);
}
@@ -511,7 +511,7 @@ int EventArea_Create(HWND hCluiWnd) Frame.hWnd = g_CluiData.hwndEventFrame;
Frame.align = alBottom;
Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
- Frame.Flags = (db_get_b(NULL, "CLUI", "ShowEventArea", SETTING_SHOWEVENTAREAFRAME_DEFAULT) ? F_VISIBLE : 0) | F_LOCKED | F_NOBORDER | F_NO_SUBCONTAINER | F_TCHAR;
+ Frame.Flags = (db_get_b(NULL, "CLUI", "ShowEventArea", SETTING_SHOWEVENTAREAFRAME_DEFAULT) ? F_VISIBLE : 0) | F_LOCKED | F_NOBORDER | F_NO_SUBCONTAINER | F_UNICODE;
Frame.height = h;
Frame.tname = L"EventArea"; //do not translate
Frame.TBtname = TranslateT("Event area");
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp index 2605dea546..7d97a9d428 100644 --- a/plugins/Clist_modern/src/modern_clistmenus.cpp +++ b/plugins/Clist_modern/src/modern_clistmenus.cpp @@ -84,11 +84,11 @@ static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM) if (bContactRate > _countof(rates) - 1)
bContactRate = _countof(rates) - 1;
- CMString tszName;
+ CMStringW tszName;
if (!bContactRate)
tszName = FAVMENUROOTNAME;
else
- tszName.Format(L"%s (%s)", TranslateTS(FAVMENUROOTNAME), TranslateTS(rates[bContactRate]));
+ tszName.Format(L"%s (%s)", TranslateW(FAVMENUROOTNAME), TranslateW(rates[bContactRate]));
Menu_ModifyItem(hFavoriteContactMenu, tszName);
for (int i = 0; i < _countof(rates); i++)
@@ -125,13 +125,13 @@ int LoadFavoriteContactMenu() CMenuItem mi;
SET_UID(mi, 0xf99a2320, 0xc024, 0x48bd, 0x81, 0xf7, 0x9f, 0xa2, 0x5, 0xb0, 0x7f, 0xdc);
mi.name.w = FAVMENUROOTNAME;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
hFavoriteContactMenu = Menu_AddContactMenuItem(&mi);
Menu_ConfigureItem(hFavoriteContactMenu, MCI_OPT_UNIQUENAME, "ModernClistMenu_ContactRate");
UNSET_UID(mi);
mi.root = hFavoriteContactMenu;
- mi.flags = CMIF_TCHAR | CMIF_SYSTEM; // not included into new menu settings
+ mi.flags = CMIF_UNICODE | CMIF_SYSTEM; // not included into new menu settings
mi.pszService = CLUI_FAVSETRATE;
for (int i = 0; i < _countof(rates); i++) {
mi.hIcolibItem = iconList[i].hIcolib;
diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp index 051ef974a9..2039a0deb4 100644 --- a/plugins/Clist_modern/src/modern_clistopts.cpp +++ b/plugins/Clist_modern/src/modern_clistopts.cpp @@ -510,7 +510,7 @@ static INT_PTR CALLBACK DlgProcItemTextOpts(HWND hwndDlg, UINT msg, WPARAM wPara int item;
wchar_t *align[] = { LPGENW("Left align group names"), LPGENW("Center group names"), LPGENW("Right align group names") };
for (int i = 0; i < sizeof(align) / sizeof(char*); i++)
- item = SendDlgItemMessage(hwndDlg, IDC_ALIGNGROUPCOMBO, CB_ADDSTRING, 0, (LPARAM)TranslateTS(align[i]));
+ item = SendDlgItemMessage(hwndDlg, IDC_ALIGNGROUPCOMBO, CB_ADDSTRING, 0, (LPARAM)TranslateW(align[i]));
SendDlgItemMessage(hwndDlg, IDC_ALIGNGROUPCOMBO, CB_SETCURSEL, db_get_b(NULL, "CList", "AlignGroupCaptions", SETTING_ALIGNGROPCAPTION_DEFAULT), 0);
}
CheckDlgButton(hwndDlg, IDC_ALIGN_RIGHT, db_get_b(NULL, "CList", "TextAlignToRight", SETTING_TEXT_RIGHTALIGN_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
@@ -584,7 +584,7 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_DRAW_SMILEYS, db_get_b(NULL, "CList", "SecondLineDrawSmileys", SETTING_SECONDLINE_SMILEYS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
{
- ptrW tszText(db_get_tsa(NULL, "CList", "SecondLineText"));
+ ptrW tszText(db_get_wsa(NULL, "CList", "SecondLineText"));
if (tszText)
SetDlgItemText(hwndDlg, IDC_VARIABLE_TEXT, tszText);
}
@@ -719,7 +719,7 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM wchar_t t[TEXT_TEXT_MAX_LENGTH];
GetDlgItemText(hwndDlg, IDC_VARIABLE_TEXT, t, _countof(t));
t[TEXT_TEXT_MAX_LENGTH - 1] = '\0';
- db_set_ts(NULL, "CList", "SecondLineText", t);
+ db_set_ws(NULL, "CList", "SecondLineText", t);
db_set_b(NULL, "CList", "SecondLineXStatusHasPriority", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_XSTATUS_HAS_PRIORITY));
db_set_b(NULL, "CList", "SecondLineShowStatusIfNoAway", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_STATUS_IF_NOAWAY));
@@ -750,7 +750,7 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_DRAW_SMILEYS, db_get_b(NULL, "CList", "ThirdLineDrawSmileys", SETTING_THIRDLINE_SMILEYS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
{
DBVARIANT dbv;
- if (!db_get_ts(NULL, "CList", "ThirdLineText", &dbv)) {
+ if (!db_get_ws(NULL, "CList", "ThirdLineText", &dbv)) {
SetDlgItemText(hwndDlg, IDC_VARIABLE_TEXT, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 6fd42fbb23..a545ba2928 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -411,7 +411,7 @@ HRESULT CLUI::CreateCLC() Frame.hWnd = pcli->hwndContactTree;
Frame.align = alClient;
Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
- Frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NO_SUBCONTAINER | F_TCHAR;
+ Frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NO_SUBCONTAINER | F_UNICODE;
Frame.tname = LPGENW("My contacts");
Frame.TBtname = TranslateT("My contacts");
hFrameContactTree = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
@@ -666,7 +666,7 @@ void CLUI_ChangeWindowMode() // 4 - Set Title
wchar_t titleText[255] = { 0 };
DBVARIANT dbv;
- if (db_get_ts(NULL, "CList", "TitleText", &dbv))
+ if (db_get_ws(NULL, "CList", "TitleText", &dbv))
mir_wstrncpy(titleText, _A2W(MIRANDANAME), _countof(titleText));
else {
mir_wstrncpy(titleText, dbv.ptszVal, _countof(titleText));
@@ -888,7 +888,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) wchar_t *str = wcsrchr(szRelativePath, '\\');
if (str != NULL)
*str = 0;
- PathToAbsoluteT(szRelativePath, tszFolderPath);
+ PathToAbsoluteW(szRelativePath, tszFolderPath);
}
if (szAccoName) {
@@ -920,7 +920,7 @@ static HICON CLUI_LoadIconFromExternalFile(wchar_t *filename, int i) {
wchar_t szPath[MAX_PATH], szFullPath[MAX_PATH];
mir_snwprintf(szPath, L"Icons\\%s", filename);
- PathToAbsoluteT(szPath, szFullPath);
+ PathToAbsoluteW(szPath, szFullPath);
if (_waccess(szPath, 0))
return NULL;
@@ -1516,12 +1516,12 @@ HANDLE RegisterIcolibIconHandle(char *szIcoID, char *szSectionName, char *szDesc SKINICONDESC sid = { 0 };
sid.section.a = szSectionName;
sid.pszName = szIcoID;
- sid.flags |= SIDF_PATH_TCHAR;
+ sid.flags |= SIDF_PATH_UNICODE;
sid.description.a = szDescription;
sid.defaultFile.w = fileFull;
if (tszDefaultFile) {
- PathToAbsoluteT(tszDefaultFile, fileFull);
+ PathToAbsoluteW(tszDefaultFile, fileFull);
if (!FileExists(fileFull))
fileFull[0] = '\0';
}
diff --git a/plugins/Clist_modern/src/modern_keyboard.cpp b/plugins/Clist_modern/src/modern_keyboard.cpp index f4773c48e2..174efbed7f 100644 --- a/plugins/Clist_modern/src/modern_keyboard.cpp +++ b/plugins/Clist_modern/src/modern_keyboard.cpp @@ -47,23 +47,23 @@ int InitSkinHotKeys(void) HOTKEYDESC shk = { 0 };
shk.cbSize = sizeof(shk);
- shk.dwFlags = HKD_TCHAR;
+ shk.dwFlags = HKD_UNICODE;
- shk.ptszDescription = LPGENW("Close Miranda");
+ shk.pwszDescription = LPGENW("Close Miranda");
shk.pszName = "CloseMiranda";
- shk.ptszSection = LPGENW("Main");
+ shk.pwszSection = LPGENW("Main");
shk.pszService = "CLIST/HK/CloseMiranda";
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENW("Restore last status");
+ shk.pwszDescription = LPGENW("Restore last status");
shk.pszName = "RestoreLastStatus";
- shk.ptszSection = LPGENW("Status");
+ shk.pwszSection = LPGENW("Status");
shk.pszService = "CLIST/HK/RestoreStatus";
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENW("Show/Hide offline users");
+ shk.pwszDescription = LPGENW("Show/Hide offline users");
shk.pszName = "ShowHideOfflineUsers";
- shk.ptszSection = LPGENW("Main");
+ shk.pwszSection = LPGENW("Main");
shk.pszService = MS_CLIST_TOGGLEHIDEOFFLINE;
Hotkey_Register(&shk);
diff --git a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp index 2cbabaafe4..5b160a3c07 100644 --- a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp +++ b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp @@ -314,14 +314,14 @@ void RefreshTree(HWND hwndDlg, HTREEITEM hti) if (cell->type == 0)
mir_snwprintf(buf, TranslateT("Empty %s cell"), cell->cont == TC_COL ? TranslateT("column") : TranslateT("line"));
else
- mir_wstrncpy(buf, TranslateTS(types[cell->type]), _countof(buf));
+ mir_wstrncpy(buf, TranslateW(types[cell->type]), _countof(buf));
}
else
{
if (cell->type == 0)
mir_wstrncpy(buf, (cell->cont != TC_COL ? TranslateT("columns") : TranslateT("lines")), _countof(buf));
else
- mir_snwprintf(buf, TranslateT("%s, contain %s"), TranslateTS(types[cell->type]), cell->cont != TC_COL ? TranslateT("columns") : TranslateT("lines"));
+ mir_snwprintf(buf, TranslateT("%s, contain %s"), TranslateW(types[cell->type]), cell->cont != TC_COL ? TranslateT("columns") : TranslateT("lines"));
}
if (cell->layer) mir_wstrncat(buf, TranslateT(" layered"), _countof(buf) - mir_wstrlen(buf));
tvi.mask = TVIF_HANDLE | TVIF_TEXT;
@@ -357,21 +357,21 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM int i, item;
for (i = 0; i < _countof(types); i++) {
- item = SendDlgItemMessage(hwndDlg, IDC_CONTTYPE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(types[i]));
+ item = SendDlgItemMessage(hwndDlg, IDC_CONTTYPE, CB_ADDSTRING, 0, (LPARAM)TranslateW(types[i]));
SendDlgItemMessage(hwndDlg, IDC_CONTTYPE, CB_SETITEMDATA, item, 0);
}
SendDlgItemMessage(hwndDlg, IDC_CONTTYPE, CB_SETCURSEL, 0, 0);
wchar_t *h_alignment[] = { L"left", L"hCenter", L"right" };
for (i = 0; i < _countof(h_alignment); i++) {
- item = SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateTS(h_alignment[i]));
+ item = SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateW(h_alignment[i]));
SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_SETITEMDATA, item, 0);
}
SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_SETCURSEL, 0, 0);
wchar_t *v_alignment[] = { L"top", L"vCenter", L"bottom" };
for (i = 0; i < _countof(v_alignment); i++) {
- item = SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateTS(v_alignment[i]));
+ item = SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateW(v_alignment[i]));
SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_SETITEMDATA, item, 0);
}
SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_SETCURSEL, 0, 0);
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index f493876e60..167a0a8d07 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -1469,7 +1469,7 @@ void ske_PreMultiplyChannels(HBITMAP hbmp, BYTE Mult) int ske_GetFullFilename(wchar_t *buf, const wchar_t *file, wchar_t *skinfolder, BOOL madeAbsolute) { - wchar_t *SkinPlace = db_get_tsa(NULL, SKIN, "SkinFolder"); + wchar_t *SkinPlace = db_get_wsa(NULL, SKIN, "SkinFolder"); if (SkinPlace == NULL) SkinPlace = mir_wstrdup(L"\\Skin\\default"); @@ -1481,9 +1481,9 @@ int ske_GetFullFilename(wchar_t *buf, const wchar_t *file, wchar_t *skinfolder, if (madeAbsolute) { if (b2[0] == '\\' && b2[1] != '\\') - PathToAbsoluteT(b2 + 1, buf); + PathToAbsoluteW(b2 + 1, buf); else - PathToAbsoluteT(b2, buf); + PathToAbsoluteW(b2, buf); } else mir_wstrncpy(buf, b2, MAX_PATH); @@ -1912,7 +1912,7 @@ static int ske_GetSkinFromDB(char *, SKINOBJECTSLIST *Skin) Skin->pMaskList = (LISTMODERNMASK*)mir_alloc(sizeof(LISTMODERNMASK)); memset(Skin->pMaskList, 0, sizeof(LISTMODERNMASK)); - Skin->szSkinPlace = db_get_tsa(NULL, SKIN, "SkinFolder"); + Skin->szSkinPlace = db_get_wsa(NULL, SKIN, "SkinFolder"); if (!Skin->szSkinPlace || (wcschr(Skin->szSkinPlace, '%') && !db_get_b(NULL, SKIN, "Modified", 0))) { BOOL bOnlyObjects = FALSE; if (Skin->szSkinPlace && wcschr(Skin->szSkinPlace, '%')) @@ -1972,8 +1972,8 @@ int ske_LoadSkinFromIniFile(wchar_t *szFileName, BOOL bOnlyObjects) IniParser::GetSkinFolder(szFileName, skinFolder); PathToRelativeT(szFileName, skinFile); - db_set_ts(NULL, SKIN, "SkinFolder", skinFolder); - db_set_ts(NULL, SKIN, "SkinFile", skinFile); + db_set_ws(NULL, SKIN, "SkinFolder", skinFolder); + db_set_ws(NULL, SKIN, "SkinFile", skinFile); parser.Parse(IniParser::WriteStrToDb, 1); return 0; diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp index 5207c15c8b..c52fa1533e 100644 --- a/plugins/Clist_modern/src/modern_skinopt.cpp +++ b/plugins/Clist_modern/src/modern_skinopt.cpp @@ -55,7 +55,7 @@ int SkinOptInit(WPARAM wParam, LPARAM) odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SKIN); odp.pwszGroup = LPGENW("Skins"); odp.pwszTitle = LPGENW("Contact list"); - odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; + odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; Options_AddPage(wParam, &odp); } return 0; @@ -262,7 +262,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara GetPrivateProfileString(L"Skin_Description_Section", L"Preview", L"", imfn, _countof(imfn), sd->File); IniParser::GetSkinFolder(sd->File, skinfolder); mir_snwprintf(prfn, L"%s\\%s", skinfolder, imfn); - PathToAbsoluteT(prfn, imfn); + PathToAbsoluteW(prfn, imfn); hPreviewBitmap = ske_LoadGlyphImage(imfn); EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_APPLY_SKIN), TRUE); @@ -367,9 +367,9 @@ HTREEITEM FillAvailableSkinList(HWND hwndDlg) SearchSkinFiles(hwndDlg, SkinsFolder); { wchar_t skinfull[MAX_PATH]; - ptrW skinfile(db_get_tsa(NULL, SKIN, "SkinFile")); + ptrW skinfile(db_get_wsa(NULL, SKIN, "SkinFile")); if (skinfile) { - PathToAbsoluteT(skinfile, skinfull); + PathToAbsoluteW(skinfile, skinfull); res = AddSkinToListFullName(hwndDlg, skinfull); } } @@ -471,10 +471,10 @@ HTREEITEM AddItemToTree(HWND hTree, wchar_t *itemName, void *data) INT_PTR SvcActiveSkin(WPARAM, LPARAM) { - ptrW skinfile(db_get_tsa(NULL, SKIN, "SkinFile")); + ptrW skinfile(db_get_wsa(NULL, SKIN, "SkinFile")); if (skinfile) { wchar_t skinfull[MAX_PATH]; - PathToAbsoluteT(skinfile, skinfull); + PathToAbsoluteW(skinfile, skinfull); return (INT_PTR)mir_wstrdup(skinfull); } @@ -525,7 +525,7 @@ INT_PTR SvcPreviewSkin(WPARAM wParam, LPARAM lParam) GetPrivateProfileString(L"Skin_Description_Section", L"Preview", L"", imfn, _countof(imfn), (LPCTSTR)lParam); IniParser::GetSkinFolder((LPCTSTR)lParam, skinfolder); mir_snwprintf(prfn, L"%s\\%s", skinfolder, imfn); - PathToAbsoluteT(prfn, imfn); + PathToAbsoluteW(prfn, imfn); hPreviewBitmap = ske_LoadGlyphImage(imfn); if (hPreviewBitmap) { diff --git a/plugins/Clist_modern/src/modern_skinselector.cpp b/plugins/Clist_modern/src/modern_skinselector.cpp index 119ceb7f8d..f50b22618a 100644 --- a/plugins/Clist_modern/src/modern_skinselector.cpp +++ b/plugins/Clist_modern/src/modern_skinselector.cpp @@ -469,8 +469,8 @@ int RegisterButtonByParce(char * ObjectName, char * Params) + ((TL[3] == 'C') ? SBF_ALIGN_BR_VCENTER : 0)
+ ((TL[4] == 'I') ? SBF_CALL_ON_PRESS : 0);
if (a)
- return ModernSkinButton_AddButton(pcli->hwndContactList, ObjectName + 1, pServiceName, pStatusServiceName, "\0", Left, Top, Right, Bottom, alingnto, TranslateTS(Hint), Section, Type, MinWidth, MinHeight);
- return ModernSkinButton_AddButton(pcli->hwndContactList, ObjectName + 1, pServiceName, pStatusServiceName, "\0", Left, Top, Right, Bottom, alingnto, TranslateTS(Hint), NULL, NULL, MinWidth, MinHeight);
+ return ModernSkinButton_AddButton(pcli->hwndContactList, ObjectName + 1, pServiceName, pStatusServiceName, "\0", Left, Top, Right, Bottom, alingnto, TranslateW(Hint), Section, Type, MinWidth, MinHeight);
+ return ModernSkinButton_AddButton(pcli->hwndContactList, ObjectName + 1, pServiceName, pStatusServiceName, "\0", Left, Top, Right, Bottom, alingnto, TranslateW(Hint), NULL, NULL, MinWidth, MinHeight);
}
//Parse DB string and add object
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index 8e2e364a9b..0284519c59 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -106,7 +106,7 @@ int LoadStatusBarData() if (g_CluiData.fDisableSkinEngine) {
g_StatusBarData.bkColour = cliGetColor("StatusBar", "BkColour", CLCDEFAULT_BKCOLOUR);
if (db_get_b(NULL, "StatusBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- ptrW tszBitmapName(db_get_tsa(NULL, "StatusBar", "BkBitmap"));
+ ptrW tszBitmapName(db_get_wsa(NULL, "StatusBar", "BkBitmap"));
if (tszBitmapName)
g_StatusBarData.hBmpBackground = Bitmap_Load(tszBitmapName);
}
@@ -345,7 +345,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) if ((p.xStatusMode & 8) && p.iProtoStatus > ID_STATUS_OFFLINE) {
wchar_t str[512];
CUSTOM_STATUS cs = { sizeof(cs) };
- cs.flags = CSSF_MASK_NAME | CSSF_TCHAR;
+ cs.flags = CSSF_MASK_NAME | CSSF_UNICODE;
cs.ptszName = str;
if (CallProtoService(p.szAccountName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&cs) == 0)
p.tszProtoXStatus = mir_wstrdup(str);
@@ -883,7 +883,7 @@ HWND StatusBar_Create(HWND parent) Frame.hWnd = hModernStatusBar;
Frame.align = alBottom;
Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
- Frame.Flags = F_LOCKED | F_NOBORDER | F_NO_SUBCONTAINER | F_TCHAR;
+ Frame.Flags = F_LOCKED | F_NOBORDER | F_NO_SUBCONTAINER | F_UNICODE;
if (db_get_b(NULL, "CLUI", "ShowSBar", SETTING_SHOWSBAR_DEFAULT))
Frame.Flags |= F_VISIBLE;
Frame.height = h;
diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp index 44218b6bba..c875d29f5c 100644 --- a/plugins/Clist_modern/src/modern_statusbar_options.cpp +++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp @@ -239,14 +239,14 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l {
wchar_t *align[] = { LPGENW("Left"), LPGENW("Center"), LPGENW("Right") };
for (int i = 0; i < _countof(align); i++)
- SendDlgItemMessage(hwndDlg, IDC_SBAR_HORIZ_ALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateTS(align[i]));
+ SendDlgItemMessage(hwndDlg, IDC_SBAR_HORIZ_ALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateW(align[i]));
SendDlgItemMessage(hwndDlg, IDC_SBAR_HORIZ_ALIGN, CB_SETCURSEL, db_get_b(NULL, "CLUI", "Align", SETTING_ALIGN_DEFAULT), 0);
}
{
wchar_t *align[] = { LPGENW("Top"), LPGENW("Center"), LPGENW("Bottom") };
for (int i = 0; i < _countof(align); i++)
- SendDlgItemMessage(hwndDlg, IDC_SBAR_VERT_ALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateTS(align[i]));
+ SendDlgItemMessage(hwndDlg, IDC_SBAR_VERT_ALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateW(align[i]));
SendDlgItemMessage(hwndDlg, IDC_SBAR_VERT_ALIGN, CB_SETCURSEL, db_get_b(NULL, "CLUI", "VAlign", SETTING_VALIGN_DEFAULT), 0);
}
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp index 3009c46d0c..b31609f534 100644 --- a/plugins/Clist_modern/src/modern_toolbar.cpp +++ b/plugins/Clist_modern/src/modern_toolbar.cpp @@ -138,7 +138,7 @@ static int ehhToolBarBackgroundSettingsChanged(WPARAM, LPARAM) if (g_CluiData.fDisableSkinEngine) {
tbdat.mtb_bkColour = cliGetColor("ToolBar", "BkColour", CLCDEFAULT_BKCOLOUR);
if (db_get_b(NULL, "ToolBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- ptrW tszBitmapName(db_get_tsa(NULL, "ToolBar", "BkBitmap"));
+ ptrW tszBitmapName(db_get_wsa(NULL, "ToolBar", "BkBitmap"));
if (tszBitmapName)
tbdat.mtb_hBmpBackground = Bitmap_Load(tszBitmapName);
}
@@ -282,7 +282,7 @@ void CustomizeToolbar(HWND hwnd) Frame.tname = L"Toolbar";
Frame.hWnd = hwnd;
Frame.align = alTop;
- Frame.Flags = F_VISIBLE | F_NOBORDER | F_LOCKED | F_TCHAR | F_NO_SUBCONTAINER;
+ Frame.Flags = F_VISIBLE | F_NOBORDER | F_LOCKED | F_UNICODE | F_NO_SUBCONTAINER;
Frame.height = 18;
Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
pMTBInfo->hFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
@@ -344,7 +344,7 @@ static int Toolbar_ModulesLoaded(WPARAM, LPARAM) }
if (!ServiceExists(MS_TTB_REMOVEBUTTON) && bOldSetting == 1)
- if (IDYES == MessageBox(NULL, TranslateTS(szWarning), TranslateT("Toolbar upgrade"), MB_ICONQUESTION | MB_YESNO))
+ if (IDYES == MessageBox(NULL, TranslateW(szWarning), TranslateT("Toolbar upgrade"), MB_ICONQUESTION | MB_YESNO))
Utils_OpenUrl(szUrl);
return 0;
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index bcfec081be..adb51b8167 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -511,7 +511,7 @@ static void UpdateFilters() return;
mir_snprintf(szSetting, "%c%s_GF", 246, szBuf);
- ptrW szGF(db_get_tsa(NULL, CLVM_MODULE, szSetting));
+ ptrW szGF(db_get_wsa(NULL, CLVM_MODULE, szSetting));
if (szGF == NULL)
return;
@@ -926,7 +926,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM hwndSelector = CreateWindow(MIRANDABUTTONCLASS, L"", BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
hwnd, (HMENU)IDC_SELECTMODE, g_hInst, NULL);
MakeButtonSkinned(hwndSelector);
- SendMessage(hwndSelector, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Select a view mode"), BATF_TCHAR);
+ SendMessage(hwndSelector, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Select a view mode"), BATF_UNICODE);
SendMessage(hwndSelector, BUTTONSETMARGINS, 0, (LPARAM)&rcMargins);
SendMessage(hwndSelector, BUTTONSETID, 0, (LPARAM) "ViewMode.Select");
SendMessage(hwndSelector, WM_SETFONT, 0, (LPARAM)FONTID_VIEMODES + 1);
@@ -938,7 +938,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM HWND hwndButton = CreateWindow(MIRANDABUTTONCLASS, L"", BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
hwnd, (HMENU)IDC_CONFIGUREMODES, g_hInst, NULL);
MakeButtonSkinned(hwndButton);
- SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Setup view modes"), BATF_TCHAR);
+ SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Setup view modes"), BATF_UNICODE);
SendMessage(hwndButton, BUTTONSETID, 0, (LPARAM) "ViewMode.Setup");
SendMessage(hwndButton, BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(hwndButton, MBM_UPDATETRANSPARENTFLAG, 0, 2);
@@ -946,7 +946,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM hwndButton = CreateWindow(MIRANDABUTTONCLASS, L"", BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
hwnd, (HMENU)IDC_RESETMODES, g_hInst, NULL);
MakeButtonSkinned(hwndButton);
- SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Clear view mode and return to default display"), BATF_TCHAR);
+ SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Clear view mode and return to default display"), BATF_UNICODE);
SendMessage(hwndButton, BUTTONSETID, 0, (LPARAM) "ViewMode.Clear");
SendMessage(hwnd, WM_USER + 100, 0, 0);
SendMessage(hwndButton, BUTTONSETASFLATBTN, TRUE, 0);
@@ -1167,7 +1167,7 @@ static int ehhViewModeBackgroundSettingsChanged(WPARAM, LPARAM) if (g_CluiData.fDisableSkinEngine) {
view_mode.bkColour = cliGetColor("ViewMode", "BkColour", CLCDEFAULT_BKCOLOUR);
if (db_get_b(NULL, "ViewMode", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- ptrW tszBitmapName(db_get_tsa(NULL, "ViewMode", "BkBitmap"));
+ ptrW tszBitmapName(db_get_wsa(NULL, "ViewMode", "BkBitmap"));
if (tszBitmapName)
view_mode.hBmpBackground = Bitmap_Load(tszBitmapName);
}
@@ -1202,7 +1202,7 @@ void CreateViewModeFrame() frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
frame.height = 18;
frame.TBtname = TranslateT("View modes");
- frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_NO_SUBCONTAINER | F_TCHAR;
+ frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_NO_SUBCONTAINER | F_UNICODE;
frame.align = alBottom;
frame.hWnd = CreateWindowEx(0, L"CLVMFrameWindow", _A2W(CLVM_MODULE), WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_CLIPCHILDREN, 0, 0, 20, 20, pcli->hwndContactList, (HMENU)0, g_hInst, NULL);
g_hwndViewModeFrame = frame.hWnd;
@@ -1267,7 +1267,7 @@ void ApplyViewMode(const char *Name, bool onlySelector) mir_free(dbv.pszVal);
}
mir_snprintf(szSetting, "%c%s_GF", 246, Name);
- if (!db_get_ts(NULL, CLVM_MODULE, szSetting, &dbv)) {
+ if (!db_get_ws(NULL, CLVM_MODULE, szSetting, &dbv)) {
if (mir_wstrlen(dbv.ptszVal) >= 2) {
mir_wstrncpy(g_CluiData.groupFilter, dbv.ptszVal, _countof(g_CluiData.groupFilter));
g_CluiData.groupFilter[_countof(g_CluiData.groupFilter) - 1] = 0;
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 4aeb70399c..b50a7127e5 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -163,7 +163,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) MCONTACT hContact = p->hContact;
DBVARIANT dbv = { 0 };
- INT_PTR result = db_get_ts(hContact, "CList", "StatusMsg", &dbv);
+ INT_PTR result = db_get_ws(hContact, "CList", "StatusMsg", &dbv);
if (!result && mir_wstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_CLIST;
else {
@@ -172,11 +172,11 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (szProto) {
if (!result)
db_free(&dbv);
- if (!(result = db_get_ts(hContact, szProto, "YMsg", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
+ if (!(result = db_get_ws(hContact, szProto, "YMsg", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_YIM;
- else if (!(result = db_get_ts(hContact, szProto, "StatusDescr", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
+ else if (!(result = db_get_ws(hContact, szProto, "StatusDescr", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_GG;
- else if (!(result = db_get_ts(hContact, szProto, "XStatusMsg", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
+ else if (!(result = db_get_ws(hContact, szProto, "XStatusMsg", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_XSTATUS;
}
}
@@ -184,7 +184,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (p->bStatusMsgValid == STATUSMSG_NOTFOUND) { // no status msg, consider xstatus name (if available)
if (!result)
db_free(&dbv);
- result = db_get_ts(hContact, szProto, "XStatusName", &dbv);
+ result = db_get_ws(hContact, szProto, "XStatusName", &dbv);
if (!result && mir_wstrlen(dbv.ptszVal) > 1) {
size_t iLen = mir_wstrlen(dbv.ptszVal);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
@@ -200,11 +200,11 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) cst.flags = CSSF_MASK_STATUS;
cst.status = &xStatus;
if (ProtoServiceExists(szProto, PS_GETCUSTOMSTATUSEX) && !CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, hContact, (LPARAM)&cst) && xStatus > 0) {
- cst.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR;
+ cst.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_UNICODE;
cst.wParam = &xStatus2;
cst.ptszName = xStatusName;
if (!CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, hContact, (LPARAM)&cst)) {
- wchar_t *szwXstatusName = TranslateTS(xStatusName);
+ wchar_t *szwXstatusName = TranslateW(xStatusName);
p->statusMsg = (wchar_t *)realloc(p->statusMsg, (mir_wstrlen(szwXstatusName) + 2) * sizeof(wchar_t));
wcsncpy(p->statusMsg, szwXstatusName, mir_wstrlen(szwXstatusName) + 1);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
@@ -407,7 +407,7 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, struct ClcData }
if (cfg::dat.bFilterEffective & CLVM_FILTER_GROUPS) {
- ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_wsa(hContact, "CList", "Group"));
if (tszGroup != NULL) {
wchar_t szGroupMask[256];
mir_snwprintf(szGroupMask, L"%s|", tszGroup);
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index 5d73f252b9..579407f4d6 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -88,7 +88,7 @@ static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *value tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
for (i = 0; i < nValues; i++) {
tvis.item.lParam = values[i].style;
- tvis.item.pszText = TranslateTS(values[i].szDescr);
+ tvis.item.pszText = TranslateW(values[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.state = INDEXTOSTATEIMAGEMASK((style & tvis.item.lParam) != 0 ? 2 : 1);
TreeView_InsertItem(hwndTree, &tvis);
@@ -710,9 +710,9 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, CheckDlgButton(hwndDlg, IDC_SKINMODE, cfg::dat.bWallpaperMode ? BST_CHECKED : BST_UNCHECKED);
{
DBVARIANT dbv;
- if (!db_get_ts(NULL, "CLC", "BkBitmap", &dbv)) {
+ if (!db_get_ws(NULL, "CLC", "BkBitmap", &dbv)) {
wchar_t szPath[MAX_PATH];
- if (PathToAbsoluteT(dbv.ptszVal, szPath))
+ if (PathToAbsoluteW(dbv.ptszVal, szPath))
SetDlgItemText(hwndDlg, IDC_FILENAME, szPath);
db_free(&dbv);
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 639cffa96e..5cde52aab1 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -185,7 +185,7 @@ static int CreateCLC() frame.TBtname = TranslateT("Event area"); frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME); frame.height = 20; - frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_TCHAR; + frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_UNICODE; frame.align = alBottom; frame.hWnd = CreateWindowExA(0, "EventAreaClass", "evt", WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, pcli->hwndContactList, (HMENU)0, g_hInst, NULL); g_hwndEventArea = frame.hWnd; @@ -200,12 +200,12 @@ static int CreateCLC() Frame.hWnd = pcli->hwndContactTree; Frame.align = alClient; Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME); - Frame.Flags = F_VISIBLE | F_SHOWTB | F_SHOWTBTIP | F_NOBORDER | F_TCHAR; + Frame.Flags = F_VISIBLE | F_SHOWTB | F_SHOWTBTIP | F_NOBORDER | F_UNICODE; Frame.tname = L"My contacts"; Frame.TBtname = TranslateT("My contacts"); Frame.height = 200; hFrameContactTree = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0); - CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME | FO_TCHAR, hFrameContactTree), (LPARAM)TranslateT("My contacts")); + CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME | FO_UNICODETEXT, hFrameContactTree), (LPARAM)TranslateT("My contacts")); // ugly, but working hack. Prevent that annoying little scroll bar from appearing in the "My Contacts" title bar DWORD flags = (DWORD)CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, hFrameContactTree), 0); @@ -1983,7 +1983,7 @@ static clistFontDescr[] = void FS_RegisterFonts() { - FontIDT fid = { sizeof(fid) }; + FontIDW fid = { sizeof(fid) }; wcsncpy(fid.group, LPGENW("Contact list"), _countof(fid.group)); strncpy(fid.dbSettingsGroup, "CLC", 5); fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS | FIDF_APPENDNAME | FIDF_SAVEPOINTSIZE; @@ -2008,12 +2008,12 @@ void FS_RegisterFonts() mir_snprintf(idstr, "Font%d", i); strncpy(fid.prefix, idstr, _countof(fid.prefix)); fid.order = i; - FontRegisterT(&fid); + FontRegisterW(&fid); } ReleaseDC(NULL, hdc); // and colours - ColourIDT colourid = { 0 }; + ColourIDW colourid = { 0 }; colourid.cbSize = sizeof(colourid); colourid.order = 0; strncpy(colourid.dbSettingsGroup, "CLC", sizeof(colourid.dbSettingsGroup)); @@ -2022,30 +2022,30 @@ void FS_RegisterFonts() wcsncpy(colourid.name, LPGENW("Background"), _countof(colourid.name)); wcsncpy(colourid.group, LPGENW("Contact list"), _countof(colourid.group)); colourid.defcolour = CLCDEFAULT_BKCOLOUR; - ColourRegisterT(&colourid); + ColourRegisterW(&colourid); strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting)); wcsncpy(colourid.name, LPGENW("Selected text"), _countof(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_SELTEXTCOLOUR; - ColourRegisterT(&colourid); + ColourRegisterW(&colourid); strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting)); wcsncpy(colourid.name, LPGENW("Hottrack text"), _countof(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_HOTTEXTCOLOUR; - ColourRegisterT(&colourid); + ColourRegisterW(&colourid); strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting)); wcsncpy(colourid.name, LPGENW("Quicksearch text"), _countof(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR; - ColourRegisterT(&colourid); + ColourRegisterW(&colourid); strncpy(colourid.dbSettingsGroup, "CLUI", sizeof(colourid.dbSettingsGroup)); strncpy(colourid.setting, "clr_frameborder", sizeof(colourid.setting)); wcsncpy(colourid.name, LPGENW("Embedded frames border"), _countof(colourid.name)); colourid.order = 1; colourid.defcolour = RGB(40, 40, 40); - ColourRegisterT(&colourid); + ColourRegisterW(&colourid); } diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp index 4e7b17a37f..a3a6475ccf 100644 --- a/plugins/Clist_nicer/src/cluiframes.cpp +++ b/plugins/Clist_nicer/src/cluiframes.cpp @@ -441,7 +441,7 @@ int DBStoreFrameSettingsAtPos(int pos, int Frameid) _itoa(pos, sadd, 10); - db_set_ts(0, CLUIFrameModule, AS(buf, "Name", sadd), Frames[Frameid].name); + db_set_ws(0, CLUIFrameModule, AS(buf, "Name", sadd), Frames[Frameid].name); //boolean db_set_b(0, CLUIFrameModule, AS(buf, "Collapse", sadd), (BYTE)btoint(Frames[Frameid].collapsed)); db_set_b(0, CLUIFrameModule, AS(buf, "Locked", sadd), (BYTE)btoint(Frames[Frameid].Locked)); @@ -472,7 +472,7 @@ int LocateStorePosition(int Frameid, int maxstored) for (int i = 0; i < maxstored; i++) { char settingname[255]; mir_snprintf(settingname, "Name%d", i); - ptrW frmname(db_get_tsa(0, CLUIFrameModule, settingname)); + ptrW frmname(db_get_wsa(0, CLUIFrameModule, settingname)); if (frmname == NULL) continue; if (mir_wstrcmpi(frmname, Frames[Frameid].name) == 0) return i; @@ -1342,7 +1342,7 @@ static int CLUIFramesLoadMainMenu() // create frames menu CMenuItem mi; mi.root = cont.MainMenuItem; - mi.flags = CMIF_TCHAR | CMIF_SYSTEM; + mi.flags = CMIF_UNICODE | CMIF_SYSTEM; int separator = (int)3000200000; for (int i = 0; i < nFramescount; i++) { FRAMEWND &F = Frames[i]; @@ -2153,7 +2153,7 @@ int OnFrameTitleBarBackgroundChange() hBmpBackground = NULL; } if (db_get_b(NULL, "FrameTitleBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) { - ptrW tszBitmapName(db_get_tsa(NULL, "FrameTitleBar", "BkBitmap")); + ptrW tszBitmapName(db_get_wsa(NULL, "FrameTitleBar", "BkBitmap")); if (tszBitmapName != NULL) hBmpBackground = Bitmap_Load(tszBitmapName); } diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp index f3cdc54267..f99933c311 100644 --- a/plugins/Clist_nicer/src/cluiopts.cpp +++ b/plugins/Clist_nicer/src/cluiopts.cpp @@ -84,7 +84,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l Utils::enableDlgControl(hwndDlg, IDC_AUTOSIZEUPWARD, FALSE);
}
{
- ptrW tszTitle(db_get_tsa(NULL, "CList", "TitleText"));
+ ptrW tszTitle(db_get_wsa(NULL, "CList", "TitleText"));
if (tszTitle != NULL)
SetDlgItemText(hwndDlg, IDC_TITLETEXT, tszTitle);
else
@@ -235,7 +235,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
- db_set_ts(NULL, "CList", "TitleText", title);
+ db_set_ws(NULL, "CList", "TitleText", title);
SetWindowText(pcli->hwndContactList, title);
cfg::dat.dwFlags = IsDlgButtonChecked(hwndDlg, IDC_ROUNDEDBORDER) ? cfg::dat.dwFlags | CLUI_FRAME_ROUNDEDFRAME : cfg::dat.dwFlags & ~CLUI_FRAME_ROUNDEDFRAME;
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index f25aa3dc81..a796250e76 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -1166,7 +1166,7 @@ static void BTN_ReadItem(char *itemName, char *file) void IMG_LoadItems()
{
DBVARIANT dbv;
- if (db_get_ts(NULL, "CLC", "AdvancedSkin", &dbv))
+ if (db_get_ws(NULL, "CLC", "AdvancedSkin", &dbv))
return;
wchar_t tszFileName[MAX_PATH];
@@ -1443,7 +1443,7 @@ static void ApplyCLUISkin() DBVARIANT dbv = { 0 };
wchar_t tszFinalName[MAX_PATH];
char szFinalName[MAX_PATH];
- if (!db_get_ts(NULL, "CLC", "AdvancedSkin", &dbv)) {
+ if (!db_get_ws(NULL, "CLC", "AdvancedSkin", &dbv)) {
MY_pathToAbsolute(dbv.ptszVal, tszFinalName);
WideCharToMultiByte(CP_ACP, 0, tszFinalName, MAX_PATH, szFinalName, MAX_PATH, 0, 0);
@@ -1496,7 +1496,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L else
Utils::enableDlgControl(hwndDlg, IDC_RELOAD, FALSE);
CheckDlgButton(hwndDlg, IDC_USESKIN, db_get_b(NULL, "CLUI", "useskin", 0) ? BST_CHECKED : BST_UNCHECKED);
- if (!db_get_ts(NULL, "CLC", "AdvancedSkin", &dbv)) {
+ if (!db_get_ws(NULL, "CLC", "AdvancedSkin", &dbv)) {
SetDlgItemText(hwndDlg, IDC_SKINFILENAME, dbv.ptszVal);
db_free(&dbv);
}
@@ -1542,14 +1542,14 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L int skinChanged = 0;
DBVARIANT dbv = { 0 };
- if (!db_get_ts(NULL, "CLC", "AdvancedSkin", &dbv)) {
+ if (!db_get_ws(NULL, "CLC", "AdvancedSkin", &dbv)) {
if (mir_wstrcmp(dbv.ptszVal, final_path))
skinChanged = TRUE;
db_free(&dbv);
}
else
skinChanged = TRUE;
- db_set_ts(NULL, "CLC", "AdvancedSkin", final_path);
+ db_set_ws(NULL, "CLC", "AdvancedSkin", final_path);
db_set_b(NULL, "CLUI", "skin_changed", (BYTE)skinChanged);
SetDlgItemText(hwndDlg, IDC_SKINFILENAME, final_path);
}
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index 07397d6c33..a9f25d0472 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -182,7 +182,7 @@ extern "C" int __declspec(dllexport) CListInitialise() cfg::dat.dwFlags |= (db_get_b(NULL, "CLUI", "ShowSBar", 1) ? CLUI_FRAME_SBARSHOW : 0);
cfg::dat.soundsOff = db_get_b(NULL, "Skin", "UseSound", 1) ? 0 : 1;
- CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)cfg::dat.tszProfilePath);
+ CallService(MS_DB_GETPROFILEPATHW, MAX_PATH, (LPARAM)cfg::dat.tszProfilePath);
wcslwr(cfg::dat.tszProfilePath);
// get the clist interface
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 8a0e588ce9..b1ca3a8640 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -215,7 +215,7 @@ static int FillDialog(HWND hwnd) ListView_InsertColumn(hwndList, 0, &lvc);
for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
- item.pszText = TranslateTS(pcli->pfnGetStatusModeDescription(i, 0));
+ item.pszText = TranslateW(pcli->pfnGetStatusModeDescription(i, 0));
item.iItem = i - ID_STATUS_OFFLINE;
ListView_InsertItem(hwndList, &item);
}
@@ -304,7 +304,7 @@ void SaveViewMode(const char *name, const wchar_t *szGroupFilter, const char *sz mir_snprintf(szSetting, "%c%s_PF", 246, name);
db_set_s(NULL, CLVM_MODULE, szSetting, szProtoFilter);
mir_snprintf(szSetting, "%c%s_GF", 246, name);
- db_set_ts(NULL, CLVM_MODULE, szSetting, szGroupFilter);
+ db_set_ws(NULL, CLVM_MODULE, szSetting, szGroupFilter);
mir_snprintf(szSetting, "%c%s_SM", 246, name);
db_set_dw(NULL, CLVM_MODULE, szSetting, statusMask);
mir_snprintf(szSetting, "%c%s_SSM", 246, name);
@@ -320,7 +320,7 @@ void SaveViewMode(const char *name, const wchar_t *szGroupFilter, const char *sz // saves the state of the filter definitions for the current item
void SaveState()
{
- CMString newGroupFilter(L"|");
+ CMStringW newGroupFilter(L"|");
CMStringA newProtoFilter("|");
DWORD statusMask = 0;
DWORD operators = 0;
@@ -443,7 +443,7 @@ void UpdateFilters() goto cleanup;
mir_snprintf(szSetting, "%c%s_GF", 246, szBuf);
- if (db_get_ts(NULL, CLVM_MODULE, szSetting, &dbv_gf))
+ if (db_get_ws(NULL, CLVM_MODULE, szSetting, &dbv_gf))
goto cleanup;
mir_snprintf(szSetting, "%c%s_OPT", 246, szBuf);
@@ -1019,7 +1019,7 @@ void CreateViewModeFrame() frame.TBtname = TranslateT("View modes");
frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
frame.height = 22;
- frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_TCHAR;
+ frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_UNICODE;
frame.align = alBottom;
frame.hWnd = CreateWindowEx(0, L"CLVMFrameWindow", L"CLVM", WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_CLIPCHILDREN, 0, 0, 20, 20, pcli->hwndContactList, (HMENU)0, g_hInst, NULL);
g_hwndViewModeFrame = frame.hWnd;
@@ -1042,7 +1042,7 @@ void ApplyViewMode(const char *name) }
mir_snprintf(szSetting, "%c%s_GF", 246, name);
- ptrW tszGroups(db_get_tsa(NULL, CLVM_MODULE, szSetting));
+ ptrW tszGroups(db_get_wsa(NULL, CLVM_MODULE, szSetting));
if (mir_wstrlen(tszGroups) >= 2) {
wcsncpy_s(cfg::dat.groupFilter, tszGroups, _TRUNCATE);
cfg::dat.bFilterEffective |= CLVM_FILTER_GROUPS;
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 7bef6f8f5b..1d18f4bc8b 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -1288,7 +1288,7 @@ void __cdecl OpenMessageWindowThread(void *data) {
MCONTACT hContact = (UINT_PTR)data;
if (hContact) {
- CallServiceSync(MS_MSG_SENDMESSAGET, hContact, 0);
+ CallServiceSync(MS_MSG_SENDMESSAGEW, hContact, 0);
}
}
@@ -1569,7 +1569,7 @@ void HandleSetNicknameCommand(PCommand command, TArgument *argv, int argc, PRepl mir_strcpy(protocol, argv[2]);
mir_strcpy(nickname, argv[3]);
- int res = CallProtoService(protocol, PS_SETMYNICKNAME, SMNN_TCHAR, (LPARAM)nickname);
+ int res = CallProtoService(protocol, PS_SETMYNICKNAME, SMNN_UNICODE, (LPARAM)nickname);
if (res == 0) {
reply->code = MIMRES_SUCCESS;
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index e62f6c83b9..46200dfaec 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -97,9 +97,9 @@ void saveSettingsConnections(struct CONNECTION *connHead) while (tmp != NULL) {
mir_snprintf(buff, "%dFilterIntIp", i);
- db_set_ts(NULL, PLUGINNAME, buff, tmp->strIntIp);
+ db_set_ws(NULL, PLUGINNAME, buff, tmp->strIntIp);
mir_snprintf(buff, "%dFilterExtIp", i);
- db_set_ts(NULL, PLUGINNAME, buff, tmp->strExtIp);
+ db_set_ws(NULL, PLUGINNAME, buff, tmp->strExtIp);
mir_snprintf(buff, "%dFilterPName", i);
db_set_ws(NULL, PLUGINNAME, buff, tmp->PName);
mir_snprintf(buff, "%dFilterIntPort", i);
@@ -126,15 +126,15 @@ struct CONNECTION* LoadSettingsConnections() for (i = settingFiltersCount - 1; i >= 0; i--) {
struct CONNECTION *conn = (struct CONNECTION*)mir_alloc(sizeof(struct CONNECTION));
mir_snprintf(buff, "%dFilterIntIp", i);
- if (!db_get_ts(NULL, PLUGINNAME, buff, &dbv))
+ if (!db_get_ws(NULL, PLUGINNAME, buff, &dbv))
wcsncpy(conn->strIntIp, dbv.ptszVal, _countof(conn->strIntIp));
db_free(&dbv);
mir_snprintf(buff, "%dFilterExtIp", i);
- if (!db_get_ts(NULL, PLUGINNAME, buff, &dbv))
+ if (!db_get_ws(NULL, PLUGINNAME, buff, &dbv))
wcsncpy(conn->strExtIp, dbv.ptszVal, _countof(conn->strExtIp));
db_free(&dbv);
mir_snprintf(buff, "%dFilterPName", i);
- if (!db_get_ts(NULL, PLUGINNAME, buff, &dbv))
+ if (!db_get_ws(NULL, PLUGINNAME, buff, &dbv))
wcsncpy(conn->PName, dbv.ptszVal, _countof(conn->PName));
db_free(&dbv);
@@ -590,7 +590,7 @@ int ConnectionNotifyOptInit(WPARAM wParam, LPARAM) odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_DIALOG);
odp.pwszTitle = _A2W(PLUGINNAME);
odp.pwszGroup = LPGENW("Plugins");
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pfnDlgProc = DlgProcConnectionNotifyOpts;//callback function name
Options_AddPage(wParam, &odp);
return 0;
diff --git a/plugins/ConnectionNotify/src/debug.cpp b/plugins/ConnectionNotify/src/debug.cpp index 506a0e07a1..d7c32e755b 100644 --- a/plugins/ConnectionNotify/src/debug.cpp +++ b/plugins/ConnectionNotify/src/debug.cpp @@ -2,7 +2,7 @@ void _OutputDebugString(wchar_t* lpOutputString, ...)
{
- CMString format;
+ CMStringW format;
va_list args;
va_start(args, lpOutputString);
format.FormatV(lpOutputString, args);
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp index 856a2752c7..c3bc12a83c 100644 --- a/plugins/Console/src/Console.cpp +++ b/plugins/Console/src/Console.cpp @@ -331,7 +331,7 @@ static INT_PTR CALLBACK LogDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LP HWND hwnd = GetDlgItem(hwndDlg, ctrls[i].control);
SendMessage(hwnd, ctrls[i].type, 0, 0);
SendMessage(hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcons[i + ICON_FIRST]);
- SendMessage(hwnd, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(ctrls[i].tooltip), BATF_TCHAR);
+ SendMessage(hwnd, BUTTONADDTOOLTIP, (WPARAM)TranslateW(ctrls[i].tooltip), BATF_UNICODE);
}
CheckDlgButton(hwndDlg, IDC_SCROLL, dat->Scroll ? BST_CHECKED : BST_UNCHECKED);
@@ -617,9 +617,9 @@ static INT_PTR CALLBACK ConsoleDlgProc(HWND hwndDlg, UINT message, WPARAM wParam // restore position
Utils_RestoreWindowPosition(hwndDlg, NULL, "Console", "Console", RWPF_HIDDEN);
- CallService(MS_DB_GETPROFILENAMET, (WPARAM)_countof(name), (LPARAM)name);
+ CallService(MS_DB_GETPROFILENAMEW, (WPARAM)_countof(name), (LPARAM)name);
- CallService(MS_DB_GETPROFILEPATHT, (WPARAM)_countof(path), (LPARAM)path);
+ CallService(MS_DB_GETPROFILEPATHW, (WPARAM)_countof(path), (LPARAM)path);
mir_snwprintf(title, L"%s - %s\\%s", TranslateT("Miranda Console"), path, name);
@@ -1093,13 +1093,13 @@ static int OnFontChange(WPARAM, LPARAM) if (hwndConsole) {
HFONT hf = NULL;
LOGFONT LogFont = { 0 };
- FontIDT fid = { 0 };
+ FontIDW fid = { 0 };
fid.cbSize = sizeof(fid);
mir_wstrncpy(fid.group, LPGENW("Console"), _countof(fid.group));
mir_wstrncpy(fid.name, LPGENW("Text"), _countof(fid.name));
- colLogFont = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&LogFont);
+ colLogFont = (COLORREF)CallService(MS_FONT_GETW, (WPARAM)&fid, (LPARAM)&LogFont);
if (LogFont.lfHeight != 0) {
hf = CreateFontIndirect(&LogFont);
@@ -1118,7 +1118,7 @@ static int OnSystemModulesLoaded(WPARAM, LPARAM) {
CreateServiceFunction(MS_CONSOLE_SHOW_HIDE, ShowHideConsole);
- FontIDT fid = { 0 };
+ FontIDW fid = { 0 };
fid.cbSize = sizeof(fid);
mir_wstrncpy(fid.group, LPGENW("Console"), _countof(fid.group));
mir_wstrncpy(fid.name, LPGENW("Text"), _countof(fid.name));
@@ -1132,18 +1132,18 @@ static int OnSystemModulesLoaded(WPARAM, LPARAM) fid.deffontsettings.size = 10;
fid.deffontsettings.style = 0;
mir_wstrncpy(fid.deffontsettings.szFace, L"Courier", _countof(fid.deffontsettings.szFace));
- FontRegisterT(&fid);
+ FontRegisterW(&fid);
HookEvent(ME_FONT_RELOAD, OnFontChange);
- ColourIDT cid = { 0 };
+ ColourIDW cid = { 0 };
cid.cbSize = sizeof(cid);
mir_wstrncpy(cid.group, LPGENW("Console"), _countof(cid.group));
mir_wstrncpy(cid.name, LPGENW("Background"), _countof(cid.name));
mir_strncpy(cid.dbSettingsGroup, "Console", _countof(cid.dbSettingsGroup));
mir_strncpy(cid.setting, "BgColor", _countof(cid.setting));
cid.defcolour = RGB(255, 255, 255);
- ColourRegisterT(&cid);
+ ColourRegisterW(&cid);
HookEvent(ME_COLOUR_RELOAD, OnColourChange);
@@ -1161,7 +1161,7 @@ static int OnSystemModulesLoaded(WPARAM, LPARAM) CMenuItem mi;
SET_UID(mi, 0x6d97694e, 0x2024, 0x4560, 0xbb, 0xbc, 0x20, 0x62, 0x7e, 0x5, 0xdf, 0xb3);
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = hIcons[0];
mi.position = 1900000000;
mi.name.w = (IsWindowVisible(hwndConsole)) ? LPGENW("Hide Console") : LPGENW("Show Console");
diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp index fe354361d6..affed99313 100644 --- a/plugins/ContactsPlus/src/receive.cpp +++ b/plugins/ContactsPlus/src/receive.cpp @@ -323,7 +323,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara if (ServiceExists(MS_CLIST_CONTACTCHANGEGROUP))
CallService(MS_CLIST_CONTACTCHANGEGROUP, hContact, (LPARAM)nGroupId);
else
- db_set_ts(hContact, "CList", "Group", caGroup);
+ db_set_ws(hContact, "CList", "Group", caGroup);
}
break;
}
diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp index 5031b03ac9..93da4f592d 100644 --- a/plugins/ContactsPlus/src/send.cpp +++ b/plugins/ContactsPlus/src/send.cpp @@ -479,7 +479,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar TranslateDialogDefault(hwndDlg);
{
if (lParam)
- SetDlgItemText(hwndDlg, IDC_ERRORTEXT, TranslateTS((wchar_t*)lParam));
+ SetDlgItemText(hwndDlg, IDC_ERRORTEXT, TranslateW((wchar_t*)lParam));
RECT rc, rcParent;
GetWindowRect(hwndDlg, &rc);
diff --git a/plugins/ContactsPlus/src/utils.cpp b/plugins/ContactsPlus/src/utils.cpp index 0cb84a1642..257cdb555f 100644 --- a/plugins/ContactsPlus/src/utils.cpp +++ b/plugins/ContactsPlus/src/utils.cpp @@ -115,7 +115,7 @@ void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, MCONTACT hContact) void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, wchar_t *pszTitleStart)
{
wchar_t newtitle[512];
- mir_wstrncpy(newtitle, TranslateTS(pszTitleStart), _countof(newtitle));
+ mir_wstrncpy(newtitle, TranslateW(pszTitleStart), _countof(newtitle));
if (hContact) {
char *szProto = GetContactProto(hContact);
@@ -130,7 +130,7 @@ void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, wchar_t *pszTitleStart) SetDlgItemText(hwndDlg, IDC_NAME, uid ? uid : contactName);
wchar_t *szStatus = pcli->pfnGetStatusModeDescription(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
- mir_snwprintf(newtitle, L"%s %s (%s)", TranslateTS(pszTitleStart), contactName, szStatus);
+ mir_snwprintf(newtitle, L"%s %s (%s)", TranslateW(pszTitleStart), contactName, szStatus);
}
}
@@ -152,7 +152,7 @@ HICON InitMButton(HWND hDlg, int idButton, int idIcon, wchar_t *szTip) SendMessage(hButton, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
SendMessage(hButton, BUTTONSETASFLATBTN, TRUE, 0);
- SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)szTip, BATF_TCHAR);
+ SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)szTip, BATF_UNICODE);
return hIcon;
}
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp index eec8817037..d351160b0b 100644 --- a/plugins/CrashDumper/src/crshdmp.cpp +++ b/plugins/CrashDumper/src/crshdmp.cpp @@ -65,14 +65,14 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SERVIC INT_PTR StoreVersionInfoToFile(WPARAM, LPARAM lParam)
{
- CreateDirectoryTreeT(VersionInfoFolder);
+ CreateDirectoryTreeW(VersionInfoFolder);
wchar_t path[MAX_PATH];
mir_snwprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
HANDLE hDumpFile = CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hDumpFile != INVALID_HANDLE_VALUE) {
- CMString buffer;
+ CMStringW buffer;
PrintVersionInfo(buffer, (unsigned int)lParam | VI_FLAG_PRNVAR);
WriteUtfFile(hDumpFile, T2Utf(buffer.c_str()));
@@ -87,7 +87,7 @@ INT_PTR StoreVersionInfoToFile(WPARAM, LPARAM lParam) INT_PTR StoreVersionInfoToClipboard(WPARAM, LPARAM lParam)
{
- CMString buffer;
+ CMStringW buffer;
WriteBBFile(buffer, true);
PrintVersionInfo(buffer, (unsigned int)lParam | VI_FLAG_PRNVAR | VI_FLAG_FORMAT);
WriteBBFile(buffer, false);
@@ -99,7 +99,7 @@ INT_PTR StoreVersionInfoToClipboard(WPARAM, LPARAM lParam) INT_PTR UploadVersionInfo(WPARAM, LPARAM lParam)
{
- CMString buffer;
+ CMStringW buffer;
PrintVersionInfo(buffer);
VerTrnsfr *trn = (VerTrnsfr*)mir_alloc(sizeof(VerTrnsfr));
@@ -130,7 +130,7 @@ INT_PTR GetVersionInfo(WPARAM wParam, LPARAM lParam) {
int result = 1; //failure
if (lParam != NULL) {
- CMString buffer;
+ CMStringW buffer;
PrintVersionInfo(buffer, (unsigned int)wParam);
char **retData = (char **)lParam;
*retData = mir_utf8encodeW(buffer.c_str());
diff --git a/plugins/CrashDumper/src/dumper.cpp b/plugins/CrashDumper/src/dumper.cpp index 7843451951..f802e4e33b 100644 --- a/plugins/CrashDumper/src/dumper.cpp +++ b/plugins/CrashDumper/src/dumper.cpp @@ -34,7 +34,7 @@ void CreateMiniDump(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr) }
-void WriteBBFile(CMString& buffer, bool hdr)
+void WriteBBFile(CMStringW& buffer, bool hdr)
{
static const wchar_t header[] = TEXT("[spoiler=VersionInfo][quote]");
static const wchar_t footer[] = TEXT("[/quote][/spoiler]");
@@ -55,7 +55,7 @@ void WriteUtfFile(HANDLE hDumpFile, char* bufu) BOOL CALLBACK LoadedModules64(LPCSTR, DWORD64 ModuleBase, ULONG ModuleSize, PVOID UserContext)
{
- CMString& buffer = *(CMString*)UserContext;
+ CMStringW& buffer = *(CMStringW*)UserContext;
const HMODULE hModule = (HMODULE)ModuleBase;
@@ -100,7 +100,7 @@ BOOL CALLBACK LoadedModulesFind64(LPCSTR ModuleName, DWORD64 ModuleBase, ULONG M }
-void GetLinkedModulesInfo(wchar_t *moduleName, CMString &buffer)
+void GetLinkedModulesInfo(wchar_t *moduleName, CMStringW &buffer)
{
HANDLE hDllFile = CreateFile(moduleName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hDllFile == INVALID_HANDLE_VALUE)
@@ -165,11 +165,11 @@ struct ListItem {
ListItem() : str(), next(NULL) {}
- CMString str;
+ CMStringW str;
ListItem *next;
};
-static void GetPluginsString(CMString& buffer, unsigned& flags)
+static void GetPluginsString(CMStringW& buffer, unsigned& flags)
{
buffer.AppendFormat(TEXT("Service Mode: %s\r\n"), servicemode ? TEXT("Yes") : TEXT("No"));
@@ -186,7 +186,7 @@ static void GetPluginsString(CMString& buffer, unsigned& flags) size_t count = 0, ucount = 0;
- CMString ubuffer;
+ CMStringW ubuffer;
ListItem* dlllist = NULL;
static const wchar_t format[] = TEXT("\xa4 %s v.%s%d.%d.%d.%d%s [%s] - %S %s\r\n");
@@ -299,7 +299,7 @@ struct ProtoCount bool nloaded;
};
-static void GetProtocolStrings(CMString& buffer)
+static void GetProtocolStrings(CMStringW& buffer)
{
PROTOACCOUNT **accList;
int accCount;
@@ -350,7 +350,7 @@ static void GetProtocolStrings(CMString& buffer) }
-static void GetWeatherStrings(CMString& buffer, unsigned flags)
+static void GetWeatherStrings(CMStringW& buffer, unsigned flags)
{
wchar_t path[MAX_PATH];
GetModuleFileName(NULL, path, MAX_PATH);
@@ -417,7 +417,7 @@ static void GetWeatherStrings(CMString& buffer, unsigned flags) }
-static void GetIconStrings(CMString& buffer)
+static void GetIconStrings(CMStringW& buffer)
{
wchar_t path[MAX_PATH];
GetModuleFileName(NULL, path, MAX_PATH);
@@ -442,7 +442,7 @@ static void GetIconStrings(CMString& buffer) }
-void PrintVersionInfo(CMString& buffer, unsigned flags)
+void PrintVersionInfo(CMStringW& buffer, unsigned flags)
{
GetProcessorString(buffer);
buffer.Append(L"\r\n");
@@ -576,7 +576,7 @@ void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const wcha wchar_t curtime[30];
GetISO8061Time(NULL, curtime, 30);
- CMString buffer;
+ CMStringW buffer;
buffer.AppendFormat(TEXT("Miranda Crash Report from %s. Crash Dumper v.%d.%d.%d.%d\r\n"),
curtime,
HIBYTE(HIWORD(pluginInfoEx->version)), LOBYTE(HIWORD(pluginInfoEx->version)),
@@ -654,7 +654,7 @@ void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const wcha static const wchar_t formatc[] = TEXT("\r\nLikely cause of the crash plugin: %S\r\n\r\n");
if (pi->shortName) {
- CMString crashcause;
+ CMStringW crashcause;
crashcause.AppendFormat(formatc, pi->shortName);
buffer.Insert(crashpos, crashcause);
}
diff --git a/plugins/CrashDumper/src/exhndlr.cpp b/plugins/CrashDumper/src/exhndlr.cpp index eef812a33a..0a23ed5ba9 100644 --- a/plugins/CrashDumper/src/exhndlr.cpp +++ b/plugins/CrashDumper/src/exhndlr.cpp @@ -51,7 +51,7 @@ void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify) HANDLE hDumpFile = NULL;
GetLocalTime(&st);
- CreateDirectoryTreeT(CrashLogFolder);
+ CreateDirectoryTreeW(CrashLogFolder);
__try {
if (dtsubfldr) {
diff --git a/plugins/CrashDumper/src/stdafx.h b/plugins/CrashDumper/src/stdafx.h index f7abf43d21..6a0dc8bede 100644 --- a/plugins/CrashDumper/src/stdafx.h +++ b/plugins/CrashDumper/src/stdafx.h @@ -95,30 +95,30 @@ extern bool servicemode, clsdates, dtsubfldr, catchcrashes, needrestart; extern wchar_t CrashLogFolder[MAX_PATH];
extern wchar_t VersionInfoFolder[MAX_PATH];
-void WriteBBFile(CMString& buffer, bool hdr);
+void WriteBBFile(CMStringW& buffer, bool hdr);
void WriteUtfFile(HANDLE hDumpFile, char* bufu);
LONG WINAPI myfilter(PEXCEPTION_POINTERS exc_ptr);
LONG WINAPI myfilterv(PEXCEPTION_POINTERS exc_ptr);
DWORD MirandaThreadFilter(DWORD code, EXCEPTION_POINTERS* info);
-void GetInternetExplorerVersion(CMString& buffer);
-void GetProcessorString(CMString& buffer);
-void GetFreeMemoryString(CMString& buffer);
-void GetFreeDiskString(LPCTSTR dirname, CMString& buffer);
-void GetAdminString(CMString& buffer);
-void GetLanguageString(CMString& buffer);
-void GetLanguagePackString(CMString& buffer);
-void GetWow64String(CMString& buffer);
-void GetVersionInfo(HMODULE hLib, CMString& buffer);
+void GetInternetExplorerVersion(CMStringW& buffer);
+void GetProcessorString(CMStringW& buffer);
+void GetFreeMemoryString(CMStringW& buffer);
+void GetFreeDiskString(LPCTSTR dirname, CMStringW& buffer);
+void GetAdminString(CMStringW& buffer);
+void GetLanguageString(CMStringW& buffer);
+void GetLanguagePackString(CMStringW& buffer);
+void GetWow64String(CMStringW& buffer);
+void GetVersionInfo(HMODULE hLib, CMStringW& buffer);
void GetISO8061Time(SYSTEMTIME* stLocal, LPTSTR lpszString, DWORD dwSize);
-void ReadableExceptionInfo(PEXCEPTION_RECORD excrec, CMString& buffer);
+void ReadableExceptionInfo(PEXCEPTION_RECORD excrec, CMStringW& buffer);
void GetLastWriteTime(LPCTSTR fileName, LPTSTR lpszString, DWORD dwSize);
void GetLastWriteTime(FILETIME* ftime, LPTSTR lpszString, DWORD dwSize);
-void StoreStringToClip(CMString& buffer);
+void StoreStringToClip(CMStringW& buffer);
void ShowMessage(int type, const wchar_t* format, ...);
bool IsPluginEnabled(wchar_t* filename);
@@ -127,7 +127,7 @@ const PLUGININFOEX* GetPluginInfoEx(void); void CreateMiniDump(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr);
void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const wchar_t* msg);
-void PrintVersionInfo(CMString& buffer, unsigned flags = VI_FLAG_PRNVAR);
+void PrintVersionInfo(CMStringW& buffer, unsigned flags = VI_FLAG_PRNVAR);
bool ProcessVIHash(bool store);
void InitExceptionHandler(void);
diff --git a/plugins/CrashDumper/src/ui.cpp b/plugins/CrashDumper/src/ui.cpp index 319740aaa7..e2d6c71002 100644 --- a/plugins/CrashDumper/src/ui.cpp +++ b/plugins/CrashDumper/src/ui.cpp @@ -72,7 +72,7 @@ INT_PTR CALLBACK DlgProcView(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara mir_wstrcpy(chf.szFaceName, TEXT("Courier New"));
SendDlgItemMessage(hwndDlg, IDC_VIEWVERSIONINFO, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&chf);
- CMString buffer;
+ CMStringW buffer;
PrintVersionInfo(buffer, (unsigned int)lParam);
SetDlgItemText(hwndDlg, IDC_VIEWVERSIONINFO, buffer.c_str());
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
diff --git a/plugins/CrashDumper/src/upload.cpp b/plugins/CrashDumper/src/upload.cpp index ad180b0589..dd7583cf79 100644 --- a/plugins/CrashDumper/src/upload.cpp +++ b/plugins/CrashDumper/src/upload.cpp @@ -215,7 +215,7 @@ void __cdecl VersionInfoUploadThread(void* arg) void UploadInit(void)
{
NETLIBUSER nlu = { sizeof(nlu) };
- nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_NOHTTPSOPTION | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_NOHTTPSOPTION | NUF_UNICODE;
nlu.szSettingsModule = (char*)PluginName;
nlu.ptszDescriptiveName = TranslateT("Crash Dumper HTTP connections");
hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
@@ -228,7 +228,7 @@ void UploadClose(void) bool ProcessVIHash(bool store)
{
- CMString buffer;
+ CMStringW buffer;
PrintVersionInfo(buffer, 0);
BYTE hash[16];
diff --git a/plugins/CrashDumper/src/utils.cpp b/plugins/CrashDumper/src/utils.cpp index df32598f4a..2fd7e8f815 100644 --- a/plugins/CrashDumper/src/utils.cpp +++ b/plugins/CrashDumper/src/utils.cpp @@ -100,7 +100,7 @@ PLUGININFOEX* GetMirInfo(HMODULE hModule) return bpi(mirandaVersion);
}
-void GetInternetExplorerVersion(CMString &buffer)
+void GetInternetExplorerVersion(CMStringW &buffer)
{
HKEY hKey;
DWORD size;
@@ -164,7 +164,7 @@ void TrimMultiSpaces(wchar_t *str) }
}
-void GetProcessorString(CMString &buffer)
+void GetProcessorString(CMStringW &buffer)
{
HKEY hKey;
DWORD size;
@@ -197,7 +197,7 @@ void GetProcessorString(CMString &buffer) buffer.AppendFormat(TEXT(" [%u CPUs]"), si.dwNumberOfProcessors);
}
-void GetFreeMemoryString(CMString &buffer)
+void GetFreeMemoryString(CMStringW &buffer)
{
unsigned ram;
MEMORYSTATUSEX ms = { 0 };
@@ -207,7 +207,7 @@ void GetFreeMemoryString(CMString &buffer) buffer.AppendFormat(TEXT("Installed RAM: %u MBytes"), ram);
}
-void GetFreeDiskString(LPCTSTR dirname, CMString &buffer)
+void GetFreeDiskString(LPCTSTR dirname, CMStringW &buffer)
{
ULARGE_INTEGER tnb, tfb, fs = { 0 };
GetDiskFreeSpaceEx(dirname, &fs, &tnb, &tfb);
@@ -216,7 +216,7 @@ void GetFreeDiskString(LPCTSTR dirname, CMString &buffer) buffer.AppendFormat(TEXT("Free disk space on Miranda partition: %u MBytes"), fs.LowPart);
}
-void ReadableExceptionInfo(PEXCEPTION_RECORD excrec, CMString& buffer)
+void ReadableExceptionInfo(PEXCEPTION_RECORD excrec, CMStringW& buffer)
{
buffer.Append(TEXT("Exception: "));
@@ -317,7 +317,7 @@ void ReadableExceptionInfo(PEXCEPTION_RECORD excrec, CMString& buffer) }
}
-void GetAdminString(CMString &buffer)
+void GetAdminString(CMStringW &buffer)
{
BOOL b;
__try {
@@ -341,7 +341,7 @@ void GetAdminString(CMString &buffer) buffer.AppendFormat(TEXT("Administrator privileges: %s"), b ? TEXT("Yes") : TEXT("No"));
}
-void GetLanguageString(CMString &buffer)
+void GetLanguageString(CMStringW &buffer)
{
wchar_t name1[256], name2[256], name3[256], name4[256];
@@ -354,7 +354,7 @@ void GetLanguageString(CMString &buffer) buffer.AppendFormat(TEXT("OS Languages: (UI | Locale (User/System)) : %s/%s | %s/%s"), name3, name4, name1, name2);
}
-void GetLanguagePackString(CMString &buffer)
+void GetLanguagePackString(CMStringW &buffer)
{
buffer.Append(TEXT("Language pack: "));
if (packlcid != LOCALE_USER_DEFAULT) {
@@ -372,7 +372,7 @@ void GetLanguagePackString(CMString &buffer) buffer.Append(TEXT("No language pack installed"));
}
-void GetWow64String(CMString &buffer)
+void GetWow64String(CMStringW &buffer)
{
BOOL wow64 = 0;
if (!IsWow64Process(GetCurrentProcess(), &wow64))
@@ -382,7 +382,7 @@ void GetWow64String(CMString &buffer) buffer.Append(TEXT(" [running inside WOW64]"));
}
-void GetVersionInfo(HMODULE hLib, CMString& buffer)
+void GetVersionInfo(HMODULE hLib, CMStringW& buffer)
{
HRSRC hVersion = FindResource(hLib, MAKEINTRESOURCE(VS_VERSION_INFO), RT_VERSION);
if (hVersion != NULL) {
@@ -406,7 +406,7 @@ void GetVersionInfo(HMODULE hLib, CMString& buffer) }
}
-void StoreStringToClip(CMString& buffer)
+void StoreStringToClip(CMStringW& buffer)
{
int bufLen = (buffer.GetLength() + 1) * sizeof(wchar_t);
HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, bufLen);
diff --git a/plugins/Db3x_mmap/src/database.cpp b/plugins/Db3x_mmap/src/database.cpp index 80dc43d777..85c94ad360 100644 --- a/plugins/Db3x_mmap/src/database.cpp +++ b/plugins/Db3x_mmap/src/database.cpp @@ -91,7 +91,7 @@ void __cdecl dbpanic(void *) MessageBox(0, err, TranslateT("Database Error"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
}
- else MessageBox(0, TranslateTS(tszPanic), TranslateT("Database Panic"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
+ else MessageBox(0, TranslateW(tszPanic), TranslateT("Database Panic"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
TerminateProcess(GetCurrentProcess(), 255);
}
diff --git a/plugins/Db3x_mmap/src/dbheaders.cpp b/plugins/Db3x_mmap/src/dbheaders.cpp index 8cd51d5a6b..d769a189b7 100644 --- a/plugins/Db3x_mmap/src/dbheaders.cpp +++ b/plugins/Db3x_mmap/src/dbheaders.cpp @@ -69,7 +69,7 @@ int CDb3Mmap::CheckDbHeaders(bool bInteractive) if (!memcmp(&m_dbHeader.signature, &dbSignatureSD, sizeof(m_dbHeader.signature))) {
if (bInteractive)
- if (IDYES == MessageBox(NULL, TranslateTS(tszOldHeaders), TranslateT("Obsolete database format"), MB_YESNO | MB_ICONWARNING)) {
+ if (IDYES == MessageBox(NULL, TranslateW(tszOldHeaders), TranslateT("Obsolete database format"), MB_YESNO | MB_ICONWARNING)) {
wchar_t tszCurPath[MAX_PATH];
GetModuleFileName(NULL, tszCurPath, _countof(tszCurPath));
wchar_t *p = wcsrchr(tszCurPath, '\\');
diff --git a/plugins/Db3x_mmap/src/ui.cpp b/plugins/Db3x_mmap/src/ui.cpp index 5e6929572f..9c18e83900 100644 --- a/plugins/Db3x_mmap/src/ui.cpp +++ b/plugins/Db3x_mmap/src/ui.cpp @@ -317,7 +317,7 @@ static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM) Menu_ConfigureItem(mi.root, MCI_OPT_UID, "F7C5567C-D1EE-484B-B4F6-24677A5AAAEF");
SET_UID(mi, 0x50321866, 0xba1, 0x46dd, 0xb3, 0xa6, 0xc3, 0xcc, 0x55, 0xf2, 0x42, 0x9e);
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = iconList[1].hIcolib;
mi.name.w = db->GetMenuTitle();
mi.pszService = MS_DB_CHANGEPASSWORD;
diff --git a/plugins/DbChecker/src/selectdb.cpp b/plugins/DbChecker/src/selectdb.cpp index 0a704fe2ef..5fe836c21d 100644 --- a/plugins/DbChecker/src/selectdb.cpp +++ b/plugins/DbChecker/src/selectdb.cpp @@ -47,7 +47,7 @@ int OpenDatabase(HWND hdlg, INT iNextPage) if (dblink->CheckDB == NULL) {
mir_snwprintf(tszMsg,
TranslateT("Database driver '%s' doesn't support checking."),
- TranslateTS(dblink->szFullName));
+ TranslateW(dblink->szFullName));
goto LBL_Error;
}
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index 20026bb8bc..d997ab744e 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -132,11 +132,11 @@ int ModulesLoaded(WPARAM, LPARAM) // Register hotkeys
_A2T text(modFullname);
HOTKEYDESC hkd = { sizeof(hkd) };
- hkd.dwFlags = HKD_TCHAR;
+ hkd.dwFlags = HKD_UNICODE;
hkd.pszName = "hk_dbepp_open";
hkd.pszService = "DBEditorpp/MenuCommand";
- hkd.ptszDescription = LPGENW("Open Database Editor");
- hkd.ptszSection = text;
+ hkd.pwszDescription = LPGENW("Open Database Editor");
+ hkd.pwszSection = text;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_EXT, 'D');
Hotkey_Register(&hkd);
@@ -529,7 +529,7 @@ void loadListSettings(HWND hwnd, ColumnsSettings *cs) sLC.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
int i = 0;
while (cs[i].name) {
- sLC.pszText = TranslateTS(cs[i].name);
+ sLC.pszText = TranslateW(cs[i].name);
sLC.cx = db_get_w(NULL, modname, cs[i].dbname, cs[i].defsize);
ListView_InsertColumn(hwnd, cs[i].index, &sLC);
i++;
diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp index ea18899542..d95b9e59f1 100644 --- a/plugins/Db_autobackups/src/backup.cpp +++ b/plugins/Db_autobackups/src/backup.cpp @@ -186,7 +186,7 @@ int Backup(wchar_t *backup_filename) HWND progress_dialog = NULL;
SYSTEMTIME st;
- CallService(MS_DB_GETPROFILENAMET, _countof(dbname), (LPARAM)dbname);
+ CallService(MS_DB_GETPROFILENAMEW, _countof(dbname), (LPARAM)dbname);
if (backup_filename == NULL) {
int err;
@@ -196,7 +196,7 @@ int Backup(wchar_t *backup_filename) bZip = options.use_zip != 0;
backupfolder = Utils_ReplaceVarsT(options.folder);
// ensure the backup folder exists (either create it or return non-zero signifying error)
- err = CreateDirectoryTreeT(backupfolder);
+ err = CreateDirectoryTreeW(backupfolder);
if (err != ERROR_ALREADY_EXISTS && err != 0) {
mir_free(backupfolder);
return 1;
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp index 4efd79dec5..448e15fab4 100644 --- a/plugins/Db_autobackups/src/main.cpp +++ b/plugins/Db_autobackups/src/main.cpp @@ -36,7 +36,7 @@ static INT_PTR DBSaveAs(WPARAM, LPARAM) {
wchar_t fname_buff[MAX_PATH], tszFilter[200];
OPENFILENAME ofn = { 0 };
- CallService(MS_DB_GETPROFILENAMET, _countof(fname_buff), (LPARAM)fname_buff);
+ CallService(MS_DB_GETPROFILENAMEW, _countof(fname_buff), (LPARAM)fname_buff);
mir_snwprintf(tszFilter, L"%s (*.dat)%c*.dat%c%s (*.zip)%c*.zip%c%s (*.*)%c*%c",
TranslateT("Miranda NG databases"), 0, 0,
diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp index 52ca03f8ad..d7d54eae55 100644 --- a/plugins/Db_autobackups/src/options.cpp +++ b/plugins/Db_autobackups/src/options.cpp @@ -42,7 +42,7 @@ int LoadOptions(void) if (!ServiceExists(MS_FOLDERS_GET_PATH)) {
DBVARIANT dbv;
- if (!db_get_ts(0, "AutoBackups", "Folder", &dbv)) {
+ if (!db_get_ws(0, "AutoBackups", "Folder", &dbv)) {
wchar_t *tmp = Utils_ReplaceVarsT(dbv.ptszVal);
if (mir_wstrlen(tmp) >= 2 && tmp[1] == ':')
@@ -82,10 +82,10 @@ int SaveOptions(void) size_t opt_len = mir_wstrlen(options.folder);
if (opt_len > prof_len && wcsncmp(options.folder, prof_dir, prof_len) == 0) {
- db_set_ts(0, "AutoBackups", "Folder", (options.folder + prof_len));
+ db_set_ws(0, "AutoBackups", "Folder", (options.folder + prof_len));
}
else
- db_set_ts(0, "AutoBackups", "Folder", options.folder);
+ db_set_ws(0, "AutoBackups", "Folder", options.folder);
wchar_t *tmp = Utils_ReplaceVarsT(options.folder);
if (mir_wstrlen(tmp) < 2 || tmp[1] != ':') {
@@ -365,7 +365,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP mir_snwprintf(backupfolder, L"%s\\%s", profilePath, tmp);
mir_free(tmp);
- int err = CreateDirectoryTreeT(backupfolder);
+ int err = CreateDirectoryTreeW(backupfolder);
if (err != ERROR_ALREADY_EXISTS && err != 0) {
wchar_t msg_buff[512];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, err, 0, msg_buff, 512, 0);
diff --git a/plugins/Dbx_mdb/src/dbintf.cpp b/plugins/Dbx_mdb/src/dbintf.cpp index a47dd6b677..8dbc56fa22 100644 --- a/plugins/Dbx_mdb/src/dbintf.cpp +++ b/plugins/Dbx_mdb/src/dbintf.cpp @@ -230,7 +230,7 @@ EXTERN_C void __cdecl dbpanic(void *) MessageBox(0, err, TranslateT("Database Error"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
}
- else MessageBox(0, TranslateTS(tszPanic), TranslateT("Database Panic"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
+ else MessageBox(0, TranslateW(tszPanic), TranslateT("Database Panic"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
TerminateProcess(GetCurrentProcess(), 255);
}
diff --git a/plugins/Dropbox/src/dropbox_events.cpp b/plugins/Dropbox/src/dropbox_events.cpp index 24f4a384a7..a6454efe64 100644 --- a/plugins/Dropbox/src/dropbox_events.cpp +++ b/plugins/Dropbox/src/dropbox_events.cpp @@ -10,7 +10,7 @@ int CDropbox::OnModulesLoaded(WPARAM, LPARAM) HookEventObj(ME_FILEDLG_CANCELED, GlobalEvent<&CDropbox::OnFileDialogCancelled>, this);
NETLIBUSER nlu = { sizeof(nlu) };
- nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
+ nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = MODULE;
nlu.ptszDescriptiveName = L"Dropbox";
diff --git a/plugins/Dropbox/src/dropbox_options.cpp b/plugins/Dropbox/src/dropbox_options.cpp index 3bba4c0520..20f3f99474 100644 --- a/plugins/Dropbox/src/dropbox_options.cpp +++ b/plugins/Dropbox/src/dropbox_options.cpp @@ -153,7 +153,7 @@ int CDropbox::OnOptionsInitialized(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.pwszTitle = MODULEW;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.pwszGroup = LPGENW("Network");
odp.pwszTab = LPGENW("General");
diff --git a/plugins/Dropbox/src/dropbox_utils.cpp b/plugins/Dropbox/src/dropbox_utils.cpp index b388117db5..c8ef7f06c8 100644 --- a/plugins/Dropbox/src/dropbox_utils.cpp +++ b/plugins/Dropbox/src/dropbox_utils.cpp @@ -105,7 +105,7 @@ void CDropbox::SendToContact(MCONTACT hContact, const wchar_t *data) const char *szProto = GetContactProto(hContact);
if (db_get_b(hContact, szProto, "ChatRoom", 0) == TRUE) {
- ptrW tszChatRoom(db_get_tsa(hContact, szProto, "ChatRoomID"));
+ ptrW tszChatRoom(db_get_wsa(hContact, szProto, "ChatRoomID"));
GCDEST gcd = { szProto, tszChatRoom, GC_EVENT_SENDMESSAGE };
GCEVENT gce = { sizeof(gce), &gcd };
gce.bIsMe = TRUE;
diff --git a/plugins/Dropbox/src/file_transfer.h b/plugins/Dropbox/src/file_transfer.h index f5ef1e56fd..8c50542bed 100644 --- a/plugins/Dropbox/src/file_transfer.h +++ b/plugins/Dropbox/src/file_transfer.h @@ -15,9 +15,9 @@ private: const wchar_t* folderName;
int relativePathStart;
- CMString serverFolder;
+ CMStringW serverFolder;
- CMString data;
+ CMStringW data;
public:
FileTransferParam(MCONTACT hContact)
@@ -31,7 +31,7 @@ public: relativePathStart = 0;
pfts.cbSize = sizeof(this->pfts);
- pfts.flags = PFTS_TCHAR | PFTS_SENDING;
+ pfts.flags = PFTS_UNICODE | PFTS_SENDING;
pfts.hContact = hContact;
pfts.currentFileNumber = -1;
pfts.currentFileProgress = 0;
diff --git a/plugins/Exchange/src/dlg_handlers.cpp b/plugins/Exchange/src/dlg_handlers.cpp index 93e5cde48f..6a4d7cc15e 100644 --- a/plugins/Exchange/src/dlg_handlers.cpp +++ b/plugins/Exchange/src/dlg_handlers.cpp @@ -112,13 +112,13 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara wchar_t buffer[4096];
GetDlgItemText(hWnd, IDC_USER_EDIT, buffer, _countof(buffer));
- db_set_ts(NULL, ModuleName, "Username", buffer);
+ db_set_ws(NULL, ModuleName, "Username", buffer);
GetDlgItemText(hWnd, IDC_PASSWORD_EDIT, buffer, _countof(buffer));
- db_set_ts(NULL, ModuleName, "Password", buffer);
+ db_set_ws(NULL, ModuleName, "Password", buffer);
GetDlgItemText(hWnd, IDC_SERVER_EDIT, buffer, _countof(buffer));
- db_set_ts(NULL, ModuleName, "Server", buffer);
+ db_set_ws(NULL, ModuleName, "Server", buffer);
GetDlgItemText(hWnd, IDC_PORT_EDIT, buffer, _countof(buffer));
db_set_dw(NULL, ModuleName, "Port", GetDlgItemInt(hWnd, IDC_PORT_EDIT, NULL, FALSE));
diff --git a/plugins/Exchange/src/emails.cpp b/plugins/Exchange/src/emails.cpp index 5f22aa6a29..51fdb00455 100644 --- a/plugins/Exchange/src/emails.cpp +++ b/plugins/Exchange/src/emails.cpp @@ -62,7 +62,7 @@ int CExchangeServer::Connect(int bForceConnect) wchar_t server[1024];
GetStringFromDatabase("Username", L"", user, _countof(user));
- wcsncpy_s(user, VARST(user), _TRUNCATE);
+ wcsncpy_s(user, VARSW(user), _TRUNCATE);
GetStringFromDatabase("Password", L"", password, _countof(password));
GetStringFromDatabase("Server", L"", server, _countof(server));
diff --git a/plugins/Exchange/src/hooked_events.cpp b/plugins/Exchange/src/hooked_events.cpp index c484e976c3..4d70d44ceb 100644 --- a/plugins/Exchange/src/hooked_events.cpp +++ b/plugins/Exchange/src/hooked_events.cpp @@ -65,7 +65,7 @@ int OnModulesLoaded(WPARAM, LPARAM) mi.hIcolibItem = hiMailIcon;
mi.position = 10000000;
mi.pszService = MS_EXCHANGE_CHECKEMAIL;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.name.w = LPGENW("Check exchange mailbox");
Menu_AddMainMenuItem(&mi);
@@ -85,7 +85,7 @@ int OnOptionsInitialise(WPARAM wParam, LPARAM) odp.pwszTitle = LPGENW("Exchange notify");
odp.pwszGroup = LPGENW("Plugins");
odp.groupPosition = 910000000;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pfnDlgProc = DlgProcOptions;
Options_AddPage(wParam, &odp);
return 0;
diff --git a/plugins/Exchange/src/utils.cpp b/plugins/Exchange/src/utils.cpp index e65843eb88..97fc4cca13 100644 --- a/plugins/Exchange/src/utils.cpp +++ b/plugins/Exchange/src/utils.cpp @@ -113,7 +113,7 @@ int GetStringFromDatabase(char *szSettingName, wchar_t *szError, wchar_t *szResu DBVARIANT dbv = { 0 };
int res = 1;
dbv.type = DBVT_ASCIIZ;
- if (db_get_ts(NULL, ModuleName, szSettingName, &dbv) == 0) {
+ if (db_get_ws(NULL, ModuleName, szSettingName, &dbv) == 0) {
res = 0;
size_t tmp = mir_wstrlen(dbv.ptszVal);
size_t len = (tmp < size - 1) ? tmp : size - 1;
diff --git a/plugins/FTPFileYM/src/dialog.cpp b/plugins/FTPFileYM/src/dialog.cpp index 06c914070c..36ae1f824c 100644 --- a/plugins/FTPFileYM/src/dialog.cpp +++ b/plugins/FTPFileYM/src/dialog.cpp @@ -191,31 +191,31 @@ INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar SendDlgItemMessage(hwndDlg, IDC_UP_CONTACT, WM_SETFONT, (WPARAM)hFont, 0);
SendDlgItemMessage(hwndDlg, IDC_BTN_PROTO, BUTTONSETASFLATBTN, 0, 0);
- SendDlgItemMessage(hwndDlg, IDC_BTN_PROTO, BUTTONADDTOOLTIP, (WPARAM)TranslateT("User Info"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_PROTO, BUTTONADDTOOLTIP, (WPARAM)TranslateT("User Info"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_BTN_PAUSE, BUTTONSETASFLATBTN, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_BTN_PAUSE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Utils::loadIconEx("pause"));
- SendDlgItemMessage(hwndDlg, IDC_BTN_PAUSE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Pause"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_PAUSE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Pause"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_BTN_CLIPBOARD, BUTTONSETASFLATBTN, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_BTN_CLIPBOARD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Utils::loadIconEx("clipboard"));
- SendDlgItemMessage(hwndDlg, IDC_BTN_CLIPBOARD, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Copy Link to Clipboard"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_CLIPBOARD, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Copy Link to Clipboard"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_BTN_DOWNLOAD, BUTTONSETASFLATBTN, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_BTN_DOWNLOAD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadIcon(SKINICON_EVENT_URL));
- SendDlgItemMessage(hwndDlg, IDC_BTN_DOWNLOAD, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Open in Browser"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_DOWNLOAD, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Open in Browser"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_BTN_FILEMANAGER, BUTTONSETASFLATBTN, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_BTN_FILEMANAGER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Utils::loadIconEx("main"));
- SendDlgItemMessage(hwndDlg, IDC_BTN_FILEMANAGER, BUTTONADDTOOLTIP, (WPARAM)TranslateT("FTP File Manager"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_FILEMANAGER, BUTTONADDTOOLTIP, (WPARAM)TranslateT("FTP File Manager"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_BTN_OPTIONS, BUTTONSETASFLATBTN, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_BTN_OPTIONS, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadIcon(SKINICON_OTHER_OPTIONS));
- SendDlgItemMessage(hwndDlg, IDC_BTN_OPTIONS, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Options"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_OPTIONS, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Options"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_BTN_CLOSE, BUTTONSETASFLATBTN, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_BTN_CLOSE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadIcon(SKINICON_OTHER_DELETE));
- SendDlgItemMessage(hwndDlg, IDC_BTN_CLOSE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Close"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_CLOSE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Close"), BATF_UNICODE);
}
break;
diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp index f2681e24c4..c915436f48 100644 --- a/plugins/FTPFileYM/src/ftpfile.cpp +++ b/plugins/FTPFileYM/src/ftpfile.cpp @@ -93,7 +93,7 @@ void InitMenuItems() CMenuItem mi;
SET_UID(mi, 0xB7132F5A, 0x65FC, 0x42C5, 0xB4, 0xCB, 0x54, 0xBC, 0xAC, 0x58, 0x34, 0xE9);
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = iconList[ServerList::FTP_COUNT].hIcolib;
mi.position = 3000090001;
mi.name.w = LPGENW("FTP File");
@@ -104,10 +104,10 @@ void InitMenuItems() memset(&mi, 0, sizeof(mi));
mi.name.w = stzName;
- mi.flags = CMIF_TCHAR | CMIF_SYSTEM;
+ mi.flags = CMIF_UNICODE | CMIF_SYSTEM;
CMenuItem mi2;
- mi2.flags = CMIF_TCHAR | CMIF_SYSTEM;
+ mi2.flags = CMIF_UNICODE | CMIF_SYSTEM;
mi2.pszService = MS_FTPFILE_CONTACTMENU;
for (int i = 0; i < ServerList::FTP_COUNT; i++) {
@@ -155,7 +155,7 @@ void InitMenuItems() memset(&mi, 0, sizeof(mi));
SET_UID(mi, 0x0C17CAD7, 0x7F23, 0x449B, 0xB9, 0xCD, 0xFF, 0x50, 0xDA, 0x69, 0xF3, 0x6F);
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = iconList[ServerList::FTP_COUNT].hIcolib;
mi.position = 3000090001;
mi.name.w = LPGENW("FTP File manager");
diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp index 5bd60536f5..8443dafb6b 100644 --- a/plugins/FTPFileYM/src/job_upload.cpp +++ b/plugins/FTPFileYM/src/job_upload.cpp @@ -434,11 +434,11 @@ void UploadJob::refreshTab(bool bTabChanged) if (bTabChanged) {
if (isPaused()) {
SendDlgItemMessage(uDlg->m_hwnd, IDC_BTN_PAUSE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Utils::loadIconEx("resume"));
- SendDlgItemMessage(uDlg->m_hwnd, IDC_BTN_PAUSE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Resume"), BATF_TCHAR);
+ SendDlgItemMessage(uDlg->m_hwnd, IDC_BTN_PAUSE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Resume"), BATF_UNICODE);
}
else {
SendDlgItemMessage(uDlg->m_hwnd, IDC_BTN_PAUSE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Utils::loadIconEx("pause"));
- SendDlgItemMessage(uDlg->m_hwnd, IDC_BTN_PAUSE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Pause"), BATF_TCHAR);
+ SendDlgItemMessage(uDlg->m_hwnd, IDC_BTN_PAUSE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Pause"), BATF_UNICODE);
}
ShowWindow(GetDlgItem(uDlg->m_hwnd, IDC_ST_REMAIN), !isCompleted() ? SW_SHOW : SW_HIDE);
diff --git a/plugins/FTPFileYM/src/manager.cpp b/plugins/FTPFileYM/src/manager.cpp index 84e648bcfd..c77cd62fc2 100644 --- a/plugins/FTPFileYM/src/manager.cpp +++ b/plugins/FTPFileYM/src/manager.cpp @@ -227,19 +227,19 @@ INT_PTR CALLBACK Manager::ManagerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, SendDlgItemMessage(hwndDlg, IDC_BTN_SELECTALL, BUTTONSETASFLATBTN, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_BTN_SELECTALL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadIcon(SKINICON_OTHER_TICK));
- SendDlgItemMessage(hwndDlg, IDC_BTN_SELECTALL, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Select All"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_SELECTALL, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Select All"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_BTN_DESELECTALL, BUTTONSETASFLATBTN, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_BTN_DESELECTALL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadIcon(SKINICON_OTHER_NOTICK));
- SendDlgItemMessage(hwndDlg, IDC_BTN_DESELECTALL, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Clear All"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_DESELECTALL, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Clear All"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_BTN_DELETEFROMLIST, BUTTONSETASFLATBTN, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_BTN_DELETEFROMLIST, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Utils::loadIconEx("clear"));
- SendDlgItemMessage(hwndDlg, IDC_BTN_DELETEFROMLIST, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Delete from List"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_DELETEFROMLIST, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Delete from List"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_BTN_DELETE, BUTTONSETASFLATBTN, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_BTN_DELETE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Utils::loadIconEx("delete"));
- SendDlgItemMessage(hwndDlg, IDC_BTN_DELETE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Delete from FTP"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_DELETE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Delete from FTP"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_BTN_CLOSE, BUTTONSETASFLATBTN, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_BTN_CLOSE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadIcon(SKINICON_OTHER_EXIT));
- SendDlgItemMessage(hwndDlg, IDC_BTN_CLOSE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Close"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_CLOSE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Close"), BATF_UNICODE);
return TRUE;
case WM_COMMAND:
diff --git a/plugins/FTPFileYM/src/mir_db.cpp b/plugins/FTPFileYM/src/mir_db.cpp index dadc502028..e7c693585a 100644 --- a/plugins/FTPFileYM/src/mir_db.cpp +++ b/plugins/FTPFileYM/src/mir_db.cpp @@ -50,7 +50,7 @@ int DB::setStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, w {
char formSet[256];
mir_snprintf(formSet, szSetting, id);
- return db_set_ts(hContact, szModule, formSet, stzValue);
+ return db_set_ws(hContact, szModule, formSet, stzValue);
}
int DB::getByteF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue)
@@ -97,7 +97,7 @@ int DB::getAStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, int DB::getString(MCONTACT hContact, char *szModule, char *szSetting, wchar_t *buff)
{
DBVARIANT dbv;
- if (!db_get_ts(hContact, szModule, szSetting, &dbv)) {
+ if (!db_get_ws(hContact, szModule, szSetting, &dbv)) {
mir_wstrcpy(buff, dbv.ptszVal);
db_free(&dbv);
return 0;
diff --git a/plugins/FTPFileYM/src/options.cpp b/plugins/FTPFileYM/src/options.cpp index fa0632194b..38777bcc6a 100644 --- a/plugins/FTPFileYM/src/options.cpp +++ b/plugins/FTPFileYM/src/options.cpp @@ -249,7 +249,7 @@ int Options::InitOptions(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 100000000;
odp.hInstance = hInst;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pwszTitle = LPGENW("FTP File");
odp.pwszGroup = LPGENW("Services");
diff --git a/plugins/FavContacts/src/favlist.h b/plugins/FavContacts/src/favlist.h index 3cbb4a8285..b111550237 100644 --- a/plugins/FavContacts/src/favlist.h +++ b/plugins/FavContacts/src/favlist.h @@ -20,7 +20,7 @@ public: name = mir_wstrdup(pcli->pfnGetContactDisplayName(hContact, 0));
if (g_Options.bUseGroups) {
- if ((group = db_get_tsa(hContact, "CList", "Group")) == NULL)
+ if ((group = db_get_wsa(hContact, "CList", "Group")) == NULL)
group = mir_wstrdup(TranslateT("<no group>"));
}
else group = mir_wstrdup(TranslateT("Favorite Contacts"));
diff --git a/plugins/FavContacts/src/menu.cpp b/plugins/FavContacts/src/menu.cpp index 64568587c2..ebf50f87fa 100644 --- a/plugins/FavContacts/src/menu.cpp +++ b/plugins/FavContacts/src/menu.cpp @@ -71,7 +71,7 @@ static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options) if (options->bSecondLine) {
bool bFree = false;
- wchar_t *title = db_get_tsa(hContact, "CList", "StatusMsg");
+ wchar_t *title = db_get_wsa(hContact, "CList", "StatusMsg");
if (title == NULL) {
char *proto = GetContactProto(hContact);
int status = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE);
@@ -315,7 +315,7 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL) if (options->bSecondLine) {
bool bFree = false;
- wchar_t *title = db_get_tsa(hContact, "CList", "StatusMsg");
+ wchar_t *title = db_get_wsa(hContact, "CList", "StatusMsg");
if (title == NULL) {
int status = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE);
title = pcli->pfnGetStatusModeDescription(status, 0);
diff --git a/plugins/FavContacts/src/services.cpp b/plugins/FavContacts/src/services.cpp index 00a053b996..2a6cab99c5 100644 --- a/plugins/FavContacts/src/services.cpp +++ b/plugins/FavContacts/src/services.cpp @@ -127,29 +127,29 @@ int ProcessReloadFonts(WPARAM, LPARAM) if (g_Options.hfntSecond) DeleteObject(g_Options.hfntSecond);
LOGFONT lf = { 0 };
- FontIDT fontid = { sizeof(fontid) };
+ FontIDW fontid = { sizeof(fontid) };
mir_wstrcpy(fontid.group, LPGENW("Favorite Contacts"));
mir_wstrcpy(fontid.name, LPGENW("Contact name"));
- g_Options.clLine1 = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
+ g_Options.clLine1 = CallService(MS_FONT_GETW, (WPARAM)&fontid, (LPARAM)&lf);
g_Options.hfntName = CreateFontIndirect(&lf);
mir_wstrcpy(fontid.name, LPGENW("Second line"));
- g_Options.clLine2 = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
+ g_Options.clLine2 = CallService(MS_FONT_GETW, (WPARAM)&fontid, (LPARAM)&lf);
g_Options.hfntSecond = CreateFontIndirect(&lf);
mir_wstrcpy(fontid.name, LPGENW("Selected contact name (color)"));
- g_Options.clLine1Sel = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
+ g_Options.clLine1Sel = CallService(MS_FONT_GETW, (WPARAM)&fontid, (LPARAM)&lf);
mir_wstrcpy(fontid.name, LPGENW("Selected second line (color)"));
- g_Options.clLine2Sel = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
+ g_Options.clLine2Sel = CallService(MS_FONT_GETW, (WPARAM)&fontid, (LPARAM)&lf);
- ColourIDT colourid = { sizeof(colourid) };
+ ColourIDW colourid = { sizeof(colourid) };
mir_wstrcpy(colourid.group, LPGENW("Favorite Contacts"));
mir_wstrcpy(colourid.name, LPGENW("Background"));
- g_Options.clBack = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, (LPARAM)&lf);
+ g_Options.clBack = CallService(MS_COLOUR_GETW, (WPARAM)&colourid, (LPARAM)&lf);
mir_wstrcpy(colourid.name, LPGENW("Selected background"));
- g_Options.clBackSel = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, (LPARAM)&lf);
+ g_Options.clBackSel = CallService(MS_COLOUR_GETW, (WPARAM)&colourid, (LPARAM)&lf);
return 0;
}
@@ -170,7 +170,7 @@ int ProcessModulesLoaded(WPARAM, LPARAM) /////////////////////////////////////////////////////////////////////////////////////
- FontIDT fontid = { sizeof(fontid) };
+ FontIDW fontid = { sizeof(fontid) };
mir_wstrcpy(fontid.group, LPGENW("Favorite Contacts"));
mir_strcpy(fontid.dbSettingsGroup, "FavContacts");
mir_wstrcpy(fontid.backgroundGroup, LPGENW("Favorite Contacts"));
@@ -186,13 +186,13 @@ int ProcessModulesLoaded(WPARAM, LPARAM) mir_strcpy(fontid.prefix, "fntName");
fontid.deffontsettings.colour = GetSysColor(COLOR_MENUTEXT);
fontid.deffontsettings.style = DBFONTF_BOLD;
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
mir_wstrcpy(fontid.name, LPGENW("Second line"));
mir_strcpy(fontid.prefix, "fntSecond");
fontid.deffontsettings.colour = sttShadeColor(GetSysColor(COLOR_MENUTEXT), GetSysColor(COLOR_MENU));
fontid.deffontsettings.style = 0;
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
mir_wstrcpy(fontid.backgroundName, LPGENW("Selected background"));
@@ -200,29 +200,29 @@ int ProcessModulesLoaded(WPARAM, LPARAM) mir_strcpy(fontid.prefix, "fntNameSel");
fontid.deffontsettings.colour = GetSysColor(COLOR_HIGHLIGHTTEXT);
fontid.deffontsettings.style = DBFONTF_BOLD;
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
mir_wstrcpy(fontid.name, LPGENW("Selected second line (color)"));
mir_strcpy(fontid.prefix, "fntSecondSel");
fontid.deffontsettings.colour = sttShadeColor(GetSysColor(COLOR_HIGHLIGHTTEXT), GetSysColor(COLOR_HIGHLIGHT));
fontid.deffontsettings.style = 0;
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
/////////////////////////////////////////////////////////////////////////////////////
- ColourIDT colourid = { sizeof(colourid) };
+ ColourIDW colourid = { sizeof(colourid) };
mir_wstrcpy(colourid.group, LPGENW("Favorite Contacts"));
mir_strcpy(colourid.dbSettingsGroup, "FavContacts");
mir_wstrcpy(colourid.name, LPGENW("Background"));
mir_strcpy(colourid.setting, "BackColour");
colourid.defcolour = GetSysColor(COLOR_MENU);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
mir_wstrcpy(colourid.name, LPGENW("Selected background"));
mir_strcpy(colourid.setting, "SelectedColour");
colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
HookEvent(ME_FONT_RELOAD, ProcessReloadFonts);
HookEvent(ME_COLOUR_RELOAD, ProcessReloadFonts);
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp index 3d0f14b90c..0ec2887af0 100644 --- a/plugins/FingerprintNG/src/fingerprint.cpp +++ b/plugins/FingerprintNG/src/fingerprint.cpp @@ -79,7 +79,7 @@ void __fastcall Prepare(KN_FP_MASK* mask, bool bEnable) return; SKINICONDESC sid = { 0 }; - sid.flags = SIDF_ALL_TCHAR; + sid.flags = SIDF_ALL_UNICODE; sid.section.w = SectName; sid.pszName = mask->szIconName; sid.description.w = mask->szClientDescription; @@ -144,7 +144,7 @@ static void SetSrmmIcon(MCONTACT hContact, LPTSTR ptszMirver) StatusIconData sid = { sizeof(sid) }; sid.szModule = MODULENAME; sid.dwId = 1; - sid.flags = MBF_TCHAR; + sid.flags = MBF_UNICODE; sid.tszTooltip = ptszMirver; if (mir_wstrlen(ptszMirver)) @@ -843,7 +843,7 @@ int OnExtraImageApply(WPARAM hContact, LPARAM) ptrW tszMirver; char *szProto = GetContactProto(hContact); if (szProto != NULL) - tszMirver = db_get_tsa(hContact, szProto, "MirVer"); + tszMirver = db_get_wsa(hContact, szProto, "MirVer"); ApplyFingerprintImage(hContact, tszMirver); return 0; @@ -896,7 +896,7 @@ static int OnSrmmWindowEvent(WPARAM, LPARAM lParam) ptrW ptszMirVer; char *szProto = GetContactProto(event->hContact); if (szProto != NULL) - ptszMirVer = db_get_tsa(event->hContact, szProto, "MirVer"); + ptszMirVer = db_get_wsa(event->hContact, szProto, "MirVer"); SetSrmmIcon(event->hContact, ptszMirVer); arMonitoredWindows.insert((HANDLE)event->hContact); } @@ -923,7 +923,7 @@ int OnModulesLoaded(WPARAM, LPARAM) HookEvent(ME_MC_DEFAULTTCHANGED, OnExtraImageApply); - PathToAbsoluteT(DEFAULT_SKIN_FOLDER, g_szSkinLib); + PathToAbsoluteW(DEFAULT_SKIN_FOLDER, g_szSkinLib); RegisterIcons(); diff --git a/plugins/FingerprintNG/src/options.cpp b/plugins/FingerprintNG/src/options.cpp index 0aef494660..36bac46dab 100644 --- a/plugins/FingerprintNG/src/options.cpp +++ b/plugins/FingerprintNG/src/options.cpp @@ -121,7 +121,7 @@ int OnOptInitialise(WPARAM wParam, LPARAM) odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG);
odp.pwszTitle = LPGENW("Fingerprint");
odp.pfnDlgProc = DlgProcOptions;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
Options_AddPage(wParam, &odp);
return 0;
}
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index dbd018a81a..ca53b9415c 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -314,7 +314,7 @@ void SendMsgDialog(HWND hwnd, wchar_t *pText) {
ThumbInfo *pThumb = thumbList.FindThumb(hwnd);
if (pThumb != NULL)
- CallService(MS_MSG_SENDMESSAGET, (WPARAM)pThumb->hContact, (LPARAM)pText);
+ CallService(MS_MSG_SENDMESSAGEW, (WPARAM)pThumb->hContact, (LPARAM)pText);
}
static void ShowContactMenu(HWND hwnd, POINT pt)
@@ -570,7 +570,7 @@ static void CreateBackgroundBrush() }
if (db_get_b(NULL, MODULE, "BkUseBitmap", FLT_DEFAULT_BKGNDUSEBITMAP)) {
- ptrW tszBitmapName(db_get_tsa(NULL, MODULE, "BkBitmap"));
+ ptrW tszBitmapName(db_get_wsa(NULL, MODULE, "BkBitmap"));
if (tszBitmapName != NULL)
hBmpBackground = Bitmap_Load(tszBitmapName);
}
@@ -723,7 +723,7 @@ static void LoadMenus() CreateServiceFunction(MODULE "/RemoveThumb", OnContactMenu_Remove);
SET_UID(mi,0xbab83df0, 0xe126, 0x4d9a, 0xbc, 0xc3, 0x2b, 0xea, 0x84, 0x90, 0x58, 0xc8);
mi.position = 0xFFFFF;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_HIDE));
mi.name.w = LPGENW("Remove thumb");
mi.pszService = MODULE "/RemoveThumb";
diff --git a/plugins/FloatingContacts/src/options.cpp b/plugins/FloatingContacts/src/options.cpp index ecf1100007..f62b761fc4 100644 --- a/plugins/FloatingContacts/src/options.cpp +++ b/plugins/FloatingContacts/src/options.cpp @@ -180,7 +180,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP SendMessage(hwndDlg, M_REFRESHBKGBOXES, 0, 0);
{
DBVARIANT dbv;
- if (!db_get_ts(NULL, MODULE, "BkBitmap", &dbv)) {
+ if (!db_get_ws(NULL, MODULE, "BkBitmap", &dbv)) {
SetDlgItemText(hwndDlg, IDC_FILENAME, dbv.ptszVal);
db_free(&dbv);
}
@@ -303,7 +303,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP wchar_t str[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
- db_set_ts(NULL, MODULE, "BkBitmap", str);
+ db_set_ws(NULL, MODULE, "BkBitmap", str);
WORD flags = 0;
if (IsDlgButtonChecked(hwndDlg, IDC_STRETCHH))
diff --git a/plugins/Folders/src/dlg_handlers.cpp b/plugins/Folders/src/dlg_handlers.cpp index cc22e06423..ec64c90581 100644 --- a/plugins/Folders/src/dlg_handlers.cpp +++ b/plugins/Folders/src/dlg_handlers.cpp @@ -38,8 +38,8 @@ static void LoadRegisteredFolderSections(HWND hWnd) for (int i = 0; i < lstRegisteredFolders.getCount(); i++) {
CFolderItem &tmp = lstRegisteredFolders[i];
wchar_t *translated = mir_a2u(tmp.GetSection());
- if (!ContainsSection(hWnd, TranslateTS(translated))) {
- int idx = SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM)TranslateTS(translated));
+ if (!ContainsSection(hWnd, TranslateW(translated))) {
+ int idx = SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM)TranslateW(translated));
SendMessage(hwndList, LB_SETITEMDATA, idx, (LPARAM)tmp.GetSection());
}
@@ -61,7 +61,7 @@ static void LoadRegisteredFolderItems(HWND hWnd) for (int i = 0; i < lstRegisteredFolders.getCount(); i++) {
CFolderItem &item = lstRegisteredFolders[i];
if (!mir_strcmp(szSection, item.GetSection())) {
- idx = SendMessage(hwndItems, LB_ADDSTRING, 0, (LPARAM)TranslateTS(item.GetUserName()));
+ idx = SendMessage(hwndItems, LB_ADDSTRING, 0, (LPARAM)TranslateW(item.GetUserName()));
SendMessage(hwndItems, LB_SETITEMDATA, idx, (LPARAM)&item);
}
}
diff --git a/plugins/Folders/src/folderItem.cpp b/plugins/Folders/src/folderItem.cpp index 4a47eb5c7d..f277a27ec3 100644 --- a/plugins/Folders/src/folderItem.cpp +++ b/plugins/Folders/src/folderItem.cpp @@ -62,7 +62,7 @@ int CFolderItem::IsEqual(const char *section, const wchar_t *name) int CFolderItem::IsEqualTranslated(const char *trSection, const wchar_t *trName)
{
- return !mir_wstrcmp(TranslateTS(m_tszUserName), trName) && !mir_strcmp(Translate(m_szSection), trSection);
+ return !mir_wstrcmp(TranslateW(m_tszUserName), trName) && !mir_strcmp(Translate(m_szSection), trSection);
}
int CFolderItem::operator ==(const CFolderItem *other)
@@ -70,7 +70,7 @@ int CFolderItem::operator ==(const CFolderItem *other) return IsEqual(other);
}
-CMString CFolderItem::Expand()
+CMStringW CFolderItem::Expand()
{
return ExpandPath(m_tszFormat);
}
@@ -87,8 +87,8 @@ int CFolderItem::FolderCreateDirectory(int showFolder) if (m_tszFormat == NULL)
return FOLDER_SUCCESS;
- CMString buffer(ExpandPath(m_tszFormat));
- CreateDirectoryTreeT(buffer);
+ CMStringW buffer(ExpandPath(m_tszFormat));
+ CreateDirectoryTreeW(buffer);
if (showFolder)
ShellExecute(NULL, L"explore", buffer, NULL, NULL, SW_SHOW);
@@ -103,7 +103,7 @@ int CFolderItem::FolderDeleteOldDirectory(int showFolder) if (!mir_wstrcmp(m_tszFormat, m_tszOldFormat)) //format wasn't changed
return FOLDER_SUCCESS;
- CMString buffer(ExpandPath(m_tszOldFormat));
+ CMStringW buffer(ExpandPath(m_tszOldFormat));
RemoveDirectories(buffer);
int res = (DirectoryExists(buffer)) ? FOLDER_FAILURE : FOLDER_SUCCESS;
if ((res == FOLDER_FAILURE) && (showFolder))
@@ -117,7 +117,7 @@ void CFolderItem::GetDataFromDatabase(const wchar_t *szNotFound) strcpy_s(szSettingName, _countof(szSettingName), m_szSection);
strcat_s(szSettingName, _countof(szSettingName), m_szName);
- ptrW tszValue(db_get_tsa(NULL, ModuleName, szSettingName));
+ ptrW tszValue(db_get_wsa(NULL, ModuleName, szSettingName));
SetFormat(tszValue != NULL ? tszValue : szNotFound);
}
@@ -128,5 +128,5 @@ void CFolderItem::WriteDataToDatabase() strcat_s(szSettingName, sizeof(szSettingName), m_szName);
if (m_tszFormat)
- db_set_ts(NULL, ModuleName, szSettingName, m_tszFormat);
+ db_set_ws(NULL, ModuleName, szSettingName, m_tszFormat);
}
diff --git a/plugins/Folders/src/folderItem.h b/plugins/Folders/src/folderItem.h index ad02db6d12..385037b0d2 100644 --- a/plugins/Folders/src/folderItem.h +++ b/plugins/Folders/src/folderItem.h @@ -43,7 +43,7 @@ public: CFolderItem(const char *sectionName, const char *name, const wchar_t *format, const wchar_t *userName);
virtual ~CFolderItem();
- CMString Expand();
+ CMStringW Expand();
void Save();
int IsEqual(const CFolderItem *other);
diff --git a/plugins/Folders/src/services.cpp b/plugins/Folders/src/services.cpp index c05f4ee007..619723ec1b 100644 --- a/plugins/Folders/src/services.cpp +++ b/plugins/Folders/src/services.cpp @@ -67,7 +67,7 @@ INT_PTR GetPathService(WPARAM wParam, LPARAM lParam) if (data->cbSize != sizeof(FOLDERSGETDATA))
return 1;
- CMString buf(p->Expand());
+ CMStringW buf(p->Expand());
if (data->flags & FF_UNICODE)
wcsncpy_s(data->szPathT, data->nMaxPathSize, buf, _TRUNCATE);
else
@@ -79,8 +79,8 @@ INT_PTR GetPathService(WPARAM wParam, LPARAM lParam) int InitServices()
{
- CallService(MS_DB_GETPROFILEPATHT, _countof(szCurrentProfilePath), (LPARAM)szCurrentProfilePath);
- CallService(MS_DB_GETPROFILENAMET, _countof(szCurrentProfile), (LPARAM)szCurrentProfile);
+ CallService(MS_DB_GETPROFILEPATHW, _countof(szCurrentProfilePath), (LPARAM)szCurrentProfilePath);
+ CallService(MS_DB_GETPROFILENAMEW, _countof(szCurrentProfile), (LPARAM)szCurrentProfile);
wchar_t *pos = wcsrchr(szCurrentProfile, '.'); if (pos) *pos = 0;
GetModuleFileName(GetModuleHandleA("mir_app.mir"), szMirandaPath, _countof(szMirandaPath));
diff --git a/plugins/Folders/src/utils.cpp b/plugins/Folders/src/utils.cpp index f2fb0087af..61b445b5c6 100644 --- a/plugins/Folders/src/utils.cpp +++ b/plugins/Folders/src/utils.cpp @@ -20,14 +20,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-CMString ExpandPath(const wchar_t *format)
+CMStringW ExpandPath(const wchar_t *format)
{
- CMString res;
+ CMStringW res;
if (ServiceExists(MS_VARS_FORMATSTRING))
- res = VARST(ptrW(variables_parse((wchar_t*)format, NULL, NULL)));
+ res = VARSW(ptrW(variables_parse((wchar_t*)format, NULL, NULL)));
else
- res = VARST(format);
+ res = VARSW(format);
res.Replace(PROFILE_PATHT, szCurrentProfilePath);
res.Replace(CURRENT_PROFILET, szCurrentProfile);
diff --git a/plugins/Folders/src/utils.h b/plugins/Folders/src/utils.h index 4724635ce0..509546dcd6 100644 --- a/plugins/Folders/src/utils.h +++ b/plugins/Folders/src/utils.h @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef M_FOLDERS_UTILS_H
#define M_FOLDERS_UTILS_H
-CMString ExpandPath(const wchar_t *format);
+CMStringW ExpandPath(const wchar_t *format);
void RemoveDirectories(const wchar_t *szPath);
bool DirectoryExists(const wchar_t *szPath);
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index ed36ad8ac2..b84e83de92 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -997,7 +997,7 @@ static INT_PTR CALLBACK DlgProcStatsticView(HWND hwndDlg, UINT msg, WPARAM wPara void SendLinkToUser(WPARAM wParam, char *pszSrvPath)
{
string sLink = sCreateLink(pszSrvPath);
- CallService(MS_MSG_SENDMESSAGET, wParam, (LPARAM)sLink.c_str());
+ CallService(MS_MSG_SENDMESSAGEW, wParam, (LPARAM)sLink.c_str());
}
/////////////////////////////////////////////////////////////////////
@@ -1342,7 +1342,7 @@ int OptionsInitialize(WPARAM wParam, LPARAM /*lParam*/) odp.position = 900000000;
odp.hInstance = hInstance;
odp.pszTemplate = MAKEINTRESOURCE(IDD_OPT_HTTP_SERVER);
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pwszTitle = LPGENW("HTTP Server");
odp.pwszGroup = LPGENW("Network");
odp.pfnDlgProc = OptionsDlgProc;
@@ -1484,7 +1484,7 @@ void InitGuiElements() if (db_get_b(NULL, MODULE, "AddStatisticsMenuItem", 1) != 0) {
SET_UID(mi, 0x68db84c9, 0xe6b4, 0x4b4f, 0x93, 0x4b, 0xfd, 0x34, 0x2d, 0x83, 0x11, 0xe7);
mi.position = 1000085005;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.name.w = LPGENW("Show HTTP server statistics");
mi.pszService = MS_SHOW_STATISTICS_VIEW;
hShowStatisticsViewMenuItem = Menu_AddMainMenuItem(&mi);
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index e0f87a2171..3a1145bf72 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -924,7 +924,7 @@ extern "C" __declspec(dllexport) int Load() if (db_get_b(NULL, MODULE, "AddAcceptConMenuItem", 1)) {
CMenuItem mi;
SET_UID(mi, 0xf0a68784, 0xc30e, 0x4245, 0xb6, 0x2b, 0xb8, 0x71, 0x7e, 0xe6, 0xe1, 0x73);
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SHARE_NEW_FILE));
mi.position = 1000085000;
mi.name.a = LPGEN("Enable HTTP server");
diff --git a/plugins/HistoryLinkListPlus/src/linklist.cpp b/plugins/HistoryLinkListPlus/src/linklist.cpp index 0ad6c2cda1..5021b50f0f 100644 --- a/plugins/HistoryLinkListPlus/src/linklist.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist.cpp @@ -62,7 +62,7 @@ extern "C" __declspec(dllexport) int Load(void) CMenuItem mi;
SET_UID(mi, 0x2964dc6c, 0x9cf9, 0x4f20, 0x8f, 0x8a, 0xc6, 0xfe, 0xe2, 0x65, 0xac, 0xc9);
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_LINKLISTICON));
mi.name.w = LPGENW("&Create Linklist");
mi.pszService = "Linklist/MenuCommand";
diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index c267c1d03c..cd8fffbe8f 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -58,7 +58,7 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart) date[0] = 0;
time[0] = 0;
- msg = DbGetEventTextT(dbei, CP_ACP);
+ msg = DbGetEventTextW(dbei, CP_ACP);
if (msg == NULL)
return 0;
@@ -383,7 +383,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc dbe.pBlob = (PBYTE)mir_alloc(dbe.cbBlob+1);
db_event_get(actualElement->hEvent, &dbe);
dbe.pBlob[dbe.cbBlob] = 0;
- LPTSTR msg = DbGetEventTextT(&dbe, CP_ACP);
+ LPTSTR msg = DbGetEventTextW(&dbe, CP_ACP);
if ( wcsstr(msg, searchString))
filter3 = 1;
@@ -617,7 +617,7 @@ void WriteMessage(HWND hDlg, LISTELEMENT *listStart, int actLinePos) dbe.pBlob = (PBYTE)mir_alloc(dbe.cbBlob+1);
db_event_get(hEvent, &dbe);
dbe.pBlob[dbe.cbBlob] = 0;
- LPCTSTR msg = DbGetEventTextT(&dbe, CP_ACP);
+ LPCTSTR msg = DbGetEventTextW(&dbe, CP_ACP);
SetDlgItemText(hDlg, IDC_MESSAGE, NULL);
SendDlgItemMessage(hDlg, IDC_MESSAGE, EM_REPLACESEL, FALSE, (LPARAM)msg);
mir_free((void*)msg);
diff --git a/plugins/HistoryStats/src/bandctrlimpl.cpp b/plugins/HistoryStats/src/bandctrlimpl.cpp index d3ed8a4f65..0bd72c9e5a 100644 --- a/plugins/HistoryStats/src/bandctrlimpl.cpp +++ b/plugins/HistoryStats/src/bandctrlimpl.cpp @@ -461,8 +461,8 @@ int BandCtrlImpl::onBCMAddButton(BCBUTTON *pButton) id.bChecked = bool_(pButton->dwFlags & BCF_CHECKED);
id.bVisible = !(pButton->dwFlags & BCF_HIDDEN);
id.bDropDown = bool_(pButton->dwFlags & BCF_DROPDOWN);
- id.text = (pButton->dwFlags & BCF_TEXT) ? TranslateTS(pButton->m_szText) : L"";
- id.tooltip = (pButton->dwFlags & BCF_TOOLTIP) ? TranslateTS(pButton->m_szTooltip) : L"";
+ id.text = (pButton->dwFlags & BCF_TEXT) ? TranslateW(pButton->m_szText) : L"";
+ id.tooltip = (pButton->dwFlags & BCF_TOOLTIP) ? TranslateW(pButton->m_szTooltip) : L"";
id.uTTId = -1;
id.dwData = (pButton->dwFlags & BCF_DATA) ? pButton->dwData : 0;
id.bEnabled = !(pButton->dwFlags & BCF_DISABLED);
diff --git a/plugins/HistoryStats/src/canvas.cpp b/plugins/HistoryStats/src/canvas.cpp index 118534209d..945b22351b 100644 --- a/plugins/HistoryStats/src/canvas.cpp +++ b/plugins/HistoryStats/src/canvas.cpp @@ -139,5 +139,5 @@ bool Canvas::writePNG(const wchar_t* szFileName) img.hbm = m_hBmp;
img.fif = FIF_PNG;
img.tszName = (wchar_t*)szFileName;
- return CallService(MS_IMG_SAVE, (WPARAM)&img, IMGL_TCHAR) == 0;
+ return CallService(MS_IMG_SAVE, (WPARAM)&img, IMGL_WCHAR) == 0;
}
diff --git a/plugins/HistoryStats/src/column.h b/plugins/HistoryStats/src/column.h index bb03bc1291..acd99f933e 100644 --- a/plugins/HistoryStats/src/column.h +++ b/plugins/HistoryStats/src/column.h @@ -155,7 +155,7 @@ public: void setCustomTitle(const ext::string& customTitle) { m_CustomTitle = customTitle; }
const ext::string getCustomTitle() const { return m_CustomTitle; }
const ext::string getCustomTitle(const ext::string& strShort, const ext::string& strLong) const;
- ext::string getTitleForOptions() { return m_CustomTitle.empty() ? TranslateTS(getTitle()) : (m_CustomTitle + L" (" + TranslateTS(getTitle()) + L")"); }
+ ext::string getTitleForOptions() { return m_CustomTitle.empty() ? TranslateW(getTitle()) : (m_CustomTitle + L" (" + TranslateW(getTitle()) + L")"); }
void setHelpers(Statistic* pStatistic, Settings* pSettings, Settings::CharMapper* pCharMapper) { m_pStatistic = pStatistic; m_pSettings = pSettings; m_pCharMapper = pCharMapper; }
Statistic* getStatistic() const { return m_pStatistic; }
diff --git a/plugins/HistoryStats/src/column_chatduration.cpp b/plugins/HistoryStats/src/column_chatduration.cpp index 762e750d1b..96af1bc4aa 100644 --- a/plugins/HistoryStats/src/column_chatduration.cpp +++ b/plugins/HistoryStats/src/column_chatduration.cpp @@ -88,7 +88,7 @@ void ColChatDuration::impl_outputRenderHeader(ext::ostream& tos, int row, int ro if (row == 1)
{
- ext::string szLong = TranslateTS(szVisModeDesc[m_nVisMode]);
+ ext::string szLong = TranslateW(szVisModeDesc[m_nVisMode]);
writeRowspanTD(tos, getCustomTitle(TranslateT("Chat duration"), szLong) + (m_bGraph ? L"<div style=\"width: 70px;\"></div>" : L""), row, 1, rowSpan);
}
}
@@ -176,7 +176,7 @@ void ColChatDuration::impl_outputRenderRow(ext::ostream& tos, const Contact& con {
if (i != m_nVisMode)
{
- strTooltip += ext::str(ext::kformat(TranslateTS(szPrefixes[i])) % L"#{amount}" * strAll[i]);
+ strTooltip += ext::str(ext::kformat(TranslateW(szPrefixes[i])) % L"#{amount}" * strAll[i]);
++nSegments;
if (nSegments < 3)
diff --git a/plugins/HistoryStats/src/column_events.cpp b/plugins/HistoryStats/src/column_events.cpp index 1ecea2f2d5..bdee38136a 100644 --- a/plugins/HistoryStats/src/column_events.cpp +++ b/plugins/HistoryStats/src/column_events.cpp @@ -42,7 +42,7 @@ void ColEvents::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup) array_each_(i, sourceTexts)
{
- Opt.addComboItem(m_hSource, TranslateTS(sourceTexts[i]));
+ Opt.addComboItem(m_hSource, TranslateW(sourceTexts[i]));
}
Opt.setComboSelected(m_hSource, m_nSource);
@@ -71,7 +71,7 @@ void ColEvents::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) if (row == 1)
{
- writeRowspanTD(tos, getCustomTitle(TranslateTS(szShortDesc[m_nSource / 3]), TranslateTS(szSourceDesc[m_nSource])), row, 1, rowSpan);
+ writeRowspanTD(tos, getCustomTitle(TranslateW(szShortDesc[m_nSource / 3]), TranslateW(szSourceDesc[m_nSource])), row, 1, rowSpan);
}
}
diff --git a/plugins/HistoryStats/src/column_inout.cpp b/plugins/HistoryStats/src/column_inout.cpp index 67a8d7d35f..d305783e91 100644 --- a/plugins/HistoryStats/src/column_inout.cpp +++ b/plugins/HistoryStats/src/column_inout.cpp @@ -60,7 +60,7 @@ void ColInOut::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup) array_each_(i, sourceTexts)
{
- Opt.addComboItem(m_hSource, TranslateTS(sourceTexts[i]));
+ Opt.addComboItem(m_hSource, TranslateW(sourceTexts[i]));
}
Opt.setComboSelected(m_hSource , m_nSource );
@@ -107,16 +107,16 @@ void ColInOut::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) if (m_bAbsolute)
{
- strTitle = TranslateTS(szSourceDesc[m_nSource]);
+ strTitle = TranslateW(szSourceDesc[m_nSource]);
}
else
{
strTitle = str(ext::kformat(TranslateT("#{data} per #{unit}"))
- % L"#{data}" * TranslateTS(szSourceDesc[m_nSource])
- % L"#{unit}" * TranslateTS(szUnitDesc[m_nAbsTime]));
+ % L"#{data}" * TranslateW(szSourceDesc[m_nSource])
+ % L"#{unit}" * TranslateW(szUnitDesc[m_nAbsTime]));
}
- writeRowspanTD(tos, getCustomTitle(TranslateTS(szShortDesc[m_nSource / 3]), strTitle), row, 1, rowSpan);
+ writeRowspanTD(tos, getCustomTitle(TranslateW(szShortDesc[m_nSource / 3]), strTitle), row, 1, rowSpan);
}
}
diff --git a/plugins/HistoryStats/src/column_inoutgraph.cpp b/plugins/HistoryStats/src/column_inoutgraph.cpp index 288080c6fa..e448e40b73 100644 --- a/plugins/HistoryStats/src/column_inoutgraph.cpp +++ b/plugins/HistoryStats/src/column_inoutgraph.cpp @@ -150,16 +150,16 @@ void ColInOutGraph::impl_outputRenderHeader(ext::ostream& tos, int row, int rowS if (m_bAbsolute)
{
- strTitle = TranslateTS(szSourceDesc[m_nSource]);
+ strTitle = TranslateW(szSourceDesc[m_nSource]);
}
else
{
strTitle = str(ext::kformat(TranslateT("#{data} per #{unit}"))
- % L"#{data}" * TranslateTS(szSourceDesc[m_nSource])
- % L"#{unit}" * TranslateTS(szSourceUnit[m_nAbsTime]));
+ % L"#{data}" * TranslateW(szSourceDesc[m_nSource])
+ % L"#{unit}" * TranslateW(szSourceUnit[m_nAbsTime]));
}
- writeRowspanTD(tos, getCustomTitle(TranslateTS(szSourceDesc[m_nSource]), strTitle) + L"<div style=\"width: 100px;\"></div>", 1, 2, rowSpan, 2);
+ writeRowspanTD(tos, getCustomTitle(TranslateW(szSourceDesc[m_nSource]), strTitle) + L"<div style=\"width: 100px;\"></div>", 1, 2, rowSpan, 2);
}
else if (row == 2)
{
diff --git a/plugins/HistoryStats/src/column_split.cpp b/plugins/HistoryStats/src/column_split.cpp index c0b2ce3990..512875a3c0 100644 --- a/plugins/HistoryStats/src/column_split.cpp +++ b/plugins/HistoryStats/src/column_split.cpp @@ -87,7 +87,7 @@ void ColSplit::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup) array_each_(i, sourceTexts)
{
- Opt.addComboItem(m_hSource, TranslateTS(sourceTexts[i]));
+ Opt.addComboItem(m_hSource, TranslateW(sourceTexts[i]));
}
static const wchar_t* unitTexts[] = {
@@ -98,7 +98,7 @@ void ColSplit::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup) array_each_(i, unitTexts)
{
- Opt.addComboItem(m_hBlockUnit, TranslateTS(unitTexts[i]));
+ Opt.addComboItem(m_hBlockUnit, TranslateW(unitTexts[i]));
}
Opt.setComboSelected(m_hSource , 3 * m_nSource + m_nSourceType);
@@ -285,10 +285,10 @@ void ColSplit::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) {
SplitParams params = getParams();
ext::string strTitle = str(ext::kformat(TranslateT("#{type} for #{data}"))
- % L"#{type}" * TranslateTS(szTypeDesc[params.effective_vis_mode])
- % L"#{data}" * TranslateTS(szSourceDesc[3 * m_nSource + m_nSourceType]));
+ % L"#{type}" * TranslateW(szTypeDesc[params.effective_vis_mode])
+ % L"#{data}" * TranslateW(szSourceDesc[3 * m_nSource + m_nSourceType]));
- writeRowspanTD(tos, getCustomTitle(TranslateTS(szTypeDesc[params.effective_vis_mode]), strTitle) + ext::str(ext::format(L"<div style=\"width: |px;\"></div>") % (5 * params.blocks_in_column - 1)), row, 1, rowSpan);
+ writeRowspanTD(tos, getCustomTitle(TranslateW(szTypeDesc[params.effective_vis_mode]), strTitle) + ext::str(ext::format(L"<div style=\"width: |px;\"></div>") % (5 * params.blocks_in_column - 1)), row, 1, rowSpan);
}
}
@@ -427,7 +427,7 @@ void ColSplit::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, D else if (params.effective_vis_mode == 1)
{
divTitle = ext::str(ext::kformat(TranslateT("[#{day}] #{amount}"))
- % L"#{day}" * utils::stripPrefix(L"wday3:", TranslateTS(szWDayName[j]))
+ % L"#{day}" * utils::stripPrefix(L"wday3:", TranslateW(szWDayName[j]))
% L"#{amount}" * utils::intToGrouped(part_top));
}
else
diff --git a/plugins/HistoryStats/src/column_splittimeline.cpp b/plugins/HistoryStats/src/column_splittimeline.cpp index 55d8f791c3..a5b75c0918 100644 --- a/plugins/HistoryStats/src/column_splittimeline.cpp +++ b/plugins/HistoryStats/src/column_splittimeline.cpp @@ -107,7 +107,7 @@ void ColSplitTimeline::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGrou array_each_(i, sourceTexts)
{
- Opt.addComboItem(m_hSource, TranslateTS(sourceTexts[i]));
+ Opt.addComboItem(m_hSource, TranslateW(sourceTexts[i]));
}
static const wchar_t* unitTexts[] = {
@@ -118,7 +118,7 @@ void ColSplitTimeline::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGrou array_each_(i, unitTexts)
{
- Opt.addComboItem(m_hBlockUnit, TranslateTS(unitTexts[i]));
+ Opt.addComboItem(m_hBlockUnit, TranslateW(unitTexts[i]));
}
Opt.setComboSelected(m_hSource , 4 * m_nSource + m_nSourceType);
@@ -275,10 +275,10 @@ void ColSplitTimeline::impl_outputRenderHeader(ext::ostream& tos, int row, int r {
SplitParams params = getParams();
ext::string strTitle = str(ext::kformat(TranslateT("#{type} for #{data}"))
- % L"#{type}" * TranslateTS(szTypeDesc[params.effective_vis_mode])
- % L"#{data}" * TranslateTS(szSourceDesc[4 * m_nSource + m_nSourceType]));
+ % L"#{type}" * TranslateW(szTypeDesc[params.effective_vis_mode])
+ % L"#{data}" * TranslateW(szSourceDesc[4 * m_nSource + m_nSourceType]));
- writeRowspanTD(tos, getCustomTitle(TranslateTS(szTypeDesc[params.effective_vis_mode]), strTitle) + L"<div style=\"width: " + utils::intToString(m_nTimelineWidth) + L"px;\"></div>", row, 1, rowSpan);
+ writeRowspanTD(tos, getCustomTitle(TranslateW(szTypeDesc[params.effective_vis_mode]), strTitle) + L"<div style=\"width: " + utils::intToString(m_nTimelineWidth) + L"px;\"></div>", row, 1, rowSpan);
}
}
diff --git a/plugins/HistoryStats/src/column_timeline.cpp b/plugins/HistoryStats/src/column_timeline.cpp index 67e579ca0e..9c82240562 100644 --- a/plugins/HistoryStats/src/column_timeline.cpp +++ b/plugins/HistoryStats/src/column_timeline.cpp @@ -64,7 +64,7 @@ void ColTimeline::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup) array_each_(i, sourceTexts)
{
- Opt.addComboItem(m_hSource, TranslateTS(sourceTexts[i]));
+ Opt.addComboItem(m_hSource, TranslateW(sourceTexts[i]));
}
Opt.setComboSelected(m_hSource , 4 * m_nSource + m_nSourceType);
@@ -208,7 +208,7 @@ void ColTimeline::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpa if (row == 1)
{
ext::string strTitle = str(ext::kformat(TranslateT("Timeline for #{data}"))
- % L"#{data}" * TranslateTS(szSourceDesc[4 * m_nSource + m_nSourceType]));
+ % L"#{data}" * TranslateW(szSourceDesc[4 * m_nSource + m_nSourceType]));
writeRowspanTD(tos, getCustomTitle(TranslateT("Timeline"), strTitle) + L"<div style=\"width: " + utils::intToString(m_nTimelineWidth) + L"px;\"></div>", row, 1, rowSpan);
}
diff --git a/plugins/HistoryStats/src/column_wordcount.cpp b/plugins/HistoryStats/src/column_wordcount.cpp index a83f27e652..65d59fe21d 100644 --- a/plugins/HistoryStats/src/column_wordcount.cpp +++ b/plugins/HistoryStats/src/column_wordcount.cpp @@ -125,10 +125,10 @@ void ColWordCount::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSp if (row == 1)
{
ext::string strTitle = str(ext::kformat(TranslateT("#{type} for #{data}"))
- % L"#{type}" * TranslateTS(szTypeDesc[m_nVisMode])
- % L"#{data}" * TranslateTS(szSourceDesc[m_nSource]));
+ % L"#{type}" * TranslateW(szTypeDesc[m_nVisMode])
+ % L"#{data}" * TranslateW(szSourceDesc[m_nSource]));
- writeRowspanTD(tos, getCustomTitle(TranslateTS(szTypeDesc[m_nVisMode]), strTitle), row, 1, rowSpan);
+ writeRowspanTD(tos, getCustomTitle(TranslateW(szTypeDesc[m_nVisMode]), strTitle), row, 1, rowSpan);
}
}
diff --git a/plugins/HistoryStats/src/column_words.cpp b/plugins/HistoryStats/src/column_words.cpp index 7d79cb467f..b19b363913 100644 --- a/plugins/HistoryStats/src/column_words.cpp +++ b/plugins/HistoryStats/src/column_words.cpp @@ -231,10 +231,10 @@ void ColWords::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) if (row == 1)
{
ext::string strTitle = str(ext::kformat(TranslateT("#{type} for #{data}"))
- % L"#{type}" * TranslateTS(szTypeDesc[m_nVisMode])
- % L"#{data}" * TranslateTS(szSourceDesc[m_nSource]));
+ % L"#{type}" * TranslateW(szTypeDesc[m_nVisMode])
+ % L"#{data}" * TranslateW(szSourceDesc[m_nSource]));
- writeRowspanTD(tos, getCustomTitle(TranslateTS(szTypeDesc[m_nVisMode]), strTitle), row, 1, rowSpan);
+ writeRowspanTD(tos, getCustomTitle(TranslateW(szTypeDesc[m_nVisMode]), strTitle), row, 1, rowSpan);
}
}
diff --git a/plugins/HistoryStats/src/dlgfilterwords.cpp b/plugins/HistoryStats/src/dlgfilterwords.cpp index 9344e55f19..372b39d186 100644 --- a/plugins/HistoryStats/src/dlgfilterwords.cpp +++ b/plugins/HistoryStats/src/dlgfilterwords.cpp @@ -90,7 +90,7 @@ void DlgFilterWords::onWMInitDialog() HICON hIcon = reinterpret_cast<HICON>(LoadImage(g_hInst, MAKEINTRESOURCE(columnBand[i].iconId), IMAGE_ICON, OS::smIconCX(), OS::smIconCY(), 0));
DWORD dwFlags = (columnBand[i].bDisabled ? BandCtrl::BCF_DISABLED : 0);
- m_hActionButtons[i] = m_Band.addButton(dwFlags, hIcon, i, TranslateTS(columnBand[i].szTooltip));
+ m_hActionButtons[i] = m_Band.addButton(dwFlags, hIcon, i, TranslateW(columnBand[i].szTooltip));
DestroyIcon(hIcon);
}
@@ -122,7 +122,7 @@ void DlgFilterWords::onWMInitDialog() array_each_(i, szWordFilterModes)
{
- SendDlgItemMessage(m_hWnd, IDC_MODE, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(TranslateTS(szWordFilterModes[i])));
+ SendDlgItemMessage(m_hWnd, IDC_MODE, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(TranslateW(szWordFilterModes[i])));
}
SendDlgItemMessage(m_hWnd, IDC_MODE, CB_SETCURSEL, 0, 0);
diff --git a/plugins/HistoryStats/src/dlgoption_subcolumns.cpp b/plugins/HistoryStats/src/dlgoption_subcolumns.cpp index f6c635bfa0..a2ff5e6ca8 100644 --- a/plugins/HistoryStats/src/dlgoption_subcolumns.cpp +++ b/plugins/HistoryStats/src/dlgoption_subcolumns.cpp @@ -23,7 +23,7 @@ INT_PTR CALLBACK DlgOption::SubColumns::staticAddProc(HWND hDlg, UINT msg, WPARA upto_each_(i, Column::countColInfo())
{
- int nIndex = SendMessage(hWndList, LB_ADDSTRING, 0, reinterpret_cast<LPARAM>(TranslateTS(Column::getColInfo(i).m_Title)));
+ int nIndex = SendMessage(hWndList, LB_ADDSTRING, 0, reinterpret_cast<LPARAM>(TranslateW(Column::getColInfo(i).m_Title)));
SendMessage(hWndList, LB_SETITEMDATA, nIndex, i);
}
@@ -183,7 +183,7 @@ void DlgOption::SubColumns::onWMInitDialog() (columnBand[i].bDropDown ? BandCtrl::BCF_DROPDOWN : 0) |
(columnBand[i].bDisabled ? BandCtrl::BCF_DISABLED : 0);
- m_hActionButtons[i] = m_Band.addButton(dwFlags, hIcon, i, TranslateTS(columnBand[i].szTooltip));
+ m_hActionButtons[i] = m_Band.addButton(dwFlags, hIcon, i, TranslateW(columnBand[i].szTooltip));
DestroyIcon(hIcon);
}
@@ -313,7 +313,7 @@ void DlgOption::SubColumns::toggleInfo() HWND hInfo = GetDlgItem(getHWnd(), IDC_INFO);
const wchar_t* szInfoLabelText = m_bShowInfo ? LPGENW("Hide additional column info...") : LPGENW("Show additional column info...");
- SetDlgItemText(getHWnd(), IDC_INFOLABEL, TranslateTS(szInfoLabelText));
+ SetDlgItemText(getHWnd(), IDC_INFOLABEL, TranslateW(szInfoLabelText));
ShowWindow(hInfo, m_bShowInfo ? SW_SHOW : SW_HIDE);
EnableWindow(hInfo, BOOL_(m_bShowInfo));
@@ -327,7 +327,7 @@ void DlgOption::SubColumns::addCol(int nCol) getParent()->getLocalSettings().addCol(pCol);
- OptionsCtrl::Check hColCheck = m_Columns.insertCheck(NULL, TranslateTS(pCol->getTitle()), 0, reinterpret_cast<INT_PTR>(pCol));
+ OptionsCtrl::Check hColCheck = m_Columns.insertCheck(NULL, TranslateW(pCol->getTitle()), 0, reinterpret_cast<INT_PTR>(pCol));
m_Columns.checkItem(hColCheck, pCol->isEnabled());
@@ -541,7 +541,7 @@ void DlgOption::SubColumns::onBandDropDown(HANDLE hButton, INT_PTR dwData) upto_each_(i, Column::countColInfo())
{
- AppendMenu(hPopup, MF_STRING, i + 1, TranslateTS(Column::getColInfo(i).m_Title));
+ AppendMenu(hPopup, MF_STRING, i + 1, TranslateW(Column::getColInfo(i).m_Title));
}
int nCol = -1 + TrackPopupMenu(
@@ -674,7 +674,7 @@ bool DlgOption::SubColumns::configHasConflicts(HelpVec* pHelp) if (pHelp) {
pHelp->push_back(HelpPair());
- pHelp->back().first = TranslateTS(pCol->getTitle());
+ pHelp->back().first = TranslateW(pCol->getTitle());
pHelp->back().first += L": ";
pHelp->back().first += TranslateT("HTML output unsupported.");
@@ -694,7 +694,7 @@ bool DlgOption::SubColumns::configHasConflicts(HelpVec* pHelp) if (pHelp) {
pHelp->push_back(HelpPair());
- pHelp->back().first = TranslateTS(pCol->getTitle());
+ pHelp->back().first = TranslateW(pCol->getTitle());
pHelp->back().first += L": ";
if (nPNGMode == Settings::pmHTMLFallBack)
diff --git a/plugins/HistoryStats/src/dlgoption_subglobal.cpp b/plugins/HistoryStats/src/dlgoption_subglobal.cpp index ec6c21ae94..51732bfa40 100644 --- a/plugins/HistoryStats/src/dlgoption_subglobal.cpp +++ b/plugins/HistoryStats/src/dlgoption_subglobal.cpp @@ -22,12 +22,12 @@ INT_PTR CALLBACK DlgOption::SubGlobal::staticInfoProc(HWND hDlg, UINT msg, WPARA const SupportInfo& info = *reinterpret_cast<const SupportInfo*>(lParam);
SetDlgItemText(hDlg, IDC_PLUGIN, info.szPlugin);
- SetDlgItemText(hDlg, IDC_FEATURES, TranslateTS(info.szTeaser));
- SetDlgItemText(hDlg, IDC_DESCRIPTION, TranslateTS(info.szDescription));
+ SetDlgItemText(hDlg, IDC_FEATURES, TranslateW(info.szTeaser));
+ SetDlgItemText(hDlg, IDC_DESCRIPTION, TranslateW(info.szDescription));
static const WORD LinkIDs[] = { IDC_LINK2, IDC_LINK1 };
- ext::string linkTexts = TranslateTS(info.szLinkTexts);
+ ext::string linkTexts = TranslateW(info.szLinkTexts);
ext::string linkURLs = info.szLinkURLs;
int nCurLink = 0;
@@ -387,7 +387,7 @@ void DlgOption::SubGlobal::toggleInfo() HWND hInfo = GetDlgItem(getHWnd(), IDC_INFO);
const wchar_t* szInfoLabelText = m_bShowInfo ? LPGENW("HistoryStats supports several plugins. Click to hide info...") : LPGENW("HistoryStats supports several plugins. Click to learn more...");
- SetDlgItemText(getHWnd(), IDC_INFOLABEL, TranslateTS(szInfoLabelText));
+ SetDlgItemText(getHWnd(), IDC_INFOLABEL, TranslateW(szInfoLabelText));
ShowWindow(hInfo, m_bShowInfo ? SW_SHOW : SW_HIDE);
EnableWindow(hInfo, BOOL_(m_bShowInfo));
diff --git a/plugins/HistoryStats/src/dlgoption_suboutput.cpp b/plugins/HistoryStats/src/dlgoption_suboutput.cpp index 67c58f9910..97be76691a 100644 --- a/plugins/HistoryStats/src/dlgoption_suboutput.cpp +++ b/plugins/HistoryStats/src/dlgoption_suboutput.cpp @@ -188,7 +188,7 @@ void DlgOption::SubOutput::onWMInitDialog() array_each_(i, sortLevels)
{
- m_hSortBy[i] = m_Options.insertCombo(m_hSort, TranslateTS(sortLevels[i]), (i == 0) ? 0 : OptionsCtrl::OCF_DISABLECHILDSONINDEX0);
+ m_hSortBy[i] = m_Options.insertCombo(m_hSort, TranslateW(sortLevels[i]), (i == 0) ? 0 : OptionsCtrl::OCF_DISABLECHILDSONINDEX0);
if (i != 0)
{
@@ -197,7 +197,7 @@ void DlgOption::SubOutput::onWMInitDialog() array_each_(j, sortKeys)
{
- m_Options.addComboItem(m_hSortBy[i], TranslateTS(sortKeys[j].desc));
+ m_Options.addComboItem(m_hSortBy[i], TranslateW(sortKeys[j].desc));
}
m_hSortDir[i] = m_Options.insertRadio(m_hSortBy[i], NULL, TranslateT("Ascending"));
@@ -229,7 +229,7 @@ void DlgOption::SubOutput::onWMInitDialog() array_each_(i, omitData)
{
- m_Options.addComboItem(m_hOmitByValueData, TranslateTS(omitData[i]));
+ m_Options.addComboItem(m_hOmitByValueData, TranslateW(omitData[i]));
}
m_Options.ensureVisible(NULL);
diff --git a/plugins/HistoryStats/src/iconlib.cpp b/plugins/HistoryStats/src/iconlib.cpp index 7993c26a3b..d8a6dc5417 100644 --- a/plugins/HistoryStats/src/iconlib.cpp +++ b/plugins/HistoryStats/src/iconlib.cpp @@ -71,12 +71,12 @@ void IconLib::init() if (m_IconInfo[i].szSection) {
strSection += L"/";
- strSection += TranslateTS(m_IconInfo[i].szSection);
+ strSection += TranslateW(m_IconInfo[i].szSection);
}
mu::icolib::addIcon(
strSection.c_str(),
- TranslateTS(m_IconInfo[i].szDescription),
+ TranslateW(m_IconInfo[i].szDescription),
(m_IconName + m_IconInfo[i].szIconName).c_str(),
szModule,
-m_IconInfo[i].wID);
diff --git a/plugins/HistoryStats/src/mirandasettings.cpp b/plugins/HistoryStats/src/mirandasettings.cpp index e2b9bc9d49..9840e1ae0a 100644 --- a/plugins/HistoryStats/src/mirandasettings.cpp +++ b/plugins/HistoryStats/src/mirandasettings.cpp @@ -100,12 +100,12 @@ void MirandaSettings::writeDWord(const char* szSetting, int dwValue) const void MirandaSettings::writeStr(const char* szSetting, const wchar_t* szValue) const
{
- db_set_ts(m_hContact, m_strModule.c_str(), szSetting, szValue);
+ db_set_ws(m_hContact, m_strModule.c_str(), szSetting, szValue);
}
void MirandaSettings::writeStrDirect(const char* szSetting, const wchar_t* szValue) const
{
- db_set_ts(m_hContact, m_strModule.c_str(), szSetting, szValue);
+ db_set_ws(m_hContact, m_strModule.c_str(), szSetting, szValue);
}
void MirandaSettings::writeTree(const char* szSetting, const SettingsTree& value) const
diff --git a/plugins/HistoryStats/src/mu_common.cpp b/plugins/HistoryStats/src/mu_common.cpp index 7b1ee72f8d..ef5bfc66e2 100644 --- a/plugins/HistoryStats/src/mu_common.cpp +++ b/plugins/HistoryStats/src/mu_common.cpp @@ -20,7 +20,7 @@ namespace mu // TODO: support for unicode-core with unicode-aware CList
CMenuItem mi;
mi.name.w = (wchar_t*)pszName;
- mi.flags = flags | CMIF_TCHAR;
+ mi.flags = flags | CMIF_UNICODE;
mi.position = position;
mi.hIcolibItem = hIcon;
mi.pszService = const_cast<char*>(pszService);
@@ -34,7 +34,7 @@ namespace mu // TODO: support for unicode-core with unicode-aware CList
CMenuItem mi;
mi.name.w = (wchar_t*)pszName;
- mi.flags = flags | CMIF_TCHAR;
+ mi.flags = flags | CMIF_UNICODE;
mi.position = position;
mi.hIcolibItem = hIcon;
mi.pszService = const_cast<char*>(pszService);
@@ -51,12 +51,12 @@ namespace mu {
int getProfilePath(int cbName, wchar_t* pszName)
{
- return CallService(MS_DB_GETPROFILEPATHT, cbName, reinterpret_cast<LPARAM>(pszName));
+ return CallService(MS_DB_GETPROFILEPATHW, cbName, reinterpret_cast<LPARAM>(pszName));
}
int getProfileName(int cbName, wchar_t* pszName)
{
- return CallService(MS_DB_GETPROFILENAMET, cbName, reinterpret_cast<LPARAM>(pszName));
+ return CallService(MS_DB_GETPROFILENAMEW, cbName, reinterpret_cast<LPARAM>(pszName));
}
void setSafetyMode(bool safetyMode)
@@ -103,7 +103,7 @@ namespace mu sid.pszName = const_cast<char*>(szIconName);
sid.defaultFile.a = const_cast<char*>(szDefaultFile);
sid.iDefaultIndex = iDefaultIndex;
- sid.flags = SIDF_TCHAR;
+ sid.flags = SIDF_UNICODE;
IcoLib_AddIcon(&sid);
}
@@ -127,7 +127,7 @@ namespace mu odp.pszTemplate = const_cast<char*>(pszTemplate);
odp.hInstance = hInstance;
odp.pwszGroup = const_cast<wchar_t*>(pszGroup);
- odp.flags = flags | ODPF_TCHAR;
+ odp.flags = flags | ODPF_UNICODE;
odp.pwszTab = const_cast<wchar_t*>(pszTab);
Options_AddPage(addInfo, &odp);
}
diff --git a/plugins/HistoryStats/src/statistic.cpp b/plugins/HistoryStats/src/statistic.cpp index 0d9b1deea9..b064304cbf 100644 --- a/plugins/HistoryStats/src/statistic.cpp +++ b/plugins/HistoryStats/src/statistic.cpp @@ -1352,7 +1352,7 @@ bool Statistic::createStatisticsSteps() array_each_(i, stepsInfo)
{
- setProgressLabel(false, TranslateTS(stepsInfo[i].stepMsg));
+ setProgressLabel(false, TranslateW(stepsInfo[i].stepMsg));
if (!(this->*stepsInfo[i].stepFn)())
return false;
diff --git a/plugins/HistoryStats/src/utils.cpp b/plugins/HistoryStats/src/utils.cpp index b70ee4630e..bc1c1f272b 100644 --- a/plugins/HistoryStats/src/utils.cpp +++ b/plugins/HistoryStats/src/utils.cpp @@ -282,10 +282,10 @@ namespace utils strSubst = intToPadded(timeTM->tm_mon + 1, 2);
}
else if (strVar == L"MMM") {
- strSubst = stripPrefix(L"month3:", TranslateTS(szMonthName[timeTM->tm_mon % 12][0]));
+ strSubst = stripPrefix(L"month3:", TranslateW(szMonthName[timeTM->tm_mon % 12][0]));
}
else if (strVar == L"MMMM") {
- strSubst = stripPrefix(L"monthF:", TranslateTS(szMonthName[timeTM->tm_mon % 12][1]));
+ strSubst = stripPrefix(L"monthF:", TranslateW(szMonthName[timeTM->tm_mon % 12][1]));
}
else if (strVar == L"d") {
strSubst = intToString(timeTM->tm_mday);
@@ -294,13 +294,13 @@ namespace utils strSubst = intToPadded(timeTM->tm_mday, 2);
}
else if (strVar == L"ww") {
- strSubst = stripPrefix(L"wday2:", TranslateTS(szWDayName[(timeTM->tm_wday + 6) % 7][0]));
+ strSubst = stripPrefix(L"wday2:", TranslateW(szWDayName[(timeTM->tm_wday + 6) % 7][0]));
}
else if (strVar == L"www") {
- strSubst = stripPrefix(L"wday3:", TranslateTS(szWDayName[(timeTM->tm_wday + 6) % 7][1]));
+ strSubst = stripPrefix(L"wday3:", TranslateW(szWDayName[(timeTM->tm_wday + 6) % 7][1]));
}
else if (strVar == L"wwww") {
- strSubst = stripPrefix(L"wdayF:", TranslateTS(szWDayName[(timeTM->tm_wday + 6) % 7][2]));
+ strSubst = stripPrefix(L"wdayF:", TranslateW(szWDayName[(timeTM->tm_wday + 6) % 7][2]));
}
else if (strVar == L"miranda_path") {
strSubst = getMirandaPath();
@@ -895,7 +895,7 @@ namespace utils if (strMirandaPath.empty()) {
wchar_t szPath[MAX_PATH] = { 0 };
- PathToAbsoluteT(L"x", szPath);
+ PathToAbsoluteW(L"x", szPath);
strMirandaPath = extractPath(szPath);
}
diff --git a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp index 30c64f0d74..28be0ee7cb 100644 --- a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp +++ b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp @@ -128,7 +128,7 @@ int initializeOptions(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE OptDlgPg = { sizeof(OptDlgPg) };
OptDlgPg.position = 100000000;
OptDlgPg.hInstance = hInstance;
- OptDlgPg.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ OptDlgPg.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
OptDlgPg.pszTemplate = MAKEINTRESOURCEA(dlg_options);
OptDlgPg.pwszGroup = LPGENW("Customize");
OptDlgPg.pwszTitle = LPGENW("Hardware HotKeys");
diff --git a/plugins/IEHistory/src/IEHistory.cpp b/plugins/IEHistory/src/IEHistory.cpp index 5a0460db92..057a3e639c 100644 --- a/plugins/IEHistory/src/IEHistory.cpp +++ b/plugins/IEHistory/src/IEHistory.cpp @@ -78,7 +78,7 @@ extern "C" int __declspec(dllexport) Load(void) CMenuItem mi; SET_UID(mi, 0x28848d7a, 0x6995, 0x4799, 0x82, 0xd7, 0x18, 0x40, 0x3d, 0xe3, 0x71, 0xc4); mi.name.w = LPGENW("View &history"); - mi.flags = CMIF_TCHAR; + mi.flags = CMIF_UNICODE; mi.position = 1000090000; mi.hIcolibItem = hIcon; mi.pszService = MS_HISTORY_SHOWCONTACTHISTORY; diff --git a/plugins/IEHistory/src/events.cpp b/plugins/IEHistory/src/events.cpp index 67edd36a56..5d63eb25dd 100644 --- a/plugins/IEHistory/src/events.cpp +++ b/plugins/IEHistory/src/events.cpp @@ -43,7 +43,7 @@ int OnOptionsInitialize(WPARAM wParam, LPARAM) odp.pfnDlgProc = OptionsDlgProc; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_HISTORY); odp.hInstance = hInstance; - odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; + odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; Options_AddPage(wParam, &odp); return 0; } diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index 5e055c1cac..33f7a40fc2 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -439,7 +439,7 @@ int IEViewOptInit(WPARAM wParam, LPARAM) odp.hInstance = hInstance;
odp.pwszGroup = LPGENW("Message sessions");
odp.pwszTitle = LPGENW("IEView");
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pszTemplate = MAKEINTRESOURCEA(tabPages[0].dlgId);
odp.pfnDlgProc = tabPages[0].dlgProc;
odp.pwszTab = tabPages[0].tabName;
@@ -511,7 +511,7 @@ static INT_PTR CALLBACK IEViewGeneralOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w {
wchar_t* size[] = { L"320 x 205", L"480 x 385", L"560 x 349", L"640 x 390" };
for (int i = 0; i < _countof(size); ++i) {
- int item = SendDlgItemMessage(hwndDlg, IDC_EMBED_SIZE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(size[i]));
+ int item = SendDlgItemMessage(hwndDlg, IDC_EMBED_SIZE, CB_ADDSTRING, 0, (LPARAM)TranslateW(size[i]));
SendDlgItemMessage(hwndDlg, IDC_EMBED_SIZE, CB_SETITEMDATA, item, 0);
}
SendDlgItemMessage(hwndDlg, IDC_EMBED_SIZE, CB_SETCURSEL, Options::getEmbedsize(), 0);
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp index 438fa6f6ef..a1a7a3e565 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp @@ -52,14 +52,14 @@ char* TemplateHTMLBuilder::getAvatar(MCONTACT hContact, const char *szProto) MultiByteToWideChar(CP_ACP, 0, (char*)ace->szFilename, -1, tmpPath, _countof(tmpPath));
}
}
- if (!db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
+ if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) {
if (mir_wstrlen(dbv.ptszVal) > 0) {
//wchar_t *ext = wcsrchr(dbv.ptszVal, '.');
if (result == NULL) {
/* relative -> absolute */
mir_wstrcpy(tmpPath, dbv.ptszVal);
if (wcsncmp(tmpPath, L"http://", 7))
- PathToAbsoluteT(dbv.ptszVal, tmpPath);
+ PathToAbsoluteW(dbv.ptszVal, tmpPath);
result = tmpPath;
}
}
diff --git a/plugins/IEView/src/Utils.cpp b/plugins/IEView/src/Utils.cpp index 56af00067a..009c01a19e 100644 --- a/plugins/IEView/src/Utils.cpp +++ b/plugins/IEView/src/Utils.cpp @@ -25,7 +25,7 @@ wchar_t Utils::base_dir[MAX_PATH]; const wchar_t *Utils::getBaseDir()
{
- PathToAbsoluteT(L"miranda32.exe", base_dir);
+ PathToAbsoluteW(L"miranda32.exe", base_dir);
return base_dir;
}
diff --git a/plugins/IgnoreState/src/options.cpp b/plugins/IgnoreState/src/options.cpp index d6fac3275f..e34153b94f 100644 --- a/plugins/IgnoreState/src/options.cpp +++ b/plugins/IgnoreState/src/options.cpp @@ -47,7 +47,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP tvis.hInsertAfter = TVI_LAST;
tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE;
tvis.item.lParam = ii[i].type;
- tvis.item.pszText = TranslateTS(ii[i].name);
+ tvis.item.pszText = TranslateW(ii[i].name);
tvis.item.iImage = tvis.item.iSelectedImage = index;
HTREEITEM hti = TreeView_InsertItem(hTree, &tvis);
TreeView_SetCheckState(hTree, hti, checkState(ii[i].type));
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index 2db83b8a7c..b163428edb 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -77,7 +77,7 @@ void AddMessage(const wchar_t* fmt, ...) va_list args;
wchar_t msgBuf[4096];
va_start(args, fmt);
- mir_vsnwprintf(msgBuf, _countof(msgBuf), TranslateTS(fmt), args);
+ mir_vsnwprintf(msgBuf, _countof(msgBuf), TranslateW(fmt), args);
SendMessage(hdlgProgress, PROGM_ADDMESSAGE, 0, (LPARAM)msgBuf);
}
@@ -113,7 +113,7 @@ static int myGetD(MCONTACT hContact, const char *szModule, const char *szSetting static wchar_t* myGetWs(MCONTACT hContact, const char *szModule, const char *szSetting)
{
- DBVARIANT dbv = { DBVT_TCHAR };
+ DBVARIANT dbv = { DBVT_WCHAR };
return srcDb->GetContactSettingStr(hContact, szModule, szSetting, &dbv) ? NULL : dbv.ptszVal;
}
@@ -143,7 +143,7 @@ static MCONTACT HContactFromID(char *pszProtoName, char *pszSetting, wchar_t *pw for (MCONTACT hContact = dstDb->FindFirstContact(); hContact; hContact = dstDb->FindNextContact(hContact)) {
char *szProto = GetContactProto(hContact);
if (!mir_strcmp(szProto, pszProtoName)) {
- ptrW id(db_get_tsa(hContact, pszProtoName, pszSetting));
+ ptrW id(db_get_wsa(hContact, pszProtoName, pszSetting));
if (!mir_wstrcmp(pwszID, id))
return hContact;
}
@@ -500,7 +500,7 @@ bool ImportAccounts(OBJLIST<char> &arSkippedModules) if (p.tszSrcName == NULL) {
p.pa->tszAccountName = mir_a2u(p.pa->szModuleName);
itoa(800 + p.pa->iOrder, szSetting, 10);
- db_set_ts(NULL, "Protocols", szSetting, p.pa->tszAccountName);
+ db_set_ws(NULL, "Protocols", szSetting, p.pa->tszAccountName);
}
CopySettings(NULL, p.szSrcAcc, NULL, p.pa->szModuleName);
diff --git a/plugins/Import/src/miranda.cpp b/plugins/Import/src/miranda.cpp index bed803d016..a177685952 100644 --- a/plugins/Import/src/miranda.cpp +++ b/plugins/Import/src/miranda.cpp @@ -71,10 +71,10 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- VARST pfd(L"%miranda_path%\\Profiles");
- VARST pfd1(L"%miranda_path%");
- VARST pfd2(L"%miranda_profilesdir%");
- VARST pfn(L"%miranda_profilename%");
+ VARSW pfd(L"%miranda_path%\\Profiles");
+ VARSW pfd1(L"%miranda_path%");
+ VARSW pfd2(L"%miranda_profilesdir%");
+ VARSW pfn(L"%miranda_profilename%");
SearchForLists(hwndDlg, pfd2, pfn);
SearchForLists(hwndDlg, pfd1, NULL);
diff --git a/plugins/Import/src/utils.cpp b/plugins/Import/src/utils.cpp index 59adce72b9..b854ae9ab9 100644 --- a/plugins/Import/src/utils.cpp +++ b/plugins/Import/src/utils.cpp @@ -36,7 +36,7 @@ int CreateGroup(const wchar_t *group, MCONTACT hContact) if (Clist_GroupExists(group)) {
if (hContact)
- db_set_ts(hContact, "CList", "Group", group);
+ db_set_ws(hContact, "CList", "Group", group);
else
AddMessage(LPGENW("Skipping duplicate group %s."), group);
return 0;
@@ -44,7 +44,7 @@ int CreateGroup(const wchar_t *group, MCONTACT hContact) Clist_GroupCreate(NULL, group);
if (hContact)
- db_set_ts(hContact, "CList", "Group", group);
+ db_set_ws(hContact, "CList", "Group", group);
return 1;
}
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 2ccf62e6f1..51eb50200b 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -521,7 +521,7 @@ void createProcessList(void) ProcessList.szFileName = (wchar_t **)mir_alloc(count * sizeof(wchar_t *));
if (ProcessList.szFileName) {
for (int i = 0; i < count; i++)
- ProcessList.szFileName[i] = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i));
+ ProcessList.szFileName[i] = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i));
ProcessList.count = count;
}
diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index 1fdc35eae0..8296b4ea27 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -67,10 +67,10 @@ void exportThemes(const wchar_t *filename) fwprintf(fExport, TranslateT("\n; Automatically generated Keyboard Notify Theme file\n\n\n")); wchar_t *szTheme; - for (int i = 0; szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) { + for (int i = 0; szTheme = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) { fwprintf(fExport, L"[%s]\n", szTheme); mir_free(szTheme); - if (szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i))) { + if (szTheme = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i))) { fwprintf(fExport, L"%s\n\n", szTheme); mir_free(szTheme); } @@ -340,11 +340,11 @@ static INT_PTR CALLBACK DlgProcXstatusList(HWND hwndDlg, UINT msg, WPARAM wParam wchar_t szDefaultName[1024]; CUSTOM_STATUS xstatus = { 0 }; xstatus.cbSize = sizeof(CUSTOM_STATUS); - xstatus.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR; + xstatus.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_UNICODE; xstatus.ptszName = szDefaultName; xstatus.wParam = &j; CallProtoService(ProtoList.protoInfo[i].szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus); - tvis.item.pszText = TranslateTS(szDefaultName); + tvis.item.pszText = TranslateW(szDefaultName); } tvis.item.lParam = (LPARAM)j; tvis.item.iImage = tvis.item.iSelectedImage = j ? ImageList_AddIcon(hImageList, hIconAux = (HICON)CallProtoService(ProtoList.protoInfo[i].szProto, PS_GETCUSTOMSTATUSICON, (WPARAM)j, 0)) : 0; @@ -807,7 +807,7 @@ static INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wPara int i = 0; for (int j = 0; j < ProcessListAux.count; j++) if (ProcessListAux.szFileName[j]) - db_set_ts(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i++), ProcessListAux.szFileName[j]); + db_set_ws(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i++), ProcessListAux.szFileName[j]); db_set_w(NULL, KEYBDMODULE, "processcount", (WORD)i); while (!db_unset(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i++))); @@ -855,7 +855,7 @@ static INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wPar CheckDlgButton(hwndDlg, IDC_INTURN, bFlashEffect == FLASH_INTURN ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_INSEQUENCE, bFlashEffect == FLASH_INSEQUENCE ? BST_CHECKED : BST_UNCHECKED); for (int i = 0; i < 3; i++) { - int index = SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_INSERTSTRING, -1, (LPARAM)TranslateTS(OrderName[i])); + int index = SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_INSERTSTRING, -1, (LPARAM)TranslateW(OrderName[i])); if (index != CB_ERR && index != CB_ERRSPACE) SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_SETITEMDATA, (WPARAM)index, (LPARAM)i); } @@ -865,7 +865,7 @@ static INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wPar CheckDlgButton(hwndDlg, IDC_CUSTOM, bFlashEffect == FLASH_CUSTOM ? BST_CHECKED : BST_UNCHECKED); wchar_t *szTheme; - for (int i = 0; szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) { + for (int i = 0; szTheme = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) { int index = SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)szTheme); mir_free(szTheme); if (index != CB_ERR && index != CB_ERRSPACE) @@ -1001,11 +1001,11 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara SendDlgItemMessage(hwndDlg, IDC_CUSTOMSTRING, EM_LIMITTEXT, MAX_PATH, 0); wchar_t *szTheme; - for (int i = 0; szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) { + for (int i = 0; szTheme = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) { int index = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)szTheme); mir_free(szTheme); if (index != CB_ERR && index != CB_ERRSPACE) { - wchar_t *str = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i)); + wchar_t *str = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i)); if (str) SendDlgItemMessage(hwndDlg, IDC_THEME, CB_SETITEMDATA, (WPARAM)index, (LPARAM)str); } @@ -1226,7 +1226,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - if (szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", wCustomTheme))) { + if (szTheme = db_get_wsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", wCustomTheme))) { mir_wstrcpy(theme, szTheme); mir_free(szTheme); } @@ -1239,12 +1239,12 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara count = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETCOUNT, 0, 0); for (int i = 0; i < count; i++) { SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETLBTEXT, (WPARAM)i, (LPARAM)themeAux); - db_set_ts(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), themeAux); + db_set_ws(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), themeAux); wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)i, 0); if (str) - db_set_ts(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), str); + db_set_ws(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), str); else - db_set_ts(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), L""); + db_set_ws(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), L""); if (!mir_wstrcmp(theme, themeAux)) wCustomTheme = i; diff --git a/plugins/KeyboardNotify/src/utils.cpp b/plugins/KeyboardNotify/src/utils.cpp index f7d8bc4ab8..1c4920c876 100644 --- a/plugins/KeyboardNotify/src/utils.cpp +++ b/plugins/KeyboardNotify/src/utils.cpp @@ -36,8 +36,8 @@ wchar_t *getAbsoluteProfileName(wchar_t *absoluteProfileName, size_t maxLen) wchar_t profilePath[MAX_PATH+1], profileName[MAX_PATH+1];
profilePath[0] = profileName[0] = '\0';
- CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)profilePath);
- CallService(MS_DB_GETPROFILENAMET, MAX_PATH, (LPARAM)profileName);
+ CallService(MS_DB_GETPROFILEPATHW, MAX_PATH, (LPARAM)profilePath);
+ CallService(MS_DB_GETPROFILENAMEW, MAX_PATH, (LPARAM)profileName);
mir_snwprintf(absoluteProfileName, maxLen, L"%s\\%s", profilePath, profileName);
return absoluteProfileName;
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 8f7dfe7465..7dcad9e830 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -194,7 +194,7 @@ void RebuildMenu() mi.position = 500080000 + i;
mi.pszService = MS_LISTENINGTO_MAINMENU;
mi.name.w = text;
- mi.flags = CMIF_TCHAR | CMIF_UNMOVABLE
+ mi.flags = CMIF_UNICODE | CMIF_UNMOVABLE
| (ListeningToEnabled(info->proto, TRUE) ? CMIF_CHECKED : 0)
| (opts.enable_sending ? 0 : CMIF_GRAYED);
@@ -273,7 +273,7 @@ int ModulesLoaded(WPARAM, LPARAM) char *proto = GetContactProto(hContact);
if (proto != NULL) {
DBVARIANT dbv;
- if (!db_get_ts(hContact, proto, "ListeningTo", &dbv)) {
+ if (!db_get_ws(hContact, proto, "ListeningTo", &dbv)) {
if (dbv.ptszVal != NULL && dbv.ptszVal[0] != 0)
SetExtraIcon(hContact, TRUE);
@@ -287,7 +287,7 @@ int ModulesLoaded(WPARAM, LPARAM) SET_UID(mi, 0xe8e4e594, 0x255e, 0x434d, 0x83, 0x74, 0x79, 0x44, 0x1b, 0x4e, 0xe7, 0x16);
mi.position = 500080000;
mi.name.w = LPGENW("Listening to");
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = iconList[0].hIcolib;
hMainMenuGroup = Menu_AddMainMenuItem(&mi);
@@ -299,7 +299,7 @@ int ModulesLoaded(WPARAM, LPARAM) // Add all protos
SET_UID(mi, 0xc396a9dd, 0x9a00, 0x46af, 0x96, 0x2e, 0x5, 0x5a, 0xbc, 0x52, 0xfc, 0x9b);
mi.name.w = LPGENW("Send to all protocols");
- mi.flags = CMIF_TCHAR
+ mi.flags = CMIF_UNICODE
| (ListeningToEnabled(NULL, true) ? CMIF_CHECKED : 0)
| (opts.enable_sending ? 0 : CMIF_GRAYED);
proto_items.resize(1);
@@ -547,7 +547,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL) Buffer<wchar_t> msg;
ReplaceTemplate(&msg, NULL, opts.xstatus_message, fr, _countof(fr));
- ics.flags = CSSF_TCHAR | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE;
+ ics.flags = CSSF_UNICODE | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE;
ics.ptszName = name.str;
ics.ptszMessage = msg.str;
@@ -563,7 +563,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL) // Set to old text
ProtocolInfo *pi = GetProtoInfo(proto);
if (pi != NULL) {
- ics.flags = CSSF_TCHAR | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE;
+ ics.flags = CSSF_UNICODE | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE;
ics.status = &pi->old_xstatus;
ics.ptszName = pi->old_xstatus_name;
ics.ptszMessage = pi->old_xstatus_message;
@@ -600,7 +600,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL) if (!CallProtoService(proto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&ics) && status != XSTATUS_MUSIC) {
ProtocolInfo *pi = GetProtoInfo(proto);
if (pi != NULL) {
- ics.flags = CSSF_TCHAR | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE;
+ ics.flags = CSSF_UNICODE | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE;
ics.status = &pi->old_xstatus;
ics.ptszName = pi->old_xstatus_name;
ics.ptszMessage = pi->old_xstatus_message;
@@ -629,7 +629,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL) ReplaceTemplate(&msg, NULL, opts.xstatus_message, fr, _countof(fr));
status = XSTATUS_MUSIC;
- ics.flags = CSSF_TCHAR | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE;
+ ics.flags = CSSF_UNICODE | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE;
ics.status = &status;
ics.ptszName = name.str;
ics.ptszMessage = msg.str;
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index 02a83da50d..9639f2f385 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -520,7 +520,7 @@ int check() { int cnt;
for(cnt = 0; cnt <= 4; cnt++)
if(startuperror >> cnt & 1)
- ErMsgT(TranslateTS(startuperrors[cnt]));
+ ErMsgT(TranslateW(startuperrors[cnt]));
return 1;
}
@@ -985,15 +985,15 @@ static void LoadSettings() db_free(&dbv);
}
- if (!db_get_ts(NULL, PLUGINNAME, "LNFilterSender", &dbv)) {
+ if (!db_get_ws(NULL, PLUGINNAME, "LNFilterSender", &dbv)) {
wcsncpy_s(settingFilterSender, dbv.ptszVal, _TRUNCATE);
db_free(&dbv);
}
- if (!db_get_ts(NULL, PLUGINNAME, "LNFilterSubject", &dbv)) {
+ if (!db_get_ws(NULL, PLUGINNAME, "LNFilterSubject", &dbv)) {
wcsncpy_s(settingFilterSubject, dbv.ptszVal, _TRUNCATE);
db_free(&dbv);
}
- if (!db_get_ts(NULL, PLUGINNAME, "LNFilterTo", &dbv)) {
+ if (!db_get_ws(NULL, PLUGINNAME, "LNFilterTo", &dbv)) {
wcsncpy_s(settingFilterTo, dbv.ptszVal, _TRUNCATE);
db_free(&dbv);
}
@@ -1056,7 +1056,7 @@ static void SaveSettings(HWND hwndDlg) wcscat_s(settingFilterSender, _countof(settingFilterSender), text);
wcscat_s(settingFilterSender, _countof(settingFilterSender), TEXT(";"));
}
- db_set_ts(NULL, PLUGINNAME, "LNFilterSender", settingFilterSender);
+ db_set_ws(NULL, PLUGINNAME, "LNFilterSender", settingFilterSender);
settingFilterSubject[0] = 0;
for (int i = 0; i < SendDlgItemMessage(hwndDlg, IDC_FILTER_SUBJECT, CB_GETCOUNT, 0, 0); i++) {
@@ -1065,7 +1065,7 @@ static void SaveSettings(HWND hwndDlg) wcscat_s(settingFilterSubject, _countof(settingFilterSubject), text);
wcscat_s(settingFilterSubject, _countof(settingFilterSubject), TEXT(";"));
}
- db_set_ts(NULL, PLUGINNAME, "LNFilterSubject", settingFilterSubject);
+ db_set_ws(NULL, PLUGINNAME, "LNFilterSubject", settingFilterSubject);
settingFilterTo[0] = 0;
for (int i = 0; i < SendDlgItemMessage(hwndDlg, IDC_FILTER_TO, CB_GETCOUNT, 0, 0); i++) {
@@ -1074,7 +1074,7 @@ static void SaveSettings(HWND hwndDlg) wcscat_s(settingFilterTo, _countof(settingFilterTo), text);
wcscat_s(settingFilterTo, _countof(settingFilterTo), TEXT(";"));
}
- db_set_ts(NULL, PLUGINNAME, "LNFilterTo", settingFilterTo);
+ db_set_ws(NULL, PLUGINNAME, "LNFilterTo", settingFilterTo);
}
//callback function to speak with user interactions in options page
@@ -1457,7 +1457,7 @@ int LotusNotifyOptInit(WPARAM wParam, LPARAM) odp.hInstance = hInst;
odp.pwszGroup = LPGENW("Plugins");
odp.pwszTitle = _A2W(__PLUGIN_NAME);
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pwszTab = LPGENW("Connection");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_LOTUS_CONECTION);
@@ -1531,7 +1531,7 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM lParam) int cnt;
for (cnt = 0; cnt <= 4; cnt++)
if (startuperror >> cnt & 1)
- ErMsgT(TranslateTS(startuperrors[cnt]));
+ ErMsgT(TranslateW(startuperrors[cnt]));
return 1;
}
@@ -1578,7 +1578,7 @@ void checkEnvPath(wchar_t *path) if (found != NULL && (found[len] == ';' || found[len] == 0 || (found[len] == '\\' && (found[len + 1] == ';' || found[len + 1] == 0))))
return;
- _wputenv(CMString(FORMAT, L"PATH=%s;%s;", cur, path));
+ _wputenv(CMStringW(FORMAT, L"PATH=%s;%s;", cur, path));
}
//GetStatus
@@ -1642,7 +1642,7 @@ static int modulesloaded(WPARAM, LPARAM) assert(startuperror == 0);
for (cnt = 0; cnt <= 4; cnt++) {
if (startuperror >> cnt & 1)
- ErMsgT(TranslateTS(startuperrors[cnt]));
+ ErMsgT(TranslateW(startuperrors[cnt]));
}
return 0;
@@ -1699,7 +1699,7 @@ extern "C" int __declspec(dllexport) Load(void) CMenuItem mi;
SET_UID(mi, 0x4519458, 0xb55a, 0x4e22, 0xac, 0x95, 0x5e, 0xa4, 0x4d, 0x92, 0x65, 0x65);
mi.position = -0x7FFFFFFF; //on top menu position
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON1));
mi.name.w = LPGENW("&Check Lotus");
mi.pszService = "LotusNotify/MenuCommand"; //service name thet listning for menu call
@@ -1727,7 +1727,7 @@ extern "C" int __declspec(dllexport) Load(void) LoadSettings(); //read from db to variables
- SkinAddNewSoundExT("LotusNotify", LPGENW("Lotus Notify"), LPGENW("New Lotus document detected"));
+ SkinAddNewSoundExW("LotusNotify", LPGENW("Lotus Notify"), LPGENW("New Lotus document detected"));
hOptInit = HookEvent(ME_OPT_INITIALISE, LotusNotifyOptInit); //register service to hook option call
assert(hOptInit);
diff --git a/plugins/LotusNotify/src/debug.cpp b/plugins/LotusNotify/src/debug.cpp index 965538e7f4..8acf5c0a63 100644 --- a/plugins/LotusNotify/src/debug.cpp +++ b/plugins/LotusNotify/src/debug.cpp @@ -7,7 +7,7 @@ void logRegister(){ // Register netlib user for logging function
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_TCHAR | NUF_NOOPTIONS;
+ nlu.flags = NUF_UNICODE | NUF_NOOPTIONS;
nlu.szSettingsModule = PLUGINNAME;
nlu.ptszDescriptiveName = mir_a2u(PLUGINNAME);
netlibHandle = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index a71bac9998..73e72e3d88 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -331,7 +331,7 @@ BOOL MirVerExists(MCONTACT hContact) if (!szProto)
return 0;
- ptrW msg(db_get_tsa(hContact, szProto, "MirVer"));
+ ptrW msg(db_get_wsa(hContact, szProto, "MirVer"));
return mir_wstrlen(msg) != 0;
}
@@ -354,7 +354,7 @@ LPTSTR getMirVer(MCONTACT hContact) LPSTR szProto = GetContactProto(hContact);
if (!szProto) return NULL;
- LPTSTR msg = db_get_tsa(hContact, szProto, "MirVer");
+ LPTSTR msg = db_get_wsa(hContact, szProto, "MirVer");
if (msg) {
if (msg[0] != 0)
return msg;
@@ -624,11 +624,11 @@ INT_PTR onCopyStatusMsg(WPARAM wparam, LPARAM lparam) else
strncpy(par, statusMsg[i].name, _countof(par) - 1);
- LPTSTR msg = db_get_tsa(hContact, (statusMsg[i].module) ? statusMsg[i].module : module, par);
+ LPTSTR msg = db_get_wsa(hContact, (statusMsg[i].module) ? statusMsg[i].module : module, par);
if (msg) {
if (wcslen(msg)) {
if (flags & VF_SMNAME) {
- mir_wstrncat(buffer, TranslateTS(statusMsg[i].fullName), (_countof(buffer) - wcslen(buffer) - 1));
+ mir_wstrncat(buffer, TranslateW(statusMsg[i].fullName), (_countof(buffer) - wcslen(buffer) - 1));
mir_wstrncat(buffer, L": ", (_countof(buffer) - wcslen(buffer) - 1));
}
mir_wstrncat(buffer, msg, (_countof(buffer) - wcslen(buffer) - 1));
diff --git a/plugins/MessageState/src/messagestate.cpp b/plugins/MessageState/src/messagestate.cpp index 2082f67ec5..b9dee446e2 100644 --- a/plugins/MessageState/src/messagestate.cpp +++ b/plugins/MessageState/src/messagestate.cpp @@ -22,9 +22,9 @@ void SetSRMMIcon(MCONTACT hContact, SRMM_ICON_TYPE type, time_t time) StatusIconData sid = { sizeof(sid) };
sid.szModule = MODULENAME;
sid.dwId = 1;
- sid.flags = MBF_TCHAR;
+ sid.flags = MBF_UNICODE;
- CMString tszTooltip;
+ CMStringW tszTooltip;
if (type != ICON_HIDDEN)
{
@@ -43,7 +43,7 @@ void SetSRMMIcon(MCONTACT hContact, SRMM_ICON_TYPE type, time_t time) }
}
else
- tszTooltip = TranslateTS(Tooltips[type]);
+ tszTooltip = TranslateW(Tooltips[type]);
sid.tszTooltip = tszTooltip.GetBuffer();
}
diff --git a/plugins/MirFox/src/MirandaInterface.cpp b/plugins/MirFox/src/MirandaInterface.cpp index 299a3635d6..75d379347d 100644 --- a/plugins/MirFox/src/MirandaInterface.cpp +++ b/plugins/MirFox/src/MirandaInterface.cpp @@ -111,7 +111,7 @@ static int onModulesLoaded(WPARAM, LPARAM) puc.flags = PCF_TCHAR;
puc.pszName = "MirFox_Notify";
- puc.ptszDescription = TranslateT("MirFox/Notification");
+ puc.pwszDescription = TranslateT("MirFox/Notification");
puc.colorBack = RGB(173, 206, 247); //light blue
puc.colorText = GetSysColor(COLOR_WINDOWTEXT);
puc.iSeconds = 3;
@@ -119,7 +119,7 @@ static int onModulesLoaded(WPARAM, LPARAM) hPopupNotify = Popup_RegisterClass(&puc);
puc.pszName = "MirFox_Error";
- puc.ptszDescription = TranslateT("MirFox/Error");
+ puc.pwszDescription = TranslateT("MirFox/Error");
puc.colorBack = RGB(255, 128, 128); //light red
puc.colorText = GetSysColor(COLOR_WINDOWTEXT);
puc.iSeconds = 20;
diff --git a/plugins/MirFox/src/MirandaOptions.cpp b/plugins/MirFox/src/MirandaOptions.cpp index 7ea8ece4f5..20e1d42c30 100644 --- a/plugins/MirFox/src/MirandaOptions.cpp +++ b/plugins/MirFox/src/MirandaOptions.cpp @@ -145,7 +145,7 @@ INT_PTR CALLBACK DlgProcOpts_Tab1(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM MFLogger* logger = MFLogger::getInstance();
logger->log_p(L"Options. Save clientsProfilesFilterString: [%s]", mirfoxMiranda.getMirfoxData().getClientsProfilesFilterStringPtr()->c_str());
- db_set_ts(0, PLUGIN_DB_ID, "clientsProfilesFilterString", mirfoxMiranda.getMirfoxData().getClientsProfilesFilterStringPtr()->c_str());
+ db_set_ws(0, PLUGIN_DB_ID, "clientsProfilesFilterString", mirfoxMiranda.getMirfoxData().getClientsProfilesFilterStringPtr()->c_str());
//TODO fire actualization visableTo field at CSM record
diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp index a29245cff6..7a9a5e54b1 100644 --- a/plugins/MirFox/src/MirandaUtils.cpp +++ b/plugins/MirFox/src/MirandaUtils.cpp @@ -31,7 +31,7 @@ void MirandaUtils::netlibRegister(){ // Register netlib user for logging function
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_TCHAR | NUF_NOOPTIONS;
+ nlu.flags = NUF_UNICODE | NUF_NOOPTIONS;
nlu.szSettingsModule = PLUGIN_DB_ID;
nlu.ptszDescriptiveName = TranslateT("MirFox log");
@@ -343,13 +343,13 @@ int MirandaUtils::on_hook_OpenMW(WPARAM wParam, LPARAM lParam) if (param->msgBuffer != NULL){
wchar_t *msgBuffer = mir_wstrdup(param->msgBuffer->c_str());
- CallServiceSync(MS_MSG_SENDMESSAGET, (WPARAM)param->targetHandle, (LPARAM)msgBuffer);
+ CallServiceSync(MS_MSG_SENDMESSAGEW, (WPARAM)param->targetHandle, (LPARAM)msgBuffer);
mir_free(msgBuffer);
delete param->msgBuffer;
} else {
//only open window
- CallServiceSync(MS_MSG_SENDMESSAGET, (WPARAM)param->targetHandle, 0);
+ CallServiceSync(MS_MSG_SENDMESSAGEW, (WPARAM)param->targetHandle, 0);
}
// show and focus window
@@ -487,10 +487,10 @@ void MirandaUtils::translateOldDBNames() { }
DBVARIANT opt2Dbv = {0};
- INT_PTR opt2Result = db_get_s(0, OLD_PLUGIN_DB_ID, "clientsProfilesFilterString", &opt2Dbv, DBVT_TCHAR);
+ INT_PTR opt2Result = db_get_s(0, OLD_PLUGIN_DB_ID, "clientsProfilesFilterString", &opt2Dbv, DBVT_WCHAR);
if (opt2Result == 0){ //success
std::wstring clientsProfilesFilterString = opt2Dbv.pwszVal;
- db_set_ts(0, PLUGIN_DB_ID, "clientsProfilesFilterString", clientsProfilesFilterString.c_str());
+ db_set_ws(0, PLUGIN_DB_ID, "clientsProfilesFilterString", clientsProfilesFilterString.c_str());
db_unset(0, OLD_PLUGIN_DB_ID, "clientsProfilesFilterString");
logger->log(L"TranslateOldDBNames: 'clientsProfilesFilterString' db entry found and moved");
db_free(&opt2Dbv);
diff --git a/plugins/MirFox/src/MirfoxData.cpp b/plugins/MirFox/src/MirfoxData.cpp index c3369ac897..e6bcfb7c31 100644 --- a/plugins/MirFox/src/MirfoxData.cpp +++ b/plugins/MirFox/src/MirfoxData.cpp @@ -709,14 +709,14 @@ void MirfoxData::initializeOptions() //clientsProfilesFilterString
DBVARIANT opt2Dbv = {0};
- INT_PTR opt2Result = db_get_s(0, PLUGIN_DB_ID, "clientsProfilesFilterString", &opt2Dbv, DBVT_TCHAR);
+ INT_PTR opt2Result = db_get_s(0, PLUGIN_DB_ID, "clientsProfilesFilterString", &opt2Dbv, DBVT_WCHAR);
if (opt2Result == 0){ //success
//option exists in DB, get value
(* getClientsProfilesFilterStringPtr()) = opt2Dbv.pwszVal;
} else {
//option not exists in DB, set default value
(* getClientsProfilesFilterStringPtr()) = L"";
- db_set_ts(0, PLUGIN_DB_ID, "clientsProfilesFilterString", getClientsProfilesFilterStringPtr()->c_str());
+ db_set_ws(0, PLUGIN_DB_ID, "clientsProfilesFilterString", getClientsProfilesFilterStringPtr()->c_str());
}
db_free(&opt2Dbv);
diff --git a/plugins/MirLua/Modules/m_popup/src/main.cpp b/plugins/MirLua/Modules/m_popup/src/main.cpp index c169ba72e6..62d6bfb43b 100644 --- a/plugins/MirLua/Modules/m_popup/src/main.cpp +++ b/plugins/MirLua/Modules/m_popup/src/main.cpp @@ -56,8 +56,8 @@ static POPUPDATA2* MakePopupData2(lua_State *L) ppd->flags = lua_tointeger(L, -1);
lua_pop(L, 1);
- if (!(ppd->flags & PU2_TCHAR))
- ppd->flags |= PU2_TCHAR;
+ if (!(ppd->flags & PU2_UNICODE))
+ ppd->flags |= PU2_UNICODE;
lua_getfield(L, -1, "Title");
ppd->lptzTitle = mir_utf8decodeW(lua_tostring(L, -1));
diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp index 07f3c9329e..fa4a769a74 100644 --- a/plugins/MirLua/src/m_core.cpp +++ b/plugins/MirLua/src/m_core.cpp @@ -289,7 +289,7 @@ static int core_Parse(lua_State *L) char *what = (char*)luaL_checkstring(L, 1);
ptrW value(mir_utf8decodeW(what));
- lua_pushstring(L, T2Utf(VARST(value)));
+ lua_pushstring(L, T2Utf(VARSW(value)));
return 1;
}
diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp index e5b33d58a7..0eaafee37a 100644 --- a/plugins/MirLua/src/m_genmenu.cpp +++ b/plugins/MirLua/src/m_genmenu.cpp @@ -8,8 +8,8 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi) mi.flags = lua_tointeger(L, -1);
lua_pop(L, 1);
- if (!(mi.flags & CMIF_TCHAR))
- mi.flags |= CMIF_TCHAR;
+ if (!(mi.flags & CMIF_UNICODE))
+ mi.flags |= CMIF_UNICODE;
lua_getfield(L, -1, "Uid");
const char* uuid = lua_tostring(L, -1);
diff --git a/plugins/MirLua/src/m_hotkeys.cpp b/plugins/MirLua/src/m_hotkeys.cpp index c99ef4290b..e3c71cf38c 100644 --- a/plugins/MirLua/src/m_hotkeys.cpp +++ b/plugins/MirLua/src/m_hotkeys.cpp @@ -8,19 +8,19 @@ void MakeHotkey(lua_State *L, HOTKEYDESC &hk) hk.dwFlags = lua_tointeger(L, -1);
lua_pop(L, 1);
- if (!(hk.dwFlags & HKD_TCHAR))
- hk.dwFlags |= HKD_TCHAR;
+ if (!(hk.dwFlags & HKD_UNICODE))
+ hk.dwFlags |= HKD_UNICODE;
lua_getfield(L, -1, "Name");
hk.pszName = mir_utf8decodeA(luaL_checkstring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "Description");
- hk.ptszDescription = mir_utf8decodeW(lua_tostring(L, -1));
+ hk.pwszDescription = mir_utf8decodeW(lua_tostring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "Section");
- hk.ptszSection = mir_utf8decodeW(luaL_optstring(L, -1, MODULE));
+ hk.pwszSection = mir_utf8decodeW(luaL_optstring(L, -1, MODULE));
lua_pop(L, 1);
lua_getfield(L, -1, "Hotkey");
diff --git a/plugins/MirLua/src/m_icolib.cpp b/plugins/MirLua/src/m_icolib.cpp index 018931ffb7..ef8ee4ff85 100644 --- a/plugins/MirLua/src/m_icolib.cpp +++ b/plugins/MirLua/src/m_icolib.cpp @@ -14,7 +14,7 @@ static int icolib_AddIcon(lua_State *L) }
SKINICONDESC si = { 0 };
- si.flags = SIDF_ALL_TCHAR;
+ si.flags = SIDF_ALL_UNICODE;
si.pszName = mir_utf8decodeA(name);
si.description.w = description;
si.section.w = section;
diff --git a/plugins/MirLua/src/m_message.cpp b/plugins/MirLua/src/m_message.cpp index 0a56c791e3..eb99205312 100644 --- a/plugins/MirLua/src/m_message.cpp +++ b/plugins/MirLua/src/m_message.cpp @@ -34,7 +34,7 @@ static int message_Send(lua_State *L) const char *szProto = GetContactProto(hContact);
if (db_get_b(hContact, szProto, "ChatRoom", 0) == TRUE)
{
- ptrW tszChatRoom(db_get_tsa(hContact, szProto, "ChatRoomID"));
+ ptrW tszChatRoom(db_get_wsa(hContact, szProto, "ChatRoomID"));
GCDEST gcd = { szProto, tszChatRoom, GC_EVENT_SENDMESSAGE };
GCEVENT gce = { sizeof(gce), &gcd };
gce.bIsMe = TRUE;
diff --git a/plugins/MirLua/src/m_options.cpp b/plugins/MirLua/src/m_options.cpp index 6bb25cbe26..f55af0f6d0 100644 --- a/plugins/MirLua/src/m_options.cpp +++ b/plugins/MirLua/src/m_options.cpp @@ -47,11 +47,11 @@ void MakeOptionDialogPage(lua_State *L, OPTIONSDIALOGPAGE &odp) odp.hLangpack = CMLuaScript::GetScriptIdFromEnviroment(L);
lua_getfield(L, -1, "Flags");
- odp.flags = luaL_optinteger(L, -1, ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE);
+ odp.flags = luaL_optinteger(L, -1, ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE);
lua_pop(L, 1);
- if (!(odp.flags & ODPF_TCHAR))
- odp.flags |= ODPF_TCHAR;
+ if (!(odp.flags & ODPF_UNICODE))
+ odp.flags |= ODPF_UNICODE;
lua_getfield(L, -1, "Group");
odp.pwszGroup = mir_utf8decodeW(lua_tostring(L, -1));
diff --git a/plugins/MirLua/src/m_sounds.cpp b/plugins/MirLua/src/m_sounds.cpp index 0291515ee7..ea7c2a5e6a 100644 --- a/plugins/MirLua/src/m_sounds.cpp +++ b/plugins/MirLua/src/m_sounds.cpp @@ -9,10 +9,10 @@ static int sounds_AddSound(lua_State *L) SKINSOUNDDESCEX ssd = { sizeof(SKINSOUNDDESCEX) };
ssd.pszName = name;
- ssd.dwFlags = SSDF_TCHAR;
- ssd.ptszDescription = description;
- ssd.ptszSection = section;
- ssd.ptszDefaultFile = filePath;
+ ssd.dwFlags = SSDF_UNICODE;
+ ssd.pwszDescription = description;
+ ssd.pwszSection = section;
+ ssd.pwszDefaultFile = filePath;
int hScriptLangpack = CMLuaScript::GetScriptIdFromEnviroment(L);
diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp index b6c62101a6..156e957a02 100644 --- a/plugins/MirLua/src/mlua.cpp +++ b/plugins/MirLua/src/mlua.cpp @@ -27,11 +27,11 @@ void CMLua::SetPaths() lua_getglobal(L, "package");
- FoldersGetCustomPathT(g_hCLibsFolder, path, _countof(path), VARST(MIRLUA_PATHT));
+ FoldersGetCustomPathT(g_hCLibsFolder, path, _countof(path), VARSW(MIRLUA_PATHT));
lua_pushfstring(L, "%s\\?.dll", ptrA(mir_utf8encodeW(path)));
lua_setfield(L, -2, "cpath");
- FoldersGetCustomPathT(g_hScriptsFolder, path, _countof(path), VARST(MIRLUA_PATHT));
+ FoldersGetCustomPathT(g_hScriptsFolder, path, _countof(path), VARSW(MIRLUA_PATHT));
lua_pushfstring(L, "%s\\?.lua", ptrA(mir_utf8encodeW(path)));
lua_setfield(L, -2, "path");
diff --git a/plugins/MirLua/src/mlua_options.cpp b/plugins/MirLua/src/mlua_options.cpp index 524cd427bb..dca7c9f363 100644 --- a/plugins/MirLua/src/mlua_options.cpp +++ b/plugins/MirLua/src/mlua_options.cpp @@ -60,7 +60,7 @@ void CMLuaOptions::OnInitDialog() ImageList_AddIcon(hImageList, GetIcon(IDI_RELOAD));
wchar_t scriptDir[MAX_PATH], relativeScriptDir[MAX_PATH], header[MAX_PATH + 100];
- FoldersGetCustomPathT(g_hScriptsFolder, scriptDir, _countof(scriptDir), VARST(MIRLUA_PATHT));
+ FoldersGetCustomPathT(g_hScriptsFolder, scriptDir, _countof(scriptDir), VARSW(MIRLUA_PATHT));
PathToRelativeT(scriptDir, relativeScriptDir, NULL);
mir_snwprintf(header, L"%s (%s)", TranslateT("Common scripts"), relativeScriptDir);
@@ -160,7 +160,7 @@ int CMLuaOptions::OnOptionsInit(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_hInstance;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.pwszGroup = LPGENW("Services");
odp.pwszTitle = L"Lua";
odp.pwszTab = LPGENW("Scripts");
diff --git a/plugins/MirLua/src/mlua_script_loader.cpp b/plugins/MirLua/src/mlua_script_loader.cpp index 3a3d88fbc7..758422b9f4 100644 --- a/plugins/MirLua/src/mlua_script_loader.cpp +++ b/plugins/MirLua/src/mlua_script_loader.cpp @@ -26,7 +26,7 @@ void CMLuaScriptLoader::LoadScript(const wchar_t *scriptDir, const wchar_t *file void CMLuaScriptLoader::LoadScripts()
{
wchar_t scriptDir[MAX_PATH];
- FoldersGetCustomPathT(g_hScriptsFolder, scriptDir, _countof(scriptDir), VARST(MIRLUA_PATHT));
+ FoldersGetCustomPathT(g_hScriptsFolder, scriptDir, _countof(scriptDir), VARSW(MIRLUA_PATHT));
Log(L"Loading scripts from %s", scriptDir);
diff --git a/plugins/MirOTR/src/mirotrmenu.cpp b/plugins/MirOTR/src/mirotrmenu.cpp index 2629202ed3..60ee2d96aa 100644 --- a/plugins/MirOTR/src/mirotrmenu.cpp +++ b/plugins/MirOTR/src/mirotrmenu.cpp @@ -167,36 +167,36 @@ void InitMirOTRMenu(void) // menu items CMenuItem mi; - mi.flags = CMIF_DISABLED | CMIF_TCHAR; + mi.flags = CMIF_DISABLED | CMIF_UNICODE; mi.name.w = LPGENW("OTR Status"); mi.position = 0; hStatusInfoItem = AddMirOTRMenuItem(&mi, NULL); - mi.flags = CMIF_TCHAR | CMIF_NOTPRIVATE | CMIF_NOTUNVERIFIED; + mi.flags = CMIF_UNICODE | CMIF_NOTPRIVATE | CMIF_NOTUNVERIFIED; mi.name.w = LANG_MENU_START; mi.position = 100001; mi.hIcolibItem = IcoLib_GetIconHandle(ICON_UNVERIFIED); AddMirOTRMenuItem(&mi, MS_OTR_MENUSTART); - mi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE | CMIF_NOTFINISHED; + mi.flags = CMIF_UNICODE | CMIF_NOTNOTPRIVATE | CMIF_NOTFINISHED; mi.name.w = LANG_MENU_REFRESH; mi.position = 100002; mi.hIcolibItem = IcoLib_GetIconHandle(ICON_FINISHED); AddMirOTRMenuItem(&mi, MS_OTR_MENUREFRESH); - mi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE; + mi.flags = CMIF_UNICODE | CMIF_NOTNOTPRIVATE; mi.name.w = LANG_MENU_STOP; mi.position = 100003; mi.hIcolibItem = IcoLib_GetIconHandle(ICON_NOT_PRIVATE); AddMirOTRMenuItem(&mi, MS_OTR_MENUSTOP); - mi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE | CMIF_NOTFINISHED; + mi.flags = CMIF_UNICODE | CMIF_NOTNOTPRIVATE | CMIF_NOTFINISHED; mi.name.w = LANG_MENU_VERIFY; mi.position = 200001; mi.hIcolibItem = IcoLib_GetIconHandle(ICON_PRIVATE); AddMirOTRMenuItem(&mi, MS_OTR_MENUVERIFY); - mi.flags = CMIF_TCHAR | CMIF_CHECKED; + mi.flags = CMIF_UNICODE | CMIF_CHECKED; mi.name.w = LANG_MENU_TOGGLEHTML; mi.position = 300001; mi.hIcolibItem = 0; diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp index 861dec4677..d11a3ecb29 100644 --- a/plugins/MirOTR/src/options.cpp +++ b/plugins/MirOTR/src/options.cpp @@ -19,7 +19,7 @@ void SetFilenames(const wchar_t *path) { if (!path || !path[0]) return; - CreateDirectoryTreeT(path); + CreateDirectoryTreeW(path); mir_snwprintf(g_private_key_filename, L"%s\\" _A2W(PRIVATE_KEY_FILENAME), path); mir_snwprintf(g_fingerprint_store_filename, L"%s\\" _A2W(FINGERPRINT_STORE_FILENAME), path); @@ -30,7 +30,7 @@ int FoldersChanged(WPARAM, LPARAM) { wchar_t path[MAX_PATH]; if ( FoldersGetCustomPathT(hPATH_MIROTR, path, _countof(path), L"")) - SetFilenames(VARST(DATA_DIRECTORY)); + SetFilenames(VARSW(DATA_DIRECTORY)); else SetFilenames(path); @@ -47,7 +47,7 @@ void LoadFilenames() FoldersChanged(0, 0); } else { - SetFilenames( VARST(DATA_DIRECTORY)); + SetFilenames( VARSW(DATA_DIRECTORY)); ReadPrivkeyFiles(); } } @@ -822,7 +822,7 @@ static int OpenOptions(WPARAM wParam, LPARAM) odp.hInstance = hInst; odp.pwszGroup = LPGENW("Services"); odp.pwszTitle = L"OTR"; - odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; + odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.pwszTab = LANG_OPT_GENERAL; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GENERAL); diff --git a/plugins/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/src/svcs_menu.cpp index c86d81ef4f..5b9d4703d7 100644 --- a/plugins/MirOTR/src/svcs_menu.cpp +++ b/plugins/MirOTR/src/svcs_menu.cpp @@ -30,7 +30,7 @@ int StartOTR(MCONTACT hContact) { for(const wchar_t* c=MIROTR_PROTO_HELLO_MSG; *c && msgoff<msgend; *msgoff++=*c++); LCID langid = Langpack_GetDefaultLocale(); if(langid != 0x0409/*US*/ && langid != 0x1009/*CA*/ && langid != 0x0809/*GB*/){ // non english - const wchar_t* translated=TranslateTS(MIROTR_PROTO_HELLO_MSG); + const wchar_t* translated=TranslateW(MIROTR_PROTO_HELLO_MSG); if(mir_wstrcmp(MIROTR_PROTO_HELLO_MSG,translated)){ *msgoff++ = '\n'; for(const wchar_t* c=nick; *c && msgoff<msgend; *msgoff++=*c++); @@ -159,7 +159,7 @@ void InitMenu() CreateServiceFunction(MS_OTR_MENUTOGGLEHTML, SVC_ToggleHTMLOTR); CMenuItem mi; - mi.flags = CMIF_NOTOFFLINE | CMIF_TCHAR; + mi.flags = CMIF_NOTOFFLINE | CMIF_UNICODE; mi.position = -400000; SET_UID(mi, 0xAB574FAD, 0x15D8, 0x49FF, 0xB7, 0x03, 0xDA, 0x2B, 0x45, 0x46, 0xC3, 0x56); diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 436881080f..48d2c843c6 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -202,7 +202,7 @@ bool CAppletManager::Shutdown() tstring CAppletManager::TranslateString(wchar_t *szString, ...) { wchar_t out[1024]; - wchar_t *szTranslatedString = TranslateTS(szString); + wchar_t *szTranslatedString = TranslateW(szString); va_list body; va_start(body, szString); @@ -451,7 +451,7 @@ tstring CAppletManager::GetContactDisplayname(MCONTACT hContact, bool bShortened tstring CAppletManager::GetContactGroup(MCONTACT hContact) { DBVARIANT dbv; - int res = db_get_ts(hContact, "CList", "Group", &dbv); + int res = db_get_ws(hContact, "CList", "Group", &dbv); tstring strGroup = L""; if (!res) @@ -758,7 +758,7 @@ MEVENT CAppletManager::SendMessageToContact(MCONTACT hContact, tstring strMessag if (pIRCCon && db_get_b(hContact, szProto, "ChatRoom", 0) != 0) { DBVARIANT dbv; - if (db_get_ts(hContact, szProto, "Nick", &dbv)) + if (db_get_ws(hContact, szProto, "Nick", &dbv)) return NULL; GCDEST gcd = { szProto, 0, GC_EVENT_SENDMESSAGE }; @@ -1478,7 +1478,7 @@ int CAppletManager::HookStatusChanged(WPARAM wParam, LPARAM lParam) Event.strDescription = TranslateString(L"Joined %s", strName.c_str()); DBVARIANT dbv; - if (db_get_ts(Event.hContact, szProto, "Nick", &dbv)) + if (db_get_ws(Event.hContact, szProto, "Nick", &dbv)) return 0; CAppletManager::GetInstance()->CreateIRCHistory(Event.hContact, dbv.ptszVal); db_free(&dbv); @@ -1669,7 +1669,7 @@ int CAppletManager::HookSettingChanged(WPARAM hContact, LPARAM lParam) DBVARIANT dbv = { 0 }; // if the protocol nick has changed, check if a custom handle is set if (!strcmp(dbcws->szSetting, "Nick")) { - if (!db_get_ts(Event.hContact, "CList", "MyHandle", &dbv)) { + if (!db_get_ws(Event.hContact, "CList", "MyHandle", &dbv)) { // handle found, ignore this event if (dbv.pszVal && mir_strlen(dbv.pszVal) > 0) return 0; @@ -1686,7 +1686,7 @@ int CAppletManager::HookSettingChanged(WPARAM hContact, LPARAM lParam) } else { char *szProto = GetContactProto(Event.hContact); - if (db_get_ts(Event.hContact, szProto, "Nick", &dbv)) + if (db_get_ws(Event.hContact, szProto, "Nick", &dbv)) return 0; Event.strValue = dbv.ptszVal; db_free(&dbv); @@ -1700,7 +1700,7 @@ int CAppletManager::HookSettingChanged(WPARAM hContact, LPARAM lParam) else if (!strcmp(dbcws->szSetting, "Group")) { Event.eType = EVENT_CONTACT_GROUP; DBVARIANT dbv; - int res = db_get_ts(hContact, "CList", "Group", &dbv); + int res = db_get_ws(hContact, "CList", "Group", &dbv); if (!res) Event.strValue = dbv.ptszVal; db_free(&dbv); diff --git a/plugins/MirandaG15/src/CConfig.cpp b/plugins/MirandaG15/src/CConfig.cpp index 5903b8f2ca..e5c6f687ca 100644 --- a/plugins/MirandaG15/src/CConfig.cpp +++ b/plugins/MirandaG15/src/CConfig.cpp @@ -306,7 +306,7 @@ void CConfig::SaveFontSettings(int iFont) // Name
mir_snprintf(szSetting, "Font%dName", iFont);
- db_set_ts(NULL, "MirandaG15", szSetting, m_logfont[iFont].lfFaceName);
+ db_set_ws(NULL, "MirandaG15", szSetting, m_logfont[iFont].lfFaceName);
UpdateFontSettings(iFont);
}
@@ -337,7 +337,7 @@ void CConfig::LoadFontSettings(int iFont) // Name
mir_snprintf(szSetting, "Font%dName", iFont);
DBVARIANT dbv;
- if (db_get_ts(NULL, "MirandaG15", szSetting, &dbv))
+ if (db_get_ws(NULL, "MirandaG15", szSetting, &dbv))
mir_wstrcpy(m_logfont[iFont].lfFaceName, L"Small Fonts");
else {
mir_wstrcpy(m_logfont[iFont].lfFaceName, dbv.ptszVal);
diff --git a/plugins/MobileState/src/main.cpp b/plugins/MobileState/src/main.cpp index b170f9d704..2b0cc8caf7 100644 --- a/plugins/MobileState/src/main.cpp +++ b/plugins/MobileState/src/main.cpp @@ -54,7 +54,7 @@ bool hasMobileClient(MCONTACT hContact, LPARAM) {
char *proto = GetContactProto(hContact);
- ptrW client(db_get_tsa(hContact, proto, "MirVer"));
+ ptrW client(db_get_wsa(hContact, proto, "MirVer"));
if (client) {
// Make client lower-case
wcslwr(client);
diff --git a/plugins/ModernOpt/src/modernopt.cpp b/plugins/ModernOpt/src/modernopt.cpp index 9f7716d456..4743e8394c 100644 --- a/plugins/ModernOpt/src/modernopt.cpp +++ b/plugins/ModernOpt/src/modernopt.cpp @@ -192,7 +192,7 @@ static INT_PTR CALLBACK ModernOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (g_ModernOptPages[i].bShow && g_ModernOptPages[i].bShowTab)
{
HICON hIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(g_ModernOptPages[i].iIcon), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR);
- MIcoTab_AddItem(hwndCtrl, TranslateTS(g_ModernOptPages[i].lpzTitle), hIcon, i, FALSE);
+ MIcoTab_AddItem(hwndCtrl, TranslateW(g_ModernOptPages[i].lpzTitle), hIcon, i, FALSE);
DestroyIcon(hIcon);
}
@@ -428,7 +428,7 @@ static void ModernOptUI_SelectSection(HWND hwndDlg, struct ModernOptionsData *da tvis.hParent = TVI_ROOT;
tvis.hInsertAfter = TVI_LAST;
tvis.item.mask = TVIF_IMAGE|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
- tvis.item.pszText = TranslateTS(obj->optObject.lptzSubsection);
+ tvis.item.pszText = TranslateW(obj->optObject.lptzSubsection);
tvis.item.iImage = tvis.item.iSelectedImage = obj->iTreeImageIndex;
tvis.item.lParam = i;
TreeView_InsertItem(hwndTree, &tvis);
diff --git a/plugins/ModernOpt/src/mopt_home.cpp b/plugins/ModernOpt/src/mopt_home.cpp index 53b1f3c919..17ec383e16 100644 --- a/plugins/ModernOpt/src/mopt_home.cpp +++ b/plugins/ModernOpt/src/mopt_home.cpp @@ -41,8 +41,8 @@ INT_PTR CALLBACK ModernOptHome_DlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (g_ModernOptPages[i].bShow) {
HICON hIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(g_ModernOptPages[i].iIcon), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR);
MDescButton_SetIcon(hwndCtrl, hIcon);
- MDescButton_SetTitle(hwndCtrl, TranslateTS(g_ModernOptPages[i].lpzTitle));
- MDescButton_SetDescription(hwndCtrl, TranslateTS(g_ModernOptPages[i].lpzDescription));
+ MDescButton_SetTitle(hwndCtrl, TranslateW(g_ModernOptPages[i].lpzTitle));
+ MDescButton_SetDescription(hwndCtrl, TranslateW(g_ModernOptPages[i].lpzDescription));
DestroyIcon(hIcon);
}
else ShowWindow(hwndCtrl, SW_HIDE);
diff --git a/plugins/ModernOpt/src/mopt_selector.cpp b/plugins/ModernOpt/src/mopt_selector.cpp index 24c7ebb47c..6af988e4ae 100644 --- a/plugins/ModernOpt/src/mopt_selector.cpp +++ b/plugins/ModernOpt/src/mopt_selector.cpp @@ -46,7 +46,7 @@ static void sttPreviewSkin(MODERNOPTOBJECT *obj, wchar_t *fn, LPDRAWITEMSTRUCT l return;
}
- HBITMAP hbmPreview = Bitmap_Load(CMString(fn) + L".png");
+ HBITMAP hbmPreview = Bitmap_Load(CMStringW(fn) + L".png");
if (!hbmPreview)
return;
diff --git a/plugins/MsgPopup/src/main.cpp b/plugins/MsgPopup/src/main.cpp index 01f6807f53..0d9743112e 100644 --- a/plugins/MsgPopup/src/main.cpp +++ b/plugins/MsgPopup/src/main.cpp @@ -188,7 +188,7 @@ int HookedOptions(WPARAM wParam, LPARAM) odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.pwszTitle = LPGENW("MessagePopup");
odp.pwszGroup = LPGENW("Popups");
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pfnDlgProc = OptionsDlgProc;
Options_AddPage(wParam, &odp);
}
diff --git a/plugins/MsgPopup/src/options.cpp b/plugins/MsgPopup/src/options.cpp index 20ba22d8b5..0698089b72 100644 --- a/plugins/MsgPopup/src/options.cpp +++ b/plugins/MsgPopup/src/options.cpp @@ -54,10 +54,10 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l case WM_COMMAND:
if (LOWORD(wParam) == IDC_PREVIEW) {
- MessageBox(0, TranslateT("Message with question"), TranslateTS(_A2W(SERVICENAME) L" - demo"), MB_ICONQUESTION);
- MessageBox(0, TranslateT("Message with exclamation"), TranslateTS(_A2W(SERVICENAME) L" - demo"), MB_ICONEXCLAMATION);
- MessageBox(0, TranslateT("Message with error"), TranslateTS(_A2W(SERVICENAME) L" - demo"), MB_ICONSTOP);
- MessageBox(0, TranslateT("Message with asterisk"), TranslateTS(_A2W(SERVICENAME) L" - demo"), MB_ICONASTERISK);
+ MessageBox(0, TranslateT("Message with question"), TranslateW(_A2W(SERVICENAME) L" - demo"), MB_ICONQUESTION);
+ MessageBox(0, TranslateT("Message with exclamation"), TranslateW(_A2W(SERVICENAME) L" - demo"), MB_ICONEXCLAMATION);
+ MessageBox(0, TranslateT("Message with error"), TranslateW(_A2W(SERVICENAME) L" - demo"), MB_ICONSTOP);
+ MessageBox(0, TranslateT("Message with asterisk"), TranslateW(_A2W(SERVICENAME) L" - demo"), MB_ICONASTERISK);
return FALSE;
}
diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp index f8b48d7ece..a158317a01 100755 --- a/plugins/Msg_Export/src/FileViewer.cpp +++ b/plugins/Msg_Export/src/FileViewer.cpp @@ -1053,7 +1053,7 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, db_set_dw(NULL, MODULE, szFileViewDB "TEffects", dwEffects);
db_set_dw(NULL, MODULE, szFileViewDB "THeight", cf.iPointSize * 2);
db_set_dw(NULL, MODULE, szFileViewDB "TColor", cf.rgbColors);
- db_set_ts(NULL, MODULE, szFileViewDB "TFace", lf.lfFaceName);
+ db_set_ws(NULL, MODULE, szFileViewDB "TFace", lf.lfFaceName);
SetRichEditFont(hRichEdit, bUseSyntaxHL);
}
return TRUE;
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 0b3faed0f8..b09b5dae4d 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -366,7 +366,7 @@ BOOL bApplyChanges(HWND hwndDlg) if (ListView_GetItem(hMapUser, &sItem)) {
MCONTACT hUser = (MCONTACT)sItem.lParam;
if (mir_wstrlen(szTemp) > 0)
- db_set_ts(hUser, MODULE, "FileName", szTemp);
+ db_set_ws(hUser, MODULE, "FileName", szTemp);
else
db_unset(hUser, MODULE, "FileName");
@@ -1226,7 +1226,7 @@ int OptionsInitialize(WPARAM wParam, LPARAM /*lParam*/) odp.position = 100000000;
odp.hInstance = hInstance;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MSGEXPORT);
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pwszTitle = LPGENW("Message export");
odp.pwszGroup = LPGENW("History");
odp.pwszTab = LPGENW("General");
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 686b006ffb..74bc251e71 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -465,12 +465,12 @@ bool bReadMirandaDirAndPath() {
wchar_t szDBPath[MAX_PATH], tmp[MAX_PATH];
mir_wstrcpy(szDBPath, pszDbPathError);
- PathToAbsoluteT(L"miranda32.exe", tmp);
+ PathToAbsoluteW(L"miranda32.exe", tmp);
sMirandaPath = tmp;
sMirandaPath.erase(sMirandaPath.find_last_of(L"\\"));
- CallService(MS_DB_GETPROFILEPATHT, (WPARAM)MAX_PATH - 1, (LPARAM)szDBPath);
+ CallService(MS_DB_GETPROFILEPATHW, (WPARAM)MAX_PATH - 1, (LPARAM)szDBPath);
sDBPath = szDBPath;
- CallService(MS_DB_GETPROFILENAMET, (WPARAM)MAX_PATH - 1, (LPARAM)szDBPath);
+ CallService(MS_DB_GETPROFILENAMEW, (WPARAM)MAX_PATH - 1, (LPARAM)szDBPath);
sDBPath.append(L"\\").append(szDBPath);
sDBPath.erase(sDBPath.size() - 4);
return true;
@@ -596,7 +596,7 @@ tstring GetFilePathFromUser(MCONTACT hContact) }
// Store the Filename used so that we can check if it changes.
- db_set_ts(hContact, MODULE, "PrevFileName", sNoDBPath.c_str());
+ db_set_ws(hContact, MODULE, "PrevFileName", sNoDBPath.c_str());
}
return sFilePath;
@@ -812,7 +812,7 @@ void UpdateFileToColWidth() void DisplayErrorDialog(const wchar_t *pszError, tstring& sFilePath, DBEVENTINFO * dbei)
{
- tstring sError = TranslateTS(pszError);
+ tstring sError = TranslateW(pszError);
sError += sFilePath;
sError += TranslateT("\nError: ");
sError += sGetErrorString();
@@ -1013,7 +1013,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) switch (dbei.eventType) {
case EVENTTYPE_MESSAGE:
{
- wchar_t *msg = DbGetEventTextT(&dbei, CP_ACP);
+ wchar_t *msg = DbGetEventTextW(&dbei, CP_ACP);
if (!bWriteIndentedToFile(hFile, nIndent, msg, bWriteUTF8Format)) {
DisplayErrorDialog(LPGENW("Failed to write message to the file :\n"), sFilePath, &dbei);
}
@@ -1109,7 +1109,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) for (int i = 0; i < nStringCount && pszCurBlobPos < pszEnd; i++) {
if (*pszCurBlobPos) {
if (!bWriteNewLine(hFile, nIndent) ||
- !bWriteTextToFile(hFile, TranslateTS(pszTypes[i]), bWriteUTF8Format) ||
+ !bWriteTextToFile(hFile, TranslateW(pszTypes[i]), bWriteUTF8Format) ||
!bWriteIndentedToFile(hFile, nIndent, pszCurBlobPos, bWriteUTF8Format)) {
break;
}
@@ -1414,11 +1414,11 @@ int nContactDeleted(WPARAM wparam, LPARAM /*lparam*/) void SaveSettings()
{
db_set_w(NULL, MODULE, "MaxLineWidth", (WORD)nMaxLineWidth);
- db_set_ts(NULL, MODULE, "ExportDir", sExportDir.c_str());
- db_set_ts(NULL, MODULE, "DefaultFile", sDefaultFile.c_str());
- db_set_ts(NULL, MODULE, "TimeFormat", sTimeFormat.c_str());
+ db_set_ws(NULL, MODULE, "ExportDir", sExportDir.c_str());
+ db_set_ws(NULL, MODULE, "DefaultFile", sDefaultFile.c_str());
+ db_set_ws(NULL, MODULE, "TimeFormat", sTimeFormat.c_str());
- db_set_ts(NULL, MODULE, "FileViewerPrg", sFileViewerPrg.c_str());
+ db_set_ws(NULL, MODULE, "FileViewerPrg", sFileViewerPrg.c_str());
db_set_b(NULL, MODULE, "UseInternalViewer", bUseInternalViewer());
db_set_b(NULL, MODULE, "ReplaceHistory", bReplaceHistory);
db_set_b(NULL, MODULE, "AppendNewLine", bAppendNewLine);
diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index 681c2d4f61..6005135cd8 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -113,7 +113,7 @@ int Protocol::GetStatus() wchar_t tszXStatusName[256], tszXStatusMessage[1024];
if (ProtoServiceExists(name, PS_GETCUSTOMSTATUSEX)) {
// check if custom status is set
- css.flags = CSSF_TCHAR | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE | CSSF_DEFAULT_NAME;
+ css.flags = CSSF_UNICODE | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE | CSSF_DEFAULT_NAME;
css.status = &custom_status;
css.ptszName = tszXStatusName;
css.ptszMessage = tszXStatusMessage;
@@ -132,7 +132,7 @@ int Protocol::GetStatus() lcopystr(status_name, tmp, _countof(status_name));
}
else {
- wchar_t *p = (tszXStatusName[0] != 0) ? TranslateTS(tszXStatusName) : TranslateT("<no status name>");
+ wchar_t *p = (tszXStatusName[0] != 0) ? TranslateW(tszXStatusName) : TranslateT("<no status name>");
if (tszXStatusMessage[0])
mir_snwprintf(status_name, L"%s: %s", p, tszXStatusMessage);
else
@@ -214,11 +214,11 @@ void Protocol::GetStatusMsg(int aStatus, wchar_t *msg, size_t msg_size) if (!CanGetStatusMsg())
lcopystr(msg, L"", msg_size);
else if (aStatus == status && ProtoServiceExists(name, PS_GETMYAWAYMSG)) {
- ptrW tmp((wchar_t *)CallProtoService(name, PS_GETMYAWAYMSG, 0, SGMA_TCHAR));
+ ptrW tmp((wchar_t *)CallProtoService(name, PS_GETMYAWAYMSG, 0, SGMA_UNICODE));
lcopystr(msg, tmp == NULL ? L"" : tmp, msg_size);
}
- else if (ServiceExists(MS_AWAYMSG_GETSTATUSMSGT)) {
- ptrW tmp((wchar_t *)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)aStatus, (LPARAM)name));
+ else if (ServiceExists(MS_AWAYMSG_GETSTATUSMSGW)) {
+ ptrW tmp((wchar_t *)CallService(MS_AWAYMSG_GETSTATUSMSGW, (WPARAM)aStatus, (LPARAM)name));
lcopystr(msg, tmp == NULL ? L"" : tmp, msg_size);
}
}
@@ -306,7 +306,7 @@ void Protocol::SetNick(const wchar_t *nick) return;
// Get it
- CallProtoService(name, PS_SETMYNICKNAME, SMNN_TCHAR, (LPARAM)nick);
+ CallProtoService(name, PS_SETMYNICKNAME, SMNN_UNICODE, (LPARAM)nick);
}
bool Protocol::CanSetAvatar()
@@ -343,7 +343,7 @@ wchar_t *Protocol::GetListeningTo() }
DBVARIANT dbv = { 0 };
- if (db_get_ts(NULL, name, "ListeningTo", &dbv)) {
+ if (db_get_ws(NULL, name, "ListeningTo", &dbv)) {
lcopystr(listening_to, L"", _countof(listening_to));
return listening_to;
}
@@ -460,7 +460,7 @@ void ProtocolArray::SetNicks(const wchar_t *nick) mir_wstrncpy(default_nick, nick, _countof(default_nick));
- db_set_ts(0, MODULE_NAME, SETTING_DEFAULT_NICK, nick);
+ db_set_ws(0, MODULE_NAME, SETTING_DEFAULT_NICK, nick);
for (int i = 0; i < buffer_len; i++)
buffer[i]->SetNick(default_nick);
@@ -480,11 +480,11 @@ void ProtocolArray::SetStatusMsgs(const wchar_t *message) void ProtocolArray::SetStatusMsgs(int status, const wchar_t *message)
{
- db_set_ts(NULL, "SRAway", StatusModeToDbSetting(status, "Msg"), message);
+ db_set_ws(NULL, "SRAway", StatusModeToDbSetting(status, "Msg"), message);
// Save default also
if (!db_get_b(NULL, "SRAway", StatusModeToDbSetting(status, "UsePrev"), 0))
- db_set_ts(NULL, "SRAway", StatusModeToDbSetting(status, "Default"), message);
+ db_set_ws(NULL, "SRAway", StatusModeToDbSetting(status, "Default"), message);
for (int i = 0; i < buffer_len; i++)
if (buffer[i]->status == status)
@@ -493,7 +493,7 @@ void ProtocolArray::SetStatusMsgs(int status, const wchar_t *message) void ProtocolArray::GetDefaultNick()
{
- ptrW tszNick(db_get_tsa(0, MODULE_NAME, SETTING_DEFAULT_NICK));
+ ptrW tszNick(db_get_wsa(0, MODULE_NAME, SETTING_DEFAULT_NICK));
if (tszNick)
mir_wstrncpy(default_nick, tszNick, _countof(default_nick));
else
@@ -502,7 +502,7 @@ void ProtocolArray::GetDefaultNick() void ProtocolArray::GetDefaultAvatar()
{
- ptrW tszFile(db_get_tsa(0, "ContactPhoto", "File"));
+ ptrW tszFile(db_get_wsa(0, "ContactPhoto", "File"));
if (tszFile)
mir_wstrncpy(default_avatar_file, tszFile, _countof(default_avatar_file));
else
@@ -521,7 +521,7 @@ wchar_t *ProtocolArray::GetDefaultStatusMsg(int status) if (status == ID_STATUS_CONNECTING)
status = ID_STATUS_OFFLINE;
- wchar_t *tmp = (wchar_t *)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)status, 0);
+ wchar_t *tmp = (wchar_t *)CallService(MS_AWAYMSG_GETSTATUSMSGW, (WPARAM)status, 0);
if (tmp != NULL) {
mir_wstrncpy(default_status_message, tmp, _countof(default_status_message));
mir_free(tmp);
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index b392bbc185..3ab2d647e4 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -62,7 +62,7 @@ HGENMENU hMenuShowHideFrame = 0; #define FONT_LISTENING_TO 4
#define NUM_FONTS 5
-FontIDT font_id[NUM_FONTS];
+FontIDW font_id[NUM_FONTS];
HFONT hFont[NUM_FONTS];
COLORREF font_colour[NUM_FONTS];
@@ -198,7 +198,7 @@ int ReloadFont(WPARAM, LPARAM) DeleteObject(hFont[i]);
LOGFONT log_font;
- font_colour[i] = CallService(MS_FONT_GETT, (WPARAM)&font_id[i], (LPARAM)&log_font);
+ font_colour[i] = CallService(MS_FONT_GETW, (WPARAM)&font_id[i], (LPARAM)&log_font);
hFont[i] = CreateFontIndirect(&log_font);
}
@@ -233,7 +233,7 @@ int CreateFrame() for (int i = 0; i < NUM_FONTS; i++) {
memset(&font_id[i], 0, sizeof(font_id[i]));
- font_id[i].cbSize = sizeof(FontIDT);
+ font_id[i].cbSize = sizeof(FontIDW);
mir_wstrncpy(font_id[i].group, LPGENW("My details"), _countof(font_id[i].group));
mir_wstrncpy(font_id[i].name, font_names[i], _countof(font_id[i].name));
mir_strncpy(font_id[i].dbSettingsGroup, MODULE_NAME, _countof(font_id[i].dbSettingsGroup));
@@ -249,7 +249,7 @@ int CreateFrame() mir_wstrncpy(font_id[i].deffontsettings.szFace, L"Tahoma", _countof(font_id[i].deffontsettings.szFace));
font_id[i].order = i;
font_id[i].flags = FIDF_DEFAULTVALID;
- FontRegisterT(&font_id[i]);
+ FontRegisterW(&font_id[i]);
}
ReleaseDC(NULL, hdc);
@@ -282,7 +282,7 @@ int CreateFrame() Frame.hWnd = hwnd_frame;
Frame.align = alTop;
Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
- Frame.Flags = F_VISIBLE | F_SHOWTB | F_SHOWTBTIP | F_NOBORDER | F_SKINNED | F_TCHAR;
+ Frame.Flags = F_VISIBLE | F_SHOWTB | F_SHOWTBTIP | F_NOBORDER | F_SKINNED | F_UNICODE;
Frame.height = 100;
frame_id = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
@@ -332,7 +332,7 @@ int CreateFrame() Menu_ConfigureItem(mi.root, MCI_OPT_UID, "8C1C981C-4F28-4C4C-9121-544156210CE9");
SET_UID(mi, 0x69a43f1d, 0x6ebd, 0x4e41, 0xa6, 0xbd, 0x18, 0xea, 0xc4, 0x3, 0x90, 0x35);
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.position = 1;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_USERDETAILS);
mi.name.w = LPGENW("Show my details");
@@ -483,7 +483,7 @@ RECT GetRect(HDC hdc, RECT rc, const wchar_t *text, const wchar_t *def_text, Pro const wchar_t *tmp;
if (text[0] == '\0')
- tmp = TranslateTS(def_text);
+ tmp = TranslateW(def_text);
else
tmp = text;
@@ -1025,7 +1025,7 @@ void DrawTextWithRect(HDC hdc, const wchar_t *text, const wchar_t *def_text, REC {
const wchar_t *tmp;
if (text[0] == '\0')
- tmp = TranslateTS(def_text);
+ tmp = TranslateW(def_text);
else
tmp = text;
diff --git a/plugins/MyDetails/src/mydetails.cpp b/plugins/MyDetails/src/mydetails.cpp index 7688d7c586..a0b2d82d32 100644 --- a/plugins/MyDetails/src/mydetails.cpp +++ b/plugins/MyDetails/src/mydetails.cpp @@ -90,12 +90,12 @@ static int MainInit(WPARAM, LPARAM) CMenuItem mi;
SET_UID(mi, 0x73ff525d, 0x7b8, 0x49cc, 0xa2, 0xdf, 0xc5, 0xad, 0x13, 0xf3, 0x8e, 0x2d);
mi.position = 500050000;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_USERDETAILS);
mi.name.w = LPGENW("My details");
HGENMENU hMenuRoot = Menu_AddMainMenuItem(&mi);
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.root = hMenuRoot;
mi.hIcolibItem = NULL;
diff --git a/plugins/MyDetails/src/options.cpp b/plugins/MyDetails/src/options.cpp index c9be969e5c..66ad5e529f 100644 --- a/plugins/MyDetails/src/options.cpp +++ b/plugins/MyDetails/src/options.cpp @@ -168,7 +168,7 @@ int InitOptionsCallback(WPARAM wParam, LPARAM) odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTS);
odp.pwszGroup = LPGENW("Contact list");
odp.pwszTitle = LPGENW("My details");
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
Options_AddPage(wParam, &odp);
return 0;
}
diff --git a/plugins/NewAwaySysMod/src/AwayOpt.cpp b/plugins/NewAwaySysMod/src/AwayOpt.cpp index d6e0213ac0..70ef7a1389 100644 --- a/plugins/NewAwaySysMod/src/AwayOpt.cpp +++ b/plugins/NewAwaySysMod/src/AwayOpt.cpp @@ -140,13 +140,13 @@ static INT_PTR CALLBACK MessagesOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LP // init image buttons
for (int i = 0; i < _countof(Dlg1Buttons); i++) {
HWND hButton = GetDlgItem(hwndDlg, Dlg1Buttons[i].DlgItem);
- SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(Dlg1Buttons[i].Text), BATF_TCHAR);
+ SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)TranslateW(Dlg1Buttons[i].Text), BATF_UNICODE);
SendMessage(hButton, BUTTONSETASFLATBTN, TRUE, 0);
}
// now default status message buttons
for (int i = 0; i < _countof(Dlg1DefMsgDlgItems); i++) {
HWND hButton = GetDlgItem(hwndDlg, Dlg1DefMsgDlgItems[i].DlgItem);
- SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)pcli->pfnGetStatusModeDescription(Dlg1DefMsgDlgItems[i].Status, 0), BATF_TCHAR);
+ SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)pcli->pfnGetStatusModeDescription(Dlg1DefMsgDlgItems[i].Status, 0), BATF_UNICODE);
SendMessage(hButton, BUTTONSETASPUSHBTN, TRUE, 0);
SendMessage(hButton, BUTTONSETASFLATBTN, TRUE, 0);
g_OrigDefStatusButtonMsgProc = (WNDPROC)SetWindowLongPtr(hButton, GWLP_WNDPROC, (LONG_PTR)DefStatusButtonSubclassProc);
@@ -375,7 +375,7 @@ static INT_PTR CALLBACK MoreOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SendDlgItemMessage(hwndDlg, IDC_MOREOPTDLG_UPDATEMSGSPERIOD_SPIN, UDM_SETRANGE32, 30, 99999);
for (int i = 0; i < _countof(Dlg2StatusButtons); i++) {
HWND hButton = GetDlgItem(hwndDlg, Dlg2StatusButtons[i].DlgItem);
- SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)pcli->pfnGetStatusModeDescription(Dlg2StatusButtons[i].Status, 0), BATF_TCHAR);
+ SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)pcli->pfnGetStatusModeDescription(Dlg2StatusButtons[i].Status, 0), BATF_UNICODE);
SendMessage(hButton, BUTTONSETASPUSHBTN, TRUE, 0);
SendMessage(hButton, BUTTONSETASFLATBTN, TRUE, 0);
}
@@ -524,16 +524,16 @@ INT_PTR CALLBACK AutoreplyOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l };
for (int i = 0; i < _countof(IdleComboValues); i++)
- SendMessage(hCombo, CB_SETITEMDATA, SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateTS(IdleComboValues[i].Text)), IdleComboValues[i].Meaning);
+ SendMessage(hCombo, CB_SETITEMDATA, SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)TranslateW(IdleComboValues[i].Text)), IdleComboValues[i].Meaning);
for (int i = 0; i < _countof(Dlg3StatusButtons); i++) {
HWND hButton = GetDlgItem(hwndDlg, Dlg3StatusButtons[i].DlgItem);
- SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)pcli->pfnGetStatusModeDescription(Dlg3StatusButtons[i].Status, 0), BATF_TCHAR);
+ SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)pcli->pfnGetStatusModeDescription(Dlg3StatusButtons[i].Status, 0), BATF_UNICODE);
SendMessage(hButton, BUTTONSETASPUSHBTN, TRUE, 0);
SendMessage(hButton, BUTTONSETASFLATBTN, TRUE, 0);
}
HWND hButton = GetDlgItem(hwndDlg, IDC_REPLYDLG_VARS);
- SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Open Variables help dialog"), BATF_TCHAR);
+ SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Open Variables help dialog"), BATF_UNICODE);
SendMessage(hButton, BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(hwndDlg, IDC_MOREOPTDLG_EVNTMSG, BUTTONSETASTHEMEDBTN, TRUE, 0);
@@ -559,7 +559,7 @@ INT_PTR CALLBACK AutoreplyOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l ti.hwnd = hwndDlg;
for (int i = 0; i < _countof(Tooltips); i++) {
ti.uId = (UINT_PTR)GetDlgItem(hwndDlg, Tooltips[i].m_dlgItemID);
- ti.lpszText = TranslateTS(Tooltips[i].Text);
+ ti.lpszText = TranslateW(Tooltips[i].Text);
SendMessage(hWndTooltips, TTM_ADDTOOL, 0, (LPARAM)&ti);
}
SendMessage(hWndTooltips, TTM_SETMAXTIPWIDTH, 0, 500);
@@ -695,13 +695,13 @@ INT_PTR CALLBACK MessagesModernOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPA // init image buttons
for (int i = 0; i < _countof(Dlg4Buttons); i++) {
HWND hButton = GetDlgItem(hwndDlg, Dlg4Buttons[i].DlgItem);
- SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(Dlg4Buttons[i].Text), BATF_TCHAR);
+ SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)TranslateW(Dlg4Buttons[i].Text), BATF_UNICODE);
SendMessage(hButton, BUTTONSETASFLATBTN, TRUE, 0);
}
// now default status message buttons
for (int i = 0; i < _countof(Dlg4DefMsgDlgItems); i++) {
HWND hButton = GetDlgItem(hwndDlg, Dlg4DefMsgDlgItems[i].DlgItem);
- SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)pcli->pfnGetStatusModeDescription(Dlg4DefMsgDlgItems[i].Status, 0), BATF_TCHAR);
+ SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)pcli->pfnGetStatusModeDescription(Dlg4DefMsgDlgItems[i].Status, 0), BATF_UNICODE);
SendMessage(hButton, BUTTONSETASPUSHBTN, TRUE, 0);
SendMessage(hButton, BUTTONSETASFLATBTN, TRUE, 0);
g_OrigDefStatusButtonMsgProc = (WNDPROC)SetWindowLongPtr(hButton, GWLP_WNDPROC, (LONG_PTR)DefStatusButtonSubclassProc);
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index e80fa4c2c7..ff3b446ee7 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -633,7 +633,7 @@ int MirandaLoaded(WPARAM, LPARAM) CMenuItem mi;
SET_UID(mi, 0xa379c361, 0x9e3f, 0x468d, 0xb2, 0xac, 0xc4, 0x89, 0xbb, 0xfc, 0x81, 0x15);
mi.position = 1000020000;
- mi.flags = CMIF_TCHAR | CMIF_NOTOFFLINE;
+ mi.flags = CMIF_UNICODE | CMIF_NOTOFFLINE;
mi.hIcolibItem = iconList[SendOnEvent ? 1 : 0].hIcolib;
mi.name.w = SendOnEvent ? DISABLE_SOE_COMMAND : ENABLE_SOE_COMMAND;
mi.pszService = MS_AWAYSYS_AUTOREPLY_TOGGLE;
@@ -642,7 +642,7 @@ int MirandaLoaded(WPARAM, LPARAM) memset(&mi, 0, sizeof(mi));
SET_UID(mi, 0xd3282acc, 0x9ff1, 0x4ede, 0x8a, 0x1e, 0x36, 0x72, 0x3f, 0x44, 0x4f, 0x84);
mi.position = -2000005000;
- mi.flags = CMIF_TCHAR | CMIF_NOTOFFLINE | CMIF_HIDDEN;
+ mi.flags = CMIF_UNICODE | CMIF_NOTOFFLINE | CMIF_HIDDEN;
mi.name.w = LPGENW("Read status message"); // never seen...
mi.pszService = MS_AWAYMSG_SHOWAWAYMSG;
g_hReadStatMenuItem = Menu_AddContactMenuItem(&mi);
@@ -650,7 +650,7 @@ int MirandaLoaded(WPARAM, LPARAM) if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_USEMENUITEM)) {
memset(&mi, 0, sizeof(mi));
SET_UID(mi, 0xc42a4fdb, 0x51b8, 0x4bbe, 0x83, 0xee, 0x2d, 0x32, 0x29, 0x5c, 0x2, 0xb3);
- mi.flags = CMIF_TCHAR | CMIF_HIDDEN;
+ mi.flags = CMIF_UNICODE | CMIF_HIDDEN;
mi.name.w = LPGENW("Set status message"); // will never be shown
mi.position = 1000020000;
mi.hIcolibItem = iconList[8].hIcolib;
@@ -659,14 +659,14 @@ int MirandaLoaded(WPARAM, LPARAM) memset(&mi, 0, sizeof(mi));
SET_UID(mi, 0x47a3c631, 0x8ca9, 0x4b7e, 0x84, 0x6e, 0x29, 0xbf, 0x53, 0x30, 0x6f, 0x83);
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = NULL;
mi.position = 1000020000;
mi.name.w = LPGENW("Autoreply");
g_hToggleSOEContactMenuItem = Menu_AddContactMenuItem(&mi);
UNSET_UID(mi);
- mi.flags = CMIF_TCHAR | CMIF_SYSTEM;
+ mi.flags = CMIF_UNICODE | CMIF_SYSTEM;
mi.root = g_hToggleSOEContactMenuItem;
mi.position = 1000020000;
@@ -728,11 +728,11 @@ extern "C" int __declspec(dllexport) Load(void) if (db_get_b(NULL, MOD_NAME, DB_SETTINGSVER, 0) < 1) { // change all %nas_message% variables to %extratext% if it wasn't done before
TCString Str = db_get_s(NULL, MOD_NAME, "PopupsFormat", L"");
if (Str.GetLen())
- db_set_ts(NULL, MOD_NAME, "PopupsFormat", Str.Replace(L"nas_message", L"extratext"));
+ db_set_ws(NULL, MOD_NAME, "PopupsFormat", Str.Replace(L"nas_message", L"extratext"));
Str = db_get_s(NULL, MOD_NAME, "ReplyPrefix", L"");
if (Str.GetLen())
- db_set_ts(NULL, MOD_NAME, "ReplyPrefix", Str.Replace(L"nas_message", L"extratext"));
+ db_set_ws(NULL, MOD_NAME, "ReplyPrefix", Str.Replace(L"nas_message", L"extratext"));
}
if (db_get_b(NULL, MOD_NAME, DB_SETTINGSVER, 0) < 2) { // disable autoreply for not-on-list contacts, as such contact may be a spam bot
db_set_b(NULL, MOD_NAME, ContactStatusToDBSetting(0, DB_ENABLEREPLY, 0, INVALID_CONTACT_ID), 0);
diff --git a/plugins/NewAwaySysMod/src/CString.cpp b/plugins/NewAwaySysMod/src/CString.cpp index 83c9717ee5..727ea9fb41 100644 --- a/plugins/NewAwaySysMod/src/CString.cpp +++ b/plugins/NewAwaySysMod/src/CString.cpp @@ -279,7 +279,7 @@ CString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue)
{
- ptrW p( db_get_tsa(hContact, szModule, szSetting));
+ ptrW p( db_get_wsa(hContact, szModule, szSetting));
return TCString(p == NULL ? szDefaultValue : p);
}
diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp index a571f7f2b1..5d0c349801 100644 --- a/plugins/NewAwaySysMod/src/Client.cpp +++ b/plugins/NewAwaySysMod/src/Client.cpp @@ -128,8 +128,8 @@ void ChangeProtoMessages(char* szProto, int iMode, const TCString &Msg) for (int i = 0; i < _countof(StatusDbSettings); i++) {
if (iMode == StatusDbSettings[i].Status) {
- db_set_ts(NULL, "SRAway", CString(StatusDbSettings[i].Setting) + "Msg", CurMsg);
- db_set_ts(NULL, "SRAway", CString(StatusDbSettings[i].Setting) + "Default", CurMsg); // TODO: make it more accurate, and change not only here, but when changing status messages through UpdateMsgsTimerFunc too; and when changing messages through AutoAway() ?
+ db_set_ws(NULL, "SRAway", CString(StatusDbSettings[i].Setting) + "Msg", CurMsg);
+ db_set_ws(NULL, "SRAway", CString(StatusDbSettings[i].Setting) + "Default", CurMsg); // TODO: make it more accurate, and change not only here, but when changing status messages through UpdateMsgsTimerFunc too; and when changing messages through AutoAway() ?
break;
}
}
diff --git a/plugins/NewAwaySysMod/src/Options.cpp b/plugins/NewAwaySysMod/src/Options.cpp index 62463ea611..0a81d2f701 100644 --- a/plugins/NewAwaySysMod/src/Options.cpp +++ b/plugins/NewAwaySysMod/src/Options.cpp @@ -151,7 +151,7 @@ TCString COptItem::GetStrDBVal(const CString &sModule, CString *sDBSettingPrefix void COptItem::SetStrDBVal(const CString &sModule, TCString &Str, CString *sDBSettingPrefix)
{
if (sDBSetting != NULL && !m_bReadOnly) {
- db_set_ts(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting, Str);
+ db_set_ws(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting, Str);
}
}
@@ -331,7 +331,7 @@ void COptItem_TreeCtrl::MemToDB(const CString &sModule, CString *sDBSettingPrefi CString StrID;
_itoa(m_value[i].ID, StrID.GetBuffer(64), 10);
StrID.ReleaseBuffer();
- db_set_ts(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_TITLE + StrID, m_value[i].Title);
+ db_set_ws(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_TITLE + StrID, m_value[i].Title);
if (!(TreeFlags & TREECTRL_FLAG_IS_SINGLE_LEVEL))
db_set_w(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_PARENT + StrID, m_value[i].ParentID);
@@ -340,7 +340,7 @@ void COptItem_TreeCtrl::MemToDB(const CString &sModule, CString *sDBSettingPrefi db_set_b(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_FLAGS + StrID, m_value[i].Flags);
if (User_Str1_DBName != NULL && m_value[i].User_Str1 != NULL)
- db_set_ts(NULL, sModule, *sDBSettingPrefix + sDBSetting + User_Str1_DBName + StrID, m_value[i].User_Str1);
+ db_set_ws(NULL, sModule, *sDBSettingPrefix + sDBSetting + User_Str1_DBName + StrID, m_value[i].User_Str1);
}
COptItem::MemToDB(sModule, sDBSettingPrefix);
}
@@ -703,7 +703,7 @@ void COptItem_ListCtrl::MemToDB(const CString &sModule, CString *sDBSettingPrefi CString StrID;
_itoa(i, StrID.GetBuffer(64), 10);
StrID.ReleaseBuffer();
- db_set_ts(NULL, sModule, *sDBSettingPrefix + sDBSetting + LISTITEM_DBSTR_TEXT + StrID, m_value[i].Text);
+ db_set_ws(NULL, sModule, *sDBSettingPrefix + sDBSetting + LISTITEM_DBSTR_TEXT + StrID, m_value[i].Text);
}
COptItem::MemToDB(sModule, sDBSettingPrefix);
}
diff --git a/plugins/NewAwaySysMod/src/Path.h b/plugins/NewAwaySysMod/src/Path.h index 176f08bad7..a6356b2b6f 100644 --- a/plugins/NewAwaySysMod/src/Path.h +++ b/plugins/NewAwaySysMod/src/Path.h @@ -37,7 +37,7 @@ __inline TCString Path_ToAbsolute(TCString &Path) {
TCString Str;
Str.GetBuffer(MAX_PATH);
- PathToAbsoluteT(Path, Str);
+ PathToAbsoluteW(Path, Str);
Str.ReleaseBuffer();
return Str;
}
diff --git a/plugins/NewAwaySysMod/src/Properties.cpp b/plugins/NewAwaySysMod/src/Properties.cpp index 6e1914257c..6f1fbdef28 100644 --- a/plugins/NewAwaySysMod/src/Properties.cpp +++ b/plugins/NewAwaySysMod/src/Properties.cpp @@ -113,7 +113,7 @@ void CContactSettings::SetMsgFormat(int Flags, TCString Message) ResetContactSettingsOnStatusChange(m_hContact);
if (Message != NULL)
- db_set_ts(m_hContact, MOD_NAME, DBSetting, Message);
+ db_set_ws(m_hContact, MOD_NAME, DBSetting, Message);
else
db_unset(m_hContact, MOD_NAME, DBSetting);
}
@@ -167,10 +167,10 @@ void CProtoSettings::SetMsgFormat(int Flags, TCString Message) g_ProtoStates[szProto].TempMsg.Unset();
CString DBSetting(ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS));
if (Message != NULL)
- db_set_ts(NULL, MOD_NAME, DBSetting, Message);
+ db_set_ws(NULL, MOD_NAME, DBSetting, Message);
else {
if (!szProto)
- db_set_ts(NULL, MOD_NAME, DBSetting, CProtoSettings(NULL, Status).GetMsgFormat(GMF_LASTORDEFAULT)); // global message can't be NULL; we can use an empty string instead if it's really necessary
+ db_set_ws(NULL, MOD_NAME, DBSetting, CProtoSettings(NULL, Status).GetMsgFormat(GMF_LASTORDEFAULT)); // global message can't be NULL; we can use an empty string instead if it's really necessary
else
db_unset(NULL, MOD_NAME, DBSetting);
}
diff --git a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp index 13cf39c03b..25ee3f12f7 100644 --- a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp @@ -93,7 +93,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam ShowWindow(GetDlgItem(hwndDlg, IDC_READAWAYMSG_RETRIEVE), SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDC_READAWAYMSG_MSG), SW_SHOW);
SetDlgItemText(hwndDlg, IDOK, TranslateT("&Close"));
- db_set_ts(awayData->hContact, "CList", "StatusMsg", ptszStatusMsg);
+ db_set_ws(awayData->hContact, "CList", "StatusMsg", ptszStatusMsg);
}
break;
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index e2ec9e24a0..426e8c97b3 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -597,7 +597,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA // init image buttons
for (int i = 0; i < _countof(Buttons); i++) {
HWND hButton = GetDlgItem(hwndDlg, Buttons[i].DlgItem);
- SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(Buttons[i].Text), BATF_TCHAR);
+ SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)TranslateW(Buttons[i].Text), BATF_UNICODE);
SendMessage(hButton, BUTTONSETASFLATBTN, TRUE, 0);
}
@@ -608,7 +608,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
for (int i = 0; i < _countof(Tooltips); i++) {
ti.uId = (UINT_PTR)GetDlgItem(hwndDlg, Tooltips[i].m_dlgItemID);
- ti.lpszText = TranslateTS(Tooltips[i].Text);
+ ti.lpszText = TranslateW(Tooltips[i].Text);
SendMessage(hWndTooltips, TTM_ADDTOOL, 0, (LPARAM)&ti);
}
SendMessage(hwndDlg, UM_ICONSCHANGED, 0, 0);
@@ -1016,7 +1016,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA switch (HIWORD(wParam)) {
case EN_CHANGE:
if (LOWORD(wParam) == IDC_SAWAYMSG_MSGDATA)
- SetDlgItemText(hwndDlg, IDC_OK, TranslateTS((GetSelContactsNum(CList) > 1) ? LPGENW("Apply") : LPGENW("OK")));
+ SetDlgItemText(hwndDlg, IDC_OK, TranslateW((GetSelContactsNum(CList) > 1) ? LPGENW("Apply") : LPGENW("OK")));
break;
case EN_KILLFOCUS:
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp index 0e4cc47692..219a65bee2 100644 --- a/plugins/NewEventNotify/src/popup.cpp +++ b/plugins/NewEventNotify/src/popup.cpp @@ -373,7 +373,7 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) DBEVENTTYPEDESCR *pei = (DBEVENTTYPEDESCR*)CallService(MS_DB_EVENT_GETTYPE, (WPARAM)dbei->szModule, (LPARAM)dbei->eventType);
// support for custom database event types
if (pei && dbei->pBlob) {
- DBEVENTGETTEXT svc = {dbei, DBVT_TCHAR, CP_ACP};
+ DBEVENTGETTEXT svc = {dbei, DBVT_WCHAR, CP_ACP};
wchar_t *pet = (wchar_t*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&svc);
if (pet) {
// we've got event text, move to our memory space
@@ -397,7 +397,7 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) }
mir_free(comment1);
mir_free(comment2);
- return TranslateTS( mir_a2u(commentFix));
+ return TranslateW( mir_a2u(commentFix));
}
int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, MEVENT hEvent, UINT eventType)
@@ -491,7 +491,7 @@ int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, MEVENT hEvent, U // if hContact is NULL, && hEvent is NULL then popup is only Test
if ((hContact == NULL) && (hEvent == NULL)) {
wcsncpy(pudw.lptzContactName, TranslateT("Plugin Test"), MAX_CONTACTNAME);
- wcsncpy(pudw.lptzText, TranslateTS(sampleEvent), MAX_SECONDLINE);
+ wcsncpy(pudw.lptzText, TranslateW(sampleEvent), MAX_SECONDLINE);
}
else { // get the needed event data
wcsncpy(pudw.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index eeceb22253..504d63ddc3 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -33,14 +33,14 @@ void PreviewSound(HWND hList) int hlpStatus = lvi.lParam;
ListView_GetItemText(hList, lvi.iItem, 1, buff, _countof(buff));
- if (!mir_wstrcmp(buff, TranslateTS(DEFAULT_SOUND))) {
+ if (!mir_wstrcmp(buff, TranslateW(DEFAULT_SOUND))) {
if (hlpStatus < ID_STATUS_MIN)
SkinPlaySound(StatusListEx[hlpStatus].lpzSkinSoundName);
else
SkinPlaySound(StatusList[Index(hlpStatus)].lpzSkinSoundName);
}
else {
- PathToAbsoluteT(buff, stzSoundPath);
+ PathToAbsoluteW(buff, stzSoundPath);
SkinPlaySoundFile(stzSoundPath);
}
}
@@ -51,7 +51,7 @@ BOOL RemoveSoundFromList(HWND hList) if (iSel != -1) {
iSel = -1;
while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)
- ListView_SetItemText(hList, iSel, 1, TranslateTS(DEFAULT_SOUND));
+ ListView_SetItemText(hList, iSel, 1, TranslateW(DEFAULT_SOUND));
return TRUE;
}
@@ -64,7 +64,7 @@ wchar_t *SelectSound(HWND hwndDlg, wchar_t *buff, size_t bufflen) HWND hList = GetDlgItem(hwndDlg, IDC_INDSNDLIST);
ListView_GetItemText(hList, ListView_GetNextItem(hList, -1, LVNI_SELECTED), 1, buff, (DWORD)bufflen);
- if (!mir_wstrcmp(buff, TranslateTS(DEFAULT_SOUND)))
+ if (!mir_wstrcmp(buff, TranslateW(DEFAULT_SOUND)))
buff = NULL;
ofn.lStructSize = sizeof(ofn);
@@ -146,14 +146,14 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA lvi.iSubItem = 0;
lvi.iImage = Index(i);
lvi.lParam = (LPARAM)i;
- lvi.pszText = TranslateTS(StatusList[Index(i)].lpzSkinSoundDesc);
+ lvi.pszText = TranslateW(StatusList[Index(i)].lpzSkinSoundDesc);
lvi.iItem = ListView_InsertItem(hList, &lvi);
- if (!db_get_ts(hContact, MODULE, StatusList[Index(i)].lpzSkinSoundName, &dbv)) {
+ if (!db_get_ws(hContact, MODULE, StatusList[Index(i)].lpzSkinSoundName, &dbv)) {
mir_wstrcpy(buff, dbv.ptszVal);
db_free(&dbv);
}
- else mir_wstrcpy(buff, TranslateTS(DEFAULT_SOUND));
+ else mir_wstrcpy(buff, TranslateW(DEFAULT_SOUND));
ListView_SetItemText(hList, lvi.iItem, 1, buff);
}
@@ -166,14 +166,14 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA lvi.iSubItem = 0;
lvi.iImage = Index(ID_STATUS_MAX) + 1; // additional icon
lvi.lParam = (LPARAM)i;
- lvi.pszText = TranslateTS(StatusListEx[i].lpzSkinSoundDesc);
+ lvi.pszText = TranslateW(StatusListEx[i].lpzSkinSoundDesc);
lvi.iItem = ListView_InsertItem(hList, &lvi);
- if (!db_get_ts(hContact, MODULE, StatusList[i].lpzSkinSoundName, &dbv)) {
+ if (!db_get_ws(hContact, MODULE, StatusList[i].lpzSkinSoundName, &dbv)) {
wcsncpy(buff, dbv.ptszVal, _countof(buff)-1);
db_free(&dbv);
}
- else wcsncpy(buff, TranslateTS(DEFAULT_SOUND), _countof(buff)-1);
+ else wcsncpy(buff, TranslateW(DEFAULT_SOUND), _countof(buff)-1);
ListView_SetItemText(hList, lvi.iItem, 1, buff);
}
@@ -236,7 +236,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ListView_GetItem(hList, &lvi);
ListView_GetItemText(hList, lvi.iItem, 1, buff, _countof(buff));
- if (!mir_wstrcmp(buff, TranslateTS(DEFAULT_SOUND))) {
+ if (!mir_wstrcmp(buff, TranslateW(DEFAULT_SOUND))) {
if (lvi.lParam < ID_STATUS_MIN)
db_unset(hContact, MODULE, StatusListEx[lvi.lParam].lpzSkinSoundName);
else
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index bf7ef10106..337a197494 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -187,7 +187,7 @@ wchar_t* GetStr(STATUSMSGINFO *n, const wchar_t *tmplt) if (n == NULL || tmplt == NULL || tmplt[0] == '\0')
return NULL;
- CMString res;
+ CMStringW res;
size_t len = mir_wstrlen(tmplt);
for (size_t i = 0; i < len; i++) {
@@ -304,7 +304,7 @@ void GetStatusText(MCONTACT hContact, WORD newStatus, WORD oldStatus, wchar_t *s if (opt.ShowPreviousStatus) {
wchar_t buff[MAX_STATUSTEXT];
- mir_snwprintf(buff, TranslateTS(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(oldStatus)].lpzStandardText);
+ mir_snwprintf(buff, TranslateW(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(oldStatus)].lpzStandardText);
mir_wstrcat(mir_wstrcat(stzStatusText, L" "), buff);
}
}
@@ -326,7 +326,7 @@ void PlayChangeSound(MCONTACT hContact, const char *name) if (opt.UseIndSnd) {
DBVARIANT dbv;
wchar_t stzSoundFile[MAX_PATH] = { 0 };
- if (!db_get_ts(hContact, MODULE, name, &dbv)) {
+ if (!db_get_ws(hContact, MODULE, name, &dbv)) {
wcsncpy(stzSoundFile, dbv.ptszVal, _countof(stzSoundFile)-1);
db_free(&dbv);
}
@@ -334,7 +334,7 @@ void PlayChangeSound(MCONTACT hContact, const char *name) if (stzSoundFile[0]) {
//Now make path to IndSound absolute, as it isn't registered
wchar_t stzSoundPath[MAX_PATH];
- PathToAbsoluteT(stzSoundFile, stzSoundPath);
+ PathToAbsoluteW(stzSoundFile, stzSoundPath);
SkinPlaySoundFile(stzSoundPath);
return;
}
@@ -695,7 +695,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) char protoname[MAX_PATH];
mir_snprintf(protoname, "%s_TPopupSMsgRemoved", szProto);
DBVARIANT dbVar = { 0 };
- if (db_get_ts(NULL, MODULE, protoname, &dbVar)) {
+ if (db_get_ws(NULL, MODULE, protoname, &dbVar)) {
str = GetStr(&smi, DEFAULT_POPUP_SMSGREMOVED);
}
else {
@@ -707,7 +707,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) char protoname[MAX_PATH];
mir_snprintf(protoname, "%s_TPopupSMsgChanged", szProto);
DBVARIANT dbVar = { 0 };
- if (db_get_ts(NULL, MODULE, protoname, &dbVar)) {
+ if (db_get_ws(NULL, MODULE, protoname, &dbVar)) {
str = GetStr(&smi, DEFAULT_POPUP_SMSGCHANGED);
}
else {
@@ -1072,7 +1072,7 @@ void InitMainMenuItem() {
CMenuItem mi;
SET_UID(mi, 0x22b7b4db, 0xa9a1, 0x4d43, 0x88, 0x80, 0x4c, 0x23, 0x20, 0x31, 0xc6, 0xa0);
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
if (ServiceExists(MS_POPUP_ADDPOPUPT))
mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 0);
mi.pszService = MS_STATUSCHANGE_MENUCOMMAND;
@@ -1096,10 +1096,10 @@ void InitIcolib() void InitSound()
{
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++)
- SkinAddNewSoundExT(StatusList[Index(i)].lpzSkinSoundName, LPGENW("Status Notify"), StatusList[Index(i)].lpzSkinSoundDesc);
+ SkinAddNewSoundExW(StatusList[Index(i)].lpzSkinSoundName, LPGENW("Status Notify"), StatusList[Index(i)].lpzSkinSoundDesc);
for (int i = 0; i <= ID_STATUSEX_MAX; i++)
- SkinAddNewSoundExT(StatusListEx[i].lpzSkinSoundName, LPGENW("Status Notify"), StatusListEx[i].lpzSkinSoundDesc);
+ SkinAddNewSoundExW(StatusListEx[i].lpzSkinSoundName, LPGENW("Status Notify"), StatusListEx[i].lpzSkinSoundDesc);
}
int InitTopToolbar(WPARAM, LPARAM)
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index 2e602a4586..3d2de9a971 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -112,20 +112,20 @@ void LoadOptions() void SaveTemplates()
{
- db_set_ts(0, MODULE, "TPopupChanged", templates.PopupXstatusChanged);
- db_set_ts(0, MODULE, "TPopupRemoved", templates.PopupXstatusRemoved);
- db_set_ts(0, MODULE, "TPopupXMsgChanged", templates.PopupXMsgChanged);
- db_set_ts(0, MODULE, "TPopupXMsgRemoved", templates.PopupXMsgRemoved);
+ db_set_ws(0, MODULE, "TPopupChanged", templates.PopupXstatusChanged);
+ db_set_ws(0, MODULE, "TPopupRemoved", templates.PopupXstatusRemoved);
+ db_set_ws(0, MODULE, "TPopupXMsgChanged", templates.PopupXMsgChanged);
+ db_set_ws(0, MODULE, "TPopupXMsgRemoved", templates.PopupXMsgRemoved);
- db_set_ts(0, MODULE, "TLogXChanged", templates.LogXstatusChanged);
- db_set_ts(0, MODULE, "TLogXRemoved", templates.LogXstatusRemoved);
- db_set_ts(0, MODULE, "TLogXMsgChanged", templates.LogXMsgChanged);
- db_set_ts(0, MODULE, "TLogXMsgRemoved", templates.LogXMsgRemoved);
- db_set_ts(0, MODULE, "TLogXOpening", templates.LogXstatusOpening);
+ db_set_ws(0, MODULE, "TLogXChanged", templates.LogXstatusChanged);
+ db_set_ws(0, MODULE, "TLogXRemoved", templates.LogXstatusRemoved);
+ db_set_ws(0, MODULE, "TLogXMsgChanged", templates.LogXMsgChanged);
+ db_set_ws(0, MODULE, "TLogXMsgRemoved", templates.LogXMsgRemoved);
+ db_set_ws(0, MODULE, "TLogXOpening", templates.LogXstatusOpening);
- db_set_ts(0, MODULE, "TLogSMsgChanged", templates.LogSMsgChanged);
- db_set_ts(0, MODULE, "TLogSMsgRemoved", templates.LogSMsgRemoved);
- db_set_ts(0, MODULE, "TLogSMsgOpening", templates.LogSMsgOpening);
+ db_set_ws(0, MODULE, "TLogSMsgChanged", templates.LogSMsgChanged);
+ db_set_ws(0, MODULE, "TLogSMsgRemoved", templates.LogSMsgRemoved);
+ db_set_ws(0, MODULE, "TLogSMsgOpening", templates.LogSMsgOpening);
db_set_b(0, MODULE, "TPopupXFlags", templates.PopupXFlags);
db_set_b(0, MODULE, "TPopupSMsgFlags", templates.PopupSMsgFlags);
@@ -136,9 +136,9 @@ void SaveTemplates() PROTOTEMPLATE *prototemplate = ProtoTemplates[i];
char str[MAX_PATH];
mir_snprintf(str, "%s_TPopupSMsgChanged", prototemplate->ProtoName);
- db_set_ts(0, MODULE, str, prototemplate->ProtoTemplateMsg);
+ db_set_ws(0, MODULE, str, prototemplate->ProtoTemplateMsg);
mir_snprintf(str, "%s_TPopupSMsgRemoved", prototemplate->ProtoName);
- db_set_ts(0, MODULE, str, prototemplate->ProtoTemplateRemoved);
+ db_set_ws(0, MODULE, str, prototemplate->ProtoTemplateRemoved);
}
}
@@ -337,8 +337,8 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM //Mouse actions
for (int i = 0; i < _countof(PopupActions); i++) {
- SendDlgItemMessage(hwndDlg, IDC_STATUS_LC, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_STATUS_LC, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action);
- SendDlgItemMessage(hwndDlg, IDC_STATUS_RC, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_STATUS_RC, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action);
+ SendDlgItemMessage(hwndDlg, IDC_STATUS_LC, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_STATUS_LC, CB_ADDSTRING, 0, (LPARAM)TranslateW(PopupActions[i].Text)), PopupActions[i].Action);
+ SendDlgItemMessage(hwndDlg, IDC_STATUS_RC, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_STATUS_RC, CB_ADDSTRING, 0, (LPARAM)TranslateW(PopupActions[i].Text)), PopupActions[i].Action);
}
SendDlgItemMessage(hwndDlg, IDC_STATUS_LC, CB_SETCURSEL, opt.LeftClickAction, 0);
@@ -391,7 +391,7 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (opt.ShowPreviousStatus) {
wchar_t buff[MAX_STATUSTEXT];
- mir_snwprintf(buff, TranslateTS(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(i)].lpzStandardText);
+ mir_snwprintf(buff, TranslateW(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(i)].lpzStandardText);
mir_wstrcat(str, L" ");
mir_wstrcat(str, buff);
}
@@ -557,12 +557,12 @@ INT_PTR CALLBACK DlgProcXPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(hwndDlg, IDC_ED_TREMOVEMSG), templates.PopupXFlags & NOTIFY_REMOVE_MESSAGE);
// Buttons
- SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show available variables"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show available variables"), BATF_UNICODE);
HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_VARIABLES));
SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
- SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset all templates to default"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset all templates to default"), BATF_UNICODE);
hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RESET));
SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
@@ -691,12 +691,12 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA EnableWindow(GetDlgItem(hwndDlg, IDC_ED_TSMSGREMOVE), templates.PopupSMsgFlags & NOTIFY_REMOVE_MESSAGE);
// Buttons
- SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show available variables"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show available variables"), BATF_UNICODE);
HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_VARIABLES));
SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
- SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset all templates to default"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset all templates to default"), BATF_UNICODE);
hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RESET));
SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
@@ -730,7 +730,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA DBVARIANT dbVar = { 0 };
char protoname[MAX_PATH] = { 0 };
mir_snprintf(protoname, "%s_TPopupSMsgChanged", protos[i]->szModuleName);
- if (db_get_ts(NULL, MODULE, protoname, &dbVar))
+ if (db_get_ws(NULL, MODULE, protoname, &dbVar))
wcsncpy(prototemplate->ProtoTemplateMsg, DEFAULT_POPUP_SMSGCHANGED, _countof(prototemplate->ProtoTemplateMsg));
else {
wcsncpy(prototemplate->ProtoTemplateMsg, dbVar.ptszVal, _countof(prototemplate->ProtoTemplateMsg));
@@ -738,7 +738,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
mir_snprintf(protoname, "%s_TPopupSMsgRemoved", protos[i]->szModuleName);
- if (db_get_ts(NULL, MODULE, protoname, &dbVar))
+ if (db_get_ws(NULL, MODULE, protoname, &dbVar))
wcsncpy(prototemplate->ProtoTemplateRemoved, DEFAULT_POPUP_SMSGREMOVED, _countof(prototemplate->ProtoTemplateRemoved));
else {
wcsncpy(prototemplate->ProtoTemplateRemoved, dbVar.ptszVal, _countof(prototemplate->ProtoTemplateRemoved));
@@ -915,12 +915,12 @@ INT_PTR CALLBACK DlgProcXLogOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l SetDlgItemText(hwndDlg, IDC_ED_TXSTATUSOPENING, templates.LogXstatusOpening);
// Buttons
- SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Show available variables"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Show available variables"), BATF_UNICODE);
HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_VARIABLES));
SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
- SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Reset all templates to default"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Reset all templates to default"), BATF_UNICODE);
hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RESET));
SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
@@ -1082,12 +1082,12 @@ INT_PTR CALLBACK DlgProcLogOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SetDlgItemText(hwndDlg, IDC_LOG_TSMSGOPENING, templates.LogSMsgOpening);
// Buttons
- SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Show available variables"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Show available variables"), BATF_UNICODE);
HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_VARIABLES));
SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
- SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Reset all templates to default"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Reset all templates to default"), BATF_UNICODE);
hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RESET));
SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp index 2f7e702036..fe70659bfa 100644 --- a/plugins/NewXstatusNotify/src/popup.cpp +++ b/plugins/NewXstatusNotify/src/popup.cpp @@ -26,11 +26,11 @@ void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, const wchar POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
ppd.lchIcon = hIcon;
- CMString buf(pcli->pfnGetContactDisplayName(hContact, 0));
+ CMStringW buf(pcli->pfnGetContactDisplayName(hContact, 0));
// add group name to popup title
if (opt.ShowGroup) {
- ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_wsa(hContact, "CList", "Group"));
if (tszGroup)
buf.AppendFormat(L" (%s)", tszGroup);
}
@@ -77,7 +77,7 @@ static int AwayMsgHook(WPARAM, LPARAM lParam, LPARAM pObj) return 0;
MCONTACT hContact = PUGetContact(pdp->hWnd);
- ptrW pstzLast(db_get_tsa(hContact, MODULE, "LastPopupText"));
+ ptrW pstzLast(db_get_wsa(hContact, MODULE, "LastPopupText"));
wchar_t *tszStatus = (wchar_t *)ack->lParam;
if (tszStatus == NULL || *tszStatus == 0)
@@ -117,7 +117,7 @@ void PopupAction(HWND hWnd, BYTE action) if (hContact && hContact != INVALID_CONTACT_ID) {
switch (action) {
case PCA_OPENMESSAGEWND:
- CallServiceSync(MS_MSG_SENDMESSAGET, hContact, 0);
+ CallServiceSync(MS_MSG_SENDMESSAGEW, hContact, 0);
break;
case PCA_OPENMENU:
diff --git a/plugins/NewXstatusNotify/src/utils.cpp b/plugins/NewXstatusNotify/src/utils.cpp index f06b12914c..88a457b780 100644 --- a/plugins/NewXstatusNotify/src/utils.cpp +++ b/plugins/NewXstatusNotify/src/utils.cpp @@ -44,7 +44,7 @@ bool CheckMsgWnd(MCONTACT hContact) int DBGetStringDefault(MCONTACT hContact, const char *szModule, const char *szSetting, wchar_t *setting, int size, const wchar_t *defaultValue)
{
DBVARIANT dbv;
- if (!db_get_ts(hContact, szModule, szSetting, &dbv)) {
+ if (!db_get_ws(hContact, szModule, szSetting, &dbv)) {
wcsncpy(setting, dbv.ptszVal, size);
db_free(&dbv);
return 0;
@@ -92,12 +92,12 @@ void LogToFile(wchar_t *stzText) }
}
-void AddCR(CMString &str, const wchar_t *stzText)
+void AddCR(CMStringW &str, const wchar_t *stzText)
{
if (stzText == NULL)
return;
- CMString res(stzText);
+ CMStringW res(stzText);
res.Replace(L"\n", L"\r\n");
res.Replace(L"\r\r\n", L"\r\n");
str.Append(res);
diff --git a/plugins/NewXstatusNotify/src/utils.h b/plugins/NewXstatusNotify/src/utils.h index bdc32806fb..03f2105a87 100644 --- a/plugins/NewXstatusNotify/src/utils.h +++ b/plugins/NewXstatusNotify/src/utils.h @@ -27,6 +27,6 @@ int DBGetStringDefault(MCONTACT hContact, const char *szModule, const char *szSe void ShowLog(wchar_t *file);
BOOL StatusHasAwayMessage(char *szProto, int status);
void LogToFile(wchar_t *stzText);
-void AddCR(CMString &str, const wchar_t *statusmsg);
+void AddCR(CMStringW &str, const wchar_t *statusmsg);
#endif
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index ec650d1775..42a705852d 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -90,13 +90,13 @@ wchar_t* GetStatusTypeAsString(int type, wchar_t *buff) }
}
-CMString ReplaceVars(XSTATUSCHANGE *xsc, const wchar_t *tmplt)
+CMStringW ReplaceVars(XSTATUSCHANGE *xsc, const wchar_t *tmplt)
{
if (xsc == NULL || tmplt == NULL || tmplt[0] == '\0')
- return CMString();
+ return CMStringW();
size_t len = mir_wstrlen(tmplt);
- CMString res;
+ CMStringW res;
for (size_t i = 0; i < len; i++) {
if (tmplt[i] == '%') {
@@ -288,7 +288,7 @@ void LogChangeToDB(XSTATUSCHANGE *xsc) }
wchar_t stzLastLog[2 * MAX_TEXT_LEN];
- CMString stzLogText(ReplaceVars(xsc, Template));
+ CMStringW stzLogText(ReplaceVars(xsc, Template));
DBGetStringDefault(xsc->hContact, MODULE, DB_LASTLOG, stzLastLog, _countof(stzLastLog), L"");
if (opt.XLogToDB) {
@@ -416,11 +416,11 @@ wchar_t* GetDefaultXstatusName(int statusID, char *szProto, wchar_t *buff, int b CUSTOM_STATUS xstatus = { 0 };
xstatus.cbSize = sizeof(CUSTOM_STATUS);
- xstatus.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR;
+ xstatus.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_UNICODE;
xstatus.ptszName = nameBuff;
xstatus.wParam = (WPARAM*)&statusID;
if (!CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus))
- wcsncpy_s(buff, bufflen, TranslateTS(nameBuff), _TRUNCATE);
+ wcsncpy_s(buff, bufflen, TranslateW(nameBuff), _TRUNCATE);
return buff;
}
@@ -432,7 +432,7 @@ wchar_t* GetIcqXStatus(MCONTACT hContact, char *szProto, char *szValue, wchar_t int statusID = db_get_b(hContact, szProto, "XStatusId", -1);
if (statusID != -1) {
- if (!db_get_ts(hContact, szProto, szValue, &dbv)) {
+ if (!db_get_ws(hContact, szProto, szValue, &dbv)) {
if ((mir_strcmp(szValue, "XStatusName") == 0) && dbv.ptszVal[0] == 0)
GetDefaultXstatusName(statusID, szProto, buff, bufflen);
else
@@ -453,7 +453,7 @@ wchar_t* GetJabberAdvStatusText(MCONTACT hContact, char *szProto, char *szSlot, buff[0] = 0;
mir_snprintf(szSetting, "%s/%s/%s", szProto, szSlot, szValue);
- if (!db_get_ts(hContact, "AdvStatus", szSetting, &dbv)) {
+ if (!db_get_ws(hContact, "AdvStatus", szSetting, &dbv)) {
wcsncpy(buff, dbv.ptszVal, bufflen);
buff[bufflen - 1] = 0;
db_free(&dbv);
@@ -511,7 +511,7 @@ void AddSMsgEventThread(void *arg) if (smi.proto == NULL)
return;
- smi.newstatusmsg = db_get_tsa(smi.hContact, "CList", "StatusMsg");
+ smi.newstatusmsg = db_get_wsa(smi.hContact, "CList", "StatusMsg");
LogSMsgToDB(&smi, templates.LogSMsgOpening);
mir_free(smi.newstatusmsg);
}
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index a2dee64295..e62d46c7f5 100644 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -184,7 +184,7 @@ extern "C" int __declspec(dllexport) Load() SET_UID(mi, 0xbd22e3f8, 0xc19c, 0x45a8, 0xb7, 0x37, 0x6b, 0x3b, 0x27, 0xf0, 0x8c, 0xbb);
mi.position = -0x7FFFFFFF;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
mi.name.w = LPGENW("Load GPG public key");
mi.pszService = "/LoadPubKey";
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index bc7c4764ac..a28f21294c 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -307,8 +307,8 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, GetDlgItemTextA(hwndDlg, IDC_ACCOUNT, buf, _countof(buf)); if (!mir_strcmp(buf, Translate("Default"))) { db_set_s(NULL, szGPGModuleName, "GPGPubKey", out.c_str()); - db_set_ts(NULL, szGPGModuleName, "KeyMainName", name); - db_set_ts(NULL, szGPGModuleName, "KeyID", fp); + db_set_ws(NULL, szGPGModuleName, "KeyMainName", name); + db_set_ws(NULL, szGPGModuleName, "KeyID", fp); } else { std::string acc_str = buf; @@ -316,10 +316,10 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, db_set_s(NULL, szGPGModuleName, acc_str.c_str(), out.c_str()); acc_str = buf; acc_str += "_KeyMainName"; - db_set_ts(NULL, szGPGModuleName, acc_str.c_str(), name); + db_set_ws(NULL, szGPGModuleName, acc_str.c_str(), name); acc_str = buf; acc_str += "_KeyID"; - db_set_ts(NULL, szGPGModuleName, acc_str.c_str(), fp); + db_set_ws(NULL, szGPGModuleName, acc_str.c_str(), fp); } if (!mir_strcmp(buf, Translate("Default"))) { wstring keyinfo = TranslateT("Default private key ID"); @@ -337,7 +337,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, dbsetting += keyid; mir_free(keyid); dbsetting += "_Password"; - db_set_ts(NULL, szGPGModuleName, dbsetting.c_str(), passwd); + db_set_ws(NULL, szGPGModuleName, dbsetting.c_str(), passwd); } delete[] name; } @@ -592,7 +592,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, GetDlgItemTextA(hwndDlg, IDC_ACCOUNT, buf, _countof(buf)); if (!mir_strcmp(buf, Translate("Default"))) { db_set_s(NULL, szGPGModuleName, "GPGPubKey", out.c_str()); - db_set_ts(NULL, szGPGModuleName, "KeyID", fp); + db_set_ws(NULL, szGPGModuleName, "KeyID", fp); } else { std::string acc_str = buf; @@ -600,7 +600,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, db_set_s(NULL, szGPGModuleName, acc_str.c_str(), out.c_str()); acc_str = buf; acc_str += "_KeyID"; - db_set_ts(NULL, szGPGModuleName, acc_str.c_str(), fp); + db_set_ws(NULL, szGPGModuleName, acc_str.c_str(), fp); } } extern HWND hwndCurKey_p; @@ -825,7 +825,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, SetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp); if (gpg_exists/* && lang_exists*/) { - db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp); + db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp); string out; DWORD code; std::vector<wstring> cmd; @@ -938,7 +938,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, } { bool bad_version = false; - db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp); + db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp); string out; DWORD code; std::vector<wstring> cmd; @@ -965,7 +965,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, if (bad_version) MessageBox(0, TranslateT("Unsupported GnuPG version found, use at you own risk!\nIt is recommended that you use GnuPG v1.x.x with this plugin."), TranslateT("Warning"), MB_OK); } - db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp); + db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp); GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, _countof(tmp)); while (tmp[mir_wstrlen(tmp) - 1] == '\\') tmp[mir_wstrlen(tmp) - 1] = '\0'; @@ -973,7 +973,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, MessageBox(0, TranslateT("Please set keyring's home directory"), TranslateT("Warning"), MB_OK); break; } - db_set_ts(NULL, szGPGModuleName, "szHomePath", tmp); + db_set_ws(NULL, szGPGModuleName, "szHomePath", tmp); { wchar_t *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); DWORD dwFileAttr = GetFileAttributes(path); @@ -1009,7 +1009,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, } { bool bad_version = false; - db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp); + db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp); string out; DWORD code; std::vector<wstring> cmd; @@ -1036,7 +1036,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, if (bad_version) MessageBox(0, TranslateT("Unsupported GnuPG version found, use at you own risk!\nIt is recommended that you use GnuPG v1.x.x with this plugin."), TranslateT("Warning"), MB_OK); } - db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp); + db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp); GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, _countof(tmp)); while (tmp[mir_wstrlen(tmp) - 1] == '\\') tmp[mir_wstrlen(tmp) - 1] = '\0'; @@ -1044,7 +1044,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, MessageBox(0, TranslateT("Please set keyring's home directory"), TranslateT("Warning"), MB_OK); break; } - db_set_ts(NULL, szGPGModuleName, "szHomePath", tmp); + db_set_ws(NULL, szGPGModuleName, "szHomePath", tmp); { wchar_t *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); DWORD dwFileAttr = GetFileAttributes(path); @@ -1139,7 +1139,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, out.erase(s, 1); } db_set_s(NULL, szGPGModuleName, "GPGPubKey", out.c_str()); - db_set_ts(NULL, szGPGModuleName, "KeyID", path.c_str()); + db_set_ws(NULL, szGPGModuleName, "KeyID", path.c_str()); extern HWND hwndCurKey_p; SetWindowText(hwndCurKey_p, path.c_str()); } @@ -1876,9 +1876,9 @@ void InitCheck() { // parse gpg output wchar_t *current_home = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); - db_set_ts(NULL, szGPGModuleName, "szHomePath", L""); //we do not need home for gpg binary validation + db_set_ws(NULL, szGPGModuleName, "szHomePath", L""); //we do not need home for gpg binary validation gpg_valid = isGPGValid(); - db_set_ts(NULL, szGPGModuleName, "szHomePath", current_home); //return current home dir back + db_set_ws(NULL, szGPGModuleName, "szHomePath", current_home); //return current home dir back mir_free(current_home); bool home_dir_access = false, temp_access = false; wchar_t *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L""); @@ -2124,12 +2124,12 @@ void ImportKey() for (int i = 0; i < count; i++) { MCONTACT hcnt = db_mc_getSub(hContact, i); if (hcnt) - db_set_ts(hcnt, szGPGModuleName, "GPGPubKey", new_key.c_str()); + db_set_ws(hcnt, szGPGModuleName, "GPGPubKey", new_key.c_str()); } } - else db_set_ts(metaGetMostOnline(hContact), szGPGModuleName, "GPGPubKey", new_key.c_str()); + else db_set_ws(metaGetMostOnline(hContact), szGPGModuleName, "GPGPubKey", new_key.c_str()); } - else db_set_ts(hContact, szGPGModuleName, "GPGPubKey", new_key.c_str()); + else db_set_ws(hContact, szGPGModuleName, "GPGPubKey", new_key.c_str()); new_key.clear(); diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index 89e77e782c..dc4f95277b 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -419,7 +419,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) if (bDebugLog) debuglog << std::string(time_str() + ": info(autoexchange): found pubkey block:" + toUTF8(pcli->pfnGetContactDisplayName(ccs->hContact, 0))); s2 += mir_wstrlen(L"-----END PGP PUBLIC KEY BLOCK-----"); - db_set_ts(ccs->hContact, szGPGModuleName, "GPGPubKey", str.substr(s1, s2 - s1).c_str()); + db_set_ws(ccs->hContact, szGPGModuleName, "GPGPubKey", str.substr(s1, s2 - s1).c_str()); { //gpg execute block std::vector<wstring> cmd; wchar_t tmp2[MAX_PATH] = { 0 }; @@ -1034,9 +1034,9 @@ static INT_PTR CALLBACK DlgProcKeyPassword(HWND hwndDlg, UINT msg, WPARAM wParam string dbsetting = "szKey_"; dbsetting += inkeyid; dbsetting += "_Password"; - db_set_ts(NULL, szGPGModuleName, dbsetting.c_str(), tmp); + db_set_ws(NULL, szGPGModuleName, dbsetting.c_str(), tmp); } - else db_set_ts(NULL, szGPGModuleName, "szKeyPassword", tmp); + else db_set_ws(NULL, szGPGModuleName, "szKeyPassword", tmp); } if (password) mir_free(password); diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp index 5a7592f833..4baaa264b1 100755 --- a/plugins/New_GPG/src/options.cpp +++ b/plugins/New_GPG/src/options.cpp @@ -46,7 +46,7 @@ int GpgOptInit(WPARAM wParam, LPARAM) odp.pwszTitle = _T(szGPGModuleName);
odp.pwszGroup = LPGENW("Services");
odp.pwszTab = LPGENW("Main");
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pfnDlgProc = DlgProcGpgOpts;
Options_AddPage(wParam, &odp);
@@ -399,7 +399,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L {
wchar_t tmp[512];
GetDlgItemText(hwndDlg, IDC_LOG_FILE_EDIT, tmp, _countof(tmp));
- db_set_ts(NULL, szGPGModuleName, "szLogFilePath", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szLogFilePath", tmp);
}
return TRUE;
}
@@ -433,7 +433,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, if (gpg_exists) {
bool bad_version = false;
wchar_t *tmp_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"");
- db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp);
string out;
DWORD code;
std::vector<wstring> cmd;
@@ -447,7 +447,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, gpg_valid = true;
gpg_launcher(params);
gpg_valid = old_gpg_state;
- db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp_path);
+ db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp_path);
mir_free(tmp_path);
string::size_type p1 = out.find("(GnuPG) ");
if (p1 != string::npos) {
@@ -505,11 +505,11 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case PSN_APPLY:
wchar_t tmp[512];
GetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp, _countof(tmp));
- db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp);
GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, _countof(tmp));
while (tmp[mir_wstrlen(tmp) - 1] == '\\')
tmp[mir_wstrlen(tmp) - 1] = '\0';
- db_set_ts(NULL, szGPGModuleName, "szHomePath", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szHomePath", tmp);
return TRUE;
}
break;
@@ -567,22 +567,22 @@ static INT_PTR CALLBACK DlgProcGpgMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, {
wchar_t tmp[128];
GetDlgItemText(hwndDlg, IDC_IN_OPEN_TAG, tmp, _countof(tmp));
- db_set_ts(NULL, szGPGModuleName, "szInOpenTag", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szInOpenTag", tmp);
mir_free(inopentag);
inopentag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_wstrlen(tmp) + 1));
mir_wstrcpy(inopentag, tmp);
GetDlgItemText(hwndDlg, IDC_IN_CLOSE_TAG, tmp, _countof(tmp));
- db_set_ts(NULL, szGPGModuleName, "szInCloseTag", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szInCloseTag", tmp);
mir_free(inclosetag);
inclosetag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_wstrlen(tmp) + 1));
mir_wstrcpy(inclosetag, tmp);
GetDlgItemText(hwndDlg, IDC_OUT_OPEN_TAG, tmp, _countof(tmp));
- db_set_ts(NULL, szGPGModuleName, "szOutOpenTag", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szOutOpenTag", tmp);
mir_free(outopentag);
outopentag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_wstrlen(tmp) + 1));
mir_wstrcpy(outopentag, tmp);
GetDlgItemText(hwndDlg, IDC_OUT_CLOSE_TAG, tmp, _countof(tmp));
- db_set_ts(NULL, szGPGModuleName, "szOutCloseTag", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szOutCloseTag", tmp);
mir_free(outclosetag);
outclosetag = (wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_wstrlen(tmp) + 1));
mir_wstrcpy(outclosetag, tmp);
@@ -783,12 +783,12 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa for (int i = 0; i < count; i++) {
MCONTACT hcnt = db_mc_getSub(hContact, i);
if (hcnt)
- db_set_ts(hcnt, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str());
+ db_set_ws(hcnt, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str());
}
}
- else db_set_ts(metaGetMostOnline(hContact), szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str());
+ else db_set_ws(metaGetMostOnline(hContact), szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str());
}
- else db_set_ts(hContact, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str());
+ else db_set_ws(hContact, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str());
}
tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * (key_buf.length() + 1));
mir_wstrcpy(tmp, key_buf.substr(ws1, ws2 - ws1).c_str());
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index a0359340a9..466c7f6a14 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -28,7 +28,7 @@ wchar_t* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModu { DBVARIANT dbv = { DBVT_DELETED }; wchar_t* szRes = NULL; - if (db_get_ts(hContact, szModule, szSetting, &dbv)) + if (db_get_ws(hContact, szModule, szSetting, &dbv)) return mir_wstrdup(szDef); else if (dbv.pszVal) szRes = mir_wstrdup(dbv.ptszVal); @@ -77,7 +77,7 @@ void GetFilePath(wchar_t *WindowTittle, char *szSetting, wchar_t *szExt, wchar_t ofn.nMaxFileTitle = MAX_PATH; if (!GetOpenFileName(&ofn)) return; - db_set_ts(0, szGPGModuleName, szSetting, str); + db_set_ws(0, szGPGModuleName, szSetting, str); } wchar_t *GetFilePath(wchar_t *WindowTittle, wchar_t *szExt, wchar_t *szExtDesc, bool save_file) @@ -124,7 +124,7 @@ void GetFolderPath(wchar_t *WindowTittle, char*) if (pidl != 0) { wchar_t path[MAX_PATH]; if (SHGetPathFromIDList(pidl, path)) { - db_set_ts(NULL, szGPGModuleName, "szHomePath", path); + db_set_ws(NULL, szGPGModuleName, "szHomePath", path); } IMalloc * imalloc = 0; if (SUCCEEDED(SHGetMalloc(&imalloc))) { @@ -1034,7 +1034,7 @@ bool isGPGValid() } if (gpg_exists) { - db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp); + db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp); mir_free(tmp); tmp = NULL; string out; @@ -1705,7 +1705,7 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM) } } db_set_b(hContact, szGPGModuleName, "GPGEncryption", 1); - db_set_ts(hContact, szGPGModuleName, "GPGPubKey", toUTF16(key).c_str()); + db_set_ws(hContact, szGPGModuleName, "GPGPubKey", toUTF16(key).c_str()); } boost::filesystem::remove(path); break; diff --git a/plugins/NewsAggregator/Src/Authentication.cpp b/plugins/NewsAggregator/Src/Authentication.cpp index 8b587f8779..62cd91361f 100644 --- a/plugins/NewsAggregator/Src/Authentication.cpp +++ b/plugins/NewsAggregator/Src/Authentication.cpp @@ -23,8 +23,8 @@ void CreateAuthString(char *auth, MCONTACT hContact, HWND hwndDlg) {
wchar_t *tlogin = NULL, *tpass = NULL;
if (hContact && db_get_b(hContact, MODULE, "UseAuth", 0)) {
- tlogin = db_get_tsa(hContact, MODULE, "Login");
- tpass = db_get_tsa(hContact, MODULE, "Password");
+ tlogin = db_get_wsa(hContact, MODULE, "Login");
+ tpass = db_get_wsa(hContact, MODULE, "Password");
}
else if (hwndDlg && IsDlgButtonChecked(hwndDlg, IDC_USEAUTH)) {
wchar_t buf[MAX_PATH] = {0};
@@ -64,13 +64,13 @@ INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
}
else if (SelItem.hContact) {
- wchar_t *ptszNick = db_get_tsa(SelItem.hContact, MODULE, "Nick");
+ wchar_t *ptszNick = db_get_wsa(SelItem.hContact, MODULE, "Nick");
if (ptszNick) {
SetDlgItemText(hwndDlg, IDC_FEEDNAME, ptszNick);
mir_free(ptszNick);
}
else {
- wchar_t *ptszURL = db_get_tsa(SelItem.hContact, MODULE, "URL");
+ wchar_t *ptszURL = db_get_wsa(SelItem.hContact, MODULE, "URL");
if (ptszURL) {
SetDlgItemText(hwndDlg, IDC_FEEDNAME, ptszURL);
mir_free(ptszURL);
@@ -104,7 +104,7 @@ INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
else if (SelItem.hContact) {
db_set_b(SelItem.hContact, MODULE, "UseAuth", 1);
- db_set_ts(SelItem.hContact, MODULE, "Login", username);
+ db_set_ws(SelItem.hContact, MODULE, "Login", username);
db_set_s(SelItem.hContact, MODULE, "Password", passw);
}
EndDialog(hwndDlg, IDOK);
diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp index 8586d20477..96d80c6298 100644 --- a/plugins/NewsAggregator/Src/CheckFeed.cpp +++ b/plugins/NewsAggregator/Src/CheckFeed.cpp @@ -98,9 +98,9 @@ LPCTSTR CheckFeed(wchar_t *tszURL, HWND hwndDlg) return NULL;
}
-static void XmlToMsg(MCONTACT hContact, CMString &title, CMString &link, CMString &descr, CMString &author, CMString &comments, CMString &guid, CMString &category, time_t stamp)
+static void XmlToMsg(MCONTACT hContact, CMStringW &title, CMStringW &link, CMStringW &descr, CMStringW &author, CMStringW &comments, CMStringW &guid, CMStringW &category, time_t stamp)
{
- CMString message = db_get_tsa(hContact, MODULE, "MsgFormat");
+ CMStringW message = db_get_wsa(hContact, MODULE, "MsgFormat");
if (!message)
message = TAGSDEFAULT;
@@ -183,7 +183,7 @@ void CheckCurrentFeed(MCONTACT hContact) if (!db_get_b(hContact, MODULE, "CheckState", 1) != 0)
return;
- wchar_t *szURL = db_get_tsa(hContact, MODULE, "URL");
+ wchar_t *szURL = db_get_wsa(hContact, MODULE, "URL");
if (szURL == NULL)
return;
@@ -202,7 +202,7 @@ void CheckCurrentFeed(MCONTACT hContact) mir_free(tszData);
mir_free(szData);
- CMString szValue;
+ CMStringW szValue;
if (hXml != NULL) {
LPCTSTR codepage = NULL;
int childcount = 0;
@@ -230,13 +230,13 @@ void CheckCurrentFeed(MCONTACT hContact) if (!mir_wstrcmpi(szAttrName, L"version")) {
wchar_t ver[MAX_PATH];
mir_snwprintf(ver, L"RSS %s", xmlGetAttrValue(node, szAttrName));
- db_set_ts(hContact, MODULE, "MirVer", ver);
+ db_set_ws(hContact, MODULE, "MirVer", ver);
break;
}
}
}
else if (isAtom)
- db_set_ts(hContact, MODULE, "MirVer", L"RSS 1.0");
+ db_set_ws(hContact, MODULE, "MirVer", L"RSS 1.0");
HXML chan = xmlGetChild(node, 0);
for (int j = 0; j < xmlGetChildCount(chan); j++) {
@@ -252,7 +252,7 @@ void CheckCurrentFeed(MCONTACT hContact) else
szChildText = xmlGetText(child);
if (szChildText)
- db_set_ts(hContact, MODULE, "FirstName", ClearText(szValue, szChildText));
+ db_set_ws(hContact, MODULE, "FirstName", ClearText(szValue, szChildText));
}
else if (!mir_wstrcmpi(childName, L"link")) {
LPCTSTR szChildText = NULL;
@@ -264,7 +264,7 @@ void CheckCurrentFeed(MCONTACT hContact) else
szChildText = xmlGetText(child);
if (szChildText)
- db_set_ts(hContact, MODULE, "Homepage", ClearText(szValue, szChildText));
+ db_set_ws(hContact, MODULE, "Homepage", ClearText(szValue, szChildText));
}
else if (!mir_wstrcmpi(childName, L"description")) {
LPCTSTR szChildText = NULL;
@@ -277,8 +277,8 @@ void CheckCurrentFeed(MCONTACT hContact) szChildText = xmlGetText(child);
if (szChildText) {
ClearText(szValue, szChildText);
- db_set_ts(hContact, MODULE, "About", szValue);
- db_set_ts(hContact, "CList", "StatusMsg", szValue);
+ db_set_ws(hContact, MODULE, "About", szValue);
+ db_set_ws(hContact, "CList", "StatusMsg", szValue);
}
}
else if (!mir_wstrcmpi(childName, L"language")) {
@@ -291,7 +291,7 @@ void CheckCurrentFeed(MCONTACT hContact) else
szChildText = xmlGetText(child);
if (szChildText)
- db_set_ts(hContact, MODULE, "Language1", ClearText(szValue, szChildText));
+ db_set_ws(hContact, MODULE, "Language1", ClearText(szValue, szChildText));
}
else if (!mir_wstrcmpi(childName, L"managingEditor")) {
LPCTSTR szChildText = NULL;
@@ -303,7 +303,7 @@ void CheckCurrentFeed(MCONTACT hContact) else
szChildText = xmlGetText(child);
if (szChildText)
- db_set_ts(hContact, MODULE, "e-mail", ClearText(szValue, szChildText));
+ db_set_ws(hContact, MODULE, "e-mail", ClearText(szValue, szChildText));
}
else if (!mir_wstrcmpi(childName, L"category")) {
LPCTSTR szChildText = NULL;
@@ -315,7 +315,7 @@ void CheckCurrentFeed(MCONTACT hContact) else
szChildText = xmlGetText(child);
if (szChildText)
- db_set_ts(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText));
+ db_set_ws(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText));
}
else if (!mir_wstrcmpi(childName, L"copyright")) {
LPCTSTR szChildText = NULL;
@@ -334,22 +334,22 @@ void CheckCurrentFeed(MCONTACT hContact) HXML imageval = xmlGetChild(child, x);
if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) {
LPCTSTR url = xmlGetText(imageval);
- db_set_ts(hContact, MODULE, "ImageURL", url);
+ db_set_ws(hContact, MODULE, "ImageURL", url);
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
- wchar_t *szNick = db_get_tsa(hContact, MODULE, "Nick");
+ wchar_t *szNick = db_get_wsa(hContact, MODULE, "Nick");
if (szNick) {
wchar_t *ext = wcsrchr((wchar_t *)url, '.') + 1;
ai.format = ProtoGetAvatarFormat(url);
- CMString filename = szNick;
+ CMStringW filename = szNick;
filename.Replace(L"/", L"_");
mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename.c_str(), ext);
- CreateDirectoryTreeT(tszRoot);
+ CreateDirectoryTreeW(tszRoot);
if (DownloadFile(url, ai.filename)) {
- db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
+ db_set_ws(hContact, MODULE, "ImagePath", ai.filename);
ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
}
else ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, NULL);
@@ -380,7 +380,7 @@ void CheckCurrentFeed(MCONTACT hContact) }
}
else if (!mir_wstrcmpi(childName, L"item")) {
- CMString title, link, descr, author, comments, guid, category;
+ CMStringW title, link, descr, author, comments, guid, category;
time_t stamp = 0;
for (int z = 0; z < xmlGetChildCount(child); z++) {
HXML itemval = xmlGetChild(child, z);
@@ -426,14 +426,14 @@ void CheckCurrentFeed(MCONTACT hContact) }
}
else if (!mir_wstrcmpi(szNodeName, L"feed")) {
- db_set_ts(hContact, MODULE, "MirVer", L"Atom 3");
+ db_set_ws(hContact, MODULE, "MirVer", L"Atom 3");
for (int j = 0; j < xmlGetChildCount(node); j++) {
HXML child = xmlGetChild(node, j);
LPCTSTR szChildName = xmlGetName(child);
if (!mir_wstrcmpi(szChildName, L"title")) {
LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
- db_set_ts(hContact, MODULE, "FirstName", ClearText(szValue, szChildText));
+ db_set_ws(hContact, MODULE, "FirstName", ClearText(szValue, szChildText));
}
else if (!mir_wstrcmpi(szChildName, L"link")) {
for (int x = 0; x < xmlGetAttrCount(child); x++) {
@@ -442,27 +442,27 @@ void CheckCurrentFeed(MCONTACT hContact) break;
if (!mir_wstrcmpi(xmlGetAttrName(child, x), L"href"))
- db_set_ts(hContact, MODULE, "Homepage", xmlGetAttrValue(child, xmlGetAttrName(child, x)));
+ db_set_ws(hContact, MODULE, "Homepage", xmlGetAttrValue(child, xmlGetAttrName(child, x)));
}
}
else if (!mir_wstrcmpi(szChildName, L"subtitle")) {
LPCTSTR szChildText = xmlGetText(child);
if (szChildText) {
ClearText(szValue, szChildText);
- db_set_ts(hContact, MODULE, "About", szValue);
- db_set_ts(hContact, "CList", "StatusMsg", szValue);
+ db_set_ws(hContact, MODULE, "About", szValue);
+ db_set_ws(hContact, "CList", "StatusMsg", szValue);
}
}
else if (!mir_wstrcmpi(szChildName, L"language")) {
LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
- db_set_ts(hContact, MODULE, "Language1", ClearText(szValue, szChildText));
+ db_set_ws(hContact, MODULE, "Language1", ClearText(szValue, szChildText));
}
else if (!mir_wstrcmpi(szChildName, L"author")) {
for (int x = 0; x < xmlGetChildCount(child); x++) {
HXML authorval = xmlGetChild(child, x);
if (!mir_wstrcmpi(xmlGetName(authorval), L"email")) {
- db_set_ts(hContact, MODULE, "e-mail", xmlGetText(authorval));
+ db_set_ws(hContact, MODULE, "e-mail", xmlGetText(authorval));
break;
}
}
@@ -470,16 +470,16 @@ void CheckCurrentFeed(MCONTACT hContact) else if (!mir_wstrcmpi(szChildName, L"category")) {
LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
- db_set_ts(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText));
+ db_set_ws(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText));
}
else if (!mir_wstrcmpi(szChildName, L"icon")) {
for (int x = 0; x < xmlGetChildCount(child); x++) {
HXML imageval = xmlGetChild(child, x);
if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) {
LPCTSTR url = xmlGetText(imageval);
- db_set_ts(hContact, MODULE, "ImageURL", url);
+ db_set_ws(hContact, MODULE, "ImageURL", url);
- ptrW szNick(db_get_tsa(hContact, MODULE, "Nick"));
+ ptrW szNick(db_get_wsa(hContact, MODULE, "Nick"));
if (szNick) {
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
@@ -489,7 +489,7 @@ void CheckCurrentFeed(MCONTACT hContact) wchar_t *filename = szNick;
mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
- db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
+ db_set_ws(hContact, MODULE, "ImagePath", ai.filename);
ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
}
else ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, NULL);
@@ -513,7 +513,7 @@ void CheckCurrentFeed(MCONTACT hContact) }
}
else if (!mir_wstrcmpi(szChildName, L"entry")) {
- CMString title, link, descr, author, comments, guid, category;
+ CMStringW title, link, descr, author, comments, guid, category;
time_t stamp = 0;
for (int z = 0; z < xmlGetChildCount(child); z++) {
HXML itemval = xmlGetChild(child, z);
@@ -587,7 +587,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) if (!db_get_b(hContact, MODULE, "CheckState", 1))
return;
- wchar_t *szURL = db_get_tsa(hContact, MODULE, "URL");
+ wchar_t *szURL = db_get_wsa(hContact, MODULE, "URL");
if (szURL == NULL)
return;
@@ -621,12 +621,12 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) HXML imageval = xmlGetChild(child, x);
if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) {
LPCTSTR url = xmlGetText(imageval);
- db_set_ts(hContact, MODULE, "ImageURL", url);
+ db_set_ws(hContact, MODULE, "ImageURL", url);
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
- wchar_t *szNick = db_get_tsa(hContact, MODULE, "Nick");
+ wchar_t *szNick = db_get_wsa(hContact, MODULE, "Nick");
if (szNick) {
wchar_t *ext = wcsrchr((wchar_t *)url, '.') + 1;
ai.format = ProtoGetAvatarFormat(ext);
@@ -634,7 +634,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) wchar_t *filename = szNick;
mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
- db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
+ db_set_ws(hContact, MODULE, "ImagePath", ai.filename);
ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
}
else ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, NULL);
@@ -654,9 +654,9 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) HXML imageval = xmlGetChild(child, x);
if (!mir_wstrcmpi(xmlGetName(imageval), L"url")) {
LPCTSTR url = xmlGetText(imageval);
- db_set_ts(hContact, MODULE, "ImageURL", url);
+ db_set_ws(hContact, MODULE, "ImageURL", url);
- ptrW szNick(db_get_tsa(hContact, MODULE, "Nick"));
+ ptrW szNick(db_get_wsa(hContact, MODULE, "Nick"));
if (szNick) {
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
@@ -667,7 +667,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) wchar_t *filename = szNick;
mir_snwprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
- db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
+ db_set_ws(hContact, MODULE, "ImagePath", ai.filename);
ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
}
else ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, (HANDLE)&ai, NULL);
diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp index e1a5b18e85..03a553b9d9 100644 --- a/plugins/NewsAggregator/Src/ExportImport.cpp +++ b/plugins/NewsAggregator/Src/ExportImport.cpp @@ -151,15 +151,15 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
Proto_AddToContact(hContact, MODULE);
- db_set_ts(hContact, MODULE, "Nick", text);
- db_set_ts(hContact, MODULE, "URL", url);
- db_set_ts(hContact, MODULE, "Homepage", siteurl);
+ db_set_ws(hContact, MODULE, "Nick", text);
+ db_set_ws(hContact, MODULE, "URL", url);
+ db_set_ws(hContact, MODULE, "Homepage", siteurl);
db_set_b(hContact, MODULE, "CheckState", 1);
db_set_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME);
- db_set_ts(hContact, MODULE, "MsgFormat", TAGSDEFAULT);
+ db_set_ws(hContact, MODULE, "MsgFormat", TAGSDEFAULT);
db_set_w(hContact, MODULE, "Status", CallProtoService(MODULE, PS_GETSTATUS, 0, 0));
if (ptszGroup) {
- db_set_ts(hContact, "CList", "Group", ptszGroup);
+ db_set_ws(hContact, "CList", "Group", ptszGroup);
Clist_GroupCreate(0, ptszGroup);
}
if (isGroupUTF)
@@ -209,7 +209,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_BROWSEIMPORTFILE:
{
wchar_t FileName[MAX_PATH];
- VARST tszMirDir(L"%miranda_path%");
+ VARSW tszMirDir(L"%miranda_path%");
OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
@@ -452,7 +452,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TranslateDialogDefault(hwndDlg);
Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, MODULE, "ExportDlg");
for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
- wchar_t *message = db_get_tsa(hContact, MODULE, "Nick");
+ wchar_t *message = db_get_wsa(hContact, MODULE, "Nick");
if (message != NULL) {
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)message);
mir_free(message);
@@ -472,7 +472,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDOK:
{
wchar_t FileName[MAX_PATH];
- VARST tszMirDir(L"%miranda_path%");
+ VARSW tszMirDir(L"%miranda_path%");
OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
@@ -501,10 +501,10 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SendMessage(FeedsExportList, LB_GETTEXT, (WPARAM)i, (LPARAM)item);
MCONTACT hContact = GetContactByNick(item);
wchar_t
- *title = db_get_tsa(hContact, MODULE, "Nick"),
- *url = db_get_tsa(hContact, MODULE, "URL"),
- *siteurl = db_get_tsa(hContact, MODULE, "Homepage"),
- *group = db_get_tsa(hContact, "CList", "Group");
+ *title = db_get_wsa(hContact, MODULE, "Nick"),
+ *url = db_get_wsa(hContact, MODULE, "URL"),
+ *siteurl = db_get_wsa(hContact, MODULE, "Homepage"),
+ *group = db_get_wsa(hContact, "CList", "Group");
HXML elem = header;
if (group)
diff --git a/plugins/NewsAggregator/Src/Menus.cpp b/plugins/NewsAggregator/Src/Menus.cpp index 44aaf21532..76cb73248a 100644 --- a/plugins/NewsAggregator/Src/Menus.cpp +++ b/plugins/NewsAggregator/Src/Menus.cpp @@ -24,7 +24,7 @@ HGENMENU hService2[7]; void InitMenu()
{
CMenuItem mi;
- mi.flags = CMIF_TCHAR | CMIF_NOTOFFLINE;
+ mi.flags = CMIF_UNICODE | CMIF_NOTOFFLINE;
mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("News Aggregator"), 500099000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "D9733E4F-1946-4390-8EB3-591E8687222E");
diff --git a/plugins/NewsAggregator/Src/NewsAggregator.cpp b/plugins/NewsAggregator/Src/NewsAggregator.cpp index 8d040fdcc0..329b921a95 100644 --- a/plugins/NewsAggregator/Src/NewsAggregator.cpp +++ b/plugins/NewsAggregator/Src/NewsAggregator.cpp @@ -90,10 +90,10 @@ extern "C" __declspec(dllexport) int Load(void) CreateServiceFunction(MS_NEWSAGGREGATOR_ENABLED, EnableDisable);
HOTKEYDESC hkd = { sizeof(hkd) };
- hkd.dwFlags = HKD_TCHAR;
+ hkd.dwFlags = HKD_UNICODE;
hkd.pszName = "NewsAggregator/CheckAllFeeds";
- hkd.ptszDescription = LPGENW("Check All Feeds");
- hkd.ptszSection = LPGENW("News Aggregator");
+ hkd.pwszDescription = LPGENW("Check All Feeds");
+ hkd.pwszSection = LPGENW("News Aggregator");
hkd.pszService = MS_NEWSAGGREGATOR_CHECKALLFEEDS;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL+HKCOMB_A, 'O') | HKF_MIRANDA_LOCAL;
Hotkey_Register(&hkd);
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index fb3deb5320..5079444792 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -56,20 +56,20 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
Proto_AddToContact(hContact, MODULE);
GetDlgItemText(hwndDlg, IDC_FEEDTITLE, str, _countof(str));
- db_set_ts(hContact, MODULE, "Nick", str);
+ db_set_ws(hContact, MODULE, "Nick", str);
HWND hwndList = (HWND)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
GetDlgItemText(hwndDlg, IDC_FEEDURL, str, _countof(str));
- db_set_ts(hContact, MODULE, "URL", str);
+ db_set_ws(hContact, MODULE, "URL", str);
db_set_b(hContact, MODULE, "CheckState", 1);
db_set_dw(hContact, MODULE, "UpdateTime", (DWORD)GetDlgItemInt(hwndDlg, IDC_CHECKTIME, NULL, false));
GetDlgItemText(hwndDlg, IDC_TAGSEDIT, str, _countof(str));
- db_set_ts(hContact, MODULE, "MsgFormat", str);
+ db_set_ws(hContact, MODULE, "MsgFormat", str);
db_set_w(hContact, MODULE, "Status", CallProtoService(MODULE, PS_GETSTATUS, 0, 0));
if (IsDlgButtonChecked(hwndDlg, IDC_USEAUTH)) {
db_set_b(hContact, MODULE, "UseAuth", 1);
GetDlgItemText(hwndDlg, IDC_LOGIN, str, _countof(str));
- db_set_ts(hContact, MODULE, "Login", str);
+ db_set_ws(hContact, MODULE, "Login", str);
GetDlgItemTextA(hwndDlg, IDC_PASSWORD, passw, _countof(passw));
db_set_s(hContact, MODULE, "Password", passw);
}
@@ -152,11 +152,11 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_TIMEOUT_VALUE_SPIN, UDM_SETRANGE32, 0, 999);
for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
- ptrW dbNick(db_get_tsa(hContact, MODULE, "Nick"));
+ ptrW dbNick(db_get_wsa(hContact, MODULE, "Nick"));
if ((dbNick == NULL) || (mir_wstrcmp(dbNick, SelItem.nick) != 0))
continue;
- ptrW dbURL(db_get_tsa(hContact, MODULE, "URL"));
+ ptrW dbURL(db_get_wsa(hContact, MODULE, "URL"));
if ((dbURL == NULL) || (mir_wstrcmp(dbURL, SelItem.url) != 0))
continue;
@@ -167,7 +167,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetDlgItemText(hwndDlg, IDC_FEEDTITLE, SelItem.nick);
SetDlgItemInt(hwndDlg, IDC_CHECKTIME, db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME), TRUE);
- wchar_t *szMsgFormat = db_get_tsa(hContact, MODULE, "MsgFormat");
+ wchar_t *szMsgFormat = db_get_wsa(hContact, MODULE, "MsgFormat");
if (szMsgFormat) {
SetDlgItemText(hwndDlg, IDC_TAGSEDIT, szMsgFormat);
mir_free(szMsgFormat);
@@ -177,7 +177,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP EnableWindow(GetDlgItem(hwndDlg, IDC_LOGIN), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_PASSWORD), TRUE);
- wchar_t *szLogin = db_get_tsa(hContact, MODULE, "Login");
+ wchar_t *szLogin = db_get_wsa(hContact, MODULE, "Login");
if (szLogin) {
SetDlgItemText(hwndDlg, IDC_LOGIN, szLogin);
mir_free(szLogin);
@@ -213,17 +213,17 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
GetDlgItemText(hwndDlg, IDC_FEEDURL, str, _countof(str));
- db_set_ts(SelItem->hContact, MODULE, "URL", str);
+ db_set_ws(SelItem->hContact, MODULE, "URL", str);
GetDlgItemText(hwndDlg, IDC_FEEDTITLE, str, _countof(str));
- db_set_ts(SelItem->hContact, MODULE, "Nick", str);
+ db_set_ws(SelItem->hContact, MODULE, "Nick", str);
db_set_dw(SelItem->hContact, MODULE, "UpdateTime", (DWORD)GetDlgItemInt(hwndDlg, IDC_CHECKTIME, NULL, false));
GetDlgItemText(hwndDlg, IDC_TAGSEDIT, str, _countof(str));
- db_set_ts(SelItem->hContact, MODULE, "MsgFormat", str);
+ db_set_ws(SelItem->hContact, MODULE, "MsgFormat", str);
if (IsDlgButtonChecked(hwndDlg, IDC_USEAUTH)) {
db_set_b(SelItem->hContact, MODULE, "UseAuth", 1);
GetDlgItemText(hwndDlg, IDC_LOGIN, str, _countof(str));
- db_set_ts(SelItem->hContact, MODULE, "Login", str);
+ db_set_ws(SelItem->hContact, MODULE, "Login", str);
GetDlgItemTextA(hwndDlg, IDC_PASSWORD, passw, _countof(passw));
db_set_s(SelItem->hContact, MODULE, "Password", passw);
@@ -314,13 +314,13 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP WindowList_Add(hChangeFeedDlgList, hwndDlg, hContact);
Utils_RestoreWindowPositionNoSize(hwndDlg, hContact, MODULE, "ChangeDlg");
- wchar_t *ptszNick = db_get_tsa(hContact, MODULE, "Nick");
+ wchar_t *ptszNick = db_get_wsa(hContact, MODULE, "Nick");
if (ptszNick) {
SetDlgItemText(hwndDlg, IDC_FEEDTITLE, ptszNick);
mir_free(ptszNick);
}
- wchar_t *ptszURL = db_get_tsa(hContact, MODULE, "URL");
+ wchar_t *ptszURL = db_get_wsa(hContact, MODULE, "URL");
if (ptszNick) {
SetDlgItemText(hwndDlg, IDC_FEEDURL, ptszURL);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
@@ -329,7 +329,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetDlgItemInt(hwndDlg, IDC_CHECKTIME, db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME), TRUE);
- wchar_t *ptszMsgFormat = db_get_tsa(hContact, MODULE, "MsgFormat");
+ wchar_t *ptszMsgFormat = db_get_wsa(hContact, MODULE, "MsgFormat");
if (ptszMsgFormat) {
SetDlgItemText(hwndDlg, IDC_TAGSEDIT, ptszMsgFormat);
mir_free(ptszMsgFormat);
@@ -339,7 +339,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP CheckDlgButton(hwndDlg, IDC_USEAUTH, BST_CHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_LOGIN), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_PASSWORD), TRUE);
- wchar_t *ptszLogin = db_get_tsa(hContact, MODULE, "Login");
+ wchar_t *ptszLogin = db_get_wsa(hContact, MODULE, "Login");
if (ptszLogin) {
SetDlgItemText(hwndDlg, IDC_LOGIN, ptszLogin);
mir_free(ptszLogin);
@@ -371,17 +371,17 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
GetDlgItemText(hwndDlg, IDC_FEEDURL, str, _countof(str));
- db_set_ts(hContact, MODULE, "URL", str);
+ db_set_ws(hContact, MODULE, "URL", str);
GetDlgItemText(hwndDlg, IDC_FEEDTITLE, str, _countof(str));
- db_set_ts(hContact, MODULE, "Nick", str);
+ db_set_ws(hContact, MODULE, "Nick", str);
db_set_dw(hContact, MODULE, "UpdateTime", (DWORD)GetDlgItemInt(hwndDlg, IDC_CHECKTIME, NULL, false));
GetDlgItemText(hwndDlg, IDC_TAGSEDIT, str, _countof(str));
- db_set_ts(hContact, MODULE, "MsgFormat", str);
+ db_set_ws(hContact, MODULE, "MsgFormat", str);
if (IsDlgButtonChecked(hwndDlg, IDC_USEAUTH)) {
db_set_b(hContact, MODULE, "UseAuth", 1);
GetDlgItemText(hwndDlg, IDC_LOGIN, str, _countof(str));
- db_set_ts(hContact, MODULE, "Login", str);
+ db_set_ws(hContact, MODULE, "Login", str);
GetDlgItemTextA(hwndDlg, IDC_PASSWORD, passw, _countof(passw));
db_set_s(hContact, MODULE, "Password", passw);
@@ -498,13 +498,13 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA ListView_GetItemText(hwndList, sel, 1, url, _countof(url));
for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
- ptrW dbNick(db_get_tsa(hContact, MODULE, "Nick"));
+ ptrW dbNick(db_get_wsa(hContact, MODULE, "Nick"));
if (dbNick == NULL)
break;
if (mir_wstrcmp(dbNick, nick))
continue;
- ptrW dbURL(db_get_tsa(hContact, MODULE, "URL"));
+ ptrW dbURL(db_get_wsa(hContact, MODULE, "URL"));
if (dbURL == NULL)
break;
if (mir_wstrcmp(dbURL, url))
diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp index 6b613a231d..2ca891def2 100644 --- a/plugins/NewsAggregator/Src/Services.cpp +++ b/plugins/NewsAggregator/Src/Services.cpp @@ -40,7 +40,7 @@ int NewsAggrInit(WPARAM, LPARAM) if (hNewsAggregatorFolder = FoldersRegisterCustomPathT(LPGEN("Avatars"), LPGEN("News Aggregator"), MIRANDA_USERDATAT L"\\Avatars\\" _A2W(DEFAULT_AVATARS_FOLDER)))
FoldersGetCustomPathT(hNewsAggregatorFolder, tszRoot, MAX_PATH, L"");
else
- mir_wstrncpy(tszRoot, VARST(L"%miranda_userdata%\\Avatars\\" _A2W(DEFAULT_AVATARS_FOLDER)), _countof(tszRoot));
+ mir_wstrncpy(tszRoot, VARSW(L"%miranda_userdata%\\Avatars\\" _A2W(DEFAULT_AVATARS_FOLDER)), _countof(tszRoot));
for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
if (!db_get_b(NULL, MODULE, "StartupRetrieve", 1))
@@ -211,7 +211,7 @@ INT_PTR NewsAggrGetAvatarInfo(WPARAM wParam, LPARAM lParam) if (db_get_b(NULL, MODULE, "AutoUpdate", 1) != 0 && !ThreadRunning)
mir_forkthread(UpdateThreadProc, (void *)TRUE);
- wchar_t *ptszImageURL = db_get_tsa(pai->hContact, MODULE, "ImageURL");
+ wchar_t *ptszImageURL = db_get_wsa(pai->hContact, MODULE, "ImageURL");
if(ptszImageURL == NULL)
return GAIR_NOAVATAR;
diff --git a/plugins/NewsAggregator/Src/Utils.cpp b/plugins/NewsAggregator/Src/Utils.cpp index 8c6ba7e73b..dc7302c2e3 100644 --- a/plugins/NewsAggregator/Src/Utils.cpp +++ b/plugins/NewsAggregator/Src/Utils.cpp @@ -31,7 +31,7 @@ bool IsMyContact(MCONTACT hContact) void NetlibInit()
{
NETLIBUSER nlu = { sizeof(nlu) };
- nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR; // | NUF_HTTPGATEWAY;
+ nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE; // | NUF_HTTPGATEWAY;
nlu.ptszDescriptiveName = TranslateT("NewsAggregator HTTP connection");
nlu.szSettingsModule = MODULE;
hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
@@ -142,14 +142,14 @@ void UpdateList(HWND hwndList) UpdateListFlag = TRUE;
lvI.mask = LVIF_TEXT;
lvI.iSubItem = 0;
- wchar_t *ptszNick = db_get_tsa(hContact, MODULE, "Nick");
+ wchar_t *ptszNick = db_get_wsa(hContact, MODULE, "Nick");
if (ptszNick) {
lvI.pszText = ptszNick;
lvI.iItem = i;
ListView_InsertItem(hwndList, &lvI);
lvI.iSubItem = 1;
- wchar_t *ptszURL = db_get_tsa(hContact, MODULE, "URL");
+ wchar_t *ptszURL = db_get_wsa(hContact, MODULE, "URL");
if (ptszURL) {
lvI.pszText = ptszURL;
ListView_SetItem(hwndList, &lvI);
@@ -451,7 +451,7 @@ HRESULT TestDocumentText(IHTMLDocument3 *pHtmlDoc, BSTR &message) return hr;
}
-LPCTSTR ClearText(CMString &result, const wchar_t *message)
+LPCTSTR ClearText(CMStringW &result, const wchar_t *message)
{
BSTR bstrHtml = SysAllocString(message), bstrRes = SysAllocString(L"");
HRESULT hr = TestMarkupServices(bstrHtml, &TestDocumentText, bstrRes);
diff --git a/plugins/NewsAggregator/Src/stdafx.h b/plugins/NewsAggregator/Src/stdafx.h index 6640bcb4ca..2636e380b0 100644 --- a/plugins/NewsAggregator/Src/stdafx.h +++ b/plugins/NewsAggregator/Src/stdafx.h @@ -135,7 +135,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact); LPCTSTR CheckFeed(wchar_t* tszURL, HWND hwndDlg);
void UpdateMenu(bool State);
int ImportFeedsDialog();
-LPCTSTR ClearText(CMString &value, const wchar_t *message);
+LPCTSTR ClearText(CMStringW &value, const wchar_t *message);
bool DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal);
void CreateAuthString(char *auth, MCONTACT hContact, HWND hwndDlg);
INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp index 20afcf6e2e..b5e4bbfe8d 100644 --- a/plugins/NoHistory/src/dllmain.cpp +++ b/plugins/NoHistory/src/dllmain.cpp @@ -246,7 +246,7 @@ int ModulesLoaded(WPARAM, LPARAM) {
// create contact menu item
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
SET_UID(mi, 0xede12697, 0x3e9d, 0x47ca, 0x83, 0xe0, 0xc1, 0x40, 0x69, 0xbf, 0x2d, 0xab);
mi.position = -300010;
diff --git a/plugins/NoHistory/src/options.cpp b/plugins/NoHistory/src/options.cpp index 11f2d04a00..4541ff8ce0 100644 --- a/plugins/NoHistory/src/options.cpp +++ b/plugins/NoHistory/src/options.cpp @@ -219,7 +219,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int OptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS|ODPF_UNICODE;
odp.position = -790000000;
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT);
diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp index 530463def5..0dc717daef 100644 --- a/plugins/Non-IM Contact/src/contactinfo.cpp +++ b/plugins/Non-IM Contact/src/contactinfo.cpp @@ -120,12 +120,12 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP /* link*/
DBVARIANT dbv;
- if (!db_get_ts(hContact, MODNAME, "ProgramString", &dbv)) {
+ if (!db_get_ws(hContact, MODNAME, "ProgramString", &dbv)) {
SetDlgItemText(hwnd, IDC_LINK, dbv.ptszVal);
db_free(&dbv);
}
- if (!db_get_ts(hContact, MODNAME, "ProgramParamsString", &dbv)) {
+ if (!db_get_ws(hContact, MODNAME, "ProgramParamsString", &dbv)) {
SetDlgItemText(hwnd, IDC_PARAMS, dbv.ptszVal);
db_free(&dbv);
}
@@ -135,7 +135,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP for (int i = 1; (szGroup = Clist_GroupGetName(i, NULL)) != NULL; i++)
SendDlgItemMessage(hwnd, IDC_GROUP, CB_INSERTSTRING, 0, LPARAM(szGroup));
- if (!db_get_ts(hContact, "CList", "Group", &dbv)) {
+ if (!db_get_ws(hContact, "CList", "Group", &dbv)) {
SetDlgItemText(hwnd, IDC_GROUP, dbv.ptszVal);
db_free(&dbv);
}
@@ -237,7 +237,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP wchar_t text[512];
GetDlgItemText(hwnd, IDC_GROUP, text, _countof(text));
Clist_GroupCreate(NULL, text);
- db_set_ts(hContact, "CList", "Group", text);
+ db_set_ws(hContact, "CList", "Group", text);
}
else db_unset(hContact, "CList", "Group");
diff --git a/plugins/Non-IM Contact/src/dialog.cpp b/plugins/Non-IM Contact/src/dialog.cpp index 243bc3b761..8ead40caf2 100644 --- a/plugins/Non-IM Contact/src/dialog.cpp +++ b/plugins/Non-IM Contact/src/dialog.cpp @@ -306,7 +306,7 @@ INT_PTR addContact(WPARAM, LPARAM) MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
Proto_AddToContact(hContact, MODNAME);
CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE);
- db_set_ts(hContact, MODNAME, "Nick", TranslateT("New Non-IM Contact"));
+ db_set_ws(hContact, MODNAME, "Nick", TranslateT("New Non-IM Contact"));
DoPropertySheet(hContact);
if (db_get_static(hContact, MODNAME, "Name", tmp, _countof(tmp)))
CallService(MS_DB_CONTACT_DELETE, hContact, 0);
diff --git a/plugins/Non-IM Contact/src/http.cpp b/plugins/Non-IM Contact/src/http.cpp index 912f16eac3..9ffaf1383d 100644 --- a/plugins/Non-IM Contact/src/http.cpp +++ b/plugins/Non-IM Contact/src/http.cpp @@ -94,7 +94,7 @@ void NetlibInit() {
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_NOHTTPSOPTION | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_NOHTTPSOPTION | NUF_UNICODE;
nlu.szSettingsModule = MODNAME;
nlu.ptszDescriptiveName = TranslateT("Non-IM Contacts");
hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
diff --git a/plugins/NotesAndReminders/src/hotkeys.cpp b/plugins/NotesAndReminders/src/hotkeys.cpp index 2e96dd1608..4084e6752b 100644 --- a/plugins/NotesAndReminders/src/hotkeys.cpp +++ b/plugins/NotesAndReminders/src/hotkeys.cpp @@ -15,32 +15,32 @@ void RegisterKeyBindings() memset(&desc, 0, sizeof(desc));
desc.cbSize = sizeof(desc);
- desc.ptszSection = _A2W(SECTIONNAME);
- desc.dwFlags = HKD_TCHAR;
+ desc.pwszSection = _A2W(SECTIONNAME);
+ desc.dwFlags = HKD_UNICODE;
desc.pszName = MODULENAME"/NewNote";
- desc.ptszDescription = LPGENW("New Note");
+ desc.pwszDescription = LPGENW("New Note");
desc.lParam = KB_NEW_NOTE;
desc.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, VK_INSERT);
desc.pszService = MODULENAME"/MenuCommandAddNew";
Hotkey_Register(&desc);
desc.pszName = MODULENAME"/ToggleNotesVis";
- desc.ptszDescription = LPGENW("Toggle Notes Visibility");
+ desc.pwszDescription = LPGENW("Toggle Notes Visibility");
desc.lParam = KB_TOGGLE_NOTES;
desc.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, VK_ADD);
desc.pszService = MODULENAME"/MenuCommandShowHide";
Hotkey_Register(&desc);
desc.pszName = MODULENAME"/BringNotesFront";
- desc.ptszDescription = LPGENW("Bring All Notes to Front");
+ desc.pwszDescription = LPGENW("Bring All Notes to Front");
desc.lParam = KB_TOGGLE_NOTES;
desc.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, VK_HOME);
desc.pszService = MODULENAME"/MenuCommandBringAllFront";
Hotkey_Register(&desc);
desc.pszName = MODULENAME"/NewReminder";
- desc.ptszDescription = LPGENW("New Reminder");
+ desc.pwszDescription = LPGENW("New Reminder");
desc.lParam = KB_NEW_REMINDER;
desc.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, VK_SUBTRACT);
desc.pszService = MODULENAME"/MenuCommandNewReminder";
diff --git a/plugins/NotesAndReminders/src/main.cpp b/plugins/NotesAndReminders/src/main.cpp index ca2511778d..487a632113 100644 --- a/plugins/NotesAndReminders/src/main.cpp +++ b/plugins/NotesAndReminders/src/main.cpp @@ -123,7 +123,7 @@ int OnOptInitialise(WPARAM w, LPARAM L) odp.pszTitle = SECTIONNAME;
odp.pszGroup = LPGEN("Plugins");
odp.pfnDlgProc = DlgProcOptions;
- odp.flags = ODPF_TCHAR;
+ odp.flags = ODPF_UNICODE;
Options_AddPage(w, &odp);
return 0;
}
@@ -198,7 +198,7 @@ int OnModulesLoaded(WPARAM wparam, LPARAM lparam) CMenuItem mi;
mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Notes && Reminders"), 1600000000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "A5E140BC-D697-4689-B75B-8ECFB6FE5931");
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.position = 1600000000;
mi.hIcolibItem = iconList[2].hIcolib;
diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp index dc506b5420..0708bbfcaf 100644 --- a/plugins/NotesAndReminders/src/notes.cpp +++ b/plugins/NotesAndReminders/src/notes.cpp @@ -1025,10 +1025,10 @@ static BOOL DoContextMenu(HWND AhWnd,WPARAM wParam,LPARAM lParam) HMENU hFg = GetSubMenu(hSub, FindMenuItem(hSub, "Text Color")); for (i=0; i<_countof(clrPresets); i++) - InsertMenu(hBg, i, MF_BYPOSITION|MF_OWNERDRAW, IDM_COLORPRESET_BG+i, TranslateTS(clrPresets[i].szName)); + InsertMenu(hBg, i, MF_BYPOSITION|MF_OWNERDRAW, IDM_COLORPRESET_BG+i, Translate(clrPresets[i].szName)); for (i=0; i<_countof(clrPresets); i++) - InsertMenu(hFg, i, MF_BYPOSITION|MF_OWNERDRAW, IDM_COLORPRESET_FG+i, TranslateTS(clrPresets[i].szName)); + InsertMenu(hFg, i, MF_BYPOSITION|MF_OWNERDRAW, IDM_COLORPRESET_FG+i, Translate(clrPresets[i].szName)); } TranslateMenu(FhMenu); @@ -1040,7 +1040,7 @@ static BOOL DoContextMenu(HWND AhWnd,WPARAM wParam,LPARAM lParam) static void MeasureColorPresetMenuItem(HWND hdlg, LPMEASUREITEMSTRUCT lpMeasureItem, struct ColorPreset *clrPresets) { HDC hdc = GetDC(hdlg); - LPSTR lpsz = TranslateTS(clrPresets->szName); + LPSTR lpsz = Translate(clrPresets->szName); SIZE sz; GetTextExtentPoint32(hdc, lpsz, (int)mir_strlen(lpsz), &sz); ReleaseDC(hdlg, hdc); diff --git a/plugins/NotesAndReminders/src/options.cpp b/plugins/NotesAndReminders/src/options.cpp index 5095c216f2..fea1ee5f5c 100644 --- a/plugins/NotesAndReminders/src/options.cpp +++ b/plugins/NotesAndReminders/src/options.cpp @@ -228,7 +228,7 @@ void RegisterFontServiceFonts() char szTemp[100];
FontID fontid = { 0 };
- fontid.cbSize = sizeof(FontIDT);
+ fontid.cbSize = sizeof(FontIDW);
strncpy(fontid.group, SECTIONNAME, _countof(fontid.group));
strncpy(fontid.backgroundGroup, SECTIONNAME, _countof(fontid.backgroundGroup));
@@ -254,11 +254,11 @@ void RegisterFontServiceFonts() strncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fontid.deffontsettings.szFace));
strncpy(fontid.backgroundName, fontOptionsList[i].szBkgName, _countof(fontid.backgroundName));
- FontRegisterT(&fontid);
+ FontRegister(&fontid);
}
- ColourIDT colorid = { 0 };
- colorid.cbSize = sizeof(ColourIDT);
+ ColourID colorid = { 0 };
+ colorid.cbSize = sizeof(ColourIDW);
strncpy(colorid.group, SECTIONNAME, _countof(colorid.group));
strncpy(colorid.dbSettingsGroup, MODULENAME, _countof(fontid.dbSettingsGroup));
@@ -270,7 +270,7 @@ void RegisterFontServiceFonts() colorid.defcolour = colourOptionsList[i].defColour;
strncpy(colorid.setting, colourOptionsList[i].szSettingName, _countof(colorid.setting));
- ColourRegisterT(&colorid);
+ ColourRegister(&colorid);
}
hkFontChange = HookEvent(ME_FONT_RELOAD, FS_FontsChanged);
@@ -279,13 +279,13 @@ void RegisterFontServiceFonts() void LoadNRFont(int i, LOGFONT *lf, COLORREF *colour)
{
- FontIDT fontid = { 0 };
+ FontID fontid = { 0 };
fontid.cbSize = sizeof(fontid);
strncpy(fontid.group, LPGEN(SECTIONNAME), _countof(fontid.group));
strncpy(fontid.name, fontOptionsList[i].szDescr, _countof(fontid.name));
- COLORREF col = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)lf);
+ COLORREF col = CallService(MS_FONT_GETW, (WPARAM)&fontid, (LPARAM)lf);
if (colour)
*colour = col;
}
diff --git a/plugins/NotifyAnything/src/main.cpp b/plugins/NotifyAnything/src/main.cpp index 88e4b16fbf..3e72bf9f3d 100644 --- a/plugins/NotifyAnything/src/main.cpp +++ b/plugins/NotifyAnything/src/main.cpp @@ -145,11 +145,11 @@ void registerSound(const std::wstring &name) SKINSOUNDDESCEX ssd = { 0 };
ssd.cbSize = sizeof(ssd);
- ssd.dwFlags = SSDF_TCHAR;
+ ssd.dwFlags = SSDF_UNICODE;
ssd.pszName = _T2A(id.c_str());
- ssd.ptszSection = LPGENW("Notify Anything");
- ssd.ptszDescription = desc.c_str();
- ssd.ptszDefaultFile = file.c_str();
+ ssd.pwszSection = LPGENW("Notify Anything");
+ ssd.pwszDescription = desc.c_str();
+ ssd.pwszDefaultFile = file.c_str();
Skin_AddSound(&ssd);
}
diff --git a/plugins/NotifyAnything/src/options.cpp b/plugins/NotifyAnything/src/options.cpp index 0abd9cf948..377be8ac3a 100644 --- a/plugins/NotifyAnything/src/options.cpp +++ b/plugins/NotifyAnything/src/options.cpp @@ -66,7 +66,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara ofn.lpstrFilter = TranslateT("Log (*.log)\0*.log\0Text (*.txt)\0*.txt\0All Files (*.*)\0*.*\0");
ofn.nFilterIndex = 1;
// Use profile directory as default, if path is not specified
- CallService(MS_DB_GETPROFILEPATHT, (WPARAM)MAX_PATH, (LPARAM)szProfileDir);
+ CallService(MS_DB_GETPROFILEPATHW, (WPARAM)MAX_PATH, (LPARAM)szProfileDir);
ofn.lpstrInitialDir = szProfileDir;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_HIDEREADONLY;
ofn.lpstrDefExt = L"log";
@@ -141,8 +141,8 @@ void save_settings() db_set_b(NULL, PlugName, "use_pcspeaker", g_settings.use_pcspeaker);
db_set_b(NULL, PlugName, "allow_execute", g_settings.allow_execute);
db_set_dw(NULL, PlugName, "port", g_settings.port);
- db_set_ts(NULL, PlugName, "password", g_settings.password.c_str());
- db_set_ts(NULL, PlugName, "log_filename", g_settings.log_filename.c_str());
+ db_set_ws(NULL, PlugName, "password", g_settings.password.c_str());
+ db_set_ws(NULL, PlugName, "log_filename", g_settings.log_filename.c_str());
}
void load_settings()
@@ -156,12 +156,12 @@ void load_settings() g_settings.port = db_get_dw(NULL, PlugName, "port", 12001);
DBVARIANT dbv;
- if (!db_get_ts(NULL, PlugName, "password", &dbv)) {
+ if (!db_get_ws(NULL, PlugName, "password", &dbv)) {
g_settings.password = dbv.ptszVal;
db_free(&dbv);
}
- if (!db_get_ts(NULL, PlugName, "log_filename", &dbv)) {
+ if (!db_get_ws(NULL, PlugName, "log_filename", &dbv)) {
g_settings.log_filename = dbv.ptszVal;
db_free(&dbv);
}
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index d87d37e373..f429ba14c2 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -133,7 +133,7 @@ int NudgeReceived(WPARAM hContact, LPARAM lParam) if (p.shakeClist)
ShakeClist(hContact, lParam);
if (p.openMessageWindow)
- CallService(MS_MSG_SENDMESSAGET, hContact, 0);
+ CallService(MS_MSG_SENDMESSAGEW, hContact, 0);
if (p.shakeChat)
ShakeChat(hContact, lParam);
if (p.autoResend)
@@ -176,7 +176,7 @@ int NudgeReceived(WPARAM hContact, LPARAM lParam) if (DefaultNudge.shakeClist)
ShakeClist(hContact, lParam);
if (DefaultNudge.openMessageWindow)
- CallService(MS_MSG_SENDMESSAGET, hContact, 0);
+ CallService(MS_MSG_SENDMESSAGEW, hContact, 0);
if (DefaultNudge.shakeChat)
ShakeChat(hContact, lParam);
if (DefaultNudge.autoResend)
@@ -338,7 +338,7 @@ extern "C" int __declspec(dllexport) Load(void) // Add contact menu entry
CMenuItem mi;
SET_UID(mi, 0xd617db26, 0x22ba, 0x4205, 0x9c, 0x3e, 0x53, 0x10, 0xbc, 0xcf, 0xce, 0x19);
- mi.flags = CMIF_NOTOFFLINE | CMIF_TCHAR;
+ mi.flags = CMIF_NOTOFFLINE | CMIF_UNICODE;
mi.position = -500050004;
mi.hIcolibItem = iconList[0].hIcolib;
mi.name.w = LPGENW("Send &Nudge");
@@ -368,7 +368,7 @@ LRESULT CALLBACK NudgePopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara {
switch (msg) {
case WM_COMMAND:
- CallService(MS_MSG_SENDMESSAGET, (WPARAM)PUGetContact(hWnd), 0);
+ CallService(MS_MSG_SENDMESSAGEW, (WPARAM)PUGetContact(hWnd), 0);
PUDeletePopup(hWnd);
break;
@@ -393,7 +393,7 @@ void LoadPopupClass() POPUPCLASS ppc = { sizeof(ppc) };
ppc.flags = PCF_TCHAR;
ppc.pszName = "Nudge";
- ppc.ptszDescription = LPGENW("Show Nudge");
+ ppc.pwszDescription = LPGENW("Show Nudge");
ppc.hIcon = IcoLib_GetIconByHandle(iconList[0].hIcolib);
ppc.colorBack = NULL;
ppc.colorText = NULL;
@@ -418,7 +418,7 @@ int Preview() if (p.shakeClist)
ShakeClist(0, 0);
if (p.openMessageWindow)
- CallService(MS_MSG_SENDMESSAGET, hContact, NULL);
+ CallService(MS_MSG_SENDMESSAGEW, hContact, NULL);
if (p.shakeChat)
ShakeChat(hContact, (LPARAM)time(NULL));
}
@@ -434,7 +434,7 @@ int Preview() if (DefaultNudge.shakeClist)
ShakeClist(0, 0);
if (DefaultNudge.openMessageWindow)
- CallService(MS_MSG_SENDMESSAGET, hContact, NULL);
+ CallService(MS_MSG_SENDMESSAGEW, hContact, NULL);
if (DefaultNudge.shakeChat)
ShakeChat(hContact, (LPARAM)time(NULL));
}
@@ -524,7 +524,7 @@ void Nudge_AddAccount(PROTOACCOUNT *proto) wchar_t soundDesc[MAXMODULELABELLENGTH + 10];
mir_snwprintf(soundDesc, LPGENW("Nudge for %s"), proto->tszAccountName);
- SkinAddNewSoundExT(p->NudgeSoundname, LPGENW("Nudge"), soundDesc);
+ SkinAddNewSoundExW(p->NudgeSoundname, LPGENW("Nudge"), soundDesc);
arNudges.insert(p);
}
diff --git a/plugins/Nudge/src/nudge.cpp b/plugins/Nudge/src/nudge.cpp index 7c0ac3646b..9dc4476a54 100644 --- a/plugins/Nudge/src/nudge.cpp +++ b/plugins/Nudge/src/nudge.cpp @@ -50,9 +50,9 @@ void CNudgeElement::Save(void) mir_snprintf(SectionName, "%s-statusFlags", ProtocolName);
db_set_dw(NULL, MODULENAME, SectionName, this->statusFlags);
mir_snprintf(SectionName, "%s-recText", ProtocolName);
- db_set_ts(NULL, MODULENAME, SectionName, this->recText);
+ db_set_ws(NULL, MODULENAME, SectionName, this->recText);
mir_snprintf(SectionName, "%s-senText", ProtocolName);
- db_set_ts(NULL, MODULENAME, SectionName, this->senText);
+ db_set_ws(NULL, MODULENAME, SectionName, this->senText);
}
void CNudgeElement::Load(void)
@@ -81,7 +81,7 @@ void CNudgeElement::Load(void) this->statusFlags = db_get_dw(NULL, MODULENAME, SectionName, 967);
mir_snprintf(SectionName, "%s-recText", ProtocolName);
- if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, SectionName, &dbv)) {
wcsncpy(this->recText, dbv.ptszVal, TEXT_LEN);
if (wcslen(this->recText) < 1)
wcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
@@ -90,7 +90,7 @@ void CNudgeElement::Load(void) else wcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
mir_snprintf(SectionName, "%s-senText", ProtocolName);
- if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, SectionName, &dbv)) {
wcsncpy(this->senText, dbv.ptszVal, TEXT_LEN);
if (wcslen(this->senText) < 1)
wcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
diff --git a/plugins/OpenFolder/src/openFolder.cpp b/plugins/OpenFolder/src/openFolder.cpp index 8c6e7e62ad..5c5e1c7328 100644 --- a/plugins/OpenFolder/src/openFolder.cpp +++ b/plugins/OpenFolder/src/openFolder.cpp @@ -89,10 +89,10 @@ extern "C" int __declspec(dllexport) Load() // hotkeys service (0.8+)
HOTKEYDESC hotkey = { 0 };
hotkey.cbSize = sizeof(hotkey);
- hotkey.dwFlags = HKD_TCHAR;
+ hotkey.dwFlags = HKD_UNICODE;
hotkey.pszName = "Open Folder";
- hotkey.ptszDescription = LPGENW("Open Folder");
- hotkey.ptszSection = LPGENW("Main");
+ hotkey.pwszDescription = LPGENW("Open Folder");
+ hotkey.pwszSection = LPGENW("Main");
hotkey.pszService = MS_OPENFOLDER_OPEN;
hotkey.DefHotKey = MAKEWORD( 'O', HOTKEYF_SHIFT | HOTKEYF_ALT );
Hotkey_Register(&hotkey);
@@ -100,7 +100,7 @@ extern "C" int __declspec(dllexport) Load() CMenuItem mi;
SET_UID(mi, 0xbba6ad01, 0x755a, 0x4d01, 0x94, 0xee, 0x57, 0x84, 0x18, 0x70, 0x77, 0x4f);
mi.position = 0x7FFFFFFF;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = icon.hIcolib;
mi.name.w = LPGENW("Open Folder");
mi.pszService = MS_OPENFOLDER_OPEN;
diff --git a/plugins/PackUpdater/Src/Events.cpp b/plugins/PackUpdater/Src/Events.cpp index bc12d5359b..9a196d721e 100644 --- a/plugins/PackUpdater/Src/Events.cpp +++ b/plugins/PackUpdater/Src/Events.cpp @@ -27,10 +27,10 @@ int ModulesLoaded(WPARAM, LPARAM) Silent = true;
HOTKEYDESC hkd = { 0 };
hkd.cbSize = sizeof(hkd);
- hkd.dwFlags = HKD_TCHAR;
+ hkd.dwFlags = HKD_UNICODE;
hkd.pszName = "Check for pack updates";
- hkd.ptszDescription = LPGENW("Check for pack updates");
- hkd.ptszSection = LPGENW("Pack Updater");
+ hkd.pwszDescription = LPGENW("Check for pack updates");
+ hkd.pwszSection = LPGENW("Pack Updater");
hkd.pszService = MODNAME"/CheckUpdates";
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, VK_F10) | HKF_MIRANDA_LOCAL;
hkd.lParam = FALSE;
diff --git a/plugins/PackUpdater/Src/Notifications.cpp b/plugins/PackUpdater/Src/Notifications.cpp index 9670d9e905..98633872c8 100644 --- a/plugins/PackUpdater/Src/Notifications.cpp +++ b/plugins/PackUpdater/Src/Notifications.cpp @@ -311,7 +311,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam EnableWindow(GetDlgItem(hDlg, IDC_INFO), TRUE);
else
EnableWindow(GetDlgItem(hDlg, IDC_INFO), FALSE);
- SetDlgItemText(hDlg, IDC_MESSAGE, TranslateTS(todo[lvI.iItem].tszMessage));
+ SetDlgItemText(hDlg, IDC_MESSAGE, TranslateW(todo[lvI.iItem].tszMessage));
}
}
break;
@@ -401,7 +401,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam }
mir_wstrncpy(todo[i].tszCurVer, todo[i].tszNewVer, _countof(todo[i].tszCurVer));
mir_snprintf(szKey, "File_%d_CurrentVersion", todo[i].FileNum);
- db_set_ts(NULL, MODNAME, szKey, todo[i].tszCurVer);
+ db_set_ws(NULL, MODNAME, szKey, todo[i].tszCurVer);
arFileType.push_back(todo[i].FileType);
arFilePath.push_back(todo[i].File.tszDiskPath);
arFileName.push_back(tszFileName);
diff --git a/plugins/PackUpdater/Src/Options.cpp b/plugins/PackUpdater/Src/Options.cpp index ef4e41fd39..2738ae2034 100644 --- a/plugins/PackUpdater/Src/Options.cpp +++ b/plugins/PackUpdater/Src/Options.cpp @@ -196,8 +196,8 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) SetDlgItemInt(hdlg, IDC_TIMEOUT_VALUE, MyOptions.Timeout, TRUE);
//Mouse actions
for (i = 0; i < _countof(PopupActions); i++) {
- SendDlgItemMessage(hdlg, IDC_LC, CB_SETITEMDATA, SendDlgItemMessage(hdlg, IDC_LC, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action);
- SendDlgItemMessage(hdlg, IDC_RC, CB_SETITEMDATA, SendDlgItemMessage(hdlg, IDC_RC, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action);
+ SendDlgItemMessage(hdlg, IDC_LC, CB_SETITEMDATA, SendDlgItemMessage(hdlg, IDC_LC, CB_ADDSTRING, 0, (LPARAM)TranslateW(PopupActions[i].Text)), PopupActions[i].Action);
+ SendDlgItemMessage(hdlg, IDC_RC, CB_SETITEMDATA, SendDlgItemMessage(hdlg, IDC_RC, CB_ADDSTRING, 0, (LPARAM)TranslateW(PopupActions[i].Text)), PopupActions[i].Action);
}
SendDlgItemMessage(hdlg, IDC_LC, CB_SETCURSEL, MyOptions.LeftClickAction, 0);
SendDlgItemMessage(hdlg, IDC_RC, CB_SETCURSEL, MyOptions.RightClickAction, 0);
@@ -388,7 +388,7 @@ int OptInit(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 100000000;
odp.hInstance = hInst;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_UPDATENOTIFY);
odp.pwszGroup = LPGENW("Services");
odp.pwszTitle = LPGENW("Pack Updater");
diff --git a/plugins/PackUpdater/Src/PackUpdater.cpp b/plugins/PackUpdater/Src/PackUpdater.cpp index d4df5c677f..3f8ee10e8d 100644 --- a/plugins/PackUpdater/Src/PackUpdater.cpp +++ b/plugins/PackUpdater/Src/PackUpdater.cpp @@ -73,7 +73,7 @@ extern "C" __declspec(dllexport) int Load(void) CMenuItem mi;
SET_UID(mi, 0x326495e8, 0xab0a, 0x47d2, 0xb2, 0x22, 0x2a, 0x8e, 0xa8, 0xae, 0x53, 0x1a);
mi.position = -0x7FFFFFFF;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = IcoLib_GetIcon("check_update");
mi.name.w = LPGENW("Check for pack updates");
mi.pszService = MODNAME"/CheckUpdates";
@@ -83,7 +83,7 @@ extern "C" __declspec(dllexport) int Load(void) memset(&mi, 0, sizeof(mi));
SET_UID(mi, 0xc3eea590, 0xaba3, 0x454f, 0x93, 0x93, 0xbc, 0x97, 0x15, 0x2c, 0x3b, 0x3d);
mi.position = -0x7FFFFFFF;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = IcoLib_GetIcon("empty_folder");
mi.name.w = LPGENW("Clear pack updates folder");
mi.pszService = MODNAME"/EmptyFolder";
diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp index b555e97d37..f041e4d91d 100644 --- a/plugins/PackUpdater/Src/Utils.cpp +++ b/plugins/PackUpdater/Src/Utils.cpp @@ -50,7 +50,7 @@ BOOL NetlibInit() {
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR; // | NUF_HTTPGATEWAY;
+ nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE; // | NUF_HTTPGATEWAY;
nlu.ptszDescriptiveName = TranslateT("Pack Updater HTTP connection");
nlu.szSettingsModule = MODNAME;
hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
@@ -190,7 +190,7 @@ static void CheckUpdates(void *) FileCount = db_get_dw(NULL, MODNAME, "FileCount", DEFAULT_FILECOUNT);
// Load files info
- ptrW tszDownloadURL(db_get_tsa(NULL, MODNAME, "File_VersionURL"));
+ ptrW tszDownloadURL(db_get_wsa(NULL, MODNAME, "File_VersionURL"));
if (!tszDownloadURL) { // URL is not set
Title = TranslateT("Pack Updater");
Text = TranslateT("URL for checking updates not found.");
@@ -222,14 +222,14 @@ static void CheckUpdates(void *) FILEINFO FileInfo = { L"", L"", L"", L"", L"", L"", L"", { L"", L"" } };
mir_snprintf(szKey, "File_%d_CurrentVersion", CurrentFile + 1);
- ptrW tszCurVer(db_get_tsa(NULL, MODNAME, szKey));
+ ptrW tszCurVer(db_get_wsa(NULL, MODNAME, szKey));
if (tszCurVer)
mir_wstrncpy(FileInfo.tszCurVer, tszCurVer, _countof(FileInfo.tszCurVer));
else
mir_wstrncpy(FileInfo.tszCurVer, L"", _countof(FileInfo.tszCurVer));
mir_snprintf(szKey, "File_%d_LastVersion", CurrentFile + 1);
- ptrW tszLastVer(db_get_tsa(NULL, MODNAME, szKey));
+ ptrW tszLastVer(db_get_wsa(NULL, MODNAME, szKey));
if (tszLastVer)
mir_wstrncpy(FileInfo.tszLastVer, tszLastVer, _countof(FileInfo.tszLastVer));
else
@@ -269,14 +269,14 @@ static void CheckUpdates(void *) else
mir_snwprintf(tszBuff, L"Plugins\\%s\\%s", Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
wchar_t pluginFolderName[MAX_PATH];
- PathToAbsoluteT(tszBuff, pluginFolderName);
+ PathToAbsoluteW(tszBuff, pluginFolderName);
if (!Files[CurrentFile].Force && (IsPluginDisabled(Files[CurrentFile].File.tszDiskPath) || !Exists(pluginFolderName))) //check if plugin disabled or not exists
continue;
}
// Compare versions
if (getVer(Files[CurrentFile].tszCurVer) < getVer(Files[CurrentFile].tszNewVer)) { // Yeah, we've got new version.
- VARST tszSysRoot(L"%SystemRoot%");
- VARST tszProgFiles(L"%ProgramFiles%");
+ VARSW tszSysRoot(L"%SystemRoot%");
+ VARSW tszProgFiles(L"%ProgramFiles%");
if (Files[CurrentFile].FileType != 1 && !IsUserAnAdmin() && (wcsstr(tszRoot, tszSysRoot) || wcsstr(tszRoot, tszProgFiles))) {
MessageBox(NULL, TranslateT("Update is not possible!\nYou have no Administrator's rights.\nPlease run Miranda NG with Administrator's rights."), Title, MB_ICONINFORMATION);
@@ -292,7 +292,7 @@ static void CheckUpdates(void *) case 1:
break;
case 2: {
- VARST tszUtilRootPlug(L"%miranda_path%\\Plugins");
+ VARSW tszUtilRootPlug(L"%miranda_path%\\Plugins");
if (mir_wstrcmp(Files[CurrentFile].tszAdvFolder, L"") == 0)
mir_snwprintf(tszFilePathDest, L"%s\\%s", tszUtilRootPlug, Files[CurrentFile].File.tszDiskPath);
else
@@ -300,7 +300,7 @@ static void CheckUpdates(void *) }
break;
case 3: {
- VARST tszUtilRootIco(L"%miranda_path%\\Icons");
+ VARSW tszUtilRootIco(L"%miranda_path%\\Icons");
if (mir_wstrcmp(Files[CurrentFile].tszAdvFolder, L"") == 0)
mir_snwprintf(tszFilePathDest, L"%s\\%s", tszUtilRootIco, Files[CurrentFile].File.tszDiskPath);
else
@@ -309,7 +309,7 @@ static void CheckUpdates(void *) break;
case 4:
case 5: {
- wchar_t *tszUtilRoot = VARST(L"%miranda_path%");
+ wchar_t *tszUtilRoot = VARSW(L"%miranda_path%");
if (mir_wstrcmp(Files[CurrentFile].tszAdvFolder, L"") == 0)
mir_snwprintf(tszFilePathDest, L"%s\\%s", tszUtilRoot, Files[CurrentFile].File.tszDiskPath);
else
@@ -323,7 +323,7 @@ static void CheckUpdates(void *) // Save last version
mir_wstrncpy(Files[CurrentFile].tszLastVer, Files[CurrentFile].tszNewVer, _countof(Files[CurrentFile].tszLastVer));
mir_snprintf(szKey, "File_%d_LastVersion", CurrentFile + 1);
- db_set_ts(NULL, MODNAME, szKey, Files[CurrentFile].tszLastVer);
+ db_set_ws(NULL, MODNAME, szKey, Files[CurrentFile].tszLastVer);
} // end compare versions
} //end checking all files in for ()
diff --git a/plugins/PasteIt/src/Options.cpp b/plugins/PasteIt/src/Options.cpp index 8efd3d1174..60cec76e47 100644 --- a/plugins/PasteIt/src/Options.cpp +++ b/plugins/PasteIt/src/Options.cpp @@ -639,7 +639,7 @@ void Options::InitCodepageCB(HWND hwndCB, unsigned int codepage) int cpCount = sizeof(cpTable) / sizeof(cpTable[0]);
int selCpIdx = -1;
for (int i = 0; i < cpCount; ++i) {
- ComboBox_AddString(hwndCB, TranslateTS(cpTable[i].cpName));
+ ComboBox_AddString(hwndCB, TranslateW(cpTable[i].cpName));
if (cpTable[i].cpId == codepage)
selCpIdx = i;
}
@@ -680,7 +680,7 @@ int Options::InitOptions(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 100000000;
odp.hInstance = hInst;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pwszTitle = LPGENW("Paste It");
odp.pwszGroup = LPGENW("Services");
diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index fe85a759c3..6ebee5236d 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -294,7 +294,7 @@ void InitMenuItems() CMenuItem mi;
SET_UID(mi, 0x33ecc112, 0x6, 0x487d, 0xbb, 0x8b, 0x76, 0xb4, 0x17, 0x9b, 0xdb, 0xc5);
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = icon.hIcolib;
mi.position = 3000090005;
mi.name.w = LPGENW("Paste It");
@@ -302,7 +302,7 @@ void InitMenuItems() memset(&mi, 0, sizeof(mi));
SET_UID(mi, 0xedc0456d, 0x5aa8, 0x4a61, 0xbe, 0xfd, 0xed, 0x34, 0xb2, 0xcc, 0x6, 0x54);
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.pszService = MS_PASTEIT_CONTACTMENU;
mi.root = hContactMenu;
mi.name.w = LPGENW("Paste from clipboard");
@@ -322,7 +322,7 @@ void InitMenuItems() mi2.root = hDefWebMenu;
for (int i = 0; i < PasteToWeb::pages; ++i)
{
- mi2.flags = CMIF_TCHAR | CMIF_UNMOVABLE;
+ mi2.flags = CMIF_UNICODE | CMIF_UNMOVABLE;
if (Options::instance->defWeb == i)
mi2.flags |= CMIF_CHECKED;
mi2.name.w = pasteToWebs[i]->GetName();
@@ -404,7 +404,7 @@ extern "C" int __declspec(dllexport) Load(void) NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_TCHAR | NUF_OUTGOING | NUF_HTTPCONNS;
+ nlu.flags = NUF_UNICODE | NUF_OUTGOING | NUF_HTTPCONNS;
nlu.szSettingsModule = MODULE;
nlu.ptszDescriptiveName = TranslateT("Paste It HTTP connections");
g_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
diff --git a/plugins/Ping/src/log.cpp b/plugins/Ping/src/log.cpp index c99af91c06..ef50c5cb0b 100644 --- a/plugins/Ping/src/log.cpp +++ b/plugins/Ping/src/log.cpp @@ -32,8 +32,8 @@ INT_PTR Log(WPARAM wParam, LPARAM) { INT_PTR GetLogFilename(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv;
wchar_t *filename = (wchar_t *)lParam;
- if (db_get_ts(0, PLUG, "LogFilename", &dbv)) {
- CallService(MS_DB_GETPROFILEPATHT, wParam, (LPARAM)filename);
+ if (db_get_ws(0, PLUG, "LogFilename", &dbv)) {
+ CallService(MS_DB_GETPROFILEPATHW, wParam, (LPARAM)filename);
mir_wstrncat(filename, L"\\ping_log.txt", wParam - mir_wstrlen(filename));
}
else {
@@ -47,7 +47,7 @@ INT_PTR GetLogFilename(WPARAM wParam, LPARAM lParam) { }
INT_PTR SetLogFilename(WPARAM, LPARAM lParam) {
- db_set_ts(0, PLUG, "LogFilename", (wchar_t *)lParam);
+ db_set_ws(0, PLUG, "LogFilename", (wchar_t *)lParam);
return 0;
}
diff --git a/plugins/Ping/src/menu.cpp b/plugins/Ping/src/menu.cpp index 1fd1ce70dd..3f2a0bd198 100644 --- a/plugins/Ping/src/menu.cpp +++ b/plugins/Ping/src/menu.cpp @@ -7,7 +7,7 @@ void InitMenus() {
// main menu
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Ping"), 500099900);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "FF273885-6AEC-4C8A-B8BC-9247D920F223");
diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp index 1f77da46d2..0d763f466a 100644 --- a/plugins/Ping/src/options.cpp +++ b/plugins/Ping/src/options.cpp @@ -505,7 +505,7 @@ int PingOptInit(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pwszGroup = LPGENW("Network");
odp.pwszTitle = LPGENW("Ping");
diff --git a/plugins/Ping/src/ping.cpp b/plugins/Ping/src/ping.cpp index 9533ff3d83..2255dca874 100644 --- a/plugins/Ping/src/ping.cpp +++ b/plugins/Ping/src/ping.cpp @@ -86,7 +86,7 @@ int OnModulesLoaded(WPARAM, LPARAM) NETLIBUSER nl_user = { 0 };
nl_user.cbSize = sizeof(nl_user);
nl_user.szSettingsModule = PLUG;
- nl_user.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
+ nl_user.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nl_user.ptszDescriptiveName = TranslateT("Ping Plugin");
nl_user.szHttpGatewayHello = 0;
nl_user.szHttpGatewayUserAgent = 0;
diff --git a/plugins/Ping/src/pinglist.cpp b/plugins/Ping/src/pinglist.cpp index 9ba42dad03..92e094e74b 100644 --- a/plugins/Ping/src/pinglist.cpp +++ b/plugins/Ping/src/pinglist.cpp @@ -63,17 +63,17 @@ void write_ping_address(PINGADDRESS &i) }
db_set_dw(0, buff, "Id", i.item_id);
- db_set_ts(0, buff, "Address", i.pszName);
- db_set_ts(0, buff, "Label", i.pszLabel);
+ db_set_ws(0, buff, "Address", i.pszName);
+ db_set_ws(0, buff, "Label", i.pszLabel);
db_set_w(0, buff, "Status", i.status);
db_set_dw(0, buff, "Port", i.port);
db_set_s(0, buff, "Proto", i.pszProto);
if (mir_wstrlen(i.pszCommand))
- db_set_ts(0, buff, "Command", i.pszCommand);
+ db_set_ws(0, buff, "Command", i.pszCommand);
else
db_unset(0, buff, "Command");
if (mir_wstrlen(i.pszParams))
- db_set_ts(0, buff, "CommandParams", i.pszParams);
+ db_set_ws(0, buff, "CommandParams", i.pszParams);
else
db_unset(0, buff, "CommandParams");
db_set_w(0, buff, "SetStatus", i.set_status);
@@ -115,13 +115,13 @@ bool read_ping_address(PINGADDRESS &pa) { if ((pa.item_id = db_get_dw(0, buff, "Id", 0)) == 0) return false;
DBVARIANT dbv;
- if (!db_get_ts(0, buff, "Address", &dbv)) {
+ if (!db_get_ws(0, buff, "Address", &dbv)) {
mir_wstrncpy(pa.pszName, dbv.ptszVal, _countof(pa.pszName));
db_free(&dbv);
}
else return false;
- if (!db_get_ts(0, buff, "Label", &dbv)) {
+ if (!db_get_ws(0, buff, "Label", &dbv)) {
mir_wstrncpy(pa.pszLabel, dbv.ptszVal, _countof(pa.pszLabel));
db_free(&dbv);
}
@@ -138,13 +138,13 @@ bool read_ping_address(PINGADDRESS &pa) { }
else pa.pszProto[0] = '\0';
- if (!db_get_ts(0, buff, "Command", &dbv)) {
+ if (!db_get_ws(0, buff, "Command", &dbv)) {
mir_wstrncpy(pa.pszCommand, dbv.ptszVal, _countof(pa.pszCommand));
db_free(&dbv);
}
else
pa.pszCommand[0] = '\0';
- if (!db_get_ts(0, buff, "CommandParams", &dbv)) {
+ if (!db_get_ws(0, buff, "CommandParams", &dbv)) {
mir_wstrncpy(pa.pszParams, dbv.ptszVal, _countof(pa.pszParams));
db_free(&dbv);
}
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index 7e6ccdbfc4..b0df01d290 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -19,8 +19,8 @@ int frame_id = -1; HBRUSH tbrush = 0;
-FontIDT font_id;
-ColourIDT bk_col_id;
+FontIDW font_id;
+ColourIDW bk_col_id;
HFONT hFont = 0;
COLORREF bk_col = RGB(255, 255, 255);
@@ -312,8 +312,8 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) else
mir_snwprintf(TBcapt, L"Ping");
- CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBNAME | FO_TCHAR, frame_id), (LPARAM)TBcapt);
- CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME | FO_TCHAR, frame_id), (LPARAM)TBcapt);
+ CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBNAME | FO_UNICODETEXT, frame_id), (LPARAM)TBcapt);
+ CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME | FO_UNICODETEXT, frame_id), (LPARAM)TBcapt);
CallService(MS_CLIST_FRAMES_UPDATEFRAME, frame_id, FU_TBREDRAW);
}
}
@@ -781,11 +781,11 @@ int ReloadFont(WPARAM, LPARAM) if (hFont) DeleteObject(hFont);
LOGFONT log_font;
- CallService(MS_FONT_GETT, (WPARAM)&font_id, (LPARAM)&log_font);
+ CallService(MS_FONT_GETW, (WPARAM)&font_id, (LPARAM)&log_font);
hFont = CreateFontIndirect(&log_font);
SendMessage(list_hwnd, WM_SETFONT, (WPARAM)hFont, TRUE);
- bk_col = CallService(MS_COLOUR_GETT, (WPARAM)&bk_col_id, 0);
+ bk_col = CallService(MS_COLOUR_GETW, (WPARAM)&bk_col_id, 0);
RefreshWindow(0, 0);
return 0;
@@ -906,7 +906,7 @@ void InitList() Menu_ConfigureItem(mi.root, MCI_OPT_UID, "7CFBF239-86B5-48B2-8D5B-39E09A7DB514");
SET_UID(mi, 0x4adbd753, 0x27d6, 0x457a, 0xa6, 0x6, 0xdf, 0x4f, 0x2c, 0xd8, 0xb9, 0x3b);
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.position = 3000320001;
mi.name.w = LPGENW("Show/Hide &Ping Window");
mi.pszService = PLUG "/ShowWindow";
@@ -916,7 +916,7 @@ void InitList() else ShowWindow(hpwnd, SW_SHOW);
}
- font_id.cbSize = sizeof(FontIDT);
+ font_id.cbSize = sizeof(FontIDW);
mir_wstrncpy(font_id.group, LPGENW("Ping"), _countof(font_id.group));
mir_wstrncpy(font_id.name, LPGENW("List"), _countof(font_id.name));
mir_strncpy(font_id.dbSettingsGroup, "PING", _countof(font_id.dbSettingsGroup));
@@ -931,15 +931,15 @@ void InitList() font_id.deffontsettings.colour = RGB(255, 255, 255);
mir_wstrncpy(font_id.deffontsettings.szFace, L"Tahoma", _countof(font_id.deffontsettings.szFace));
- FontRegisterT(&font_id);
+ FontRegisterW(&font_id);
- bk_col_id.cbSize = sizeof(ColourIDT);
+ bk_col_id.cbSize = sizeof(ColourIDW);
mir_wstrncpy(bk_col_id.group, L"Ping", _countof(bk_col_id.group));
mir_wstrncpy(bk_col_id.name, L"Background", _countof(bk_col_id.name));
mir_strncpy(bk_col_id.dbSettingsGroup, "PING", _countof(bk_col_id.dbSettingsGroup));
mir_strncpy(bk_col_id.setting, "BgColor", _countof(bk_col_id.setting));
bk_col_id.defcolour = RGB(0, 0, 0);
- ColourRegisterT(&bk_col_id);
+ ColourRegisterW(&bk_col_id);
HookEvent(ME_FONT_RELOAD, ReloadFont);
diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index 37c01d0d28..8eb2002532 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -221,7 +221,7 @@ void import_ping_address(int index, PINGADDRESS &pa) { DBVARIANT dbv;
char buf[256];
mir_snprintf(buf, "Address%d", index);
- if (!db_get_ts(0, "PingPlug", buf, &dbv)) {
+ if (!db_get_ws(0, "PingPlug", buf, &dbv)) {
mir_wstrncpy(pa.pszName, dbv.ptszVal, _countof(pa.pszName));
db_free(&dbv);
}
@@ -229,7 +229,7 @@ void import_ping_address(int index, PINGADDRESS &pa) { mir_wstrncpy(pa.pszName, TranslateT("Unknown Address"), _countof(pa.pszName));
mir_snprintf(buf, "Label%d", index);
- if (!db_get_ts(0, "PingPlug", buf, &dbv)) {
+ if (!db_get_ws(0, "PingPlug", buf, &dbv)) {
mir_wstrncpy(pa.pszLabel, dbv.ptszVal, _countof(pa.pszLabel));
db_free(&dbv);
}
@@ -314,7 +314,7 @@ void InitUtils() test.flags = PCF_TCHAR;
test.hIcon = hIconResponding;
test.iSeconds = -1;
- test.ptszDescription = TranslateT("Ping");
+ test.pwszDescription = TranslateT("Ping");
test.pszName = "pingpopups";
test.PluginWindowProc = NullWindowProc;
if (hPopupClass = Popup_RegisterClass(&test))
diff --git a/plugins/PluginUpdater/src/DlgListNew.cpp b/plugins/PluginUpdater/src/DlgListNew.cpp index 7f28faab29..5d30a3a4b3 100644 --- a/plugins/PluginUpdater/src/DlgListNew.cpp +++ b/plugins/PluginUpdater/src/DlgListNew.cpp @@ -61,7 +61,7 @@ static void ApplyDownloads(void *param) mir_snwprintf(tszFileTemp, L"%s\\Temp", g_tszRoot);
SafeCreateDirectory(tszFileTemp);
- VARST tszMirandaPath(L"%miranda_path%");
+ VARSW tszMirandaPath(L"%miranda_path%");
HANDLE nlc = NULL;
for (int i=0; i < todo.getCount(); ++i) {
@@ -393,7 +393,7 @@ static void GetList(void *) }
FILELIST *UpdateFiles = new FILELIST(20);
- VARST dirname(L"%miranda_path%");
+ VARSW dirname(L"%miranda_path%");
for (int i=0; i < hashes.getCount(); i++) {
ServListEntry &hash = hashes[i];
@@ -480,7 +480,7 @@ static INT_PTR ParseUriService(WPARAM, LPARAM lParam) if (hash == NULL)
return 0;
- VARST dirName(L"%miranda_path%");
+ VARSW dirName(L"%miranda_path%");
wchar_t tszPath[MAX_PATH];
mir_snwprintf(tszPath, L"%s\\%s", dirName, hash->m_name);
FILEINFO *fileInfo = ServerEntryToFileInfo(*hash, baseUrl, tszPath);
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index 9f02de304d..06a9badcf1 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -96,7 +96,7 @@ static void ApplyUpdates(void *param) Netlib_CloseHandle(nlc);
// 3) Unpack all zips
- VARST tszMirandaPath(L"%miranda_path%");
+ VARSW tszMirandaPath(L"%miranda_path%");
for (int i = 0; i < todo.getCount(); i++) {
FILEINFO& p = todo[i];
if (p.bEnabled) {
@@ -125,9 +125,9 @@ static void ApplyUpdates(void *param) #if MIRANDA_VER < 0x0A00
// 4) Change title of clist
- ptrW title(db_get_tsa(NULL, "CList", "TitleText"));
+ ptrW title(db_get_wsa(NULL, "CList", "TitleText"));
if (!lstrcmpi(title, L"Miranda IM"))
- db_set_ts(NULL, "CList", "TitleText", L"Miranda NG");
+ db_set_ws(NULL, "CList", "TitleText", L"Miranda NG");
#endif
db_set_b(NULL, MODNAME, DB_SETTING_RESTART_COUNT, 5);
@@ -138,12 +138,12 @@ static void ApplyUpdates(void *param) if (opts.bChangePlatform) {
wchar_t mirandaPath[MAX_PATH];
GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath));
- db_set_ts(NULL, MODNAME, "OldBin2", mirandaPath);
+ db_set_ws(NULL, MODNAME, "OldBin2", mirandaPath);
db_unset(NULL, MODNAME, DB_SETTING_CHANGEPLATFORM);
}
else {
- ptrW oldbin(db_get_tsa(NULL, MODNAME, "OldBin2"));
+ ptrW oldbin(db_get_wsa(NULL, MODNAME, "OldBin2"));
if (oldbin) {
SafeDeleteFile(oldbin);
db_unset(NULL, MODNAME, "OldBin2");
@@ -446,7 +446,7 @@ static void DlgUpdateSilent(void *param) }
// 3) Unpack all zips
- VARST tszMirandaPath(L"%miranda_path%");
+ VARSW tszMirandaPath(L"%miranda_path%");
for (int i = 0; i < UpdateFiles.getCount(); i++) {
FILEINFO& p = UpdateFiles[i];
if (p.bEnabled) {
@@ -477,9 +477,9 @@ static void DlgUpdateSilent(void *param) #if MIRANDA_VER < 0x0A00
// 4) Change title of clist
- ptrW title = db_get_tsa(NULL, "CList", "TitleText");
+ ptrW title = db_get_wsa(NULL, "CList", "TitleText");
if (!wcsicmp(title, L"Miranda IM"))
- db_set_ts(NULL, "CList", "TitleText", L"Miranda NG");
+ db_set_ws(NULL, "CList", "TitleText", L"Miranda NG");
#endif
opts.bForceRedownload = false;
@@ -802,7 +802,7 @@ static void CheckUpdates(void *) bool success = ParseHashes(updateUrl, baseUrl, hashes);
if (success) {
FILELIST *UpdateFiles = new FILELIST(20);
- VARST dirname(L"%miranda_path%");
+ VARSW dirname(L"%miranda_path%");
int count = ScanFolder(dirname, lstrlen(dirname) + 1, baseUrl, hashes, UpdateFiles);
// Show dialog
diff --git a/plugins/PluginUpdater/src/Events.cpp b/plugins/PluginUpdater/src/Events.cpp index ea4c6e8ddf..f048d10a5a 100644 --- a/plugins/PluginUpdater/src/Events.cpp +++ b/plugins/PluginUpdater/src/Events.cpp @@ -50,7 +50,7 @@ int ModulesLoaded(WPARAM, LPARAM) HookEvent(ME_FOLDERS_PATH_CHANGED, OnFoldersChanged);
OnFoldersChanged(0, 0);
}
- else lstrcpyn(g_tszRoot, VARST(L"%miranda_path%\\" DEFAULT_UPDATES_FOLDER), _countof(g_tszRoot));
+ else lstrcpyn(g_tszRoot, VARSW(L"%miranda_path%\\" DEFAULT_UPDATES_FOLDER), _countof(g_tszRoot));
#if MIRANDA_VER >= 0x0A00
if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE))
diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index 38dd4d5802..9a01d64af8 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -33,7 +33,7 @@ static int GetUpdateMode() // Check if there is url for custom mode
if (UpdateMode == UPDATE_MODE_CUSTOM) {
- ptrW url(db_get_tsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
+ ptrW url(db_get_wsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
if (url == NULL || !wcslen(url)) {
// No url for custom mode, reset that setting so it will be determined automatically
db_unset(NULL, MODNAME, DB_SETTING_UPDATE_MODE);
@@ -65,7 +65,7 @@ wchar_t* GetDefaultUrl() mir_snwprintf(url, DEFAULT_UPDATE_URL_TRUNK_SYMBOLS, opts.bChangePlatform ? DEFAULT_OPP_BITS : DEFAULT_BITS);
return mir_wstrdup(url);
default:
- return db_get_tsa(NULL, MODNAME, DB_SETTING_UPDATE_URL);
+ return db_get_wsa(NULL, MODNAME, DB_SETTING_UPDATE_URL);
}
}
@@ -140,7 +140,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHANGE_PLATFORM), FALSE);
- ptrW url(db_get_tsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
+ ptrW url(db_get_wsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
if (url == NULL)
url = GetDefaultUrl();
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, url);
@@ -206,7 +206,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar EnableWindow(GetDlgItem(hwndDlg, IDC_CHANGE_PLATFORM), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), TRUE);
{
- ptrW url(db_get_tsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
+ ptrW url(db_get_wsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
if (url == NULL)
url = GetDefaultUrl();
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, url);
@@ -295,7 +295,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar else {
wchar_t tszUrl[100];
GetDlgItemText(hwndDlg, IDC_CUSTOMURL, tszUrl, _countof(tszUrl));
- db_set_ts(NULL, MODNAME, DB_SETTING_UPDATE_URL, tszUrl);
+ db_set_ws(NULL, MODNAME, DB_SETTING_UPDATE_URL, tszUrl);
db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_CUSTOM);
opts.bForceRedownload = 0;
db_unset(NULL, MODNAME, DB_SETTING_REDOWNLOAD);
@@ -340,8 +340,8 @@ static INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM SetDlgItemInt(hdlg, IDC_TIMEOUT_VALUE, PopupOptions.Timeout, TRUE);
//Mouse actions
for (int i = 0; i < _countof(PopupActions); i++) {
- SendDlgItemMessage(hdlg, IDC_LC, CB_SETITEMDATA, SendDlgItemMessage(hdlg, IDC_LC, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action);
- SendDlgItemMessage(hdlg, IDC_RC, CB_SETITEMDATA, SendDlgItemMessage(hdlg, IDC_RC, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action);
+ SendDlgItemMessage(hdlg, IDC_LC, CB_SETITEMDATA, SendDlgItemMessage(hdlg, IDC_LC, CB_ADDSTRING, 0, (LPARAM)TranslateW(PopupActions[i].Text)), PopupActions[i].Action);
+ SendDlgItemMessage(hdlg, IDC_RC, CB_SETITEMDATA, SendDlgItemMessage(hdlg, IDC_RC, CB_ADDSTRING, 0, (LPARAM)TranslateW(PopupActions[i].Text)), PopupActions[i].Action);
}
SendDlgItemMessage(hdlg, IDC_LC, CB_SETCURSEL, PopupOptions.LeftClickAction, 0);
SendDlgItemMessage(hdlg, IDC_RC, CB_SETCURSEL, PopupOptions.RightClickAction, 0);
@@ -510,7 +510,7 @@ static int OptInit(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 100000000;
odp.hInstance = hInst;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_UPDATENOTIFY);
odp.pwszGroup = LPGENW("Services");
odp.pwszTitle = LPGENW("Plugin Updater");
diff --git a/plugins/PluginUpdater/src/PluginUpdater.cpp b/plugins/PluginUpdater/src/PluginUpdater.cpp index 3a2a2fdb1d..204f167cbf 100644 --- a/plugins/PluginUpdater/src/PluginUpdater.cpp +++ b/plugins/PluginUpdater/src/PluginUpdater.cpp @@ -132,7 +132,7 @@ extern "C" __declspec(dllexport) int Load(void) #if MIRANDA_VER >= 0x0A00
// Upgrade old settings
if (-1 == db_get_b(0, MODNAME, DB_SETTING_UPDATE_MODE, -1)) {
- ptrW dbvUpdateURL(db_get_tsa(0, MODNAME, DB_SETTING_UPDATE_URL));
+ ptrW dbvUpdateURL(db_get_wsa(0, MODNAME, DB_SETTING_UPDATE_URL));
if (dbvUpdateURL) {
if (!wcscmp(dbvUpdateURL, _A2W(DEFAULT_UPDATE_URL_OLD))) {
db_set_b(0, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE);
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index 26b395a1c4..6e88d85783 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -58,7 +58,7 @@ void InitNetlib() {
NETLIBUSER nlu = {0};
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR; // | NUF_HTTPGATEWAY;
+ nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE; // | NUF_HTTPGATEWAY;
nlu.ptszDescriptiveName = TranslateT("Plugin Updater HTTP connections");
nlu.szSettingsModule = MODNAME;
hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
@@ -599,7 +599,7 @@ int SafeDeleteFile(const wchar_t *pFile) int SafeCreateDirectory(const wchar_t *pFolder)
{
if (hPipe == NULL)
- return CreateDirectoryTreeT(pFolder);
+ return CreateDirectoryTreeW(pFolder);
return TransactPipe(4, pFolder, NULL);
}
@@ -607,7 +607,7 @@ int SafeCreateDirectory(const wchar_t *pFolder) int SafeCreateFilePath(wchar_t *pFolder)
{
if (hPipe == NULL) {
- CreatePathToFileT(pFolder);
+ CreatePathToFileW(pFolder);
return 0;
}
diff --git a/plugins/Popup/src/actions.cpp b/plugins/Popup/src/actions.cpp index 5a84d99d0e..d85a6269d4 100644 --- a/plugins/Popup/src/actions.cpp +++ b/plugins/Popup/src/actions.cpp @@ -237,7 +237,7 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM group.cbSize = sizeof(group);
group.mask = LVGF_HEADER | LVGF_GROUPID;
LPTSTR wszGroup = mir_a2u(szGroup);
- group.pszHeader = TranslateTS(wszGroup);
+ group.pszHeader = TranslateW(wszGroup);
group.cchHeader = (int)mir_wstrlen(wszGroup);
grpId = group.iGroupId = groups.getCount();
ListView_InsertGroup(hwndList, -1, &group);
@@ -249,7 +249,7 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM item.mask = LVIF_IMAGE | LVIF_PARAM | LVIF_TEXT | LVIF_STATE | LVIF_INDENT;
item.iItem = i;
ptrW tszName(mir_a2u(szName));
- item.pszText = TranslateTS(tszName);
+ item.pszText = TranslateW(tszName);
item.iImage = ImageList_AddIcon(hImgList, gActions[i]->lchIcon);
item.lParam = i;
item.mask |= LVIF_GROUPID;
diff --git a/plugins/Popup/src/bitmap_funcs.cpp b/plugins/Popup/src/bitmap_funcs.cpp index 945be3e482..a652e68980 100644 --- a/plugins/Popup/src/bitmap_funcs.cpp +++ b/plugins/Popup/src/bitmap_funcs.cpp @@ -731,7 +731,7 @@ bool MyBitmap::loadFromFile(const wchar_t *fn) return loadFromFile_gradient(fn);
SIZE sz;
- HBITMAP hBmpLoaded = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)fn, IMGL_TCHAR);
+ HBITMAP hBmpLoaded = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)fn, IMGL_WCHAR);
if (!hBmpLoaded)
return false;
diff --git a/plugins/Popup/src/common.h b/plugins/Popup/src/common.h index 5fff5e0444..8ce683b65f 100644 --- a/plugins/Popup/src/common.h +++ b/plugins/Popup/src/common.h @@ -68,7 +68,7 @@ inline INT_PTR DBGetContactSettingStringX(MCONTACT hContact, const char *ModuleN case DBVT_ASCIIZ:
ret = (INT_PTR)mir_strdup(result ? Default : dbv.pszVal);
break;
- case DBVT_TCHAR:
+ case DBVT_WCHAR:
if (!result)
ret = (INT_PTR)mir_wstrdup(dbv.ptszVal);
else
@@ -95,7 +95,7 @@ inline void AddTooltipTranslated(HWND hwndToolTip, HWND hwnd, int id, RECT rc, c ti.hwnd = hwnd;
ti.uId = id;
ti.hinst = hInst;
- ti.lpszText = TranslateTS(wtext);
+ ti.lpszText = TranslateW(wtext);
ti.rect = rc;
SendMessage(hwndToolTip, TTM_ADDTOOL, 0, (LPARAM)&ti);
diff --git a/plugins/Popup/src/config.cpp b/plugins/Popup/src/config.cpp index 233fcdf811..a9763b64fd 100644 --- a/plugins/Popup/src/config.cpp +++ b/plugins/Popup/src/config.cpp @@ -93,7 +93,7 @@ void PopupPreview() 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]");
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(
+ wchar_t *lptzText2 = TranslateW(
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 :)")
);
@@ -101,7 +101,7 @@ void PopupPreview() memset(&ppd, 0, sizeof(ppd));
ppd.cbSize = sizeof(ppd);
- ppd.flags = PU2_TCHAR;
+ ppd.flags = PU2_UNICODE;
ppd.lptzTitle = lptzTitle1Eng;
ppd.lptzText = lptzText1Eng;
@@ -111,7 +111,7 @@ void PopupPreview() memset(&ppd, 0, sizeof(ppd));
ppd.cbSize = sizeof(ppd);
- ppd.flags = PU2_TCHAR;
+ ppd.flags = PU2_UNICODE;
ppd.lptzTitle = lptzTitle2;
ppd.lptzText = lptzText2;
ppd.lchIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp index 23a6156b55..5b43ddae96 100644 --- a/plugins/Popup/src/font.cpp +++ b/plugins/Popup/src/font.cpp @@ -28,8 +28,8 @@ PopupFonts fonts = { 0 }; void InitFonts()
{
// Fonts
- FontIDT fid = { 0 };
- fid.cbSize = sizeof(FontIDT);
+ FontIDW fid = { 0 };
+ fid.cbSize = sizeof(FontIDW);
mir_wstrncpy(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;
@@ -43,42 +43,42 @@ void InitFonts() 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);
+ FontRegisterW(&fid);
mir_wstrncpy(fid.name, PU_FNT_NAME_CLOCK, _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_CLOCK);
- FontRegisterT(&fid);
+ FontRegisterW(&fid);
mir_wstrncpy(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);
+ FontRegisterW(&fid);
mir_wstrncpy(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);
+ FontRegisterW(&fid);
mir_wstrncpy(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);
+ FontRegisterW(&fid);
- ColourIDT cid = { 0 };
- cid.cbSize = sizeof(ColourIDT);
+ ColourIDW cid = { 0 };
+ cid.cbSize = sizeof(ColourIDW);
mir_wstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group));
mir_strncpy(cid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, _countof(cid.dbSettingsGroup));
mir_wstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
mir_strncpy(cid.setting, PU_COL_BACK_SETTING, _countof(cid.setting));
cid.defcolour = SETTING_BACKCOLOUR_DEFAULT;
- ColourRegisterT(&cid);
+ ColourRegisterW(&cid);
mir_wstrncpy(cid.name, PU_COL_AVAT_NAME, _countof(cid.name));
mir_strncpy(cid.setting, PU_COL_AVAT_SETTING, _countof(cid.setting));
cid.defcolour = SETTING_TEXTCOLOUR_DEFAULT;
- ColourRegisterT(&cid);
+ ColourRegisterW(&cid);
ReloadFonts();
}
@@ -93,39 +93,39 @@ void ReloadFonts() if (fonts.actionHover) DeleteObject(fonts.actionHover);
LOGFONT lf = { 0 };
- FontIDT fid = { 0 };
- fid.cbSize = sizeof(FontIDT);
+ FontIDW fid = { 0 };
+ fid.cbSize = sizeof(FontIDW);
mir_wstrncpy(fid.group, PU_FNT_AND_COLORW, _countof(fid.name));
mir_wstrncpy(fid.name, PU_FNT_NAME_TITLE, _countof(fid.name));
- fonts.clTitle = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
+ fonts.clTitle = (COLORREF)CallService(MS_FONT_GETW, (WPARAM)&fid, (LPARAM)&lf);
fonts.title = CreateFontIndirect(&lf);
mir_wstrncpy(fid.name, PU_FNT_NAME_CLOCK, _countof(fid.name));
- fonts.clClock = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
+ fonts.clClock = (COLORREF)CallService(MS_FONT_GETW, (WPARAM)&fid, (LPARAM)&lf);
fonts.clock = CreateFontIndirect(&lf);
mir_wstrncpy(fid.name, PU_FNT_NAME_TEXT, _countof(fid.name));
- fonts.clText = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
+ fonts.clText = (COLORREF)CallService(MS_FONT_GETW, (WPARAM)&fid, (LPARAM)&lf);
fonts.text = CreateFontIndirect(&lf);
mir_wstrncpy(fid.name, PU_FNT_NAME_ACTION, _countof(fid.name));
- fonts.clAction = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
+ fonts.clAction = (COLORREF)CallService(MS_FONT_GETW, (WPARAM)&fid, (LPARAM)&lf);
fonts.action = CreateFontIndirect(&lf);
mir_wstrncpy(fid.name, PU_FNT_NAME_HOVERED_ACTION, _countof(fid.name));
- fonts.clActionHover = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
+ fonts.clActionHover = (COLORREF)CallService(MS_FONT_GETW, (WPARAM)&fid, (LPARAM)&lf);
fonts.actionHover = CreateFontIndirect(&lf);
- ColourIDT cid = { 0 };
- cid.cbSize = sizeof(ColourIDT);
+ ColourIDW cid = { 0 };
+ cid.cbSize = sizeof(ColourIDW);
mir_wstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group));
mir_wstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
- fonts.clBack = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, (LPARAM)&lf);
+ fonts.clBack = (COLORREF)CallService(MS_COLOUR_GETW, (WPARAM)&cid, (LPARAM)&lf);
mir_wstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group));
mir_wstrncpy(cid.name, PU_COL_AVAT_NAME, _countof(cid.name));
- fonts.clAvatarBorder = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, (LPARAM)&lf);
+ fonts.clAvatarBorder = (COLORREF)CallService(MS_COLOUR_GETW, (WPARAM)&cid, (LPARAM)&lf);
// update class popupps(only temp at this point, must rework)
char setting[256];
diff --git a/plugins/Popup/src/font.h b/plugins/Popup/src/font.h index c94739c13f..c7403af354 100644 --- a/plugins/Popup/src/font.h +++ b/plugins/Popup/src/font.h @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #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 LPGENW("Title") //use eg mir_wstrcpy(fid.name, _T(FNT_NAME_....)) for FontIDT
+#define PU_FNT_NAME_TITLE LPGENW("Title") //use eg mir_wstrcpy(fid.name, _T(FNT_NAME_....)) for FontIDW
#define PU_FNT_NAME_CLOCK LPGENW("Clock")
#define PU_FNT_NAME_TEXT LPGENW("Text")
#define PU_FNT_NAME_ACTION LPGENW("Action")
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp index b572ae477c..8acce626f7 100644 --- a/plugins/Popup/src/main.cpp +++ b/plugins/Popup/src/main.cpp @@ -175,7 +175,7 @@ INT_PTR svcShowHistory(WPARAM, LPARAM) void InitMenuItems(void)
{
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
HANDLE hIcon = GetIconHandle(PopupOptions.ModuleIsEnabled ? IDI_POPUP : IDI_NOPOPUP);
@@ -211,16 +211,16 @@ INT_PTR GetStatus(WPARAM, LPARAM) void LoadHotkey()
{
HOTKEYDESC hk = { sizeof(hk) };
- hk.dwFlags = HKD_TCHAR;
+ hk.dwFlags = HKD_UNICODE;
hk.pszName = "Toggle Popups";
- hk.ptszDescription = LPGENW("Toggle Popups");
- hk.ptszSection = MODULNAME_PLUW;
+ hk.pwszDescription = LPGENW("Toggle Popups");
+ hk.pwszSection = MODULNAME_PLUW;
hk.pszService = MENUCOMMAND_SVC;
Hotkey_Register(&hk);
// 'Popup History' Hotkey
hk.pszName = "Popup History";
- hk.ptszDescription = LPGENW("Popup History");
+ hk.pwszDescription = LPGENW("Popup History");
hk.pszService = MENUCOMMAND_HISTORY;
Hotkey_Register(&hk);
}
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp index b85db14921..1de7bcbb81 100644 --- a/plugins/Popup/src/opt_adv.cpp +++ b/plugins/Popup/src/opt_adv.cpp @@ -68,7 +68,7 @@ void LoadOption_AdvOpts() // Effects
PopupOptions.UseAnimations = db_get_b(NULL, MODULNAME, "UseAnimations", TRUE);
PopupOptions.UseEffect = db_get_b(NULL, MODULNAME, "Fade", TRUE);
- PopupOptions.Effect = (LPTSTR)DBGetContactSettingStringX(NULL, MODULNAME, "Effect", "", DBVT_TCHAR);
+ PopupOptions.Effect = (LPTSTR)DBGetContactSettingStringX(NULL, MODULNAME, "Effect", "", DBVT_WCHAR);
PopupOptions.FadeIn = db_get_dw(NULL, MODULNAME, "FadeInTime", SETTING_FADEINTIME_DEFAULT);
PopupOptions.FadeOut = db_get_dw(NULL, MODULNAME, "FadeOutTime", SETTING_FADEOUTTIME_DEFAULT);
@@ -208,7 +208,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("Fade in/out")), -1);
DWORD dwActiveItem = (DWORD)PopupOptions.UseEffect;
for (int i = 0; i < g_lstPopupVfx.getCount(); ++i) {
- DWORD dwItem = ComboBox_AddString(hCtrl, TranslateTS(g_lstPopupVfx[i]));
+ DWORD dwItem = ComboBox_AddString(hCtrl, TranslateW(g_lstPopupVfx[i]));
ComboBox_SetItemData(hCtrl, dwItem, i);
if (PopupOptions.UseEffect && !mir_wstrcmp(g_lstPopupVfx[i], PopupOptions.Effect))
dwActiveItem = dwItem;
@@ -512,7 +512,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM // Effects
db_set_b(NULL, MODULNAME, "UseAnimations", PopupOptions.UseAnimations);
db_set_b(NULL, MODULNAME, "Fade", PopupOptions.UseEffect);
- db_set_ts(NULL, MODULNAME, "Effect", PopupOptions.Effect);
+ db_set_ws(NULL, MODULNAME, "Effect", PopupOptions.Effect);
db_set_dw(NULL, MODULNAME, "FadeInTime", PopupOptions.FadeIn);
db_set_dw(NULL, MODULNAME, "FadeOutTime", PopupOptions.FadeOut);
// other old stuff
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp index 29b2702137..9110e4e58b 100644 --- a/plugins/Popup/src/opt_class.cpp +++ b/plugins/Popup/src/opt_class.cpp @@ -267,7 +267,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l hCtrl = GetDlgItem(hwnd, IDC_LACTION);
for (i = 0; i < ptd->notification.actionCount; ++i) {
psztAction = mir_a2u(ptd->notification.lpActions[i].lpzTitle);
- ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateTS(psztAction)), ptd->notification.lpActions[i].lpzTitle);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateW(psztAction)), ptd->notification.lpActions[i].lpzTitle);
mir_free(psztAction); psztAction = NULL;
}
// combo right action (EXTRA)
@@ -275,7 +275,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l psztAction = NULL;
for (i = 0; i < ptd->notification.actionCount; ++i) {
psztAction = mir_a2u(ptd->notification.lpActions[i].lpzTitle);
- ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateTS(psztAction)), ptd->notification.lpActions[i].lpzTitle);
+ ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateW(psztAction)), ptd->notification.lpActions[i].lpzTitle);
mir_free(psztAction); psztAction = NULL;
}
// enable all controls
@@ -342,7 +342,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l {
POPUPDATA2 ppd = { 0 };
ppd.cbSize = sizeof(ppd);
- ppd.flags = PU2_TCHAR;
+ ppd.flags = PU2_UNICODE;
ppd.lptzTitle = ptd->pszDescription;
ppd.lptzText = TranslateT("Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn!");
ppd.iSeconds = ptd->timeoutValue;
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp index b2b6fba0e7..8e7f31a8d2 100644 --- a/plugins/Popup/src/opt_gen.cpp +++ b/plugins/Popup/src/opt_gen.cpp @@ -181,7 +181,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM {
HWND hCtrl = GetDlgItem(hwnd, IDC_CUSTOMPOS);
SendMessage(hCtrl, BUTTONSETASFLATBTN, TRUE, 0);
- SendMessage(hCtrl, BUTTONADDTOOLTIP, (WPARAM)L"Popup area", BATF_TCHAR);
+ SendMessage(hCtrl, BUTTONADDTOOLTIP, (WPARAM)L"Popup area", BATF_UNICODE);
SendMessage(hCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(IDI_RESIZE));
}
// Spreading combobox
@@ -626,11 +626,11 @@ INT_PTR CALLBACK PositionBoxDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SendDlgItemMessage(hwndDlg, IDC_TITLE, WM_SETFONT, (WPARAM)hFontTitle, TRUE);
SendDlgItemMessage(hwndDlg, IDOK, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDOK, BUTTONADDTOOLTIP, (WPARAM)L"OK", BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDOK, BUTTONADDTOOLTIP, (WPARAM)L"OK", BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDOK, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(IDI_ACT_OK));
SendDlgItemMessage(hwndDlg, IDCANCEL, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDCANCEL, BUTTONADDTOOLTIP, (WPARAM)L"Cancel", BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDCANCEL, BUTTONADDTOOLTIP, (WPARAM)L"Cancel", BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDCANCEL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(IDI_ACT_CLOSE));
SetDlgItemInt(hwndDlg, IDC_TXT_TOP, PopupOptions.gapTop, FALSE);
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp index 2274390955..896f855a00 100644 --- a/plugins/Popup/src/opt_skins.cpp +++ b/plugins/Popup/src/opt_skins.cpp @@ -74,7 +74,7 @@ static void updatePreviewImage(HWND hwndBox) POPUPDATA2 ppd;
memset(&ppd, 0, sizeof(ppd));
ppd.cbSize = sizeof(ppd);
- ppd.flags = PU2_TCHAR;
+ ppd.flags = PU2_UNICODE;
ppd.lchIcon = Skin_LoadIcon(SKINICON_STATUS_ONLINE);
ppd.lptzTitle = TranslateT("Skin preview");
ppd.lptzText = TranslateT("Just take a look at this skin... ;)");
@@ -293,7 +293,7 @@ bool SkinOptionList_Update(OPTTREE_OPTION* &options, int *OptionsCount, HWND hwn void LoadOption_Skins() {
// skin pack
- PopupOptions.SkinPack = (LPTSTR)DBGetContactSettingStringX(NULL, MODULNAME, "SkinPack", "* Popup Classic", DBVT_TCHAR);
+ PopupOptions.SkinPack = (LPTSTR)DBGetContactSettingStringX(NULL, MODULNAME, "SkinPack", "* Popup Classic", DBVT_WCHAR);
// more Skin options
PopupOptions.DisplayTime = db_get_b(NULL, MODULNAME, "DisplayTime", TRUE);
PopupOptions.DropShadow = db_get_b(NULL, MODULNAME, "DropShadow", TRUE);
@@ -477,7 +477,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case PSN_APPLY:
{
// skin pack
- db_set_ts(NULL, MODULNAME, "SkinPack", PopupOptions.SkinPack);
+ db_set_ws(NULL, MODULNAME, "SkinPack", PopupOptions.SkinPack);
// skin options
const PopupSkin *skin = 0;
if (skin = skins.getSkin(PopupOptions.SkinPack))
diff --git a/plugins/Popup/src/opttree.cpp b/plugins/Popup/src/opttree.cpp index cc2e48e141..a9abe4ca0e 100644 --- a/plugins/Popup/src/opttree.cpp +++ b/plugins/Popup/src/opttree.cpp @@ -35,7 +35,7 @@ static void OptTree_TranslateItem(HWND hwndTree, HTREEITEM hItem) tvi.pszText = buf;
tvi.cchTextMax = _countof(buf);
SendMessage(hwndTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
- tvi.pszText = TranslateTS(tvi.pszText);
+ tvi.pszText = TranslateW(tvi.pszText);
SendMessage(hwndTree, TVM_SETITEMW, 0, (LPARAM)&tvi);
}
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index a31ce9b23e..c4611f8ce7 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -977,7 +977,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara case ACT_DEF_COPY:
if (m_lptzText || m_lptzTitle) {
- CMString tszText(FORMAT, L"%s\n\n%s",
+ CMStringW tszText(FORMAT, L"%s\n\n%s",
(m_lptzTitle) ? m_lptzTitle : L"",
(m_lptzText) ? m_lptzText : L"");
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index 23f5ac5026..c68f83d577 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -379,8 +379,8 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) // we ignore pc->colorText and use fonts.text as default (if no setting found in DB)
mir_snprintf(setting, "%s/TextCol", ptd->pupClass.pszName);
ptd->pupClass.colorText = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, fonts.clText/*pc->colorText*/);
- FontIDT fid = { 0 };
- fid.cbSize = sizeof(FontIDT);
+ FontIDW fid = { 0 };
+ fid.cbSize = sizeof(FontIDW);
mir_snwprintf(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;
@@ -392,19 +392,19 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) mir_snprintf(fid.prefix, "%s/Text", ptd->pupClass.pszName); // result is "%s/TextCol"
fid.deffontsettings.style = 0;
fid.deffontsettings.colour = fonts.clText;
- FontRegisterT(&fid);
+ FontRegisterW(&fid);
// we ignore pc->colorBack and use fonts.clBack as default (if no setting found in DB)
mir_snprintf(setting, "%s/BgCol", ptd->pupClass.pszName);
ptd->pupClass.colorBack = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
- ColourIDT cid = { 0 };
- cid.cbSize = sizeof(ColourIDT);
+ ColourIDW cid = { 0 };
+ cid.cbSize = sizeof(ColourIDW);
mir_snwprintf(cid.group, _A2W(PU_FNT_AND_COLOR) L"/%S", ptd->pupClass.pszName);
mir_strncpy(cid.dbSettingsGroup, PU_MODULCLASS, _countof(fid.dbSettingsGroup));
mir_wstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
mir_snprintf(cid.setting, "%s/BgCol", ptd->pupClass.pszName);
cid.defcolour = fonts.clBack;
- ColourRegisterT(&cid);
+ ColourRegisterW(&cid);
gTreeData.insert(ptd);
num_classes++;
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp index 73756e4e51..9fb5e34439 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_a2u(name);
- wchar_t *str = TranslateTS(wname);
+ wchar_t *str = TranslateW(wname);
GetTextExtentPoint32(hdc, str, (int)mir_wstrlen(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_a2u(name);
- wchar_t *str = TranslateTS(wname);
+ wchar_t *str = TranslateW(wname);
GetTextExtentPoint32(bmp->getDC(), str, (int)mir_wstrlen(str), &szText);
bmp->Draw_Text(str,
(PopupOptions.actions&ACT_LARGE) ? (x + szSpace.cx + 32) : (x + szSpace.cx + 16),
@@ -1098,7 +1098,7 @@ bool Skins::load() return false;
}
else {
- mir_wstrncpy(dir, VARST(L"%miranda_path%\\skins\\popup"), _countof(dir));
+ mir_wstrncpy(dir, VARSW(L"%miranda_path%\\skins\\popup"), _countof(dir));
DWORD fa = GetFileAttributes(dir);
if ((fa == INVALID_FILE_ATTRIBUTES) || !(fa&FILE_ATTRIBUTE_DIRECTORY))
return false;
diff --git a/plugins/QuickContacts/src/options.cpp b/plugins/QuickContacts/src/options.cpp index 21d23ef10f..ca5df48c19 100644 --- a/plugins/QuickContacts/src/options.cpp +++ b/plugins/QuickContacts/src/options.cpp @@ -55,7 +55,7 @@ int InitOptionsCallback(WPARAM wParam, LPARAM) odp.pwszTitle = LPGENW("Quick Contacts");
odp.pfnDlgProc = OptionsDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT);
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
Options_AddPage(wParam, &odp);
return 0;
}
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 855c5df62d..5f10956175 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -124,10 +124,10 @@ int ModulesLoaded(WPARAM, LPARAM) HOTKEYDESC hkd = {0};
hkd.cbSize = sizeof(hkd);
- hkd.dwFlags = HKD_TCHAR;
+ hkd.dwFlags = HKD_UNICODE;
hkd.pszName = "Quick Contacts/Open dialog";
- hkd.ptszDescription = LPGENW("Open dialog");
- hkd.ptszSection = LPGENW("Quick Contacts");
+ hkd.pwszDescription = LPGENW("Open dialog");
+ hkd.pwszSection = LPGENW("Quick Contacts");
hkd.pszService = MS_QC_SHOW_DIALOG;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_ALT, 'Q');
Hotkey_Register(&hkd);
@@ -137,37 +137,37 @@ int ModulesLoaded(WPARAM, LPARAM) hkd.lParam = HOTKEY_FILE;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'F');
hkd.pszName = "Quick Contacts/File";
- hkd.ptszDescription = LPGENW("Send file");
+ hkd.pwszDescription = LPGENW("Send file");
Hotkey_Register(&hkd);
hkd.lParam = HOTKEY_URL;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'U');
hkd.pszName = "Quick Contacts/URL";
- hkd.ptszDescription = LPGENW("Send URL");
+ hkd.pwszDescription = LPGENW("Send URL");
Hotkey_Register(&hkd);
hkd.lParam = HOTKEY_INFO;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'I');
hkd.pszName = "Quick Contacts/Info";
- hkd.ptszDescription = LPGENW("Open user info");
+ hkd.pwszDescription = LPGENW("Open user info");
Hotkey_Register(&hkd);
hkd.lParam = HOTKEY_HISTORY;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'H');
hkd.pszName = "Quick Contacts/History";
- hkd.ptszDescription = LPGENW("Open history");
+ hkd.pwszDescription = LPGENW("Open history");
Hotkey_Register(&hkd);
hkd.lParam = HOTKEY_MENU;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'M');
hkd.pszName = "Quick Contacts/Menu";
- hkd.ptszDescription = LPGENW("Open contact menu");
+ hkd.pwszDescription = LPGENW("Open contact menu");
Hotkey_Register(&hkd);
hkd.lParam = HOTKEY_ALL_CONTACTS;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'A');
hkd.pszName = "Quick Contacts/All Contacts";
- hkd.ptszDescription = LPGENW("Show all contacts");
+ hkd.pwszDescription = LPGENW("Show all contacts");
Hotkey_Register(&hkd);
if (ServiceExists(MS_SKIN_ADDHOTKEY))
@@ -189,7 +189,7 @@ int ModulesLoaded(WPARAM, LPARAM) CMenuItem mi;
SET_UID(mi, 0x3a3f768a, 0xcf47, 0x43d5, 0x92, 0x16, 0xe4, 0xeb, 0x93, 0xf6, 0x72, 0xfa);
mi.position = 500100001;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.name.w = LPGENW("Quick Contacts...");
mi.pszService = MS_QC_SHOW_DIALOG;
Menu_AddMainMenuItem(&mi);
@@ -400,7 +400,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) if (opts.group_append)
{
DBVARIANT dbv;
- if (db_get_ts(hMeta == NULL ? hContact : hMeta, "CList", "Group", &dbv) == 0)
+ if (db_get_ws(hMeta == NULL ? hContact : hMeta, "CList", "Group", &dbv) == 0)
{
if (dbv.ptszVal != NULL)
mir_wstrncpy(contact->szgroup, dbv.ptszVal, _countof(contact->szgroup));
@@ -714,12 +714,12 @@ static void FillButton(HWND hwndDlg, int dlgItem, wchar_t *name, wchar_t *key, H wchar_t *full = tmp;
if (key == NULL)
- full = TranslateTS(name);
+ full = TranslateW(name);
else
- mir_snwprintf(tmp, L"%s (%s)", TranslateTS(name), key);
+ mir_snwprintf(tmp, L"%s (%s)", TranslateW(name), key);
SendDlgItemMessage(hwndDlg, dlgItem, BUTTONSETASFLATBTN, 0, 0);
- SendDlgItemMessage(hwndDlg, dlgItem, BUTTONADDTOOLTIP, (LPARAM)full, BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, dlgItem, BUTTONADDTOOLTIP, (LPARAM)full, BATF_UNICODE);
SendDlgItemMessage(hwndDlg, dlgItem, BM_SETIMAGE, IMAGE_ICON, (LPARAM)icon);
}
@@ -730,9 +730,9 @@ static void FillCheckbox(HWND hwndDlg, int dlgItem, wchar_t *name, wchar_t *key) wchar_t *full = tmp;
if (key == NULL)
- full = TranslateTS(name);
+ full = TranslateW(name);
else
- mir_snwprintf(tmp, L"%s (%s)", TranslateTS(name), key);
+ mir_snwprintf(tmp, L"%s (%s)", TranslateW(name), key);
SetDlgItemText(hwndDlg, dlgItem, full);
}
@@ -825,7 +825,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_MESSAGE)))
break;
- CallService(MS_MSG_SENDMESSAGET, hContact, 0);
+ CallService(MS_MSG_SENDMESSAGEW, hContact, 0);
db_set_dw(NULL, MODULE_NAME, "LastSentTo", hContact);
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp index b5f1943aed..3b79669ca8 100644 --- a/plugins/QuickMessages/src/Utils.cpp +++ b/plugins/QuickMessages/src/Utils.cpp @@ -153,11 +153,11 @@ void SaveModuleSettings(int buttonnum, ButtonData* bd) char szMEntry[256] = { '\0' }; mir_snprintf(szMEntry, "EntryName_%u_%u", buttonnum, bd->dwPos); - db_set_ts(NULL, PLGNAME, szMEntry, bd->pszName); + db_set_ws(NULL, PLGNAME, szMEntry, bd->pszName); mir_snprintf(szMEntry, "EntryValue_%u_%u", buttonnum, bd->dwPos); if (bd->pszValue) - db_set_ts(NULL, PLGNAME, szMEntry, bd->pszValue); + db_set_ws(NULL, PLGNAME, szMEntry, bd->pszValue); else db_unset(NULL, PLGNAME, szMEntry); @@ -185,7 +185,7 @@ void CleanSettings(int buttonnum, int from) } mir_snprintf(szMEntry, "EntryName_%u_%u", buttonnum, from); - while (!db_get_ts(NULL, PLGNAME, szMEntry, &dbv)) { + while (!db_get_ws(NULL, PLGNAME, szMEntry, &dbv)) { db_unset(NULL, PLGNAME, szMEntry); mir_snprintf(szMEntry, "EntryValue_%u_%u", buttonnum, from); db_unset(NULL, PLGNAME, szMEntry); @@ -228,7 +228,7 @@ static HANDLE AddIcon(char* szIcoName) GetModuleFileName(hinstance, tszPath, _countof(tszPath)); SKINICONDESC sid = { 0 }; - sid.flags = SIDF_PATH_TCHAR; + sid.flags = SIDF_PATH_UNICODE; sid.section.a = "Quick Messages"; sid.description.a = szIcoName; sid.pszName = szIcoName; @@ -355,7 +355,7 @@ wchar_t* getMenuEntry(int buttonnum, int entrynum, BYTE mode) break; } - if (!db_get_ts(NULL, PLGNAME, szMEntry, &dbv)) { + if (!db_get_ws(NULL, PLGNAME, szMEntry, &dbv)) { if (mir_wstrlen(dbv.ptszVal)) buffer = mir_wstrdup(dbv.ptszVal); db_free(&dbv); diff --git a/plugins/QuickMessages/src/options.cpp b/plugins/QuickMessages/src/options.cpp index 297a6b0f9f..50e561c814 100644 --- a/plugins/QuickMessages/src/options.cpp +++ b/plugins/QuickMessages/src/options.cpp @@ -248,7 +248,7 @@ void SaveMenuTree() if (ld->ptszQValue) {
mir_snprintf(szMEntry, "ButtonValue_%u", iBl);
- db_set_ts(NULL, PLGNAME, szMEntry, ld->ptszQValue);
+ db_set_ws(NULL, PLGNAME, szMEntry, ld->ptszQValue);
}
@@ -263,7 +263,7 @@ void SaveMenuTree() mir_snprintf(szMEntry, "ButtonName_%u", iBl);
- db_set_ts(NULL, PLGNAME, szMEntry, ld->ptszButtonName);
+ db_set_ws(NULL, PLGNAME, szMEntry, ld->ptszButtonName);
ld->dwOPFlags = 0;
ld->dwPos = iBl;
diff --git a/plugins/QuickReplies/src/events.cpp b/plugins/QuickReplies/src/events.cpp index 0c575930dd..f64b329dc5 100644 --- a/plugins/QuickReplies/src/events.cpp +++ b/plugins/QuickReplies/src/events.cpp @@ -76,7 +76,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) int count = 0;
HMENU hMenu = NULL;
char buttonName[32];
- CMString replies;
+ CMStringW replies;
LIST<wchar_t> replyList(1);
CustomButtonClickData *cbcd = (CustomButtonClickData *)lParam;
diff --git a/plugins/QuickReplies/src/options.cpp b/plugins/QuickReplies/src/options.cpp index fb52965cb2..3356a012b0 100644 --- a/plugins/QuickReplies/src/options.cpp +++ b/plugins/QuickReplies/src/options.cpp @@ -63,7 +63,7 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR {
char key[64];
int count = 0;
- CMString replies;
+ CMStringW replies;
TranslateDialogDefault(hwndDlg);
variables_skin_helpbutton(hwndDlg, IDC_VARIABLES);
@@ -131,7 +131,7 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR GetDlgItemText(hwndDlg, IDC_REPLIES, tszReplies, length + 1);
tszReplies[length] = '\0';
{
- CMString replies = tszReplies;
+ CMStringW replies = tszReplies;
if (replies.Right(2) != L"\r\n")
replies.Append(L"\r\n");
diff --git a/plugins/Quotes/src/CommonOptionDlg.cpp b/plugins/Quotes/src/CommonOptionDlg.cpp index e192f2f16a..d2edc48c16 100644 --- a/plugins/Quotes/src/CommonOptionDlg.cpp +++ b/plugins/Quotes/src/CommonOptionDlg.cpp @@ -205,13 +205,13 @@ void CommonOptionDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp, CCommonDlgPr db_set_w(NULL, QUOTES_MODULE_NAME, visitor.m_pszDbRefreshRateValue, nRefreshRate);
tstring s = get_window_text(::GetDlgItem(hWnd, IDC_EDIT_CONTACT_LIST_FORMAT));
- db_set_ts(NULL, QUOTES_MODULE_NAME, visitor.m_pszDbDisplayNameFormat, s.c_str());
+ db_set_ws(NULL, QUOTES_MODULE_NAME, visitor.m_pszDbDisplayNameFormat, s.c_str());
s = get_window_text(::GetDlgItem(hWnd, IDC_EDIT_STATUS_MESSAGE_FORMAT));
- db_set_ts(NULL, QUOTES_MODULE_NAME, visitor.m_pszDbStatusMsgFormat, s.c_str());
+ db_set_ws(NULL, QUOTES_MODULE_NAME, visitor.m_pszDbStatusMsgFormat, s.c_str());
s = get_window_text(::GetDlgItem(hWnd, IDC_EDIT_TENDENCY_FORMAT));
- db_set_ts(NULL, QUOTES_MODULE_NAME, visitor.m_pszDbTendencyFormat, s.c_str());
+ db_set_ws(NULL, QUOTES_MODULE_NAME, visitor.m_pszDbTendencyFormat, s.c_str());
CAdvProviderSettings* pAdvSet = get_adv_settings(rData.m_pQuotesProvider, false);
if (pAdvSet)
diff --git a/plugins/Quotes/src/CurrencyConverter.cpp b/plugins/Quotes/src/CurrencyConverter.cpp index c86356aa27..faf1d09a3d 100644 --- a/plugins/Quotes/src/CurrencyConverter.cpp +++ b/plugins/Quotes/src/CurrencyConverter.cpp @@ -200,8 +200,8 @@ INT_PTR CALLBACK CurrencyConverterDlgProc(HWND hDlg, UINT msg, WPARAM wp, LPARAM CQuotesProviderGoogle::CQuote from = rSection.GetQuote(nFrom);
CQuotesProviderGoogle::CQuote to = rSection.GetQuote(nTo);
- db_set_ts(NULL, QUOTES_MODULE_NAME, DB_STR_CC_QUOTE_FROM_ID, from.GetID().c_str());
- db_set_ts(NULL, QUOTES_MODULE_NAME, DB_STR_CC_QUOTE_TO_ID, to.GetID().c_str());
+ db_set_ws(NULL, QUOTES_MODULE_NAME, DB_STR_CC_QUOTE_FROM_ID, from.GetID().c_str());
+ db_set_ws(NULL, QUOTES_MODULE_NAME, DB_STR_CC_QUOTE_TO_ID, to.GetID().c_str());
const CQuotesProviderGoogle* pProvider = get_google_provider();
assert(pProvider);
diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp index 5ce786b6b5..6e353f15e6 100644 --- a/plugins/Quotes/src/Forex.cpp +++ b/plugins/Quotes/src/Forex.cpp @@ -77,7 +77,7 @@ INT_PTR QuotesMenu_EnableDisable(WPARAM, LPARAM) void InitMenu()
{
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Quotes"), 0, Quotes_GetIconHandle(IDI_ICON_MAIN));
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "B474F556-22B6-42A1-A91E-22FE4F671388");
@@ -272,7 +272,7 @@ int QuotesEventFunc_OptInitialise(WPARAM wp, LPARAM/* lp*/) odp.pwszTitle = _T(QUOTES_PROTOCOL_NAME);
odp.pwszGroup = LPGENW("Network");
odp.hIcon = Quotes_LoadIconEx(IDI_ICON_MAIN);
- odp.flags = ODPF_USERINFOTAB | ODPF_TCHAR;
+ odp.flags = ODPF_USERINFOTAB | ODPF_UNICODE;
std::for_each(rapProviders.begin(), rapProviders.end(), boost::bind(&IQuotesProvider::ShowPropertyPage, _1, wp, boost::ref(odp)));
return 0;
diff --git a/plugins/Quotes/src/HTTPSession.cpp b/plugins/Quotes/src/HTTPSession.cpp index fb2ab0d62c..1d201389ca 100644 --- a/plugins/Quotes/src/HTTPSession.cpp +++ b/plugins/Quotes/src/HTTPSession.cpp @@ -34,7 +34,7 @@ public: NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_NOHTTPSOPTION | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_NOHTTPSOPTION | NUF_UNICODE;
nlu.szSettingsModule = QUOTES_PROTOCOL_NAME;
nlu.ptszDescriptiveName = TranslateT("Quotes HTTP connections");
g_hNetLib = reinterpret_cast<HANDLE>(CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu));
diff --git a/plugins/Quotes/src/QuoteChart.cpp b/plugins/Quotes/src/QuoteChart.cpp index 25aa422995..7075b0c5b6 100644 --- a/plugins/Quotes/src/QuoteChart.cpp +++ b/plugins/Quotes/src/QuoteChart.cpp @@ -209,7 +209,7 @@ INT_PTR CALLBACK ChartDlgProc(HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) static LPCTSTR szFilters[] = { LPGENW("All"), LPGENW("Last Day"), LPGENW("Last Week"), LPGENW("Last Month"), LPGENW("Last Year"), LPGENW("User-Defined") };
for (int i = 0; i < sizeof(szSources) / sizeof(szSources[0]); ++i) {
- LPCTSTR p = TranslateTS(szSources[i]);
+ LPCTSTR p = TranslateW(szSources[i]);
::SendDlgItemMessage(hDlg, IDC_COMBO_DATA_SOURCE, CB_INSERTSTRING, -1, reinterpret_cast<LPARAM>(p));
}
@@ -217,7 +217,7 @@ INT_PTR CALLBACK ChartDlgProc(HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) ::SendDlgItemMessage(hDlg, IDC_COMBO_DATA_SOURCE, CB_SETCURSEL, nSel, 0);
for (int i = 0; i < sizeof(szFilters) / sizeof(szFilters[0]); ++i) {
- LPCTSTR p = TranslateTS(szSources[i]);
+ LPCTSTR p = TranslateW(szSources[i]);
::SendDlgItemMessage(hDlg, IDC_COMBO_FILTER, CB_INSERTSTRING, -1, reinterpret_cast<LPARAM>(szFilters[i]));
}
diff --git a/plugins/Quotes/src/QuotesProviderBase.cpp b/plugins/Quotes/src/QuotesProviderBase.cpp index 7c058e6830..73937e2cf5 100644 --- a/plugins/Quotes/src/QuotesProviderBase.cpp +++ b/plugins/Quotes/src/QuotesProviderBase.cpp @@ -41,7 +41,7 @@ bool parse_quote(const IXMLNode::TXMLNodePtr& pTop, CQuotesProviderBase::CQuote& }
}
- q = CQuotesProviderBase::CQuote(sID, TranslateTS(sSymbol.c_str()), TranslateTS(sDescription.c_str()));
+ q = CQuotesProviderBase::CQuote(sID, TranslateW(sSymbol.c_str()), TranslateW(sDescription.c_str()));
return true;
}
@@ -72,7 +72,7 @@ bool parse_section(const IXMLNode::TXMLNodePtr& pTop, CQuotesProviderBase::CQuot }
}
- qs = CQuotesProviderBase::CQuoteSection(TranslateTS(sSectionName.c_str()), aSections, aQuotes);
+ qs = CQuotesProviderBase::CQuoteSection(TranslateW(sSectionName.c_str()), aSections, aQuotes);
return true;
}
@@ -224,7 +224,7 @@ void CQuotesProviderBase::SetContactStatus(MCONTACT hContact, int nNewStatus) db_unset(hContact, LIST_MODULE_NAME, STATUS_MSG_NAME);
tstring sSymbol = Quotes_DBGetStringT(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_SYMBOL);
if (false == sSymbol.empty())
- db_set_ts(hContact, LIST_MODULE_NAME, CONTACT_LIST_NAME, sSymbol.c_str());
+ db_set_ws(hContact, LIST_MODULE_NAME, CONTACT_LIST_NAME, sSymbol.c_str());
SetContactExtraImage(hContact, eiEmpty);
}
@@ -550,7 +550,7 @@ void CQuotesProviderBase::WriteContactRate(MCONTACT hContact, double dRate, cons time_t nTime = ::time(NULL);
if (false == rsSymbol.empty())
- db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_SYMBOL, rsSymbol.c_str());
+ db_set_ws(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_SYMBOL, rsSymbol.c_str());
double dPrev = 0.0;
bool bValidPrev = Quotes_DBReadDouble(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_CURR_VALUE, dPrev);
@@ -579,11 +579,11 @@ void CQuotesProviderBase::WriteContactRate(MCONTACT hContact, double dRate, cons if (true == tendency.Parse(this, m_sTendencyFormat, hContact))
do_set_contact_extra_icon(hContact, tendency);
- db_set_ts(hContact, LIST_MODULE_NAME, CONTACT_LIST_NAME, oNick.str().c_str());
+ db_set_ws(hContact, LIST_MODULE_NAME, CONTACT_LIST_NAME, oNick.str().c_str());
tstring sStatusMsg = format_rate(this, hContact, m_sStatusMsgFormat);
if (false == sStatusMsg.empty())
- db_set_ts(hContact, LIST_MODULE_NAME, STATUS_MSG_NAME, sStatusMsg.c_str());
+ db_set_ws(hContact, LIST_MODULE_NAME, STATUS_MSG_NAME, sStatusMsg.c_str());
else
db_unset(hContact, LIST_MODULE_NAME, STATUS_MSG_NAME);
@@ -666,9 +666,9 @@ MCONTACT CQuotesProviderBase::CreateNewContact(const tstring& rsName) if (hContact) {
if (0 == Proto_AddToContact(hContact, QUOTES_PROTOCOL_NAME)) {
tstring sProvName = GetInfo().m_sName;
- db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_PROVIDER, sProvName.c_str());
- db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_SYMBOL, rsName.c_str());
- db_set_ts(hContact, LIST_MODULE_NAME, CONTACT_LIST_NAME, rsName.c_str());
+ db_set_ws(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_PROVIDER, sProvName.c_str());
+ db_set_ws(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_SYMBOL, rsName.c_str());
+ db_set_ws(hContact, LIST_MODULE_NAME, CONTACT_LIST_NAME, rsName.c_str());
mir_cslock lck(m_cs);
m_aContacts.push_back(hContact);
diff --git a/plugins/Quotes/src/QuotesProviderDukasCopy.cpp b/plugins/Quotes/src/QuotesProviderDukasCopy.cpp index 8ecfcf1498..8119521bd1 100644 --- a/plugins/Quotes/src/QuotesProviderDukasCopy.cpp +++ b/plugins/Quotes/src/QuotesProviderDukasCopy.cpp @@ -44,9 +44,9 @@ bool CQuotesProviderDukasCopy::WatchForQuote(const CQuote& rQuote, bool bWatch) else if ((true == bWatch) && (i == m_aContacts.end())) {
MCONTACT hContact = CreateNewContact(rQuote.GetSymbol());
if (hContact) {
- db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_ID, sQuoteID.c_str());
+ db_set_ws(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_ID, sQuoteID.c_str());
if (false == rQuote.GetName().empty()) {
- db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_DESCRIPTION, rQuote.GetName().c_str());
+ db_set_ws(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_DESCRIPTION, rQuote.GetName().c_str());
}
return true;
diff --git a/plugins/Quotes/src/QuotesProviderFinance.cpp b/plugins/Quotes/src/QuotesProviderFinance.cpp index 9f02e9e2b2..ada9936e77 100644 --- a/plugins/Quotes/src/QuotesProviderFinance.cpp +++ b/plugins/Quotes/src/QuotesProviderFinance.cpp @@ -44,9 +44,9 @@ bool CQuotesProviderFinance::WatchForQuote(const CQuote& rQuote, bool bWatch) if (bWatch && i == m_aContacts.end()) {
MCONTACT hContact = CreateNewContact(rQuote.GetSymbol());
if (hContact) {
- db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_ID, sQuoteID.c_str());
+ db_set_ws(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_ID, sQuoteID.c_str());
if (false == rQuote.GetName().empty())
- db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_DESCRIPTION, rQuote.GetName().c_str());
+ db_set_ws(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_DESCRIPTION, rQuote.GetName().c_str());
return true;
}
diff --git a/plugins/Quotes/src/QuotesProviderGoogle.cpp b/plugins/Quotes/src/QuotesProviderGoogle.cpp index a124a1b002..555081c72c 100644 --- a/plugins/Quotes/src/QuotesProviderGoogle.cpp +++ b/plugins/Quotes/src/QuotesProviderGoogle.cpp @@ -34,13 +34,13 @@ bool CQuotesProviderGoogle::WatchForRate(const CRateInfo& ri, tstring sName = make_contact_name(ri.m_from.GetSymbol(), ri.m_to.GetSymbol());
MCONTACT hContact = CreateNewContact(sName);
if (hContact) {
- db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_FROM_ID, ri.m_from.GetID().c_str());
- db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_TO_ID, ri.m_to.GetID().c_str());
+ db_set_ws(hContact, QUOTES_PROTOCOL_NAME, DB_STR_FROM_ID, ri.m_from.GetID().c_str());
+ db_set_ws(hContact, QUOTES_PROTOCOL_NAME, DB_STR_TO_ID, ri.m_to.GetID().c_str());
if (false == ri.m_from.GetName().empty()) {
- db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_FROM_DESCRIPTION, ri.m_from.GetName().c_str());
+ db_set_ws(hContact, QUOTES_PROTOCOL_NAME, DB_STR_FROM_DESCRIPTION, ri.m_from.GetName().c_str());
}
if (false == ri.m_to.GetName().empty()) {
- db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_TO_DESCRIPTION, ri.m_to.GetName().c_str());
+ db_set_ws(hContact, QUOTES_PROTOCOL_NAME, DB_STR_TO_DESCRIPTION, ri.m_to.GetName().c_str());
}
return true;
diff --git a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp index 4b18bdf7ac..253fe16172 100644 --- a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp +++ b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp @@ -266,7 +266,7 @@ void CQuotesProviderGoogleFinance::RefreshQuotes(TContracts& anContacts) Quotes_DBWriteDouble(hContact, QUOTES_MODULE_NAME, DB_STR_GOOGLE_FINANCE_PERCENT_CHANGE_TO_YERSTERDAY_CLOSE, Info.m_dPercentChangeToYersterdayClose);
}
if (false == Info.m_sCmpName.empty()) {
- db_set_ts(hContact, QUOTES_MODULE_NAME, DB_STR_QUOTE_DESCRIPTION, Info.m_sCmpName.c_str());
+ db_set_ws(hContact, QUOTES_MODULE_NAME, DB_STR_QUOTE_DESCRIPTION, Info.m_sCmpName.c_str());
}
WriteContactRate(hContact, Info.m_dRate);
diff --git a/plugins/Quotes/src/QuotesProviderYahoo.cpp b/plugins/Quotes/src/QuotesProviderYahoo.cpp index cef09471c2..4950acd78c 100644 --- a/plugins/Quotes/src/QuotesProviderYahoo.cpp +++ b/plugins/Quotes/src/QuotesProviderYahoo.cpp @@ -43,7 +43,7 @@ bool get_double_from_parsed_line(MCONTACT hContact, const TStrings& rasParsedLin return Quotes_DBWriteDouble(hContact, QUOTES_MODULE_NAME, pszDbName, d);
}
- db_set_ts(hContact, QUOTES_MODULE_NAME, pszDbName, L"");
+ db_set_ws(hContact, QUOTES_MODULE_NAME, pszDbName, L"");
return false;
}
@@ -121,7 +121,7 @@ void CQuotesProviderYahoo::RefreshQuotes(TContracts& anContacts) MCONTACT hContact = it3->second;
double dRate = 0.0;
if (true == t2d(asStrings[indexLastTrade], dRate)) {
- db_set_ts(hContact, QUOTES_MODULE_NAME, DB_STR_QUOTE_DESCRIPTION, asStrings[indexName].c_str());
+ db_set_ws(hContact, QUOTES_MODULE_NAME, DB_STR_QUOTE_DESCRIPTION, asStrings[indexName].c_str());
get_double_from_parsed_line(hContact, asStrings, indexOpen, DB_STR_YAHOO_OPEN_VALUE);
get_double_from_parsed_line(hContact, asStrings, indexDayHigh, DB_STR_YAHOO_DAY_HIGH);
diff --git a/plugins/Quotes/src/SettingsDlg.cpp b/plugins/Quotes/src/SettingsDlg.cpp index c11f038809..c0f877685d 100644 --- a/plugins/Quotes/src/SettingsDlg.cpp +++ b/plugins/Quotes/src/SettingsDlg.cpp @@ -87,7 +87,7 @@ std::vector<wchar_t> get_filter() std::vector<wchar_t> aFilter;
LPCTSTR pszFilterParts[] = { LPGENW("Log Files (*.txt,*.log)"), L"*.txt;*.log", LPGENW("All files (*.*)"), L"*.*" };
for (int i = 0; i < sizeof(pszFilterParts) / sizeof(pszFilterParts[0]); ++i) {
- tstring sPart = TranslateTS(pszFilterParts[i]);
+ tstring sPart = TranslateW(pszFilterParts[i]);
std::copy(sPart.begin(), sPart.end(), std::back_inserter(aFilter));
aFilter.push_back('\0');
@@ -422,10 +422,10 @@ INT_PTR CALLBACK EditSettingsPerContactDlgProc(HWND hWnd, UINT msg, WPARAM wp, L db_set_w(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_LOG_FILE_CONDITION, nIfChangedFile);
db_set_w(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_HISTORY_CONDITION, nIfChangedHistory);
db_set_b(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_POPUP_CONDITION, bIfChangedPopup);
- db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_LOG_FILE, sLogFile.c_str());
- db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_FORMAT_LOG_FILE, sLogFileFormat.c_str());
- db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_FORMAT_HISTORY, sHistoryFormat.c_str());
- db_set_ts(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_FORMAT_POPUP, sPopupFormat.c_str());
+ db_set_ws(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_LOG_FILE, sLogFile.c_str());
+ db_set_ws(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_FORMAT_LOG_FILE, sLogFileFormat.c_str());
+ db_set_ws(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_FORMAT_HISTORY, sHistoryFormat.c_str());
+ db_set_ws(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_FORMAT_POPUP, sPopupFormat.c_str());
if (pParam->m_pPopupSettings) {
pParam->m_pPopupSettings->SaveForContact(hContact);
@@ -704,12 +704,12 @@ void CAdvProviderSettings::SaveToDb()const assert(visitor.m_pszDbPopupHistoryFlag);
db_set_w(NULL, QUOTES_PROTOCOL_NAME, visitor.m_pszDbLogMode, m_wLogMode);
- db_set_ts(NULL, QUOTES_PROTOCOL_NAME, visitor.m_pszDbHistoryFormat, m_sFormatHistory.c_str());
+ db_set_ws(NULL, QUOTES_PROTOCOL_NAME, visitor.m_pszDbHistoryFormat, m_sFormatHistory.c_str());
db_set_b(NULL, QUOTES_PROTOCOL_NAME, visitor.m_pszDbHistoryCondition, m_bIsOnlyChangedHistory);
- db_set_ts(NULL, QUOTES_PROTOCOL_NAME, visitor.m_pszDbLogFile, m_sLogFileName.c_str());
- db_set_ts(NULL, QUOTES_PROTOCOL_NAME, visitor.m_pszDbLogFormat, m_sFormatLogFile.c_str());
+ db_set_ws(NULL, QUOTES_PROTOCOL_NAME, visitor.m_pszDbLogFile, m_sLogFileName.c_str());
+ db_set_ws(NULL, QUOTES_PROTOCOL_NAME, visitor.m_pszDbLogFormat, m_sFormatLogFile.c_str());
db_set_b(NULL, QUOTES_PROTOCOL_NAME, visitor.m_pszDbLogCondition, m_bIsOnlyChangedLogFile);
- db_set_ts(NULL, QUOTES_PROTOCOL_NAME, visitor.m_pszDbPopupFormat, m_sPopupFormat.c_str());
+ db_set_ws(NULL, QUOTES_PROTOCOL_NAME, visitor.m_pszDbPopupFormat, m_sPopupFormat.c_str());
db_set_b(NULL, QUOTES_PROTOCOL_NAME, visitor.m_pszDbPopupCondition, m_bShowPopupIfValueChanged);
if (nullptr != m_pPopupSettings) {
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp index 3ad9cc6b53..31ccea8fdf 100644 --- a/plugins/SMS/src/SMS_svc.cpp +++ b/plugins/SMS/src/SMS_svc.cpp @@ -34,7 +34,7 @@ int LoadModules(void) mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_SMS);
mi.name.w = SMS_SEND_STR;
mi.pszService = szServiceFunction;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0x736e4cff, 0x769e, 0x45dc, 0x8b, 0x78, 0x83, 0xf9, 0xe4, 0xbb, 0x81, 0x9e);
@@ -42,7 +42,7 @@ int LoadModules(void) mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_SMS);
mi.name.w = SMS_SEND_CM_STR;
mi.pszService = szServiceFunction;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
ssSMSSettings.hContactMenuItems[0] = Menu_AddContactMenuItem(&mi);
SkinAddNewSoundEx("RecvSMSMsg", PROTOCOL_NAMEA, LPGEN("Incoming SMS Message"));
diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp index 985077fde9..4063da39ae 100644 --- a/plugins/Scriver/src/chat/options.cpp +++ b/plugins/Scriver/src/chat/options.cpp @@ -113,7 +113,7 @@ static HTREEITEM InsertBranch(HWND hwndTree, wchar_t* pszDescr, BOOL bExpanded) tvis.hParent = NULL;
tvis.hInsertAfter = TVI_LAST;
tvis.item.mask = TVIF_TEXT | TVIF_STATE;
- tvis.item.pszText = TranslateTS(pszDescr);
+ tvis.item.pszText = TranslateW(pszDescr);
tvis.item.stateMask = bExpanded ? TVIS_STATEIMAGEMASK | TVIS_EXPANDED : TVIS_STATEIMAGEMASK;
tvis.item.state = bExpanded ? INDEXTOSTATEIMAGEMASK(1) | TVIS_EXPANDED : INDEXTOSTATEIMAGEMASK(1);
return TreeView_InsertItem(hwndTree, &tvis);
@@ -128,7 +128,7 @@ static void FillBranch(HWND hwndTree, HTREEITEM hParent, struct branch_t *branch tvis.hInsertAfter = TVI_LAST;
tvis.item.mask = TVIF_TEXT | TVIF_STATE;
for (int i = 0; i < nValues; i++) {
- tvis.item.pszText = TranslateTS(branch[i].szDescr);
+ tvis.item.pszText = TranslateW(branch[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
if (branch[i].iMode)
iState = ((db_get_dw(NULL, CHAT_MODULE, branch[i].szDBName, defaultval)&branch[i].iMode)&branch[i].iMode) != 0 ? 2 : 1;
@@ -225,7 +225,7 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM p static void InitSetting(wchar_t **ppPointer, char *pszSetting, wchar_t *pszDefault)
{
DBVARIANT dbv;
- if ( !db_get_ts(NULL, CHAT_MODULE, pszSetting, &dbv )) {
+ if ( !db_get_ws(NULL, CHAT_MODULE, pszSetting, &dbv )) {
replaceStrW(*ppPointer, dbv.ptszVal);
db_free(&dbv);
}
@@ -529,7 +529,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa *p2 = ' ';
p2 = wcschr(ptszText, (wchar_t)',');
}
- db_set_ts(NULL, CHAT_MODULE, "HighlightWords", ptszText);
+ db_set_ws(NULL, CHAT_MODULE, "HighlightWords", ptszText);
mir_free(ptszText);
}
}
@@ -539,7 +539,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa if (iLen > 0) {
wchar_t *pszText1 = (wchar_t*)malloc(iLen*sizeof(wchar_t)+2);
GetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, pszText1, iLen + 1);
- db_set_ts(NULL, CHAT_MODULE, "LogDirectory", pszText1);
+ db_set_ws(NULL, CHAT_MODULE, "LogDirectory", pszText1);
free(pszText1);
}
else {
diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp index 3b9c78291c..7b002430ff 100644 --- a/plugins/Scriver/src/chat/tools.cpp +++ b/plugins/Scriver/src/chat/tools.cpp @@ -79,7 +79,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s AppendMenu(*hMenu, MF_SEPARATOR, 0, 0);
for (int i = 0; i < gcmi.nItems; i++) {
- wchar_t *ptszText = TranslateTS(gcmi.Item[i].pszDesc);
+ wchar_t *ptszText = TranslateW(gcmi.Item[i].pszDesc);
DWORD dwState = gcmi.Item[i].bDisabled ? MF_GRAYED : 0;
if (gcmi.Item[i].uType == MENU_NEWPOPUP) {
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index 0be7880de0..565a5f8111 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -1706,7 +1706,7 @@ LABEL_SHOWWINDOW: // takes pszRtf to a queue, no leak here
si->cmdList = tcmdlist_append(si->cmdList, pszRtf, 20, FALSE);
- CMString ptszText(ptrW(mir_utf8decodeW(pszRtf)));
+ CMStringW ptszText(ptrW(mir_utf8decodeW(pszRtf)));
pci->DoRtfToTags(ptszText, mi->nColorCount, mi->crColors);
ptszText.Trim();
ptszText.Replace(L"%", L"%%");
@@ -1907,7 +1907,7 @@ LABEL_SHOWWINDOW: mii.wID = i + 1;
mii.dwItemData = (ULONG_PTR)g_dat.hChatButtonIconList;
mii.hbmpItem = HBMMENU_CALLBACK;
- mii.dwTypeData = TranslateTS((toolbarButtons[i].name));
+ mii.dwTypeData = TranslateW((toolbarButtons[i].name));
InsertMenuItem(hToolbarMenu, i, TRUE, &mii);
}
diff --git a/plugins/Scriver/src/infobar.cpp b/plugins/Scriver/src/infobar.cpp index 8ff69e1288..764bbdd844 100644 --- a/plugins/Scriver/src/infobar.cpp +++ b/plugins/Scriver/src/infobar.cpp @@ -79,16 +79,16 @@ void RefreshInfobar(InfobarWindowData* idat) {
HWND hwnd = idat->hWnd;
SrmmWindowData *dat = idat->mwd;
- ptrW szContactStatusMsg(db_get_tsa(dat->hContact, "CList", "StatusMsg"));
- ptrW szXStatusName(db_get_tsa(idat->mwd->hContact, idat->mwd->szProto, "XStatusName"));
- ptrW szXStatusMsg(db_get_tsa(idat->mwd->hContact, idat->mwd->szProto, "XStatusMsg"));
+ ptrW szContactStatusMsg(db_get_wsa(dat->hContact, "CList", "StatusMsg"));
+ ptrW szXStatusName(db_get_wsa(idat->mwd->hContact, idat->mwd->szProto, "XStatusName"));
+ ptrW szXStatusMsg(db_get_wsa(idat->mwd->hContact, idat->mwd->szProto, "XStatusMsg"));
HICON hIcon = GetExtraStatusIcon(idat);
wchar_t szText[2048];
SETTEXTEX st;
if (szXStatusMsg && *szXStatusMsg)
- mir_snwprintf(szText, L"%s (%s)", TranslateTS(szXStatusName), szXStatusMsg);
+ mir_snwprintf(szText, L"%s (%s)", TranslateW(szXStatusName), szXStatusMsg);
else
- wcsncpy_s(szText, TranslateTS(szXStatusName), _TRUNCATE);
+ wcsncpy_s(szText, TranslateW(szXStatusName), _TRUNCATE);
st.flags = ST_DEFAULT;
st.codepage = 1200;
SendDlgItemMessage(hwnd, IDC_INFOBAR_NAME, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)pcli->pfnGetContactDisplayName(dat->hContact, 0));
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 5aab926147..e1ddf07e4e 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -759,7 +759,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SetDlgItemTextA(hwndDlg, IDC_MESSAGE, newData->szInitialText);
}
else if (g_dat.flags & SMF_SAVEDRAFTS) {
- ptrW ptszSavedMsg(db_get_tsa(dat->hContact, "SRMM", "SavedMsg"));
+ ptrW ptszSavedMsg(db_get_wsa(dat->hContact, "SRMM", "SavedMsg"));
if (ptszSavedMsg)
len = SetRichText(GetDlgItem(hwndDlg, IDC_MESSAGE), ptszSavedMsg);
PostMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETSEL, len, len);
@@ -931,7 +931,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP mii.wID = i + 1;
mii.dwItemData = (ULONG_PTR)g_dat.hButtonIconList;
mii.hbmpItem = HBMMENU_CALLBACK;
- mii.dwTypeData = TranslateTS((toolbarButtons[i].name));
+ mii.dwTypeData = TranslateW((toolbarButtons[i].name));
InsertMenuItem(hToolbarMenu, i, TRUE, &mii);
}
{
@@ -1670,7 +1670,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
db_event_get(dat->hDbEventLast, &dbei);
if (DbEventIsMessageOrCustom(&dbei)) {
- buffer = DbGetEventTextT(&dbei, CP_ACP);
+ buffer = DbGetEventTextW(&dbei, CP_ACP);
if (buffer != NULL) {
wchar_t *quotedBuffer = GetQuotedTextW(buffer);
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)quotedBuffer);
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index f75057670b..b890d7f12b 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -156,7 +156,7 @@ EventData* getEventFromDB(SrmmWindowData *dat, MCONTACT hContact, MEVENT hDbEven if (*descr != 0)
evt->pszText2T = DbGetEventStringT(&dbei, descr);
}
- else evt->pszTextT = DbGetEventTextT(&dbei, CP_UTF8);
+ else evt->pszTextT = DbGetEventTextW(&dbei, CP_UTF8);
if (!(dat->flags & SMF_RTL) && RTL_Detect(evt->pszTextT))
evt->dwFlags |= IEEDF_RTL;
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 6685fdc099..98198af1a6 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -105,7 +105,7 @@ int FontServiceFontsChanged(WPARAM, LPARAM) void RegisterFontServiceFonts()
{
- FontIDT fid = { sizeof(fid) };
+ FontIDW fid = { sizeof(fid) };
wcsncpy_s(fid.group, LPGENW("Messaging"), _TRUNCATE);
wcsncpy_s(fid.backgroundGroup, LPGENW("Messaging"), _TRUNCATE);
strncpy(fid.dbSettingsGroup, SRMMMOD, _countof(fid.dbSettingsGroup));
@@ -123,10 +123,10 @@ void RegisterFontServiceFonts() fid.deffontsettings.charset = DEFAULT_CHARSET;
wcsncpy(fid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fid.deffontsettings.szFace));
wcsncpy(fid.backgroundName, fontOptionsList[i].szBkgName, _countof(fid.backgroundName));
- FontRegisterT(&fid);
+ FontRegisterW(&fid);
}
- ColourIDT cid = { sizeof(cid) };
+ ColourIDW cid = { sizeof(cid) };
wcsncpy_s(cid.group, LPGENW("Messaging"), _TRUNCATE);
strncpy(cid.dbSettingsGroup, SRMMMOD, _countof(fid.dbSettingsGroup));
cid.flags = 0;
@@ -139,7 +139,7 @@ void RegisterFontServiceFonts() cid.defcolour = colourOptionsList[i].defColour;
strncpy(cid.setting, colourOptionsList[i].szSettingName, _countof(cid.setting));
- ColourRegisterT(&cid);
+ ColourRegisterW(&cid);
}
}
@@ -188,7 +188,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour) lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
mir_snprintf(str, "%s%d", "SRMFont", i);
- ptrW tszFace(db_get_tsa(NULL, SRMMMOD, str));
+ ptrW tszFace(db_get_wsa(NULL, SRMMMOD, str));
if (tszFace == NULL)
mir_wstrcpy(lf->lfFaceName, fontOptionsList[i].szDefFace);
else
@@ -227,7 +227,7 @@ static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *value tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
for (int i = 0; i < nValues; i++) {
tvis.item.lParam = values[i].style;
- tvis.item.pszText = TranslateTS(values[i].szDescr);
+ tvis.item.pszText = TranslateW(values[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.state = INDEXTOSTATEIMAGEMASK((style & tvis.item.lParam) != 0 ? 2 : 1);
TreeView_InsertItem(hwndTree, &tvis);
diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp index 8744cb1b64..0443ba8534 100644 --- a/plugins/Scriver/src/msgwindow.cpp +++ b/plugins/Scriver/src/msgwindow.cpp @@ -40,12 +40,12 @@ wchar_t* GetWindowTitle(MCONTACT hContact, const char *szProto) ptrW tmplt;
const wchar_t* tokens[4] = { 0 };
- CMString tszTemplate, tszStatus, tszTitle;
+ CMStringW tszTemplate, tszStatus, tszTitle;
if (hContact && szProto) {
tokens[0] = pcli->pfnGetContactDisplayName(hContact, 0);
tokens[1] = pcli->pfnGetStatusModeDescription(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
- tszStatus = ptrW(db_get_tsa(hContact, "CList", "StatusMsg"));
+ tszStatus = ptrW(db_get_wsa(hContact, "CList", "StatusMsg"));
tszStatus.Replace(L"\r\n", L" ");
tokens[2] = tszStatus;
@@ -56,7 +56,7 @@ wchar_t* GetWindowTitle(MCONTACT hContact, const char *szProto) tokens[3] = mir_wstrdup(proto->tszAccountName);
}
- tmplt = db_get_tsa(NULL, SRMMMOD, SRMSGSET_WINDOWTITLE);
+ tmplt = db_get_wsa(NULL, SRMMMOD, SRMSGSET_WINDOWTITLE);
if (tmplt != NULL)
tszTemplate = tmplt;
else {
diff --git a/plugins/SeenPlugin/src/file.cpp b/plugins/SeenPlugin/src/file.cpp index bd61b7a820..411d85a71e 100644 --- a/plugins/SeenPlugin/src/file.cpp +++ b/plugins/SeenPlugin/src/file.cpp @@ -30,17 +30,17 @@ static wchar_t *g_ptszFileStamp, *g_ptszFileName; void InitFileOutput(void)
{
- ptrW tszFileName(db_get_tsa(NULL, S_MOD, "FileName"));
+ ptrW tszFileName(db_get_wsa(NULL, S_MOD, "FileName"));
if (tszFileName == NULL)
tszFileName = mir_wstrdup(DEFAULT_FILENAME);
- replaceStrW(g_ptszFileName, VARST(tszFileName));
+ replaceStrW(g_ptszFileName, VARSW(tszFileName));
wchar_t *tszPath = NEWWSTR_ALLOCA(g_ptszFileName);
wchar_t *p = wcsrchr(tszPath, '\\');
if (p) *p = 0;
- CreateDirectoryTreeT(tszPath);
+ CreateDirectoryTreeW(tszPath);
- ptrW tszFileStamp(db_get_tsa(NULL, S_MOD, "FileStamp"));
+ ptrW tszFileStamp(db_get_wsa(NULL, S_MOD, "FileStamp"));
replaceStrW(g_ptszFileStamp, (tszFileStamp == NULL) ? DEFAULT_FILESTAMP : tszFileStamp);
}
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp index a89a7f2ce3..84639ea0a6 100644 --- a/plugins/SeenPlugin/src/history.cpp +++ b/plugins/SeenPlugin/src/history.cpp @@ -52,12 +52,12 @@ void HistoryWrite(MCONTACT hContact) wchar_t *ptszString;
DBVARIANT dbv;
- if (!db_get_ts(NULL, S_MOD, "HistoryStamp", &dbv)) {
+ if (!db_get_ws(NULL, S_MOD, "HistoryStamp", &dbv)) {
ptszString = ParseString(dbv.ptszVal, hContact);
db_free(&dbv);
}
else ptszString = ParseString(DEFAULT_HISTORYSTAMP, hContact);
- db_set_ts(hContact, S_MOD, BuildSetting(historyLast), ptszString);
+ db_set_ws(hContact, S_MOD, BuildSetting(historyLast), ptszString);
historyLast = (historyLast + 1) % historyMax;
db_set_w(hContact, S_MOD, "HistoryLast", historyLast);
@@ -88,7 +88,7 @@ void LoadHistoryList(MCONTACT hContact, HWND hwnd, int nList) i = (i - 1 + historyMax) % historyMax;
DBVARIANT dbv;
- if (!db_get_ts(hContact, S_MOD, BuildSetting(i), &dbv)) {
+ if (!db_get_ws(hContact, S_MOD, BuildSetting(i), &dbv)) {
SendDlgItemMessage(hwnd, nList, LB_ADDSTRING, 0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
@@ -188,9 +188,9 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARA SendDlgItemMessage(hwndDlg, IDC_SENDMSG, BM_SETIMAGE, IMAGE_ICON, (WPARAM)Skin_LoadIcon(SKINICON_EVENT_MESSAGE));
//set-up tooltips
- SendDlgItemMessage(hwndDlg, IDC_DETAILS, BUTTONADDTOOLTIP, (WPARAM)TranslateT("View User's Details"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_USERMENU, BUTTONADDTOOLTIP, (WPARAM)TranslateT("User Menu"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_SENDMSG, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Send Instant Message"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_DETAILS, BUTTONADDTOOLTIP, (WPARAM)TranslateT("View User's Details"), BATF_UNICODE);
+ SendDlgItemMessage(hwndDlg, IDC_USERMENU, BUTTONADDTOOLTIP, (WPARAM)TranslateT("User Menu"), BATF_UNICODE);
+ SendDlgItemMessage(hwndDlg, IDC_SENDMSG, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Send Instant Message"), BATF_UNICODE);
Utils_RestoreWindowPositionNoMove(hwndDlg, NULL, S_MOD, "History_");
ShowWindow(hwndDlg, SW_SHOW);
diff --git a/plugins/SeenPlugin/src/main.cpp b/plugins/SeenPlugin/src/main.cpp index cb98026c61..5ab4b3e6eb 100644 --- a/plugins/SeenPlugin/src/main.cpp +++ b/plugins/SeenPlugin/src/main.cpp @@ -104,10 +104,10 @@ extern "C" __declspec(dllexport) int Load(void) LoadWatchedProtos();
- SkinAddNewSoundExT("LastSeenTrackedStatusChange", LPGENW("LastSeen"), LPGENW("User status change"));
- SkinAddNewSoundExT("LastSeenTrackedStatusOnline", LPGENW("LastSeen"), LPGENW("Changed to Online"));
- SkinAddNewSoundExT("LastSeenTrackedStatusOffline", LPGENW("LastSeen"), LPGENW("User Logged Off"));
- SkinAddNewSoundExT("LastSeenTrackedStatusFromOffline", LPGENW("LastSeen"), LPGENW("User Logged In"));
+ SkinAddNewSoundExW("LastSeenTrackedStatusChange", LPGENW("LastSeen"), LPGENW("User status change"));
+ SkinAddNewSoundExW("LastSeenTrackedStatusOnline", LPGENW("LastSeen"), LPGENW("Changed to Online"));
+ SkinAddNewSoundExW("LastSeenTrackedStatusOffline", LPGENW("LastSeen"), LPGENW("User Logged Off"));
+ SkinAddNewSoundExW("LastSeenTrackedStatusFromOffline", LPGENW("LastSeen"), LPGENW("User Logged In"));
return 0;
}
diff --git a/plugins/SeenPlugin/src/menu.cpp b/plugins/SeenPlugin/src/menu.cpp index b2728560d2..c8e9777004 100644 --- a/plugins/SeenPlugin/src/menu.cpp +++ b/plugins/SeenPlugin/src/menu.cpp @@ -43,7 +43,7 @@ int BuildContactMenu(WPARAM hContact, LPARAM) }
LPCTSTR ptszName;
- ptrW tszStamp(db_get_tsa(NULL, S_MOD, "MenuStamp"));
+ ptrW tszStamp(db_get_wsa(NULL, S_MOD, "MenuStamp"));
if (tszStamp != NULL)
ptszName = ParseString(tszStamp , hContact);
else
diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp index 178eaf301d..b2cbc80f12 100644 --- a/plugins/SeenPlugin/src/options.cpp +++ b/plugins/SeenPlugin/src/options.cpp @@ -58,13 +58,13 @@ INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp EnableWindow(GetDlgItem(hdlg, i + 20), hasPopups);
}
- if (!db_get_ts(NULL, S_MOD, "PopupStamp", &dbv)) {
+ if (!db_get_ws(NULL, S_MOD, "PopupStamp", &dbv)) {
SetDlgItemText(hdlg, IDC_POPUPSTAMP, dbv.ptszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_POPUPSTAMP, DEFAULT_POPUPSTAMP);
- if (!db_get_ts(NULL, S_MOD, "PopupStampText", &dbv)) {
+ if (!db_get_ws(NULL, S_MOD, "PopupStampText", &dbv)) {
SetDlgItemText(hdlg, IDC_POPUPSTAMPTEXT, dbv.ptszVal);
db_free(&dbv);
}
@@ -130,10 +130,10 @@ INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp switch (((LPNMHDR)lparam)->code) {
case PSN_APPLY:
GetDlgItemText(hdlg, IDC_POPUPSTAMP, szstamp, _countof(szstamp));
- db_set_ts(NULL, S_MOD, "PopupStamp", szstamp);
+ db_set_ws(NULL, S_MOD, "PopupStamp", szstamp);
GetDlgItemText(hdlg, IDC_POPUPSTAMPTEXT, szstamp, _countof(szstamp));
- db_set_ts(NULL, S_MOD, "PopupStampText", szstamp);
+ db_set_ws(NULL, S_MOD, "PopupStampText", szstamp);
bchecked = (BYTE)IsDlgButtonChecked(hdlg, IDC_POPUPS);
if (db_get_b(NULL, S_MOD, "UsePopups", 0) != bchecked)
@@ -189,31 +189,31 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM EnableWindow(GetDlgItem(hdlg, IDC_HISTORYSTAMP), IsDlgButtonChecked(hdlg, IDC_HISTORY));
EnableWindow(GetDlgItem(hdlg, IDC_COUNT), IsDlgButtonChecked(hdlg, IDC_MISSEDONES));
- if (!db_get_ts(NULL, S_MOD, "MenuStamp", &dbv)) {
+ if (!db_get_ws(NULL, S_MOD, "MenuStamp", &dbv)) {
SetDlgItemText(hdlg, IDC_MENUSTAMP, dbv.ptszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_MENUSTAMP, DEFAULT_MENUSTAMP);
- if (!db_get_ts(NULL, S_MOD, "UserStamp", &dbv)) {
+ if (!db_get_ws(NULL, S_MOD, "UserStamp", &dbv)) {
SetDlgItemText(hdlg, IDC_USERSTAMP, dbv.ptszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_USERSTAMP, DEFAULT_USERSTAMP);
- if (!db_get_ts(NULL, S_MOD, "FileStamp", &dbv)) {
+ if (!db_get_ws(NULL, S_MOD, "FileStamp", &dbv)) {
SetDlgItemText(hdlg, IDC_FILESTAMP, dbv.ptszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_FILESTAMP, DEFAULT_FILESTAMP);
- if (!db_get_ts(NULL, S_MOD, "FileName", &dbv)) {
+ if (!db_get_ws(NULL, S_MOD, "FileName", &dbv)) {
SetDlgItemText(hdlg, IDC_FILENAME, dbv.ptszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_FILENAME, DEFAULT_FILENAME);
- if (!db_get_ts(NULL, S_MOD, "HistoryStamp", &dbv)) {
+ if (!db_get_ws(NULL, S_MOD, "HistoryStamp", &dbv)) {
SetDlgItemText(hdlg, IDC_HISTORYSTAMP, dbv.ptszVal);
db_free(&dbv);
}
@@ -287,19 +287,19 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM switch (((LPNMHDR)lparam)->code) {
case PSN_APPLY:
GetDlgItemText(hdlg, IDC_MENUSTAMP, szstamp, _countof(szstamp));
- db_set_ts(NULL, S_MOD, "MenuStamp", szstamp);
+ db_set_ws(NULL, S_MOD, "MenuStamp", szstamp);
GetDlgItemText(hdlg, IDC_USERSTAMP, szstamp, _countof(szstamp));
- db_set_ts(NULL, S_MOD, "UserStamp", szstamp);
+ db_set_ws(NULL, S_MOD, "UserStamp", szstamp);
GetDlgItemText(hdlg, IDC_FILESTAMP, szstamp, _countof(szstamp));
- db_set_ts(NULL, S_MOD, "FileStamp", szstamp);
+ db_set_ws(NULL, S_MOD, "FileStamp", szstamp);
GetDlgItemText(hdlg, IDC_FILENAME, szstamp, _countof(szstamp));
- db_set_ts(NULL, S_MOD, "FileName", szstamp);
+ db_set_ws(NULL, S_MOD, "FileName", szstamp);
GetDlgItemText(hdlg, IDC_HISTORYSTAMP, szstamp, _countof(szstamp));
- db_set_ts(NULL, S_MOD, "HistoryStamp", szstamp);
+ db_set_ws(NULL, S_MOD, "HistoryStamp", szstamp);
db_set_w(NULL, S_MOD, "HistoryMax", (WORD)(GetDlgItemInt(hdlg, IDC_HISTORYSIZE, NULL, FALSE) + 1));
@@ -432,7 +432,7 @@ int OptionsInit(WPARAM wparam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 100000000;
odp.hInstance = hInstance;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_SETTINGS);
odp.pwszGroup = LPGENW("Contacts");
odp.pwszTitle = LPGENW("Last seen");
diff --git a/plugins/SeenPlugin/src/userinfo.cpp b/plugins/SeenPlugin/src/userinfo.cpp index 4fb56ce9f7..881b69ae1e 100644 --- a/plugins/SeenPlugin/src/userinfo.cpp +++ b/plugins/SeenPlugin/src/userinfo.cpp @@ -41,7 +41,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar case WM_REFRESH_UI:
{
- ptrW szout(db_get_tsa(NULL, S_MOD, "UserStamp"));
+ ptrW szout(db_get_wsa(NULL, S_MOD, "UserStamp"));
wchar_t *str = ParseString((szout != NULL) ? szout : DEFAULT_USERSTAMP, wparam);
SetDlgItemText(hdlg, IDC_INFOTEXT, str);
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index 8ff36e51f0..3cb5dad4f2 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -207,7 +207,7 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact) charPtr = wantempty ? L"" : TranslateT("<unknown>");
goto LBL_charPtr;
}
- charPtr = TranslateTS(weekdays[isetting]);
+ charPtr = TranslateW(weekdays[isetting]);
LBL_charPtr:
d += mir_snwprintf(d, MAXSIZE - (d - sztemp), L"%s", charPtr);
break;
@@ -215,17 +215,17 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact) case 'w':
isetting = st.wDayOfWeek;
if (isetting == -1) goto LBL_noData;
- charPtr = TranslateTS(wdays_short[isetting]);
+ charPtr = TranslateW(wdays_short[isetting]);
goto LBL_charPtr;
case 'E':
if (!(isetting = st.wMonth)) goto LBL_noData;
- charPtr = TranslateTS(monthnames[isetting - 1]);
+ charPtr = TranslateW(monthnames[isetting - 1]);
goto LBL_charPtr;
case 'e':
if (!(isetting = st.wMonth)) goto LBL_noData;
- charPtr = TranslateTS(mnames_short[isetting - 1]);
+ charPtr = TranslateW(mnames_short[isetting - 1]);
goto LBL_charPtr;
case 'H':
@@ -263,7 +263,7 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact) goto LBL_noData;
case 'G':
- if (!db_get_ts(hcontact, "CList", "Group", &dbv)) {
+ if (!db_get_ws(hcontact, "CList", "Group", &dbv)) {
wcsncpy(szdbsetting, dbv.ptszVal, _countof(szdbsetting));
db_free(&dbv);
charPtr = szdbsetting;
@@ -291,7 +291,7 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact) goto LBL_noData;
case 'T':
- if (db_get_ts(hcontact, "CList", "StatusMsg", &dbv))
+ if (db_get_ws(hcontact, "CList", "StatusMsg", &dbv))
goto LBL_noData;
d += mir_snwprintf(d, MAXSIZE - (d - sztemp), L"%s", dbv.ptszVal);
@@ -313,7 +313,7 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact) case 'i':
case 'r':
if (isJabber(szProto)) {
- if (info = db_get_tsa(hcontact, szProto, *p == 'i' ? "Resource" : "System")) {
+ if (info = db_get_wsa(hcontact, szProto, *p == 'i' ? "Resource" : "System")) {
charPtr = info;
goto LBL_charPtr;
}
@@ -340,7 +340,7 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact) goto LBL_charPtr;
case 'C': // Get Client Info
- if (info = db_get_tsa(hcontact, szProto, "MirVer")) {
+ if (info = db_get_wsa(hcontact, szProto, "MirVer")) {
charPtr = info;
goto LBL_charPtr;
}
@@ -476,13 +476,13 @@ void ShowPopup(MCONTACT hcontact, const char * lpzProto, int newStatus) ppd.lchContact = hcontact;
ppd.lchIcon = Skin_LoadProtoIcon(lpzProto, newStatus);
- if (!db_get_ts(NULL, S_MOD, "PopupStamp", &dbv)) {
+ if (!db_get_ws(NULL, S_MOD, "PopupStamp", &dbv)) {
wcsncpy(ppd.lptzContactName, ParseString(dbv.ptszVal, hcontact), MAX_CONTACTNAME);
db_free(&dbv);
}
else wcsncpy(ppd.lptzContactName, ParseString(DEFAULT_POPUPSTAMP, hcontact), MAX_CONTACTNAME);
- if (!db_get_ts(NULL, S_MOD, "PopupStampText", &dbv)) {
+ if (!db_get_ws(NULL, S_MOD, "PopupStampText", &dbv)) {
wcsncpy(ppd.lptzText, ParseString(dbv.ptszVal, hcontact), MAX_SECONDLINE);
db_free(&dbv);
}
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index ac1082df93..61e4be2080 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -124,16 +124,16 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, case ID_btnCopy: case ID_btnThumbCopy: SendDlgItemMessage(hwndDlg, i, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIconBtn(ICO_BTN_COPY)); - SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Copy"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Copy"), BATF_UNICODE); break; case ID_btnBBC: case ID_btnThumbBBC: SendDlgItemMessage(hwndDlg, i, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIconBtn(ICO_BTN_BBC)); - SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Copy BBCode"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Copy BBCode"), BATF_UNICODE); break; default: SendDlgItemMessage(hwndDlg, i, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIconBtn(ICO_BTN_BBCLNK)); - SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Copy BBCode w/ link"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Copy BBCode w/ link"), BATF_UNICODE); } } } @@ -404,7 +404,7 @@ void CSend::Error(LPCTSTR pszFormat, ...) va_list vl; va_start(vl, pszFormat); - mir_vsnwprintf(tszMsg, _countof(tszMsg), TranslateTS(pszFormat), vl); + mir_vsnwprintf(tszMsg, _countof(tszMsg), TranslateW(pszFormat), vl); va_end(vl); mir_free(m_ErrorMsg), m_ErrorMsg = mir_wstrdup(tszMsg); @@ -436,7 +436,7 @@ void CSend::Exit(unsigned int Result) break; case ACKRESULT_DENIED: SkinPlaySound("FileDenied"); - Error(L"%s (%i):\nFile transfer denied.", TranslateTS(m_pszSendTyp), Result); + Error(L"%s (%i):\nFile transfer denied.", TranslateW(m_pszSendTyp), Result); MsgBoxService(NULL, (LPARAM)&m_box); err = false; break; diff --git a/plugins/SendScreenshotPlus/src/CSendDropbox.cpp b/plugins/SendScreenshotPlus/src/CSendDropbox.cpp index 47b7f778e6..948dcbccc1 100644 --- a/plugins/SendScreenshotPlus/src/CSendDropbox.cpp +++ b/plugins/SendScreenshotPlus/src/CSendDropbox.cpp @@ -60,7 +60,7 @@ void CSendDropbox::SendThread() if (CallService(MS_DROPBOX_UPLOAD, (WPARAM)&m_URL, (LPARAM)&ui)) { - Error(LPGENW("%s (%i):\nCould not add a share to the Dropbox plugin."), TranslateTS(m_pszSendTyp), 0); + Error(LPGENW("%s (%i):\nCould not add a share to the Dropbox plugin."), TranslateW(m_pszSendTyp), 0); Exit(ACKRESULT_FAILED); return; } diff --git a/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp b/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp index 3267ecdd14..e742c7fe08 100644 --- a/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp +++ b/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp @@ -74,7 +74,7 @@ void CSendFTPFile::SendThread() INT_PTR ret = FTPFileUploadA(m_hContact, FNUM_DEFAULT, FMODE_RAWFILE, &m_pszFileName, 1); if (ret != 0) { - Error(LPGENW("%s (%i):\nCould not add a share to the FTP File plugin."), TranslateTS(m_pszSendTyp), ret); + Error(LPGENW("%s (%i):\nCould not add a share to the FTP File plugin."), TranslateW(m_pszSendTyp), ret); Exit(ret); return; } diff --git a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp index 636b49d1b3..f02707547b 100644 --- a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp @@ -102,7 +102,7 @@ void CSendHTTPServer::SendThread() } if (ret != 0) { - Error(LPGENW("%s (%i):\nCould not add a share to the HTTP Server plugin."), TranslateTS(m_pszSendTyp), ret); + Error(LPGENW("%s (%i):\nCould not add a share to the HTTP Server plugin."), TranslateW(m_pszSendTyp), ret); Exit(ret); return; } diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp index dd1e9f5111..045bcbff2c 100644 --- a/plugins/SendScreenshotPlus/src/Main.cpp +++ b/plugins/SendScreenshotPlus/src/Main.cpp @@ -81,7 +81,7 @@ wchar_t* GetCustomPath() MessageBox(NULL, L"Can not retrieve screenshot path.", L"SendSS", MB_OK | MB_ICONERROR | MB_APPLMODAL); return 0; } - int result = CreateDirectoryTreeT(pszPath); + int result = CreateDirectoryTreeW(pszPath); if (result) { wchar_t szError[MAX_PATH]; mir_snwprintf(szError, MAX_PATH, TranslateT("Could not create screenshot folder (error code: %d):\n%s\nDo you have write permissions?"), result, pszPath); @@ -234,7 +234,7 @@ int hook_ModulesLoaded(WPARAM, LPARAM) NETLIBUSER nlu = { sizeof(nlu) }; nlu.szSettingsModule = __PLUGIN_NAME; nlu.ptszDescriptiveName = TranslateT("SendSS HTTP connections"); - nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR; //|NUF_NOHTTPSOPTION; + nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE; //|NUF_NOHTTPSOPTION; g_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu); // load my button class / or use UInfoEx CtrlButtonLoadModule(); @@ -285,7 +285,7 @@ DLL_EXPORT int Load(void) // menu items CMenuItem mi; - mi.flags = CMIF_TCHAR; + mi.flags = CMIF_UNICODE; mi.hIcolibItem = GetIconHandle(ICO_MAINXS); SET_UID(mi, 0xa559a22e, 0xd0f9, 0x4553, 0x8e, 0x68, 0x55, 0xb3, 0xae, 0xc4, 0x5d, 0x93); @@ -309,12 +309,12 @@ DLL_EXPORT int Load(void) /// hotkey's HOTKEYDESC hkd = { sizeof(hkd) }; hkd.pszName = "Open SendSS+"; - hkd.ptszDescription = LPGENW("Open SendSS+"); - hkd.ptszSection = L"SendSS+"; + hkd.pwszDescription = LPGENW("Open SendSS+"); + hkd.pwszSection = L"SendSS+"; hkd.pszService = MS_SENDSS_OPENDIALOG; //hkd.DefHotKey=HOTKEYCODE(HOTKEYF_CONTROL, VK_F10) | HKF_MIRANDA_LOCAL; hkd.lParam = 0xFFFF; - hkd.dwFlags = HKD_TCHAR; + hkd.dwFlags = HKD_UNICODE; Hotkey_Register(&hkd); /// register highlighter window class HBRUSH brush = CreateSolidBrush(0x0000FF00);//owned by class diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp index 9d7ac40e04..c572477943 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.cpp +++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp @@ -177,7 +177,7 @@ void TfrmMain::wmInitdialog(WPARAM, LPARAM) wchar_t *pt = mir_wstrdup(pcli->pfnGetContactDisplayName(m_hContact, 0)); if (pt && (m_hContact != 0)) { - CMString string; + CMStringW string; string.AppendFormat(TranslateT("Send screenshot to %s"), pt); SetWindowText(m_hWnd, string); } @@ -988,7 +988,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) GetDlgItemText(m_hwndTabPage, ID_edtCaption, winText, _countof(winText)); - CMString tszFileDesc; + CMStringW tszFileDesc; if (m_opt_tabCapture) tszFileDesc.Format(TranslateT("Screenshot of \"%s\""), winText); diff --git a/plugins/SendScreenshotPlus/src/ctrl_button.cpp b/plugins/SendScreenshotPlus/src/ctrl_button.cpp index d68cb3ed14..54d20d58ef 100644 --- a/plugins/SendScreenshotPlus/src/ctrl_button.cpp +++ b/plugins/SendScreenshotPlus/src/ctrl_button.cpp @@ -566,7 +566,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L case BUTTONTRANSLATE: wchar_t szButton[MAX_PATH]; GetWindowText(bct->hwnd, szButton, _countof(szButton)); - SetWindowText(bct->hwnd, TranslateTS(szButton)); + SetWindowText(bct->hwnd, TranslateW(szButton)); break; case WM_SETFOCUS: // set keybord bFocus and redraw diff --git a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp index 95b567af0f..8f5e9ed568 100644 --- a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp +++ b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp @@ -677,7 +677,7 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI va_list vl; va_start(vl, pszFormat); - mir_vsnwprintf(tszMsg, _countof(tszMsg), TranslateTS(pszFormat), vl); + mir_vsnwprintf(tszMsg, _countof(tszMsg), TranslateW(pszFormat), vl); va_end(vl); MSGBOX mb = { 0 }; @@ -685,8 +685,8 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI mb.hParent = hParent; mb.hiLogo = IcoLib_GetIcon(ICO_COMMON_MAIN); mb.hiMsg = NULL; - mb.ptszTitle = TranslateTS(pszTitle); - mb.ptszInfoText = TranslateTS(pszInfo); + mb.ptszTitle = TranslateW(pszTitle); + mb.ptszInfoText = TranslateW(pszInfo); mb.ptszMsg = tszMsg; mb.uType = uType; return MsgBoxService(NULL, (LPARAM)&mb); @@ -704,7 +704,7 @@ INT_PTR CALLBACK MsgErr(HWND hParent, LPCTSTR pszFormat, ...) va_list vl; va_start(vl, pszFormat); - mir_vsnwprintf(tszMsg, TranslateTS(pszFormat), vl); + mir_vsnwprintf(tszMsg, TranslateW(pszFormat), vl); va_end(vl); MSGBOX mb = { 0 }; diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 6c11fafe4f..16cd20eff3 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -460,8 +460,8 @@ INT_PTR OpenSessionsManagerWindow(WPARAM, LPARAM) }
ptrW
- tszSession(db_get_tsa(NULL, MODNAME, "SessionDate_0")),
- tszUserSession(db_get_tsa(NULL, MODNAME, "UserSessionDsc_0"));
+ tszSession(db_get_wsa(NULL, MODNAME, "SessionDate_0")),
+ tszUserSession(db_get_wsa(NULL, MODNAME, "UserSessionDsc_0"));
if (g_bIncompletedSave || tszSession || tszUserSession) {
g_hDlg = CreateDialog(g_hInst, MAKEINTRESOURCE(IDD_WLCMDIALOG), 0, LoadSessionDlgProc);
return 0;
@@ -489,9 +489,9 @@ int SaveSessionDate() char szSetting[256];
mir_snprintf(szSetting, "%s_%d", "SessionDate", 0);
- wchar_t *ptszSaveSessionDate = db_get_tsa(NULL, MODNAME, szSetting);
+ wchar_t *ptszSaveSessionDate = db_get_wsa(NULL, MODNAME, szSetting);
- db_set_ts(NULL, MODNAME, szSetting, szSessionTime);
+ db_set_ws(NULL, MODNAME, szSetting, szSessionTime);
mir_free(szSessionTime);
if (ptszSaveSessionDate)
@@ -514,11 +514,11 @@ int SaveUserSessionName(wchar_t *szUSessionName) char szSetting[256];
mir_snprintf(szSetting, "%s_%u", "UserSessionDsc", 0);
- wchar_t *ptszUserSessionName = db_get_tsa(NULL, MODNAME, szSetting);
+ wchar_t *ptszUserSessionName = db_get_wsa(NULL, MODNAME, szSetting);
if (ptszUserSessionName)
ResaveSettings("UserSessionDsc", 1, 255, ptszUserSessionName);
- db_set_ts(NULL, MODNAME, szSetting, szUSessionName);
+ db_set_ws(NULL, MODNAME, szSetting, szUSessionName);
return 0;
}
@@ -607,12 +607,12 @@ int DelUserDefSession(int ses_count) for (int i = ses_count + 1;; i++) {
mir_snprintf(szSessionName, "%s_%u", "UserSessionDsc", i);
- ptrW szSessionNameBuf(db_get_tsa(NULL, MODNAME, szSessionName));
+ ptrW szSessionNameBuf(db_get_wsa(NULL, MODNAME, szSessionName));
mir_snprintf(szSessionName, "%s_%u", "UserSessionDsc", i - 1);
if (szSessionNameBuf) {
MarkUserDefSession(i - 1, IsMarkedUserDefSession(i));
- db_set_ts(NULL, MODNAME, szSessionName, szSessionNameBuf);
+ db_set_ws(NULL, MODNAME, szSessionName, szSessionNameBuf);
}
else {
db_unset(NULL, MODNAME, szSessionName);
@@ -640,11 +640,11 @@ int DeleteAutoSession(int ses_count) for (int i = ses_count + 1;; i++) {
mir_snprintf(szSessionName, "%s_%u", "SessionDate", i);
- ptrW szSessionNameBuf(db_get_tsa(NULL, MODNAME, szSessionName));
+ ptrW szSessionNameBuf(db_get_wsa(NULL, MODNAME, szSessionName));
mir_snprintf(szSessionName, "%s_%u", "SessionDate", i - 1);
if (szSessionNameBuf)
- db_set_ts(NULL, MODNAME, szSessionName, szSessionNameBuf);
+ db_set_ws(NULL, MODNAME, szSessionName, szSessionNameBuf);
else {
db_unset(NULL, MODNAME, szSessionName);
break;
diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp index 5b0fe2e88a..c0f2e5ea90 100644 --- a/plugins/Sessions/Src/Utils.cpp +++ b/plugins/Sessions/Src/Utils.cpp @@ -231,8 +231,8 @@ BOOL ResaveSettings(char *szName, int iFirst, int iLimit, wchar_t *szBuffer) char szNameBuf[256];
mir_snprintf(szNameBuf, "%s_%u", szName, i);
- wchar_t *ptszTemp = db_get_tsa(NULL, MODNAME, szNameBuf);
- db_set_ts(NULL, MODNAME, szNameBuf, szBuffer);
+ wchar_t *ptszTemp = db_get_wsa(NULL, MODNAME, szNameBuf);
+ db_set_ws(NULL, MODNAME, szNameBuf, szBuffer);
mir_free(szBuffer);
BYTE marked = IsMarkedUserDefSession(i);
@@ -298,7 +298,7 @@ int LoadSessionToCombobox(HWND hdlg, BOOL mode, int iLimit, char* pszSetting, in for (int i = 0; i < iLimit; i++) {
mir_snprintf(szBuffer, "%s_%u", pszSetting, i);
- wchar_t *pszBuffer = db_get_tsa(NULL, MODNAME, szBuffer);
+ wchar_t *pszBuffer = db_get_wsa(NULL, MODNAME, szBuffer);
if (pszBuffer) {
if (!IsMarkedUserDefSession(i + iFirstNum) || mode == 1) {
index = SendDlgItemMessage(hdlg, IDC_LIST, CB_ADDSTRING, 0, (LPARAM)pszBuffer);
@@ -327,7 +327,7 @@ int FillFavoritesMenu(HMENU hMenu, int iLimit) if (IsMarkedUserDefSession(i)) {
char szBuffer[256];
mir_snprintf(szBuffer, "%s_%u", "UserSessionDsc", i);
- wchar_t *pszBuffer = db_get_tsa(NULL, MODNAME, szBuffer);
+ wchar_t *pszBuffer = db_get_wsa(NULL, MODNAME, szBuffer);
if (pszBuffer) {
AppendMenu(hMenu, MF_STRING, i + 1, pszBuffer);
iItems++;
@@ -362,7 +362,7 @@ void RenameUserDefSession(int ses_count, wchar_t* ptszNewName) {
char szSession[256];
mir_snprintf(szSession, "%s_%u", "UserSessionDsc", ses_count);
- db_set_ts(NULL, MODNAME, szSession, ptszNewName);
+ db_set_ws(NULL, MODNAME, szSession, ptszNewName);
}
int MarkUserDefSession(int ses_count, BYTE bCheck)
diff --git a/plugins/ShellExt/src/options.cpp b/plugins/ShellExt/src/options.cpp index 9fe7d6aee2..2f978a70f1 100644 --- a/plugins/ShellExt/src/options.cpp +++ b/plugins/ShellExt/src/options.cpp @@ -31,8 +31,8 @@ static void InitControls(HWND hwndDlg) wchar_t szBuf[MAX_PATH];
mir_snwprintf(szBuf, L"%s (%s)",
- TranslateTS(COM_OKSTR[(comReg & COMREG_OK) != 0]),
- TranslateTS(COM_APPROVEDSTR[(comReg & COMREG_APPROVED) != 0]));
+ TranslateW(COM_OKSTR[(comReg & COMREG_OK) != 0]),
+ TranslateW(COM_APPROVEDSTR[(comReg & COMREG_APPROVED) != 0]));
SetDlgItemText(hwndDlg, IDC_STATUS, szBuf);
// auto size the static windows to fit their text
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index a9b9200fd3..04583e3961 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -97,10 +97,10 @@ INT CheckDefaults(WPARAM, LPARAM) {
interval = db_get_w(NULL, protocolname, KEY_REPEATINTERVAL, 300);
- wchar_t *ptszVal = db_get_tsa(NULL, protocolname, KEY_HEADING);
+ wchar_t *ptszVal = db_get_wsa(NULL, protocolname, KEY_HEADING);
if (ptszVal == 0)
// Heading not set
- db_set_ts(NULL, protocolname, KEY_HEADING, TranslateT("Dear %user%, the owner left the following message:"));
+ db_set_ws(NULL, protocolname, KEY_HEADING, TranslateT("Dear %user%, the owner left the following message:"));
else
mir_free(ptszVal);
@@ -110,7 +110,7 @@ INT CheckDefaults(WPARAM, LPARAM) else {
char szStatus[6] = { 0 };
mir_snprintf(szStatus, "%d", c);
- ptszVal = db_get_tsa(NULL, protocolname, szStatus);
+ ptszVal = db_get_wsa(NULL, protocolname, szStatus);
if (ptszVal == 0) {
wchar_t *ptszDefault;
if (c < ID_STATUS_FREECHAT)
@@ -121,7 +121,7 @@ INT CheckDefaults(WPARAM, LPARAM) else
ptszDefault = 0;
if (ptszDefault)
- db_set_ts(NULL, protocolname, szStatus, TranslateTS(ptszDefault));
+ db_set_ws(NULL, protocolname, szStatus, TranslateW(ptszDefault));
}
else
mir_free(ptszVal);
@@ -164,7 +164,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) if (!dbei.cbBlob) /// invalid size
return FALSE;
- wchar_t *ptszVal = db_get_tsa(hContact, "Protocol", "p");
+ wchar_t *ptszVal = db_get_wsa(hContact, "Protocol", "p");
if (ptszVal == NULL) // Contact with no protocol ?!!
return FALSE;
mir_free(ptszVal);
@@ -185,12 +185,12 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) char szStatus[6] = { 0 };
mir_snprintf(szStatus, "%d", status);
- ptszVal = db_get_tsa(NULL, protocolname, szStatus);
+ ptszVal = db_get_wsa(NULL, protocolname, szStatus);
if (ptszVal) {
if (*ptszVal) {
- CMString ptszTemp;
+ CMStringW ptszTemp;
- wchar_t *ptszNick = db_get_tsa(hContact, pszProto, "Nick");
+ wchar_t *ptszNick = db_get_wsa(hContact, pszProto, "Nick");
if (ptszNick == 0) {
mir_free(ptszVal);
return FALSE;
@@ -198,7 +198,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) msgLen += mir_wstrlen(ptszVal);
- wchar_t *ptszHead = db_get_tsa(NULL, protocolname, KEY_HEADING);
+ wchar_t *ptszHead = db_get_wsa(NULL, protocolname, KEY_HEADING);
if (ptszHead != NULL) {
ptszTemp = ptszHead;
ptszTemp.Replace(L"%user%", ptszNick);
diff --git a/plugins/SimpleAR/src/Options.cpp b/plugins/SimpleAR/src/Options.cpp index 59dbbe5ad6..f603dcdebe 100644 --- a/plugins/SimpleAR/src/Options.cpp +++ b/plugins/SimpleAR/src/Options.cpp @@ -15,7 +15,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara SetDlgItemInt(hwndDlg, IDC_INTERVAL, db_get_w(NULL, protocolname, KEY_REPEATINTERVAL, 300) / 60, FALSE);
DBVARIANT dbv;
- if (!db_get_ts(NULL, protocolname, KEY_HEADING, &dbv)) {
+ if (!db_get_ws(NULL, protocolname, KEY_HEADING, &dbv)) {
SetDlgItemText(hwndDlg, IDC_HEADING, dbv.ptszVal);
db_free(&dbv);
}
@@ -28,7 +28,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara else {
SendDlgItemMessage(hwndDlg, IDC_STATUSMODE, CB_ADDSTRING, 0, (LPARAM)pszStatus);
- if (!db_get_ts(NULL, protocolname, tszStatus, &dbv)) {
+ if (!db_get_ws(NULL, protocolname, tszStatus, &dbv)) {
if (c < ID_STATUS_FREECHAT)
ptszMessage[c - ID_STATUS_ONLINE - 1] = wcsdup(dbv.ptszVal);
else if (c > ID_STATUS_INVISIBLE)
@@ -61,7 +61,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case IDC_DEFAULT:
- SetDlgItemText(hwndDlg, IDC_MESSAGE, TranslateTS(ptszDefaultMsg[lastIndex]));
+ SetDlgItemText(hwndDlg, IDC_MESSAGE, TranslateW(ptszDefaultMsg[lastIndex]));
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case IDC_INTERVAL:
@@ -88,7 +88,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara Menu_ModifyItem(hEnableMenu, LPGENW("Enable Auto&reply"), iconList[1].hIcolib);
GetDlgItemText(hwndDlg, IDC_HEADING, ptszText, _countof(ptszText));
- db_set_ts(NULL, protocolname, KEY_HEADING, ptszText);
+ db_set_ws(NULL, protocolname, KEY_HEADING, ptszText);
INT size = GetDlgItemInt(hwndDlg, IDC_INTERVAL, &translated, FALSE);
if (translated)
@@ -106,9 +106,9 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara mir_snprintf(szStatus, "%d", c);
if (c<ID_STATUS_FREECHAT && ptszMessage[c - ID_STATUS_ONLINE - 1])
- db_set_ts(NULL, protocolname, szStatus, ptszMessage[c - ID_STATUS_ONLINE - 1]);
+ db_set_ws(NULL, protocolname, szStatus, ptszMessage[c - ID_STATUS_ONLINE - 1]);
else if (c>ID_STATUS_INVISIBLE && ptszMessage[c - ID_STATUS_ONLINE - 3])
- db_set_ts(NULL, protocolname, szStatus, ptszMessage[c - ID_STATUS_ONLINE - 3]);
+ db_set_ws(NULL, protocolname, szStatus, ptszMessage[c - ID_STATUS_ONLINE - 3]);
else
db_unset(NULL, protocolname, szStatus);
}
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp index 177282ccad..a36675e407 100644 --- a/plugins/SimpleStatusMsg/src/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp @@ -383,7 +383,7 @@ int LoadAwayMsgModule(void) hWindowList2 = WindowList_Create();
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
SET_UID(mi, 0xd3282acc, 0x9ff1, 0x4ede, 0x8a, 0x1e, 0x36, 0x72, 0x3f, 0x44, 0x4f, 0x84);
CreateServiceFunction(MS_AWAYMSG_SHOWAWAYMSG, GetMessageCommand);
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index 13893bcc83..f3c15eb8ab 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -289,7 +289,7 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) mir_snprintf(buff, "SMsg%d", k);
- wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
+ wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", buff);
if (tszStatusMsg == NULL)
continue;
@@ -334,7 +334,7 @@ wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int) mir_snprintf(buff, "DefMsg%d", k);
- wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
+ wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", buff);
if (tszStatusMsg == NULL)
continue;
@@ -413,7 +413,7 @@ static wchar_t *GetAwayMessageFormat(int iStatus, const char *szProto) else
mir_snprintf(szSetting, "Msg");
- format = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting));
+ format = db_get_wsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting));
}
else if (flags & STATUS_LAST_MSG)
{
@@ -426,7 +426,7 @@ static wchar_t *GetAwayMessageFormat(int iStatus, const char *szProto) if (szLastMsg == NULL)
return NULL; //mir_wstrdup(L"");
- format = db_get_tsa(NULL, "SimpleStatusMsg", szLastMsg);
+ format = db_get_wsa(NULL, "SimpleStatusMsg", szLastMsg);
mir_free(szLastMsg);
}
else if (flags & STATUS_THIS_MSG)
@@ -436,7 +436,7 @@ static wchar_t *GetAwayMessageFormat(int iStatus, const char *szProto) else
mir_snprintf(szSetting, "Default");
- format = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting));
+ format = db_get_wsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting));
if (format == NULL)
format = mir_wstrdup(L"");
}
@@ -449,7 +449,7 @@ static wchar_t *GetAwayMessageFormat(int iStatus, const char *szProto) void DBWriteMessage(char *szSetting, wchar_t *tszMsg)
{
if (tszMsg && mir_wstrlen(tszMsg))
- db_set_ts(NULL, "SimpleStatusMsg", szSetting, tszMsg);
+ db_set_ws(NULL, "SimpleStatusMsg", szSetting, tszMsg);
else
db_unset(NULL, "SimpleStatusMsg", szSetting);
}
@@ -512,7 +512,7 @@ static wchar_t *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVar if ((!iStatus || iStatus == ID_STATUS_CURRENT) && szProto)
{
mir_snprintf(szSetting, "FCur%sMsg", szProto);
- format = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ format = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
}
else
{
@@ -533,14 +533,14 @@ static wchar_t *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVar if (flags & PROTO_THIS_MSG)
{
mir_snprintf(szSetting, "Proto%sDefault", szProto);
- format = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ format = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
if (format == NULL)
format = mir_wstrdup(L"");
}
else if (flags & PROTO_NOCHANGE && szProto)
{
mir_snprintf(szSetting, "FCur%sMsg", szProto);
- format = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ format = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
}
else if (flags & PROTO_POPUPDLG)
format = GetAwayMessageFormat(iStatus, szProto);
@@ -627,7 +627,7 @@ int HasProtoStaticStatusMsg(const char *szProto, int iInitialStatus, int iStatus else if (flags & PROTO_THIS_MSG)
{
mir_snprintf(szSetting, "Proto%sDefault", szProto);
- wchar_t *szSimpleStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *szSimpleStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
if (szSimpleStatusMsg != NULL)
{
SaveMessageToDB(szProto, szSimpleStatusMsg, TRUE);
@@ -1012,7 +1012,7 @@ int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) }
else if (iProtoFlags & PROTO_NOCHANGE && !bOnStartup) {
mir_snprintf(szSetting, "FCur%sMsg", szProto);
- wchar_t *msg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *msg = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
#ifdef _DEBUG
log2file("ChangeStatusMessage(): Set %s status and \"%S\" status message for %s.", StatusModeToDbSetting(iStatus, ""), msg, szProto);
@@ -1076,7 +1076,7 @@ int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) wchar_t *msg;
if (iProtoFlags & PROTO_NOCHANGE) {
mir_snprintf(szSetting, "FCur%sMsg", accounts->pa[i]->szModuleName);
- msg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ msg = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
}
else
msg = GetAwayMessageFormat(iStatus, NULL);
@@ -1159,7 +1159,7 @@ int SetStartupStatus(int i) else if (flags & PROTO_NOCHANGE)
{
mir_snprintf(szSetting, "FCur%sMsg", accounts->pa[i]->szModuleName);
- fmsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ fmsg = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
}
else
fmsg = GetAwayMessageFormat(iStatus, accounts->pa[i]->szModuleName);
@@ -1296,7 +1296,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD) continue;
mir_snprintf(szBuffer, "FCur%sMsg", accounts->pa[i]->szModuleName);
- wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szBuffer);
+ wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", szBuffer);
if (tszStatusMsg == NULL)
continue;
@@ -1305,7 +1305,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD) mir_snprintf(szBuffer, "Cur%sMsg", accounts->pa[i]->szModuleName);
- tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szBuffer);
+ tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", szBuffer);
if ((tszMsg && tszStatusMsg && !mir_wstrcmp(tszMsg, tszStatusMsg)) || (!tszMsg && !tszStatusMsg))
{
mir_free(tszStatusMsg);
@@ -1346,10 +1346,10 @@ void RegisterHotkey(void) HOTKEYDESC hkd = {0};
hkd.cbSize = sizeof(hkd);
- hkd.dwFlags = HKD_TCHAR;
+ hkd.dwFlags = HKD_UNICODE;
hkd.pszName = "SimpleStatusMsg_OpenDialog";
- hkd.ptszDescription = LPGENW("Open status message dialog");
- hkd.ptszSection = LPGENW("Status message");
+ hkd.pwszDescription = LPGENW("Open status message dialog");
+ hkd.pwszSection = LPGENW("Status message");
hkd.pszService = MS_SIMPLESTATUSMSG_SHOWDIALOGINT;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, VK_OEM_3);
Hotkey_Register(&hkd);
@@ -1384,7 +1384,7 @@ static int ChangeStatusMsgPrebuild(WPARAM, LPARAM) return 0;
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
if (!db_get_b(NULL, "SimpleStatusMsg", "ShowStatusMenuItem", 1))
mi.flags |= CMIF_HIDDEN;
mi.hIcolibItem = GetIconHandle(IDI_CSMSG);
@@ -1530,7 +1530,7 @@ static int CSStatusChange(WPARAM wParam, LPARAM) for (int j = 1; j <= max_hist_msgs; j++)
{
mir_snprintf(buff, "SMsg%d", j);
- wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
+ wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", buff);
if (tszStatusMsg != NULL)
{
if (!mir_wstrcmp(tszStatusMsg, szMsgW))
@@ -1718,7 +1718,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) }
}
- g_ptszWinampSong = db_get_tsa(NULL, "SimpleStatusMsg", "AmpLastTitle");
+ g_ptszWinampSong = db_get_wsa(NULL, "SimpleStatusMsg", "AmpLastTitle");
if (g_ptszWinampSong == NULL)
g_ptszWinampSong = mir_wstrdup(L"SimpleStatusMsg");
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index 20bc2a0347..844ce83b41 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -238,7 +238,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) mir_snprintf(buff, "SMsg%d", j); j--; - wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff); + wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", buff); if (tszStatusMsg != NULL) { if (*tszStatusMsg != '\0') { found = TRUE; @@ -332,7 +332,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) for (int i = 1; i <= data->num_def_msgs; ++i) { // predefined messages mir_snprintf(buff, "DefMsg%d", i); - wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff); + wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", buff); if (tszStatusMsg != NULL) { if (*tszStatusMsg != '\0') { cbei.iItem = -1; @@ -640,7 +640,7 @@ void ClearHistory(struct MsgBoxData *data, int cur_sel) for (i = 1; i <= data->max_hist_msgs; i++) { mir_snprintf(text, "SMsg%d", i); - db_set_ts(NULL, "SimpleStatusMsg", text, L""); + db_set_ws(NULL, "SimpleStatusMsg", text, L""); } db_set_s(NULL, "SimpleStatusMsg", "LastMsg", ""); for (i = 0; i < accounts->count; i++) { @@ -716,7 +716,7 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting); if (szSetting != NULL) { if (*szSetting != '\0') { - wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting); + wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", szSetting); if (tszStatusMsg != NULL) { if (*tszStatusMsg != '\0') { SetDlgItemText(hwndDlg, IDC_EDIT1, tszStatusMsg); @@ -745,7 +745,7 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) else mir_snprintf(setting, "Default"); - wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting)); + wchar_t *tszStatusMsg = db_get_wsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting)); if (tszStatusMsg != NULL) { SetDlgItemText(hwndDlg, IDC_EDIT1, tszStatusMsg); fcursel = SendMessage(data->recent_cbex, CB_FINDSTRINGEXACT, num_start, (LPARAM)tszStatusMsg); @@ -760,7 +760,7 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) else mir_snprintf(setting, "Msg"); - wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting)); + wchar_t *tszStatusMsg = db_get_wsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting)); if (tszStatusMsg != NULL) { SetDlgItemText(hwndDlg, IDC_EDIT1, tszStatusMsg); fcursel = SendMessage(data->recent_cbex, CB_FINDSTRINGEXACT, num_start, (LPARAM)tszStatusMsg); @@ -1131,7 +1131,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA db_set_s(NULL, "SimpleStatusMsg", szSetting, ""); mir_snprintf(szSetting, "%sMsg", msgbox_data->m_szProto); - db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, szSetting), L""); + db_set_ws(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, szSetting), L""); } else { db_set_s(NULL, "SimpleStatusMsg", "LastMsg", ""); @@ -1153,10 +1153,10 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA mir_snprintf(szSetting, "%sMsg", accounts->pa[j]->szModuleName); iStatus = msgbox_data->m_bOnStartup ? GetStartupStatus(accounts->pa[j]->szModuleName) : GetCurrentStatus(accounts->pa[j]->szModuleName); - db_set_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), L""); + db_set_ws(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), L""); } - db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, "Msg"), L""); // for compatibility with some plugins + db_set_ws(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, "Msg"), L""); // for compatibility with some plugins } if (bCurrentStatus) @@ -1172,7 +1172,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA for (int i = 1; i <= msgbox_data->max_hist_msgs; i++) { mir_snprintf(buff, "SMsg%d", i); - wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff); + wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", buff); if (tszStatusMsg != NULL) { if (!mir_wstrcmp(tszStatusMsg, tszMsg)) { found = true; @@ -1181,7 +1181,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA db_set_s(NULL, "SimpleStatusMsg", buff2, buff); mir_snprintf(buff2, "%sMsg", msgbox_data->m_szProto); - db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg); + db_set_ws(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg); } else { db_set_s(NULL, "SimpleStatusMsg", "LastMsg", buff); @@ -1203,7 +1203,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA mir_snprintf(buff2, "%sMsg", accounts->pa[j]->szModuleName); iStatus = msgbox_data->m_bOnStartup ? GetStartupStatus(accounts->pa[j]->szModuleName) : GetCurrentStatus(accounts->pa[j]->szModuleName); - db_set_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, buff2), tszMsg); + db_set_ws(NULL, "SRAway", StatusModeToDbSetting(iStatus, buff2), tszMsg); } } mir_free(tszStatusMsg); @@ -1222,14 +1222,14 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA last_modified_msg++; mir_snprintf(buff, "SMsg%d", last_modified_msg); - db_set_ts(NULL, "SimpleStatusMsg", buff, tszMsg); + db_set_ws(NULL, "SimpleStatusMsg", buff, tszMsg); if (msgbox_data->m_szProto) { mir_snprintf(buff2, "Last%sMsg", msgbox_data->m_szProto); db_set_s(NULL, "SimpleStatusMsg", buff2, buff); mir_snprintf(buff2, "%sMsg", msgbox_data->m_szProto); - db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg); + db_set_ws(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg); } else { db_set_s(NULL, "SimpleStatusMsg", "LastMsg", buff); @@ -1251,14 +1251,14 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA mir_snprintf(buff2, "%sMsg", accounts->pa[j]->szModuleName); iStatus = msgbox_data->m_bOnStartup ? GetStartupStatus(accounts->pa[j]->szModuleName) : GetCurrentStatus(accounts->pa[j]->szModuleName); - db_set_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, buff2), tszMsg); + db_set_ws(NULL, "SRAway", StatusModeToDbSetting(iStatus, buff2), tszMsg); } } db_set_w(NULL, "SimpleStatusMsg", "LMMsg", (WORD)last_modified_msg); } if (!msgbox_data->m_szProto) - db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, "Msg"), tszMsg); // for compatibility with some plugins + db_set_ws(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, "Msg"), tszMsg); // for compatibility with some plugins if (bCurrentStatus) SetStatusMessage(msgbox_data->m_szProto, msgbox_data->m_iInitialStatus, ID_STATUS_CURRENT, tszMsg, msgbox_data->m_bOnStartup); @@ -1386,7 +1386,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (LOWORD(histitem.lParam) == HISTORY_MSG) { char szSetting[16]; mir_snprintf(szSetting, "SMsg%d", (int)HIWORD(histitem.lParam)); - db_set_ts(NULL, "SimpleStatusMsg", szSetting, L""); + db_set_ws(NULL, "SimpleStatusMsg", szSetting, L""); SendMessage(msgbox_data->recent_cbex, CBEM_DELETEITEM, (WPARAM)msgbox_data->curr_sel_msg, 0); } if (LOWORD(histitem.lParam) == PREDEFINED_MSG) { @@ -1504,7 +1504,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (LOWORD(histitem.lParam) == HISTORY_MSG) { mir_snprintf(buff, "SMsg%d", (int)HIWORD(histitem.lParam)); - db_set_ts(NULL, "SimpleStatusMsg", buff, L""); + db_set_ws(NULL, "SimpleStatusMsg", buff, L""); } else if (LOWORD(histitem.lParam) == PREDEFINED_MSG) msgbox_data->m_bPredefChanged = TRUE; @@ -1598,7 +1598,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA mir_snprintf(buff, "DefMsg%d", i); if (LOWORD(cbitem.lParam) == PREDEFINED_MSG) { new_num_def_msgs++; - db_set_ts(NULL, "SimpleStatusMsg", buff, text); + db_set_ws(NULL, "SimpleStatusMsg", buff, text); } else db_unset(NULL, "SimpleStatusMsg", buff); diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index ebed7ada43..b6ddf1cc11 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -138,7 +138,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l val = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(i, "Flags"), STATUS_DEFAULT);
data->status_msg[0].flags[i - ID_STATUS_ONLINE] = val;
- ptrW text( db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(i, "Default")));
+ ptrW text( db_get_wsa(NULL, "SRAway", StatusModeToDbSetting(i, "Default")));
mir_wstrncpy(data->status_msg[0].msg[i - ID_STATUS_ONLINE], (text == NULL) ? GetDefaultMessage(i) : text, 1024);
for (j = 0; j < accounts->count; j++)
@@ -150,7 +150,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l val = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(i, setting), STATUS_DEFAULT);
data->status_msg[j+1].flags[i-ID_STATUS_ONLINE] = val;
mir_snprintf(setting, "%sDefault", accounts->pa[j]->szModuleName);
- text = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(i, setting));
+ text = db_get_wsa(NULL, "SRAway", StatusModeToDbSetting(i, setting));
mir_wstrncpy(data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE], (text == NULL) ? GetDefaultMessage(i) : text, 1024);
}
}
@@ -203,7 +203,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (index != CB_ERR && index != CB_ERRSPACE)
{
mir_snprintf(setting, "Proto%sDefault", accounts->pa[i]->szModuleName);
- data->proto_msg[i+1].msg = db_get_tsa(NULL, "SimpleStatusMsg", setting);
+ data->proto_msg[i+1].msg = db_get_wsa(NULL, "SimpleStatusMsg", setting);
mir_snprintf(setting, "Proto%sFlags", accounts->pa[i]->szModuleName);
val = db_get_b(NULL, "SimpleStatusMsg", setting, PROTO_DEFAULT);
@@ -451,7 +451,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting);
if (szSetting)
{
- wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg && mir_wstrlen(tszStatusMsg))
{
if (tszStatusMsg && mir_wstrlen(tszStatusMsg))
@@ -489,7 +489,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l else
mir_snprintf(setting, "Msg");
- wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
+ wchar_t *tszStatusMsg = db_get_wsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
if (tszStatusMsg)
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, tszStatusMsg);
@@ -602,7 +602,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting);
if (szSetting != NULL)
{
- wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg)
{
if (tszStatusMsg[0])
@@ -639,7 +639,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l else
mir_snprintf(setting, "Msg");
- wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
+ wchar_t *tszStatusMsg = db_get_wsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
if (tszStatusMsg != NULL)
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, tszStatusMsg);
@@ -697,7 +697,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting);
if (szSetting != NULL)
{
- wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg)
{
if (tszStatusMsg[0])
@@ -726,7 +726,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l else
mir_snprintf(setting, "Msg");
- wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
+ wchar_t *tszStatusMsg = db_get_wsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
if (tszStatusMsg != NULL)
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, tszStatusMsg);
@@ -807,7 +807,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting);
if (szSetting != NULL)
{
- wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg)
{
if (tszStatusMsg[0])
@@ -837,7 +837,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l else
mir_snprintf(setting, "Msg");
- wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(i + ID_STATUS_ONLINE, setting));
+ wchar_t *tszStatusMsg = db_get_wsa(NULL, "SRAway", StatusModeToDbSetting(i + ID_STATUS_ONLINE, setting));
if (tszStatusMsg != NULL)
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, tszStatusMsg);
@@ -999,7 +999,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l {
if (accounts->statusMsgFlags & Proto_Status2Flag(i))
{
- db_set_ts(NULL, "SRAway", StatusModeToDbSetting(i, "Default"), data->status_msg[0].msg[i - ID_STATUS_ONLINE]);
+ db_set_ws(NULL, "SRAway", StatusModeToDbSetting(i, "Default"), data->status_msg[0].msg[i - ID_STATUS_ONLINE]);
db_set_b(NULL, "SimpleStatusMsg", StatusModeToDbSetting(i, "Flags"), (BYTE)data->status_msg[0].flags[i - ID_STATUS_ONLINE]);
for (int j = 0; j < accounts->count; j++)
@@ -1013,7 +1013,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(i))
{
mir_snprintf(szSetting, "%sDefault", accounts->pa[j]->szModuleName);
- db_set_ts(NULL, "SRAway", StatusModeToDbSetting(i, szSetting), data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE]);
+ db_set_ws(NULL, "SRAway", StatusModeToDbSetting(i, szSetting), data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE]);
mir_snprintf(szSetting, "%sFlags", accounts->pa[j]->szModuleName);
db_set_b(NULL, "SimpleStatusMsg", StatusModeToDbSetting(i, szSetting), (BYTE)data->status_msg[j + 1].flags[i - ID_STATUS_ONLINE]);
@@ -1041,7 +1041,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l mir_snprintf(szSetting, "Proto%sDefault", accounts->pa[i]->szModuleName);
if (data->proto_msg[i+1].msg && (data->proto_msg[i+1].flags & PROTO_THIS_MSG))
- db_set_ts(NULL, "SimpleStatusMsg", szSetting, data->proto_msg[i+1].msg);
+ db_set_ws(NULL, "SimpleStatusMsg", szSetting, data->proto_msg[i+1].msg);
// else
// db_unset(NULL, "SimpleStatusMsg", szSetting);
@@ -1181,7 +1181,7 @@ static bool IsHistoryMsgsFound(HWND, int histMax) if (j < 1)
j = histMax;
mir_snprintf(szSetting, "SMsg%d", j);
- wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *tszStatusMsg = db_get_wsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg != NULL) {
if (*tszStatusMsg != '\0') {
mir_free(tszStatusMsg);
@@ -1330,7 +1330,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w for (int i = 1; i <= max_hist_msgs; i++) {
char text[8];
mir_snprintf(text, "SMsg%d", i);
- db_set_ts(NULL, "SimpleStatusMsg", text, L"");
+ db_set_ws(NULL, "SimpleStatusMsg", text, L"");
}
db_set_s(NULL, "SimpleStatusMsg", "LastMsg", "");
diff --git a/plugins/SkypeStatusChange/src/main.cpp b/plugins/SkypeStatusChange/src/main.cpp index a8329b8598..1b9c1d8e11 100644 --- a/plugins/SkypeStatusChange/src/main.cpp +++ b/plugins/SkypeStatusChange/src/main.cpp @@ -189,10 +189,10 @@ LRESULT APIENTRY SkypeAPI_WindowProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) if (g_Options.GetSyncStatusMsgFlag()) {
wchar_t* pszStatusMsg = NULL;
if (ProtoServiceExists(si.Module(), PS_GETMYAWAYMSG))
- pszStatusMsg = reinterpret_cast<wchar_t*>(CallProtoService(si.Module(), PS_GETMYAWAYMSG, (WPARAM)ms.m_nMirandaStatus, SGMA_TCHAR));
+ pszStatusMsg = reinterpret_cast<wchar_t*>(CallProtoService(si.Module(), PS_GETMYAWAYMSG, (WPARAM)ms.m_nMirandaStatus, SGMA_UNICODE));
if ((NULL == pszStatusMsg) || (CALLSERVICE_NOTFOUND == INT_PTR(pszStatusMsg)))
- pszStatusMsg = reinterpret_cast<wchar_t*>(CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)ms.m_nMirandaStatus, 0));
+ pszStatusMsg = reinterpret_cast<wchar_t*>(CallService(MS_AWAYMSG_GETSTATUSMSGW, (WPARAM)ms.m_nMirandaStatus, 0));
if (pszStatusMsg && reinterpret_cast<LPARAM>(pszStatusMsg) != CALLSERVICE_NOTFOUND) {
T2Utf pMsg(pszStatusMsg);
diff --git a/plugins/SkypeStatusChange/src/options.cpp b/plugins/SkypeStatusChange/src/options.cpp index cb789436a4..eb5d163de7 100644 --- a/plugins/SkypeStatusChange/src/options.cpp +++ b/plugins/SkypeStatusChange/src/options.cpp @@ -78,7 +78,7 @@ void InitProtocolTree(HWND hwndTreeCtrl) else
nState = TCBS_UNCHECKED;
}
- tree_insert_item(hwndTreeCtrl,TranslateTS(g_aStatusCode[OFFLINE_STATUS_INDEX].m_ptszStatusName),hti,nState,pItemData);
+ tree_insert_item(hwndTreeCtrl,TranslateW(g_aStatusCode[OFFLINE_STATUS_INDEX].m_ptszStatusName),hti,nState,pItemData);
for(size_t k = 0; k < _countof(g_aStatusCode); ++k) {
const CMirandaStatus2SkypeStatus& m2s = g_aStatusCode[k];
unsigned long statusFlags = Proto_Status2Flag(m2s.m_nMirandaStatus);
@@ -101,7 +101,7 @@ void InitProtocolTree(HWND hwndTreeCtrl) nState = TCBS_UNCHECKED;
}
- tree_insert_item(hwndTreeCtrl,TranslateTS(m2s.m_ptszStatusName),hti,nState,pItemData);
+ tree_insert_item(hwndTreeCtrl,TranslateW(m2s.m_ptszStatusName),hti,nState,pItemData);
}
}
diff --git a/plugins/SmileyAdd/src/customsmiley.cpp b/plugins/SmileyAdd/src/customsmiley.cpp index 64fdd3d17e..5f9ff1b9fb 100644 --- a/plugins/SmileyAdd/src/customsmiley.cpp +++ b/plugins/SmileyAdd/src/customsmiley.cpp @@ -59,7 +59,7 @@ SmileyPackCType* SmileyPackCListType::GetSmileyPack(MCONTACT id) }
-SmileyCType::SmileyCType(const CMString &fullpath, const wchar_t *filepath)
+SmileyCType::SmileyCType(const CMStringW &fullpath, const wchar_t *filepath)
{
LoadFromResource(fullpath, 0);
CreateTriggerText(_T2A(filepath));
@@ -95,7 +95,7 @@ bool SmileyCType::CreateTriggerText(char *text) bool SmileyPackCType::LoadSmileyDir(wchar_t *dir)
{
- CMString dirs = dir;
+ CMStringW dirs = dir;
dirs += L"\\*.*";
_wfinddata_t c_file;
@@ -103,7 +103,7 @@ bool SmileyPackCType::LoadSmileyDir(wchar_t *dir) if (hFile > -1L) {
do {
if (c_file.name[0] != '.') {
- CMString fullpath = dir;
+ CMStringW fullpath = dir;
fullpath = fullpath + L"\\" + c_file.name;
wchar_t *div = wcsrchr(c_file.name, '.');
if (div) {
@@ -125,11 +125,11 @@ bool SmileyPackCType::LoadSmileyDir(wchar_t *dir) bool SmileyPackCType::LoadSmiley(wchar_t *path)
{
- CMString dirs = path;
+ CMStringW dirs = path;
int slash = dirs.ReverseFind('\\');
int dot = dirs.ReverseFind('.');
- CMString name = dirs.Mid(slash + 1, dot - slash - 1);
+ CMStringW name = dirs.Mid(slash + 1, dot - slash - 1);
for (int i = 0; i < m_SmileyList.getCount(); i++)
if (m_SmileyList[i].GetTriggerText() == name) {
@@ -139,7 +139,7 @@ bool SmileyPackCType::LoadSmiley(wchar_t *path) m_SmileyList.insert(new SmileyCType(dirs, (wchar_t*)name.c_str()));
- CMString empty;
+ CMStringW empty;
m_SmileyLookup.insert(new SmileyLookup(
m_SmileyList[m_SmileyList.getCount() - 1].GetTriggerText(), false, m_SmileyList.getCount() - 1, empty));
@@ -148,7 +148,7 @@ bool SmileyPackCType::LoadSmiley(wchar_t *path) void SmileyPackCType::AddTriggersToSmileyLookup(void)
{
- CMString empty;
+ CMStringW empty;
for (int dist = 0; dist < m_SmileyList.getCount(); dist++) {
SmileyLookup *dats = new SmileyLookup(m_SmileyList[dist].GetTriggerText(), false, dist, empty);
m_SmileyLookup.insert(dats);
diff --git a/plugins/SmileyAdd/src/customsmiley.h b/plugins/SmileyAdd/src/customsmiley.h index b1366e83bc..bd76875796 100644 --- a/plugins/SmileyAdd/src/customsmiley.h +++ b/plugins/SmileyAdd/src/customsmiley.h @@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. class SmileyCType : public SmileyType
{
public:
- SmileyCType(const CMString &fullpath, const wchar_t *filepath);
+ SmileyCType(const CMStringW &fullpath, const wchar_t *filepath);
bool CreateTriggerText(char *text);
};
diff --git a/plugins/SmileyAdd/src/download.cpp b/plugins/SmileyAdd/src/download.cpp index 8a46c4fc70..8e7fa9f86f 100644 --- a/plugins/SmileyAdd/src/download.cpp +++ b/plugins/SmileyAdd/src/download.cpp @@ -23,11 +23,11 @@ static HANDLE hFolder; struct QueueElem
{
- CMString url;
- CMString fname;
+ CMStringW url;
+ CMStringW fname;
bool needext;
- QueueElem(CMString &purl, CMString &pfname, bool ne)
+ QueueElem(CMStringW &purl, CMStringW &pfname, bool ne)
: url(purl), fname(pfname), needext(ne)
{
}
@@ -135,7 +135,7 @@ void __cdecl SmileyDownloadThread(void*) InternetDownloadFile(_T2A(dlQueue[0].url.c_str()), _T2A(dlQueue[0].fname.c_str()), hHttpDwnl);
WaitForSingleObject(g_hDlMutex, 3000);
- CMString fname(dlQueue[0].fname);
+ CMStringW fname(dlQueue[0].fname);
if (dlQueue[0].needext) { fname += GetImageExt(fname); needext = true; }
_wrename(dlQueue[0].fname.c_str(), fname.c_str());
}
@@ -156,14 +156,14 @@ void __cdecl SmileyDownloadThread(void*) }
}
-bool GetSmileyFile(CMString &url, const CMString &packstr)
+bool GetSmileyFile(CMStringW &url, const CMStringW &packstr)
{
_TPattern *urlsplit = _TPattern::compile(L".*/(.*)");
_TMatcher *m0 = urlsplit->createTMatcher(url);
m0->findFirstMatch();
- CMString filename;
+ CMStringW filename;
filename.AppendFormat(L"%s\\%s\\", cachepath, packstr.c_str());
int pathpos = filename.GetLength();
filename += m0->getGroup(1);
@@ -213,13 +213,13 @@ void GetSmileyCacheFolder(void) FoldersGetCustomPathT(hFolder, cachepath, MAX_PATH, L"");
HookEvent(ME_FOLDERS_PATH_CHANGED, FolderChanged);
}
- else mir_wstrncpy(cachepath, VARST(L"%miranda_userdata%\\SmileyCache"), MAX_PATH);
+ else mir_wstrncpy(cachepath, VARSW(L"%miranda_userdata%\\SmileyCache"), MAX_PATH);
}
void DownloadInit(void)
{
NETLIBUSER nlu = { sizeof(nlu) };
- nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_NOHTTPSOPTION | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_NOHTTPSOPTION | NUF_UNICODE;
nlu.szSettingsModule = "SmileyAdd";
nlu.ptszDescriptiveName = TranslateT("SmileyAdd HTTP connections");
hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
diff --git a/plugins/SmileyAdd/src/download.h b/plugins/SmileyAdd/src/download.h index 0e1b50bf3f..87a9322a8b 100644 --- a/plugins/SmileyAdd/src/download.h +++ b/plugins/SmileyAdd/src/download.h @@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #ifndef SMILEYADD_DOWNLOAD_H_
#define SMILEYADD_DOWNLOAD_H_
-bool GetSmileyFile(CMString &url, const CMString &packstr);
+bool GetSmileyFile(CMStringW &url, const CMStringW &packstr);
void DownloadInit(void);
void DownloadClose(void);
diff --git a/plugins/SmileyAdd/src/general.cpp b/plugins/SmileyAdd/src/general.cpp index 4fda95dd92..3071b83494 100644 --- a/plugins/SmileyAdd/src/general.cpp +++ b/plugins/SmileyAdd/src/general.cpp @@ -59,7 +59,7 @@ HICON GetDefaultIcon(bool copy) return resIco;
}
-const wchar_t* GetImageExt(CMString &fname)
+const wchar_t* GetImageExt(CMStringW &fname)
{
const wchar_t *ext = L"";
@@ -124,14 +124,14 @@ HICON ImageList_GetIconFixed(HIMAGELIST himl, INT i, UINT fStyle) return hIcon;
}
-void pathToRelative(const CMString &pSrc, CMString &pOut)
+void pathToRelative(const CMStringW &pSrc, CMStringW &pOut)
{
wchar_t szOutPath[MAX_PATH];
PathToRelativeT(pSrc.c_str(), szOutPath);
pOut = szOutPath;
}
-void pathToAbsolute(const CMString &pSrc, CMString &pOut)
+void pathToAbsolute(const CMStringW &pSrc, CMStringW &pOut)
{
wchar_t szOutPath[MAX_PATH];
@@ -139,10 +139,10 @@ void pathToAbsolute(const CMString &pSrc, CMString &pOut) if (szVarPath == (wchar_t*)CALLSERVICE_NOTFOUND || szVarPath == NULL) {
wchar_t szExpPath[MAX_PATH];
ExpandEnvironmentStrings(pSrc.c_str(), szExpPath, _countof(szExpPath));
- PathToAbsoluteT(szExpPath, szOutPath);
+ PathToAbsoluteW(szExpPath, szOutPath);
}
else {
- PathToAbsoluteT(szVarPath, szOutPath);
+ PathToAbsoluteW(szVarPath, szOutPath);
mir_free(szVarPath);
}
pOut = szOutPath;
diff --git a/plugins/SmileyAdd/src/imagecache.cpp b/plugins/SmileyAdd/src/imagecache.cpp index 6960adff96..aa20f59a70 100644 --- a/plugins/SmileyAdd/src/imagecache.cpp +++ b/plugins/SmileyAdd/src/imagecache.cpp @@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. static HANDLE g_hMutexIm;
static OBJLIST<ImageBase> g_imagecache(25, ImageType::CompareImg);
-static CMString lastdllname;
+static CMStringW lastdllname;
static HMODULE lastmodule;
static time_t laststamp;
static UINT_PTR timerId;
@@ -58,7 +58,7 @@ static void CALLBACK sttMainThreadCallback(PVOID) }
-static HMODULE LoadDll(const CMString &file)
+static HMODULE LoadDll(const CMStringW &file)
{
WaitForSingleObject(g_hMutexIm, 3000);
@@ -190,7 +190,7 @@ int ImageBase::SelectNextFrame(const int frame) /////////////////////////////////////////////////////////////////////////////////////////
-IconType::IconType(const unsigned id, const CMString &file, const int index, const IcoTypeEnum type)
+IconType::IconType(const unsigned id, const CMStringW &file, const int index, const IcoTypeEnum type)
: ImageBase(id)
{
m_SmileyIcon = NULL;
@@ -279,7 +279,7 @@ void ImageListItemType::GetSize(SIZE &size) ImageList_GetIconSize(m_hImList, (int*)&size.cx, (int*)&size.cy);
}
-ImageType::ImageType(const unsigned id, const CMString &file, IStream *pStream)
+ImageType::ImageType(const unsigned id, const CMStringW &file, IStream *pStream)
: ImageBase(id)
{
m_bmp = NULL;
@@ -310,7 +310,7 @@ ImageType::ImageType(const unsigned id, const CMString &file, IStream *pStream) }
}
-ImageType::ImageType(const unsigned id, const CMString &file, const int index, const IcoTypeEnum type)
+ImageType::ImageType(const unsigned id, const CMStringW &file, const int index, const IcoTypeEnum type)
: ImageBase(id)
{
m_bmp = NULL;
@@ -415,17 +415,17 @@ ImageFType::ImageFType(const unsigned id) m_bmp = NULL;
}
-ImageFType::ImageFType(const unsigned id, const CMString &file)
+ImageFType::ImageFType(const unsigned id, const CMStringW &file)
: ImageBase(id)
{
m_bmp = NULL;
- FREE_IMAGE_FORMAT fif = fei->FI_GetFileTypeT(file.c_str(), 0);
+ FREE_IMAGE_FORMAT fif = fei->FI_GetFileTypeU(file.c_str(), 0);
if (fif == FIF_UNKNOWN)
- fif = fei->FI_GetFIFFromFilenameT(file.c_str());
+ fif = fei->FI_GetFIFFromFilenameU(file.c_str());
if (fif == FIF_UNKNOWN) return;
- FIBITMAP *dib = fei->FI_LoadT(fif, file.c_str(), 0);
+ FIBITMAP *dib = fei->FI_LoadU(fif, file.c_str(), 0);
if (dib == NULL) return;
bool transp = fei->FI_IsTransparent(dib) != 0;
@@ -525,9 +525,9 @@ void DestroyImageCache(void) CloseHandle(g_hMutexIm);
}
-ImageBase* AddCacheImage(const CMString &file, int index)
+ImageBase* AddCacheImage(const CMStringW &file, int index)
{
- CMString tmpfile(file); tmpfile.AppendFormat(L"#%d", index);
+ CMStringW tmpfile(file); tmpfile.AppendFormat(L"#%d", index);
unsigned id = mir_hash(tmpfile.c_str(), tmpfile.GetLength() * sizeof(wchar_t));
WaitForSingleObject(g_hMutexIm, 3000);
@@ -539,7 +539,7 @@ ImageBase* AddCacheImage(const CMString &file, int index) if (ind == -1)
return NULL;
- CMString ext = file.Mid(ind + 1);
+ CMStringW ext = file.Mid(ind + 1);
ext.MakeLower();
if (ext == L"dll" || ext == L"exe")
img = opt.HQScaling ? (ImageBase*)new ImageType(id, file, index, icoDll) : (ImageBase*)new IconType(id, file, index, icoDll);
diff --git a/plugins/SmileyAdd/src/imagecache.h b/plugins/SmileyAdd/src/imagecache.h index da019301a9..cc0ef2cf3b 100644 --- a/plugins/SmileyAdd/src/imagecache.h +++ b/plugins/SmileyAdd/src/imagecache.h @@ -66,7 +66,7 @@ private: HICON m_SmileyIcon;
public:
- IconType(const unsigned id, const CMString &file, const int index, const IcoTypeEnum type);
+ IconType(const unsigned id, const CMStringW &file, const int index, const IcoTypeEnum type);
~IconType();
void DrawInternal(HDC dc, int x, int y, int sizeX, int sizeY);
@@ -101,8 +101,8 @@ private: public:
- ImageType(const unsigned id, const CMString &file, IStream *pStream);
- ImageType(const unsigned id, const CMString &file, const int index, const IcoTypeEnum type);
+ ImageType(const unsigned id, const CMStringW &file, IStream *pStream);
+ ImageType(const unsigned id, const CMStringW &file, const int index, const IcoTypeEnum type);
~ImageType();
void SelectFrame(int frame);
@@ -123,7 +123,7 @@ protected: public:
ImageFType(const unsigned id);
- ImageFType(const unsigned id, const CMString &file);
+ ImageFType(const unsigned id, const CMStringW &file);
~ImageFType();
void DrawInternal(HDC dc, int x, int y, int sizeX, int sizeY);
@@ -131,7 +131,7 @@ public: void GetSize(SIZE &size);
};
-ImageBase* AddCacheImage(const CMString &file, int index);
+ImageBase* AddCacheImage(const CMStringW &file, int index);
void InitImageCache(void);
void DestroyImageCache(void);
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index eca94429b5..e477945e4b 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -206,7 +206,7 @@ void OptionsDialogType::AddCategory(void) {
wchar_t cat[30];
GetDlgItemText(m_hwndDialog, IDC_NEWCATEGORY, cat, _countof(cat));
- CMString catd = cat;
+ CMStringW catd = cat;
if (!catd.IsEmpty()) {
tmpsmcat.AddCategory(cat, catd, smcCustom);
@@ -248,7 +248,7 @@ void OptionsDialogType::UpdateControls(bool force) if (smc == NULL)
return;
- const CMString &smf = smc->GetFilename();
+ const CMStringW &smf = smc->GetFilename();
SetDlgItemText(m_hwndDialog, IDC_FILENAME, smf);
if (smPack.GetFilename() != smf || force)
@@ -259,7 +259,7 @@ void OptionsDialogType::UpdateControls(bool force) SetDlgItemText(m_hwndDialog, IDC_LIBAUTHOR, smPack.GetAuthor().c_str());
SetDlgItemText(m_hwndDialog, IDC_LIBVERSION, smPack.GetVersion().c_str());
- SetDlgItemText(m_hwndDialog, IDC_LIBNAME, TranslateTS(smPack.GetName().c_str()));
+ SetDlgItemText(m_hwndDialog, IDC_LIBNAME, TranslateW(smPack.GetName().c_str()));
}
long OptionsDialogType::GetSelProto(HTREEITEM hItem)
@@ -286,17 +286,17 @@ void OptionsDialogType::UpdateVisibleSmPackList(void) bool visible = useOne ? !smc[i].IsProto() : visiblecat;
if (!visible && smc[i].IsAcc() && !useOne) {
- CMString PhysProtoName = L"AllProto";
- CMString ProtoName = smc[i].GetName();
+ CMStringW PhysProtoName = L"AllProto";
+ CMStringW ProtoName = smc[i].GetName();
DBVARIANT dbv;
- if (db_get_ts(NULL, _T2A(ProtoName.GetBuffer()), "AM_BaseProto", &dbv) == 0) {
+ if (db_get_ws(NULL, _T2A(ProtoName.GetBuffer()), "AM_BaseProto", &dbv) == 0) {
ProtoName = dbv.ptszVal;
db_free(&dbv);
}
else
ProtoName.Empty();
- CMString FileName;
+ CMStringW FileName;
if (!ProtoName.IsEmpty()) {
PhysProtoName += ProtoName;
SmileyCategoryType *scm = tmpsmcat.GetSmileyCategory(PhysProtoName);
@@ -443,7 +443,7 @@ void OptionsDialogType::ApplyChanges(void) opt.Save();
// Cleanup database
- CMString empty;
+ CMStringW empty;
SmileyCategoryListType::SmileyCategoryVectorType &smc = *g_SmileyCategories.GetSmileyCategoryList();
for (int i = 0; i < smc.getCount(); i++)
if (tmpsmcat.GetSmileyCategory(smc[i].GetName()) == NULL)
@@ -467,7 +467,7 @@ bool OptionsDialogType::BrowseForSmileyPacks(int item) ofn.lpstrFile = filename;
ofn.nMaxFile = _countof(filename);
- CMString inidir;
+ CMStringW inidir;
SmileyCategoryType *smc = tmpsmcat.GetSmileyCategory(item);
if (smc->GetFilename().IsEmpty())
pathToAbsolute(L"Smileys", inidir);
@@ -499,7 +499,7 @@ bool OptionsDialogType::BrowseForSmileyPacks(int item) ofn.lpstrDefExt = L"msl";
if (GetOpenFileName(&ofn)) {
- CMString relpath;
+ CMStringW relpath;
pathToRelative(filename, relpath);
smc->SetFilename(relpath);
@@ -516,7 +516,7 @@ void OptionsDialogType::FilenameChanged(void) SmileyCategoryType *smc = tmpsmcat.GetSmileyCategory(GetSelProto());
if (smc->GetFilename() != str) {
- CMString temp(str);
+ CMStringW temp(str);
smc->SetFilename(temp);
UpdateControls();
}
@@ -588,48 +588,48 @@ void OptionsType::Load(void) HorizontalSorting = db_get_b(NULL, "SmileyAdd", "HorizontalSorting", 1) != 0;
}
-void OptionsType::ReadPackFileName(CMString &filename, const CMString &name, const CMString &defaultFilename)
+void OptionsType::ReadPackFileName(CMStringW &filename, const CMStringW &name, const CMStringW &defaultFilename)
{
- CMString settingKey = name + L"-filename";
+ CMStringW settingKey = name + L"-filename";
- ptrW tszValue(db_get_tsa(NULL, "SmileyAdd", _T2A(settingKey.c_str())));
+ ptrW tszValue(db_get_wsa(NULL, "SmileyAdd", _T2A(settingKey.c_str())));
filename = (tszValue != NULL) ? (wchar_t*)tszValue : defaultFilename;
}
-void OptionsType::WritePackFileName(const CMString &filename, const CMString &name)
+void OptionsType::WritePackFileName(const CMStringW &filename, const CMStringW &name)
{
- CMString settingKey = name + L"-filename";
- db_set_ts(NULL, "SmileyAdd", _T2A(settingKey.c_str()), filename.c_str());
+ CMStringW settingKey = name + L"-filename";
+ db_set_ws(NULL, "SmileyAdd", _T2A(settingKey.c_str()), filename.c_str());
}
-void OptionsType::ReadCustomCategories(CMString &cats)
+void OptionsType::ReadCustomCategories(CMStringW &cats)
{
- ptrW tszValue(db_get_tsa(NULL, "SmileyAdd", "CustomCategories"));
+ ptrW tszValue(db_get_wsa(NULL, "SmileyAdd", "CustomCategories"));
if (tszValue != NULL)
cats = tszValue;
}
-void OptionsType::WriteCustomCategories(const CMString &cats)
+void OptionsType::WriteCustomCategories(const CMStringW &cats)
{
if (cats.IsEmpty())
db_unset(NULL, "SmileyAdd", "CustomCategories");
else
- db_set_ts(NULL, "SmileyAdd", "CustomCategories", cats.c_str());
+ db_set_ws(NULL, "SmileyAdd", "CustomCategories", cats.c_str());
}
-void OptionsType::ReadContactCategory(MCONTACT hContact, CMString &cats)
+void OptionsType::ReadContactCategory(MCONTACT hContact, CMStringW &cats)
{
- ptrW tszValue(db_get_tsa(hContact, "SmileyAdd", "CustomCategory"));
+ ptrW tszValue(db_get_wsa(hContact, "SmileyAdd", "CustomCategory"));
if (tszValue != NULL)
cats = tszValue;
}
-void OptionsType::WriteContactCategory(MCONTACT hContact, const CMString &cats)
+void OptionsType::WriteContactCategory(MCONTACT hContact, const CMStringW &cats)
{
if (cats.IsEmpty())
db_unset(hContact, "SmileyAdd", "CustomCategory");
else
- db_set_ts(hContact, "SmileyAdd", "CustomCategory", cats.c_str());
+ db_set_ws(hContact, "SmileyAdd", "CustomCategory", cats.c_str());
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/SmileyAdd/src/options.h b/plugins/SmileyAdd/src/options.h index c4139f1131..adf6da53c8 100644 --- a/plugins/SmileyAdd/src/options.h +++ b/plugins/SmileyAdd/src/options.h @@ -48,12 +48,12 @@ public: void Load(void);
void Save(void);
- static void ReadPackFileName(CMString &filename, const CMString &name, const CMString &defaultFilename);
- static void ReadCustomCategories(CMString &cats);
- static void ReadContactCategory(MCONTACT hContact, CMString &cats);
- static void WritePackFileName(const CMString &filename, const CMString &name);
- static void WriteCustomCategories(const CMString &cats);
- static void WriteContactCategory(MCONTACT hContact, const CMString &cats);
+ static void ReadPackFileName(CMStringW &filename, const CMStringW &name, const CMStringW &defaultFilename);
+ static void ReadCustomCategories(CMStringW &cats);
+ static void ReadContactCategory(MCONTACT hContact, CMStringW &cats);
+ static void WritePackFileName(const CMStringW &filename, const CMStringW &name);
+ static void WriteCustomCategories(const CMStringW &cats);
+ static void WriteContactCategory(MCONTACT hContact, const CMStringW &cats);
};
extern OptionsType opt;
diff --git a/plugins/SmileyAdd/src/regexp/WCMatcher.cpp b/plugins/SmileyAdd/src/regexp/WCMatcher.cpp index 939e347afd..12c1c0d4bd 100644 --- a/plugins/SmileyAdd/src/regexp/WCMatcher.cpp +++ b/plugins/SmileyAdd/src/regexp/WCMatcher.cpp @@ -10,7 +10,7 @@ const int WCMatcher::MATCH_ENTIRE_STRING = 0x01; @version 1.07.00
*/
-WCMatcher::WCMatcher(WCPattern *pattern, const CMString &text)
+WCMatcher::WCMatcher(WCPattern *pattern, const CMStringW &text)
{
pat = pattern;
str = &text;
@@ -48,11 +48,11 @@ void WCMatcher::clearGroups() for (i = 1; i <= ncgc; ++i) groups[0 - i] = starts[0 - i] = ends[0 - i] = -1;
}
-CMString WCMatcher::replaceWithGroups(const CMString &pStr)
+CMStringW WCMatcher::replaceWithGroups(const CMStringW &pStr)
{
- CMString ret;
+ CMStringW ret;
- CMString t = pStr;
+ CMStringW t = pStr;
while (t.GetLength() > 0) {
if (t[0] == '\\') {
t.Delete(0);
@@ -86,7 +86,7 @@ unsigned long WCMatcher::getFlags() const return flags;
}
-const CMString& WCMatcher::getText() const
+const CMStringW& WCMatcher::getText() const
{
return *str;
}
@@ -132,9 +132,9 @@ bool WCMatcher::findNextMatch() return ends[0] >= 0;
}
-std::vector<CMString> WCMatcher::findAll()
+std::vector<CMStringW> WCMatcher::findAll()
{
- std::vector<CMString> ret;
+ std::vector<CMStringW> ret;
reset();
while (findNextMatch())
ret.push_back(getGroup());
@@ -163,16 +163,16 @@ int WCMatcher::getEndingIndex(const int groupNum) const return ends[groupNum];
}
-CMString WCMatcher::getGroup(const int groupNum) const
+CMStringW WCMatcher::getGroup(const int groupNum) const
{
if (groupNum < 0 || groupNum >= gc) return L"";
if (starts[groupNum] < 0 || ends[groupNum] < 0) return L"";
return str->Mid(starts[groupNum], ends[groupNum] - starts[groupNum]);
}
-std::vector<CMString> WCMatcher::getGroups(const bool includeGroupZero) const
+std::vector<CMStringW> WCMatcher::getGroups(const bool includeGroupZero) const
{
- std::vector<CMString> ret;
+ std::vector<CMStringW> ret;
for (int i = (includeGroupZero ? 0 : 1); i < gc; ++i)
ret.push_back(getGroup(i));
diff --git a/plugins/SmileyAdd/src/regexp/WCMatcher.h b/plugins/SmileyAdd/src/regexp/WCMatcher.h index 3c5df018d7..285a49c349 100644 --- a/plugins/SmileyAdd/src/regexp/WCMatcher.h +++ b/plugins/SmileyAdd/src/regexp/WCMatcher.h @@ -23,7 +23,7 @@ invocation looks like:
<pre>
wchar_t buf[10000];
- CMString str = "\\5 (user name \\1) uses \\7 for his/her shell and \\6 is their home directory";
+ CMStringW str = "\\5 (user name \\1) uses \\7 for his/her shell and \\6 is their home directory";
FILE * fp = fopen("/etc/passwd", "r");
WCPattern::registerWCPattern("entry", "[^:]+");
WCPattern * p = WCPattern::compile("^({entry}):({entry}):({entry}):({entry}):({entry}):({entry}):({entry})$",
@@ -92,24 +92,24 @@ class WCMatcher @param pattern The pattern with which to search
@param text The text in which to search
*/
- WCMatcher(WCPattern * pattern, const CMString & text);
+ WCMatcher(WCPattern *pattern, const CMStringW & ext);
protected:
/// The pattern we use to match
- WCPattern * pat;
+ WCPattern *pat;
/// The string in which we are matching
- const CMString * str;
+ const CMStringW *str;
/// The starting point of our match
int start;
/// An array of the starting positions for each group
- int * starts;
+ int *starts;
/// An array of the ending positions for each group
- int * ends;
+ int *ends;
/// An array of private data used by NFAUNodes during matching
- int * groups;
+ int *groups;
/// An array of private data used by NFAUNodes during matching
- int * groupIndeces;
+ int *groupIndeces;
/// An array of private data used by NFAUNodes during matching
- int * groupPos;
+ int *groupPos;
/// The ending index of the last match
int lm;
/// The number of capturing groups we have
@@ -135,7 +135,7 @@ class WCMatcher @param str The string in which to replace text
@return A string with all backreferences appropriately replaced
*/
- CMString replaceWithGroups(const CMString & str);
+ CMStringW replaceWithGroups(const CMStringW & str);
/**
The flags currently being used by the matcher.
@return Zero
@@ -145,7 +145,7 @@ class WCMatcher The text being searched by the matcher.
@return the text being searched by the matcher.
*/
- const CMString& getText() const;
+ const CMStringW& getText() const;
/**
Scans the string from start to finish for a match. The entire string must
@@ -179,7 +179,7 @@ class WCMatcher @return Every substring in order which matches the given pattern
*/
- std::vector<CMString> findAll();
+ std::vector<CMStringW> findAll();
/**
Resets the internal state of the matcher
*/
@@ -188,12 +188,12 @@ class WCMatcher Same as getText. Left n for backwards compatibilty with old source code
@return Returns the string that is currently being used for matching
*/
- inline const CMString& getString() const { return *str; }
+ inline const CMStringW& getString() const { return *str; }
/**
Sets the string to scan
@param newStr The string to scan for subsequent matches
*/
- inline void setString(const CMString & newStr) { str = &newStr; reset(); }
+ inline void setString(const CMStringW & newStr) { str = &newStr; reset(); }
/**
Returns the starting index of the specified group.
@@ -217,14 +217,14 @@ class WCMatcher @param groupNum The group to query
@return The text of the group
*/
- CMString getGroup(const int groupNum = 0) const;
+ CMStringW getGroup(const int groupNum = 0) const;
/**
Returns every capture group in a vector
@param includeGroupZero Whether or not include capture group zero
@return Every capture group
*/
- std::vector<CMString> getGroups(const bool includeGroupZero = 0) const;
+ std::vector<CMStringW> getGroups(const bool includeGroupZero = 0) const;
};
#endif
diff --git a/plugins/SmileyAdd/src/regexp/WCPattern.cpp b/plugins/SmileyAdd/src/regexp/WCPattern.cpp index 22a7b78847..2ce1a1b301 100644 --- a/plugins/SmileyAdd/src/regexp/WCPattern.cpp +++ b/plugins/SmileyAdd/src/regexp/WCPattern.cpp @@ -25,8 +25,8 @@ #include "../stdafx.h"
-std::map<CMString, WCPattern *> WCPattern::compiledWCPatterns;
-std::map<CMString, std::pair<CMString, unsigned long> > WCPattern::registeredWCPatterns;
+std::map<CMStringW, WCPattern *> WCPattern::compiledWCPatterns;
+std::map<CMStringW, std::pair<CMStringW, unsigned long> > WCPattern::registeredWCPatterns;
const int WCPattern::MIN_QMATCH = 0x00000000;
const int WCPattern::MAX_QMATCH = 0x7FFFFFFF;
@@ -62,7 +62,7 @@ static inline int str_icmp(const wchar_t *a, const wchar_t *b) #define str_icmp wcscasecmp
#endif
-WCPattern::WCPattern(const CMString &rhs)
+WCPattern::WCPattern(const CMStringW &rhs)
{
matcher = NULL;
pattern = rhs;
@@ -85,29 +85,29 @@ NFAUNode *WCPattern::registerNode(NFAUNode *node) return node;
}
-CMString WCPattern::classUnion(CMString s1, CMString s2) const
+CMStringW WCPattern::classUnion(CMStringW s1, CMStringW s2) const
{
wchar_t *out = new wchar_t[66000];
std::sort((LPTSTR)s1.GetString(), (LPTSTR)s1.GetTail());
std::sort((LPTSTR)s2.GetString(), (LPTSTR)s2.GetTail());
wchar_t *p = std::set_union(s1.GetString(), s1.GetTail(), s2.GetString(), s2.GetTail(), out); *p = 0;
- CMString ret = out;
+ CMStringW ret = out;
delete[] out;
return ret;
}
-CMString WCPattern::classIntersect(CMString s1, CMString s2) const
+CMStringW WCPattern::classIntersect(CMStringW s1, CMStringW s2) const
{
wchar_t *out = new wchar_t[66000];
std::sort((LPTSTR)s1.GetString(), (LPTSTR)s1.GetTail());
std::sort((LPTSTR)s2.GetString(), (LPTSTR)s2.GetTail());
*std::set_intersection(s1.GetString(), s1.GetTail(), s2.GetString(), s2.GetTail(), out) = 0;
- CMString ret = out;
+ CMStringW ret = out;
delete[] out;
return ret;
}
-CMString WCPattern::classNegate(CMString s1) const
+CMStringW WCPattern::classNegate(CMStringW s1) const
{
wchar_t *out = new wchar_t[66000];
int i, ind = 0;
@@ -116,18 +116,18 @@ CMString WCPattern::classNegate(CMString s1) const for (i = 0; i < s1.GetLength(); ++i) m[s1[i]] = 1;
for (i = 0xFF; i >= 0; --i) if (m.find((wchar_t)i) == m.end()) out[ind++] = (wchar_t)i;
out[ind] = 0;
- CMString ret(out, ind);
+ CMStringW ret(out, ind);
delete[] out;
return ret;
}
-CMString WCPattern::classCreateRange(wchar_t low, wchar_t hi) const
+CMStringW WCPattern::classCreateRange(wchar_t low, wchar_t hi) const
{
wchar_t out[300];
int ind = 0;
while (low != hi) out[ind++] = low++;
out[ind++] = low;
- return CMString(out, ind);
+ return CMStringW(out, ind);
}
int WCPattern::getInt(int start, int end)
@@ -266,9 +266,9 @@ NFAUNode* WCPattern::quantify(NFAUNode *newNode) return newNode;
}
-CMString WCPattern::parseClass()
+CMStringW WCPattern::parseClass()
{
- CMString t, ret;
+ CMStringW t, ret;
wchar_t ch, c1, c2;
bool inv = 0, neg = 0, quo = 0;
@@ -364,9 +364,9 @@ CMString WCPattern::parseClass() return ret;
}
-CMString WCPattern::parsePosix()
+CMStringW WCPattern::parsePosix()
{
- CMString s7 = pattern.Mid(curInd, 7);
+ CMStringW s7 = pattern.Mid(curInd, 7);
if (s7 == L"{Lower}") { curInd += 7; return L"abcdefghijklmnopqrstuvwxyz"; }
if (s7 == L"{Upper}") { curInd += 7; return L"ABCDEFGHIJKLMNOPQRSTUVWXYZ"; }
if (s7 == L"{Alpha}") { curInd += 7; return L"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; }
@@ -378,7 +378,7 @@ CMString WCPattern::parsePosix() if (s7 == L"{Blank}") { curInd += 7; return L" \t"; }
if (s7 == L"{Space}") { curInd += 7; return L" \t\n\x0B\f\r"; }
if (s7 == L"{Cntrl}") {
- CMString s(' ', 32 + 1);
+ CMStringW s(' ', 32 + 1);
for (int i = 0; i <= 0x1F; ++i)
s.SetAt(i, i);
s.SetAt(0x20, 0x7F);
@@ -386,7 +386,7 @@ CMString WCPattern::parsePosix() return s;
}
if (s7 == L"{ASCII}") {
- CMString s(' ', 0x80);
+ CMStringW s(' ', 0x80);
for (int i = 0; i <= 0x7f; ++i) s.SetAt(i, i);
curInd += 7;
return s;
@@ -422,7 +422,7 @@ NFAUNode* WCPattern::parseBackref() #undef to_int
}
-CMString WCPattern::parseOctal()
+CMStringW WCPattern::parseOctal()
{
#define islowoc(x) ((x) >= '0' && (x) <= '3')
#define isoc(x) ((x) >= '0' && (x) <= '7')
@@ -431,7 +431,7 @@ CMString WCPattern::parseOctal() wchar_t ch1 = (ci + 0 < pattern.GetLength()) ? pattern[ci + 0] : USHRT_MAX;
wchar_t ch2 = (ci + 1 < pattern.GetLength()) ? pattern[ci + 1] : USHRT_MAX;
wchar_t ch3 = (ci + 2 < pattern.GetLength()) ? pattern[ci + 2] : USHRT_MAX;
- CMString s = L" ";
+ CMStringW s = L" ";
if (islowoc(ch1) && isoc(ch2)) {
curInd += 2;
@@ -453,7 +453,7 @@ CMString WCPattern::parseOctal() #undef fromoc
}
-CMString WCPattern::parseHex()
+CMStringW WCPattern::parseHex()
{
#define to_low(x) (((x) >= 'A' && (x) <= 'Z') ? ((x) - 'A' + 'a') : (x))
#define is_dig(x) ((x) >= '0' && (x) <= '9')
@@ -465,7 +465,7 @@ CMString WCPattern::parseHex() wchar_t ch2 = (ci + 1 < pattern.GetLength()) ? pattern[ci + 1] : USHRT_MAX;
wchar_t ch3 = (ci + 2 < pattern.GetLength()) ? pattern[ci + 2] : USHRT_MAX;
wchar_t ch4 = (ci + 3 < pattern.GetLength()) ? pattern[ci + 3] : USHRT_MAX;
- CMString s = L" ";
+ CMStringW s = L" ";
if (is_hex(ch1) && is_hex(ch2) && is_hex(ch3) && is_hex(ch4)) {
curInd += 2;
@@ -484,10 +484,10 @@ CMString WCPattern::parseHex() #undef to_int
}
-CMString WCPattern::parseEscape(bool &inv, bool &quo)
+CMStringW WCPattern::parseEscape(bool &inv, bool &quo)
{
wchar_t ch = pattern[curInd++];
- CMString classes;
+ CMStringW classes;
if (curInd > pattern.GetLength()) {
raiseError();
@@ -530,7 +530,7 @@ CMString WCPattern::parseEscape(bool &inv, bool &quo) NFAUNode* WCPattern::parseRegisteredWCPattern(NFAUNode **end)
{
int i, j;
- CMString s;
+ CMStringW s;
NFAUNode *ret = NULL;
for (i = curInd; i < pattern.GetLength() && pattern[i] != '}'; ++i) {}
if (pattern[i] != '}') { raiseError(); return NULL; }
@@ -555,7 +555,7 @@ NFAUNode* WCPattern::parseRegisteredWCPattern(NFAUNode **end) if (registeredWCPatterns.find(s) == registeredWCPatterns.end()) raiseError();
else {
unsigned long oflags = flags;
- CMString op = pattern;
+ CMStringW op = pattern;
int ci = i + 1;
pattern = registeredWCPatterns[s].first;
@@ -577,7 +577,7 @@ NFAUNode* WCPattern::parseRegisteredWCPattern(NFAUNode **end) // pattern must have a concrete length
NFAUNode* WCPattern::parseBehind(const bool pos, NFAUNode **end)
{
- CMString t;
+ CMStringW t;
while (curInd < pattern.GetLength() && pattern[curInd] != ')') {
wchar_t ch = pattern[curInd++];
if (ch == '\\') {
@@ -597,7 +597,7 @@ NFAUNode* WCPattern::parseBehind(const bool pos, NFAUNode **end) NFAUNode* WCPattern::parseQuote()
{
bool done = 0;
- CMString s;
+ CMStringW s;
while (!done) {
if (curInd >= pattern.GetLength()) {
@@ -621,7 +621,7 @@ NFAUNode* WCPattern::parseQuote() NFAUNode* WCPattern::parse(const bool inParen, const bool inOr, NFAUNode **end)
{
NFAUNode *start, *cur, *next = NULL;
- CMString t;
+ CMStringW t;
int grc = groupCount++;
bool inv, quo;
bool ahead = 0, pos = 0, noncap = 0, indep = 0;
@@ -747,13 +747,13 @@ NFAUNode* WCPattern::parse(const bool inParen, const bool inOr, NFAUNode **end) case '[':
if ((flags & WCPattern::CASE_INSENSITIVE) == 0) {
NFAClassUNode *clazz = new NFAClassUNode();
- CMString s = parseClass();
+ CMStringW s = parseClass();
for (int i = 0; i < (int)s.GetLength(); ++i) clazz->vals[s[i]] = 1;
next = registerNode(clazz);
}
else {
NFACIClassUNode *clazz = new NFACIClassUNode();
- CMString s = parseClass();
+ CMStringW s = parseClass();
for (int i = 0; i < s.GetLength(); ++i) clazz->vals[to_lower(s[i])] = 1;
next = registerNode(clazz);
}
@@ -845,7 +845,7 @@ NFAUNode* WCPattern::parse(const bool inParen, const bool inOr, NFAUNode **end) return start;
}
-WCPattern* WCPattern::compile(const CMString &pattern, const unsigned long mode)
+WCPattern* WCPattern::compile(const CMStringW &pattern, const unsigned long mode)
{
WCPattern *p = new WCPattern(pattern);
NFAUNode *end;
@@ -879,10 +879,10 @@ WCPattern* WCPattern::compile(const CMString &pattern, const unsigned long mode) return p;
}
-WCPattern* WCPattern::compileAndKeep(const CMString &pattern, const unsigned long mode)
+WCPattern* WCPattern::compileAndKeep(const CMStringW &pattern, const unsigned long mode)
{
WCPattern *ret = NULL;
- std::map<CMString, WCPattern*>::iterator it = compiledWCPatterns.find(pattern);
+ std::map<CMStringW, WCPattern*>::iterator it = compiledWCPatterns.find(pattern);
if (it != compiledWCPatterns.end())
ret = it->second;
else {
@@ -893,9 +893,9 @@ WCPattern* WCPattern::compileAndKeep(const CMString &pattern, const unsigned lon return ret;
}
-CMString WCPattern::replace(const CMString &pattern, const CMString &str, const CMString &replacementText, const unsigned long mode)
+CMStringW WCPattern::replace(const CMStringW &pattern, const CMStringW &str, const CMStringW &replacementText, const unsigned long mode)
{
- CMString ret;
+ CMStringW ret;
WCPattern *p = WCPattern::compile(pattern, mode);
if (p) {
ret = p->replace(str, replacementText);
@@ -904,9 +904,9 @@ CMString WCPattern::replace(const CMString &pattern, const CMString &str, const return ret;
}
-std::vector<CMString> WCPattern::split(const CMString &pattern, const CMString &str, const bool keepEmptys, const unsigned long limit, const unsigned long mode)
+std::vector<CMStringW> WCPattern::split(const CMStringW &pattern, const CMStringW &str, const bool keepEmptys, const unsigned long limit, const unsigned long mode)
{
- std::vector<CMString> ret;
+ std::vector<CMStringW> ret;
WCPattern *p = WCPattern::compile(pattern, mode);
if (p) {
ret = p->split(str, keepEmptys, limit);
@@ -915,9 +915,9 @@ std::vector<CMString> WCPattern::split(const CMString &pattern, const CMString & return ret;
}
-std::vector<CMString> WCPattern::findAll(const CMString &pattern, const CMString &str, const unsigned long mode)
+std::vector<CMStringW> WCPattern::findAll(const CMStringW &pattern, const CMStringW &str, const unsigned long mode)
{
- std::vector<CMString> ret;
+ std::vector<CMStringW> ret;
WCPattern *p = WCPattern::compile(pattern, mode);
if (p) {
ret = p->findAll(str);
@@ -926,7 +926,7 @@ std::vector<CMString> WCPattern::findAll(const CMString &pattern, const CMString return ret;
}
-bool WCPattern::matches(const CMString &pattern, const CMString &str, const unsigned long mode)
+bool WCPattern::matches(const CMStringW &pattern, const CMStringW &str, const unsigned long mode)
{
bool ret = 0;
WCPattern *p = compile(pattern, mode);
@@ -938,7 +938,7 @@ bool WCPattern::matches(const CMString &pattern, const CMString &str, const unsi return ret;
}
-bool WCPattern::registerWCPattern(const CMString &name, const CMString &pattern, const unsigned long mode)
+bool WCPattern::registerWCPattern(const CMStringW &name, const CMStringW &pattern, const unsigned long mode)
{
WCPattern *p = WCPattern::compile(pattern, mode);
if (!p)
@@ -956,17 +956,17 @@ void WCPattern::unregisterWCPatterns() void WCPattern::clearWCPatternCache()
{
- std::map<CMString, WCPattern*>::iterator it;
+ std::map<CMStringW, WCPattern*>::iterator it;
for (it = compiledWCPatterns.begin(); it != compiledWCPatterns.end(); ++it)
delete it->second;
compiledWCPatterns.clear();
}
-std::pair<CMString, int> WCPattern::findNthMatch(const CMString &pattern, const CMString &str,
+std::pair<CMStringW, int> WCPattern::findNthMatch(const CMStringW &pattern, const CMStringW &str,
const int matchNum, const unsigned long mode)
{
- std::pair<CMString, int> ret;
+ std::pair<CMStringW, int> ret;
WCPattern *p = WCPattern::compile(pattern, mode);
ret.second = -1;
@@ -991,10 +991,10 @@ WCPattern::~WCPattern() delete it->first;
}
-CMString WCPattern::replace(const CMString &str, const CMString &replacementText)
+CMStringW WCPattern::replace(const CMStringW &str, const CMStringW &replacementText)
{
int li = 0;
- CMString ret;
+ CMStringW ret;
matcher->setString(str);
while (matcher->findNextMatch()) {
@@ -1007,11 +1007,11 @@ CMString WCPattern::replace(const CMString &str, const CMString &replacementText return ret;
}
-std::vector<CMString> WCPattern::split(const CMString &str, const bool keepEmptys, const unsigned long limit)
+std::vector<CMStringW> WCPattern::split(const CMStringW &str, const bool keepEmptys, const unsigned long limit)
{
unsigned long lim = (limit == 0 ? MAX_QMATCH : limit);
int li = 0;
- std::vector<CMString> ret;
+ std::vector<CMStringW> ret;
matcher->setString(str);
@@ -1031,13 +1031,13 @@ std::vector<CMString> WCPattern::split(const CMString &str, const bool keepEmpty return ret;
}
-std::vector<CMString> WCPattern::findAll(const CMString &str)
+std::vector<CMStringW> WCPattern::findAll(const CMStringW &str)
{
matcher->setString(str);
return matcher->findAll();
}
-bool WCPattern::matches(const CMString &str)
+bool WCPattern::matches(const CMStringW &str)
{
matcher->setString(str);
return matcher->matches();
@@ -1048,12 +1048,12 @@ unsigned long WCPattern::getFlags() const return flags;
}
-CMString WCPattern::getWCPattern() const
+CMStringW WCPattern::getWCPattern() const
{
return pattern;
}
-WCMatcher *WCPattern::createWCMatcher(const CMString &str)
+WCMatcher *WCPattern::createWCMatcher(const CMStringW &str)
{
return new WCMatcher(this, str);
}
@@ -1072,7 +1072,7 @@ void NFAUNode::findAllNodes(std::map<NFAUNode*, bool> &soFar) // NFACharUNode
NFACharUNode::NFACharUNode(const wchar_t c) { ch = c; }
-int NFACharUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFACharUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
if (curInd < str.GetLength() && str[curInd] == ch)
return next->match(str, matcher, curInd + 1);
@@ -1082,7 +1082,7 @@ int NFACharUNode::match(const CMString &str, WCMatcher *matcher, const int curIn // NFACICharUNode
NFACICharUNode::NFACICharUNode(const wchar_t c) { ch = to_lower(c); }
-int NFACICharUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFACICharUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
if (curInd < str.GetLength() && to_lower(str[curInd]) == ch)
return next->match(str, matcher, curInd + 1);
@@ -1092,7 +1092,7 @@ int NFACICharUNode::match(const CMString &str, WCMatcher *matcher, const int cur // NFAStartUNode
NFAStartUNode::NFAStartUNode() {}
-int NFAStartUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAStartUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
int ret = -1, ci = curInd;
@@ -1118,7 +1118,7 @@ int NFAStartUNode::match(const CMString &str, WCMatcher *matcher, const int curI // NFAEndUNode
NFAEndUNode::NFAEndUNode() {}
-int NFAEndUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAEndUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
matcher->ends[0] = curInd;
if ((matcher->getFlags() & WCMatcher::MATCH_ENTIRE_STRING) != 0) {
@@ -1147,7 +1147,7 @@ NFAQuantifierUNode::NFAQuantifierUNode(WCPattern *pat, NFAUNode *internal, const max = (maxMatch > WCPattern::MAX_QMATCH) ? WCPattern::MAX_QMATCH : maxMatch;
}
-int NFAQuantifierUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAQuantifierUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
int i0, i1, i2 = 0;
@@ -1168,14 +1168,14 @@ NFAGreedyQuantifierUNode::NFAGreedyQuantifierUNode(WCPattern *pat, NFAUNode *int {
}
-int NFAGreedyQuantifierUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAGreedyQuantifierUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
int t = NFAQuantifierUNode::match(str, matcher, curInd);
if (t != -1) return matchInternal(str, matcher, t, min);
return t;
}
-int NFAGreedyQuantifierUNode::matchInternal(const CMString &str, WCMatcher *matcher, const int curInd, const int soFar) const
+int NFAGreedyQuantifierUNode::matchInternal(const CMStringW &str, WCMatcher *matcher, const int curInd, const int soFar) const
{
if (soFar >= max)
return next->match(str, matcher, curInd);
@@ -1196,7 +1196,7 @@ NFALazyQuantifierUNode::NFALazyQuantifierUNode(WCPattern *pat, NFAUNode *interna {
}
-int NFALazyQuantifierUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFALazyQuantifierUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
int m = NFAQuantifierUNode::match(str, matcher, curInd);
if (m == -1)
@@ -1225,7 +1225,7 @@ NFAPossessiveQuantifierUNode::NFAPossessiveQuantifierUNode(WCPattern *pat, NFAUN {
}
-int NFAPossessiveQuantifierUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAPossessiveQuantifierUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
int m = NFAQuantifierUNode::match(str, matcher, curInd);
if (m == -1)
@@ -1246,7 +1246,7 @@ NFAAcceptUNode::NFAAcceptUNode() {
}
-int NFAAcceptUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAAcceptUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
if (!next) return curInd;
else return next->match(str, matcher, curInd);
@@ -1259,14 +1259,14 @@ NFAClassUNode::NFAClassUNode(const bool invert) inv = invert;
}
-NFAClassUNode::NFAClassUNode(const CMString &clazz, const bool invert)
+NFAClassUNode::NFAClassUNode(const CMStringW &clazz, const bool invert)
{
inv = invert;
for (int i = 0; i < clazz.GetLength(); ++i)
vals[clazz[i]] = 1;
}
-int NFAClassUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAClassUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
if (curInd < str.GetLength() && ((vals.find(str[curInd]) != vals.end()) ^ inv)) {
return next->match(str, matcher, curInd + 1);
@@ -1281,14 +1281,14 @@ NFACIClassUNode::NFACIClassUNode(const bool invert) inv = invert;
}
-NFACIClassUNode::NFACIClassUNode(const CMString &clazz, const bool invert)
+NFACIClassUNode::NFACIClassUNode(const CMStringW &clazz, const bool invert)
{
inv = invert;
for (int i = 0; i < (int)clazz.GetLength(); ++i)
vals[to_lower(clazz[i])] = 1;
}
-int NFACIClassUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFACIClassUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
if (curInd < str.GetLength() && ((vals.find(to_lower(str[curInd])) != vals.end()) ^ inv))
return next->match(str, matcher, curInd + 1);
@@ -1302,7 +1302,7 @@ NFASubStartUNode::NFASubStartUNode() {
}
-int NFASubStartUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFASubStartUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
return next->match(str, matcher, curInd);
}
@@ -1320,7 +1320,7 @@ void NFAOrUNode::findAllNodes(std::map<NFAUNode*, bool> &soFar) if (two) two->findAllNodes(soFar);
NFAUNode::findAllNodes(soFar);
}
-int NFAOrUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAOrUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
int ci = one->match(str, matcher, curInd);
@@ -1333,12 +1333,12 @@ int NFAOrUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) // NFAQuoteUNode
-NFAQuoteUNode::NFAQuoteUNode(const CMString "ed) :
+NFAQuoteUNode::NFAQuoteUNode(const CMStringW "ed) :
qStr(quoted)
{
}
-int NFAQuoteUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAQuoteUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
if (curInd + qStr.GetLength() > str.GetLength()) return -1;
if (str.Mid(curInd, qStr.GetLength()) != qStr) return -1;
@@ -1347,12 +1347,12 @@ int NFAQuoteUNode::match(const CMString &str, WCMatcher *matcher, const int curI // NFACIQuoteUNode
-NFACIQuoteUNode::NFACIQuoteUNode(const CMString "ed) :
+NFACIQuoteUNode::NFACIQuoteUNode(const CMStringW "ed) :
qStr(quoted)
{
}
-int NFACIQuoteUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFACIQuoteUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
if (curInd + qStr.GetLength() > str.GetLength()) return -1;
if (str_icmp(str.Mid(curInd, qStr.GetLength()).c_str(), qStr.c_str())) return -1;
@@ -1372,19 +1372,19 @@ void NFALookAheadUNode::findAllNodes(std::map<NFAUNode*, bool> &soFar) NFAUNode::findAllNodes(soFar);
}
-int NFALookAheadUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFALookAheadUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
return ((inner->match(str, matcher, curInd) == -1) ^ pos) ? next->match(str, matcher, curInd) : -1;
}
// NFALookBehindUNode
-NFALookBehindUNode::NFALookBehindUNode(const CMString &str, const bool positive) :
+NFALookBehindUNode::NFALookBehindUNode(const CMStringW &str, const bool positive) :
pos(positive), mStr(str)
{
}
-int NFALookBehindUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFALookBehindUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
if (pos) {
if (curInd < mStr.GetLength())
@@ -1408,7 +1408,7 @@ NFAStartOfLineUNode::NFAStartOfLineUNode() {
}
-int NFAStartOfLineUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAStartOfLineUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
if (curInd == 0 || str[curInd - 1] == '\n' || str[curInd - 1] == '\r')
return next->match(str, matcher, curInd);
@@ -1422,7 +1422,7 @@ NFAEndOfLineUNode::NFAEndOfLineUNode() {
}
-int NFAEndOfLineUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAEndOfLineUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
if (curInd >= str.GetLength() || str[curInd] == '\n' || str[curInd] == '\r')
return next->match(str, matcher, curInd);
@@ -1437,7 +1437,7 @@ NFAReferenceUNode::NFAReferenceUNode(const int groupIndex) : {
}
-int NFAReferenceUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAReferenceUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
int len = matcher->ends[gi] - matcher->starts[gi];
int ni = -1;
@@ -1455,7 +1455,7 @@ NFAStartOfInputUNode::NFAStartOfInputUNode() {
}
-int NFAStartOfInputUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAStartOfInputUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
if (curInd == 0) return next->match(str, matcher, curInd);
return -1;
@@ -1468,7 +1468,7 @@ NFAEndOfInputUNode::NFAEndOfInputUNode(const bool lookForTerm) : {
}
-int NFAEndOfInputUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAEndOfInputUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
int len = str.GetLength();
if (curInd == len) return next->match(str, matcher, curInd);
@@ -1490,7 +1490,7 @@ NFAWordBoundaryUNode::NFAWordBoundaryUNode(const bool positive) : {
}
-int NFAWordBoundaryUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAWordBoundaryUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
int len = str.GetLength();
@@ -1509,7 +1509,7 @@ NFAEndOfMatchUNode::NFAEndOfMatchUNode() {
}
-int NFAEndOfMatchUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAEndOfMatchUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
if (curInd == matcher->lm) return next->match(str, matcher, curInd);
return -1;
@@ -1522,7 +1522,7 @@ NFAGroupHeadUNode::NFAGroupHeadUNode(const int groupIndex) : {
}
-int NFAGroupHeadUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAGroupHeadUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
int ret, o = matcher->starts[gi];
@@ -1540,7 +1540,7 @@ NFAGroupTailUNode::NFAGroupTailUNode(const int groupIndex) : {
}
-int NFAGroupTailUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAGroupTailUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
int ret, o = matcher->ends[gi];
@@ -1558,7 +1558,7 @@ NFAGroupLoopPrologueUNode::NFAGroupLoopPrologueUNode(const int groupIndex) : {
}
-int NFAGroupLoopPrologueUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAGroupLoopPrologueUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
int ret, o1 = matcher->groups[gi], o2 = matcher->groupPos[gi], o3 = matcher->groupIndeces[gi];
@@ -1593,7 +1593,7 @@ void NFAGroupLoopUNode::findAllNodes(std::map<NFAUNode*, bool> &soFar) NFAUNode::findAllNodes(soFar);
}
-int NFAGroupLoopUNode::match(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAGroupLoopUNode::match(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
bool b = (curInd > matcher->groupIndeces[gi]);
@@ -1621,7 +1621,7 @@ int NFAGroupLoopUNode::match(const CMString &str, WCMatcher *matcher, const int return -1;
}
-int NFAGroupLoopUNode::matchGreedy(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAGroupLoopUNode::matchGreedy(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
int o = matcher->groupIndeces[gi]; // save our info for backtracking
matcher->groupIndeces[gi] = curInd; // move along
@@ -1635,7 +1635,7 @@ int NFAGroupLoopUNode::matchGreedy(const CMString &str, WCMatcher *matcher, cons return ret;
}
-int NFAGroupLoopUNode::matchLazy(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAGroupLoopUNode::matchLazy(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
int ret = next->match(str, matcher, curInd); // be lazy, just go on
if (ret < 0) {
@@ -1652,7 +1652,7 @@ int NFAGroupLoopUNode::matchLazy(const CMString &str, WCMatcher *matcher, const return ret;
}
-int NFAGroupLoopUNode::matchPossessive(const CMString &str, WCMatcher *matcher, const int curInd) const
+int NFAGroupLoopUNode::matchPossessive(const CMStringW &str, WCMatcher *matcher, const int curInd) const
{
int o = matcher->groupIndeces[gi]; // save info for backtracking
matcher->groupPos[gi] = matcher->groups[gi]; // set a flag stating we have matcher at least this much
diff --git a/plugins/SmileyAdd/src/regexp/WCPattern.h b/plugins/SmileyAdd/src/regexp/WCPattern.h index e3455e8b31..d45f734645 100644 --- a/plugins/SmileyAdd/src/regexp/WCPattern.h +++ b/plugins/SmileyAdd/src/regexp/WCPattern.h @@ -974,19 +974,19 @@ private: @param rhs The pattern to compile
@memo Creates a new pattern from the regular expression in <code>rhs</code>.
*/
- WCPattern(const CMString & rhs);
+ WCPattern(const CMStringW &rhs);
protected:
/**
This currently is not used, so don't try to do anything with it.
@memo Holds all the compiled patterns for quick access.
*/
- static std::map<CMString, WCPattern *> compiledWCPatterns;
+ static std::map<CMStringW, WCPattern*> compiledWCPatterns;
/**
Holds all of the registered patterns as strings. Due to certain problems
with compilation of patterns, especially with capturing groups, this seemed
to be the best way to do it.
*/
- static std::map<CMString, std::pair<CMString, unsigned long> > registeredWCPatterns;
+ static std::map<CMStringW, std::pair<CMStringW, unsigned long> > registeredWCPatterns;
protected:
/**
Holds all the NFA nodes used. This makes deletion of a pattern, as well as
@@ -1006,7 +1006,7 @@ protected: /**
The actual regular expression we rerpesent
*/
- CMString pattern;
+ CMStringW pattern;
/**
Flag used during compilation. Once the pattern is successfully compiled,
<code>error</code> is no longer used.
@@ -1052,7 +1052,7 @@ protected: must have appeared in one or both of <code>s1</code> and
<code>s2</code>.
*/
- CMString classUnion(CMString s1, CMString s2) const;
+ CMStringW classUnion(CMStringW s1, CMStringW s2) const;
/**
Calculates the intersection of two strings. This function will first sort
the strings and then use a simple selection algorithm to find the
@@ -1062,7 +1062,7 @@ protected: @return A new string containing all unique characters. Each character
must have appeared both <code>s1</code> and <code>s2</code>.
*/
- CMString classIntersect(CMString s1, CMString s2) const;
+ CMStringW classIntersect(CMStringW s1, CMStringW s2) const;
/**
Calculates the negation of a string. The negation is the set of all
characters between <code>\x00</code> and <code>\xFF</code> not
@@ -1072,7 +1072,7 @@ protected: @return A new string containing all unique characters. Each character
must have appeared both <code>s1</code> and <code>s2</code>.
*/
- CMString classNegate(CMString s1) const;
+ CMStringW classNegate(CMStringW s1) const;
/**
Creates a new "class" representing the range from <code>low</code> thru
<code>hi</code>. This function will wrap if <code>low</code> >
@@ -1082,7 +1082,7 @@ protected: @param hi The ending character
@return A new string containing all the characters from low thru hi.
*/
- CMString classCreateRange(wchar_t low, wchar_t hi) const;
+ CMStringW classCreateRange(wchar_t low, wchar_t hi) const;
/**
Extracts a decimal number from the substring of member-variable
@@ -1132,24 +1132,24 @@ protected: @return A string of unique characters contained in the current class being
parsed
*/
- CMString parseClass();
+ CMStringW parseClass();
/**
Parses the current POSIX class being examined in
<code>{@link pattern pattern}</code>.
@return A string of unique characters representing the POSIX class being
parsed
*/
- CMString parsePosix();
+ CMStringW parsePosix();
/**
Returns a string containing the octal character being parsed
@return The string contained the octal value being parsed
*/
- CMString parseOctal();
+ CMStringW parseOctal();
/**
Returns a string containing the hex character being parsed
@return The string contained the hex value being parsed
*/
- CMString parseHex();
+ CMStringW parseHex();
/**
Returns a new node representing the back reference being parsed
@return The new node representing the back reference being parsed
@@ -1164,7 +1164,7 @@ protected: quotation.
@return The characters represented by the class
*/
- CMString parseEscape(bool & inv, bool & quo);
+ CMStringW parseEscape(bool & inv, bool & quo);
/**
Parses a supposed registered pattern currently under compilation. If the
sequence of characters does point to a registered pattern, then the
@@ -1228,7 +1228,7 @@ public: pointer. Upon failure, <code>compile</code> returns
<code>NULL</code>
*/
- static WCPattern * compile(const CMString & pattern,
+ static WCPattern * compile(const CMStringW & pattern,
const unsigned long mode = 0);
/**
Dont use this function. This function will compile a pattern, and cache
@@ -1243,7 +1243,7 @@ public: <code>WCPattern</code> pointer. Upon failure, <code>compile</code>
returns <code>NULL</code>.
*/
- static WCPattern * compileAndKeep(const CMString & pattern,
+ static WCPattern * compileAndKeep(const CMStringW & pattern,
const unsigned long mode = 0);
/**
@@ -1265,9 +1265,9 @@ public: during the replacement process
@return The text with the replacement string substituted where necessary
*/
- static CMString replace(const CMString & pattern,
- const CMString & str,
- const CMString & replacementText,
+ static CMStringW replace(const CMStringW & pattern,
+ const CMStringW & str,
+ const CMStringW & replacementText,
const unsigned long mode = 0);
/**
@@ -1276,12 +1276,12 @@ public: configurable. A typical invocation looks like:
<p>
<code>
- CMString str(strSize, 0);<br>
+ CMStringW str(strSize, 0);<br>
FILE * fp = fopen(fileName, "r");<br>
fread((char*)str.data(), strSize * 2, 1, fp);<br>
fclose(fp);<br>
<br>
- std::vector<CMString> lines = WCPattern::split(L"[\r\n]+", str, true);<br>
+ std::vector<CMStringW> lines = WCPattern::split(L"[\r\n]+", str, true);<br>
<br>
</code>
@@ -1293,8 +1293,8 @@ public: during the split process
@return All substrings of <code>str</code> split across <code>pattern</code>.
*/
- static std::vector<CMString> split(const CMString & pattern,
- const CMString & str,
+ static std::vector<CMStringW> split(const CMStringW & pattern,
+ const CMStringW & str,
const bool keepEmptys = 0,
const unsigned long limit = 0,
const unsigned long mode = 0);
@@ -1317,8 +1317,8 @@ public: during the find process
@return All instances of <code>pattern</code> in <code>str</code>
*/
- static std::vector<CMString> findAll(const CMString & pattern,
- const CMString & str,
+ static std::vector<CMStringW> findAll(const CMStringW & pattern,
+ const CMStringW & str,
const unsigned long mode = 0);
/**
@@ -1330,8 +1330,8 @@ public: during the replacement process
@return True if <code>str</code> is recognized by <code>pattern</code>
*/
- static bool matches(const CMString & pattern,
- const CMString & str,
+ static bool matches(const CMStringW & pattern,
+ const CMStringW & str,
const unsigned long mode = 0);
/**
@@ -1353,8 +1353,8 @@ public: @return Success/Failure. Fails only if <code>pattern</code> has invalid
syntax
*/
- static bool registerWCPattern(const CMString & name,
- const CMString & pattern,
+ static bool registerWCPattern(const CMStringW & name,
+ const CMStringW & pattern,
const unsigned long mode = 0);
/**
@@ -1372,7 +1372,7 @@ public: A typical invocation looks like this:
<p>
<code>
- std::pair<CMString, int> match = WCPattern::findNthMatch(L"\\d{1,3}", L"192.168.1.101:22", 1);<br>
+ std::pair<CMStringW, int> match = WCPattern::findNthMatch(L"\\d{1,3}", L"192.168.1.101:22", 1);<br>
wprintf(L"%s %i\n", match.first.c_str(), match.second);<br>
<br>
Output: 168 4<br>
@@ -1387,8 +1387,8 @@ public: <code>str</code>. You can check for success/failure by making sure
that the integer returned is greater than or equal to zero.
*/
- static std::pair<CMString, int> findNthMatch(const CMString & pattern,
- const CMString & str,
+ static std::pair<CMStringW, int> findNthMatch(const CMStringW & pattern,
+ const CMStringW & str,
const int matchNum,
const unsigned long mode = 0);
public:
@@ -1397,12 +1397,12 @@ public: */
~WCPattern();
- CMString replace(const CMString & str,
- const CMString & replacementText);
- std::vector<CMString> split(const CMString & str, const bool keepEmptys = 0,
+ CMStringW replace(const CMStringW & str,
+ const CMStringW & replacementText);
+ std::vector<CMStringW> split(const CMStringW & str, const bool keepEmptys = 0,
const unsigned long limit = 0);
- std::vector<CMString> findAll(const CMString & str);
- bool matches(const CMString & str);
+ std::vector<CMStringW> findAll(const CMStringW & str);
+ bool matches(const CMStringW & str);
/**
Returns the flags used during compilation of this pattern
@return The flags used during compilation of this pattern
@@ -1412,14 +1412,14 @@ public: Returns the regular expression this pattern represents
@return The regular expression this pattern represents
*/
- CMString getWCPattern() const;
+ CMStringW getWCPattern() const;
/**
Creates a matcher object using the specified string and this pattern.
@param str The string to match against
@return A new matcher using object using this pattern and the specified
string
*/
- WCMatcher * createWCMatcher(const CMString & str);
+ WCMatcher * createWCMatcher(const CMStringW & str);
};
class NFAUNode
@@ -1430,7 +1430,7 @@ public: NFAUNode();
virtual ~NFAUNode();
virtual void findAllNodes(std::map<NFAUNode*, bool> & soFar);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const = 0;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const = 0;
inline virtual bool isGroupHeadNode() const { return false; }
inline virtual bool isStartOfInputNode() const { return false; }
};
@@ -1440,7 +1440,7 @@ protected: wchar_t ch;
public:
NFACharUNode(const wchar_t c);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFACICharUNode : public NFAUNode
{
@@ -1448,19 +1448,19 @@ protected: wchar_t ch;
public:
NFACICharUNode(const wchar_t c);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAStartUNode : public NFAUNode
{
public:
NFAStartUNode();
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAEndUNode : public NFAUNode
{
public:
NFAEndUNode();
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAQuantifierUNode : public NFAUNode
{
@@ -1471,7 +1471,7 @@ public: NFAQuantifierUNode(WCPattern * pat, NFAUNode * internal,
const int minMatch = WCPattern::MIN_QMATCH,
const int maxMatch = WCPattern::MAX_QMATCH);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAGreedyQuantifierUNode : public NFAQuantifierUNode
{
@@ -1479,8 +1479,8 @@ public: NFAGreedyQuantifierUNode(WCPattern * pat, NFAUNode * internal,
const int minMatch = WCPattern::MIN_QMATCH,
const int maxMatch = WCPattern::MAX_QMATCH);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
- virtual int matchInternal(const CMString & str, WCMatcher * matcher, const int curInd, const int soFar) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int matchInternal(const CMStringW & str, WCMatcher * matcher, const int curInd, const int soFar) const;
};
class NFALazyQuantifierUNode : public NFAQuantifierUNode
{
@@ -1488,7 +1488,7 @@ public: NFALazyQuantifierUNode(WCPattern * pat, NFAUNode * internal,
const int minMatch = WCPattern::MIN_QMATCH,
const int maxMatch = WCPattern::MAX_QMATCH);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAPossessiveQuantifierUNode : public NFAQuantifierUNode
{
@@ -1496,13 +1496,13 @@ public: NFAPossessiveQuantifierUNode(WCPattern * pat, NFAUNode * internal,
const int minMatch = WCPattern::MIN_QMATCH,
const int maxMatch = WCPattern::MAX_QMATCH);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAAcceptUNode : public NFAUNode
{
public:
NFAAcceptUNode();
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAClassUNode : public NFAUNode
{
@@ -1510,8 +1510,8 @@ public: bool inv;
std::map<wchar_t, bool> vals;
NFAClassUNode(const bool invert = 0);
- NFAClassUNode(const CMString & clazz, const bool invert);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ NFAClassUNode(const CMStringW & clazz, const bool invert);
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFACIClassUNode : public NFAUNode
{
@@ -1519,14 +1519,14 @@ public: bool inv;
std::map<wchar_t, bool> vals;
NFACIClassUNode(const bool invert = 0);
- NFACIClassUNode(const CMString & clazz, const bool invert);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ NFACIClassUNode(const CMStringW & clazz, const bool invert);
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFASubStartUNode : public NFAUNode
{
public:
NFASubStartUNode();
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAOrUNode : public NFAUNode
{
@@ -1535,21 +1535,21 @@ public: NFAUNode * two;
NFAOrUNode(NFAUNode * first, NFAUNode * second);
virtual void findAllNodes(std::map<NFAUNode*, bool> & soFar);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAQuoteUNode : public NFAUNode
{
public:
- CMString qStr;
- NFAQuoteUNode(const CMString & quoted);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ CMStringW qStr;
+ NFAQuoteUNode(const CMStringW & quoted);
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFACIQuoteUNode : public NFAUNode
{
public:
- CMString qStr;
- NFACIQuoteUNode(const CMString & quoted);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ CMStringW qStr;
+ NFACIQuoteUNode(const CMStringW & quoted);
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFALookAheadUNode : public NFAUNode
{
@@ -1558,40 +1558,40 @@ public: NFAUNode * inner;
NFALookAheadUNode(NFAUNode * internal, const bool positive);
virtual void findAllNodes(std::map<NFAUNode*, bool> & soFar);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFALookBehindUNode : public NFAUNode
{
public:
bool pos;
- CMString mStr;
- NFALookBehindUNode(const CMString & str, const bool positive);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ CMStringW mStr;
+ NFALookBehindUNode(const CMStringW & str, const bool positive);
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAStartOfLineUNode : public NFAUNode
{
public:
NFAStartOfLineUNode();
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAEndOfLineUNode : public NFAUNode
{
public:
NFAEndOfLineUNode();
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAReferenceUNode : public NFAUNode
{
public:
int gi;
NFAReferenceUNode(const int groupIndex);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAStartOfInputUNode : public NFAUNode
{
public:
NFAStartOfInputUNode();
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
inline virtual bool isStartOfInputNode() const { return false; }
};
class NFAEndOfInputUNode : public NFAUNode
@@ -1599,27 +1599,27 @@ class NFAEndOfInputUNode : public NFAUNode public:
bool term;
NFAEndOfInputUNode(const bool lookForTerm);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAWordBoundaryUNode : public NFAUNode
{
public:
bool pos;
NFAWordBoundaryUNode(const bool positive);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAEndOfMatchUNode : public NFAUNode
{
public:
NFAEndOfMatchUNode();
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAGroupHeadUNode : public NFAUNode
{
public:
int gi;
NFAGroupHeadUNode(const int groupIndex);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
inline virtual bool isGroupHeadNode() const { return false; }
};
class NFAGroupTailUNode : public NFAUNode
@@ -1627,14 +1627,14 @@ class NFAGroupTailUNode : public NFAUNode public:
int gi;
NFAGroupTailUNode(const int groupIndex);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAGroupLoopPrologueUNode : public NFAUNode
{
public:
int gi;
NFAGroupLoopPrologueUNode(const int groupIndex);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
class NFAGroupLoopUNode : public NFAUNode
{
@@ -1644,10 +1644,10 @@ public: NFAGroupLoopUNode(NFAUNode * internal, const int minMatch,
const int maxMatch, const int groupIndex, const int matchType);
virtual void findAllNodes(std::map<NFAUNode*, bool> & soFar);
- virtual int match(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
- int matchGreedy(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
- int matchLazy(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
- int matchPossessive(const CMString & str, WCMatcher * matcher, const int curInd = 0) const;
+ virtual int match(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
+ int matchGreedy(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
+ int matchLazy(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
+ int matchPossessive(const CMStringW & str, WCMatcher * matcher, const int curInd = 0) const;
};
#endif
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index 1abad18364..84e0034737 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -33,7 +33,7 @@ SmileyPackType* GetSmileyPack(const char *proto, MCONTACT hContact, SmileyPackCT if (proto != NULL && IsBadStringPtrA(proto, 10))
return NULL;
- CMString categoryName;
+ CMStringW categoryName;
if (hContact != NULL) {
opt.ReadContactCategory(hContact, categoryName);
if (categoryName == L"<None>") return NULL;
@@ -46,15 +46,15 @@ SmileyPackType* GetSmileyPack(const char *proto, MCONTACT hContact, SmileyPackCT char *protonam = GetContactProto(hContact);
if (protonam != NULL) {
DBVARIANT dbv;
- if (db_get_ts(hContact, protonam, "Transport", &dbv) == 0) {
+ if (db_get_ws(hContact, protonam, "Transport", &dbv) == 0) {
categoryName = dbv.ptszVal;
db_free(&dbv);
}
- else if (opt.UsePhysProto && db_get_ts(NULL, protonam, "AM_BaseProto", &dbv) == 0) {
+ else if (opt.UsePhysProto && db_get_ws(NULL, protonam, "AM_BaseProto", &dbv) == 0) {
categoryName = L"AllProto";
categoryName += dbv.ptszVal;
db_free(&dbv);
- CMString categoryFileName = g_SmileyCategories.GetSmileyCategory(categoryName) ? g_SmileyCategories.GetSmileyCategory(categoryName)->GetFilename() : L"";
+ CMStringW categoryFileName = g_SmileyCategories.GetSmileyCategory(categoryName) ? g_SmileyCategories.GetSmileyCategory(categoryName)->GetFilename() : L"";
if (categoryFileName.IsEmpty())
categoryName = _A2T(protonam);
}
@@ -235,8 +235,8 @@ INT_PTR RegisterPack(WPARAM, LPARAM lParam) if (IsBadStringPtrA(smre->name, 50) || IsBadStringPtrA(smre->dispname, 50)) return FALSE;
- CMString nmd(_A2T(smre->dispname));
- CMString nm(_A2T(smre->name));
+ CMStringW nmd(_A2T(smre->dispname));
+ CMStringW nm(_A2T(smre->name));
g_SmileyCategories.AddAndLoad(nm, nmd);
return TRUE;
@@ -249,7 +249,7 @@ INT_PTR CustomCatMenu(WPARAM hContact, LPARAM lParam) if (smct != NULL)
opt.WriteContactCategory(hContact, smct->GetName());
else {
- CMString empty;
+ CMStringW empty;
if (lParam == 1) empty = L"<None>";
opt.WriteContactCategory(hContact, empty);
}
@@ -284,12 +284,12 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) menuHandleArray.destroy();
if (haveMenu) {
- CMString cat;
+ CMStringW cat;
opt.ReadContactCategory(wParam, cat);
CMenuItem mi;
mi.root = hContactMenuItem;
- mi.flags = CMIF_TCHAR | CMIF_SYSTEM;
+ mi.flags = CMIF_UNICODE | CMIF_SYSTEM;
mi.pszService = MS_SMILEYADD_CUSTOMCATMENU;
bool nonecheck = true;
@@ -340,7 +340,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) INT_PTR ReloadPack(WPARAM, LPARAM lParam)
{
if (lParam) {
- CMString categoryName = _A2T((char*)lParam);
+ CMStringW categoryName = _A2T((char*)lParam);
SmileyCategoryType *smc = g_SmileyCategories.GetSmileyCategory(categoryName);
if (smc != NULL)
smc->Load();
@@ -382,15 +382,15 @@ int AccountListChanged(WPARAM wParam, LPARAM lParam) switch (wParam) {
case PRAC_ADDED:
if (acc != NULL) {
- CMString catname(L"Standard");
- const CMString &defaultFile = g_SmileyCategories.GetSmileyCategory(catname)->GetFilename();
+ CMStringW catname(L"Standard");
+ const CMStringW &defaultFile = g_SmileyCategories.GetSmileyCategory(catname)->GetFilename();
g_SmileyCategories.AddAccountAsCategory(acc, defaultFile);
}
break;
case PRAC_CHANGED:
if (acc != NULL && acc->szModuleName != NULL) {
- CMString name(_A2T(acc->szModuleName));
+ CMStringW name(_A2T(acc->szModuleName));
SmileyCategoryType *smc = g_SmileyCategories.GetSmileyCategory(name);
if (smc != NULL) {
if (acc->tszAccountName) name = acc->tszAccountName;
@@ -406,8 +406,8 @@ int AccountListChanged(WPARAM wParam, LPARAM lParam) case PRAC_CHECKED:
if (acc != NULL) {
if (acc->bIsEnabled) {
- CMString catname(L"Standard");
- const CMString &defaultFile = g_SmileyCategories.GetSmileyCategory(catname)->GetFilename();
+ CMStringW catname(L"Standard");
+ const CMStringW &defaultFile = g_SmileyCategories.GetSmileyCategory(catname)->GetFilename();
g_SmileyCategories.AddAccountAsCategory(acc, defaultFile);
}
else g_SmileyCategories.DeleteAccountAsCategory(acc);
@@ -427,7 +427,7 @@ int DbSettingChanged(WPARAM hContact, LPARAM lParam) return 0;
if (strcmp(cws->szSetting, "Transport") == 0) {
- CMString catname(L"Standard");
+ CMStringW catname(L"Standard");
SmileyCategoryType *smc = g_SmileyCategories.GetSmileyCategory(catname);
if (smc != NULL)
g_SmileyCategories.AddContactTransportAsCategory(hContact, smc->GetFilename());
diff --git a/plugins/SmileyAdd/src/smileyroutines.cpp b/plugins/SmileyAdd/src/smileyroutines.cpp index e6d7dfd7ed..a56be87b9f 100644 --- a/plugins/SmileyAdd/src/smileyroutines.cpp +++ b/plugins/SmileyAdd/src/smileyroutines.cpp @@ -49,7 +49,7 @@ void LookupAllSmileys(SmileyPackType *smileyPack, SmileyPackCType *smileyCPack, SmileyLookup::SmileyLocVecType *smileys = new SmileyLookup::SmileyLocVecType [smlsz];
// Find all possible smileys
- CMString tmpstr(lpstrText);
+ CMStringW tmpstr(lpstrText);
int i = 0;
if (sml)
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 213e8307d0..e0bb7d8287 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -143,12 +143,12 @@ bool SmileyType::LoadFromImage(IStream *pStream) if (m_xepimg)
m_xepimg->Release();
- CMString name;
+ CMStringW name;
m_xepimg = new ImageType(0, name, pStream);
return true;
}
-bool SmileyType::LoadFromResource(const CMString &file, const int index)
+bool SmileyType::LoadFromResource(const CMStringW &file, const int index)
{
m_index = index;
m_filepath = file;
@@ -226,9 +226,9 @@ void SmileyType::CallSmileyService(MCONTACT hContact) _TMatcher *m0 = srvsplit->createTMatcher(GetTriggerText());
m0->findFirstMatch();
- CMString name = m0->getGroup(1);
- CMString par1 = m0->getGroup(2);
- CMString par2 = m0->getGroup(3);
+ CMStringW name = m0->getGroup(1);
+ CMStringW par1 = m0->getGroup(2);
+ CMStringW par2 = m0->getGroup(3);
delete m0;
delete srvsplit;
@@ -262,7 +262,7 @@ void SmileyPackType::AddTriggersToSmileyLookup(void) {
_TPattern *p = _TPattern::compile(L"\\s+");
{
- CMString emptystr;
+ CMStringW emptystr;
m_SmileyLookup.insert(new SmileyLookup(urlRegEx, true, -1, emptystr));
m_SmileyLookup.insert(new SmileyLookup(pathRegEx, true, -1, emptystr));
m_SmileyLookup.insert(new SmileyLookup(timeRegEx, true, -1, emptystr));
@@ -285,7 +285,7 @@ void SmileyPackType::AddTriggersToSmileyLookup(void) while (m0->findNextMatch()) {
int stind = m0->getStartingIndex();
if (li != stind) {
- CMString out;
+ CMStringW out;
ReplaceAllSpecials(m0->getString().Mid(li, stind - li), out);
SmileyLookup *dats = new SmileyLookup(out, false, dist, GetFilename());
if (dats->IsValid()) {
@@ -301,7 +301,7 @@ void SmileyPackType::AddTriggersToSmileyLookup(void) int stind = (int)m0->getString().GetLength();
if (li < stind) {
- CMString out;
+ CMStringW out;
ReplaceAllSpecials(m0->getString().Mid(li, stind - li), out);
SmileyLookup *dats = new SmileyLookup(out, false, dist, GetFilename());
if (dats->IsValid()) {
@@ -320,7 +320,7 @@ void SmileyPackType::AddTriggersToSmileyLookup(void) delete p;
}
-void SmileyPackType::ReplaceAllSpecials(const CMString &Input, CMString &Output)
+void SmileyPackType::ReplaceAllSpecials(const CMStringW &Input, CMStringW &Output)
{
Output = _TPattern::replace(L"%%_{1,2}%%", Input, L" ");
Output = _TPattern::replace(L"%%''%%", Output, L"\"");
@@ -341,7 +341,7 @@ void SmileyPackType::Clear(void) errorFound = false;
}
-bool SmileyPackType::LoadSmileyFile(const CMString &filename, const CMString &packname, bool onlyInfo, bool noerr)
+bool SmileyPackType::LoadSmileyFile(const CMStringW &filename, const CMStringW &packname, bool onlyInfo, bool noerr)
{
Clear();
@@ -350,7 +350,7 @@ bool SmileyPackType::LoadSmileyFile(const CMString &filename, const CMString &pa return false;
}
- CMString modpath;
+ CMStringW modpath;
pathToAbsolute(filename, modpath);
// Load xep file
@@ -359,7 +359,7 @@ bool SmileyPackType::LoadSmileyFile(const CMString &filename, const CMString &pa if (!noerr) {
static const wchar_t errmsg[] = LPGENW("Smiley pack %s for category \"%s\" not found.\nSelect correct smiley pack in the Options -> Customize -> Smileys.");
wchar_t msgtxt[1024];
- mir_snwprintf(msgtxt, TranslateTS(errmsg), modpath.c_str(), packname);
+ mir_snwprintf(msgtxt, TranslateW(errmsg), modpath.c_str(), packname);
ReportError(msgtxt);
}
@@ -382,7 +382,7 @@ bool SmileyPackType::LoadSmileyFile(const CMString &filename, const CMString &pa // Close file
_close(fh);
- CMString tbuf;
+ CMStringW tbuf;
if (len > 2 && *(wchar_t*)buf == 0xfeff)
tbuf = ((wchar_t*)buf + 1);
@@ -405,9 +405,9 @@ bool SmileyPackType::LoadSmileyFile(const CMString &filename, const CMString &pa return res;
}
-bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString &modpath)
+bool SmileyPackType::LoadSmileyFileMSL(CMStringW &tbuf, bool onlyInfo, CMStringW &modpath)
{
- CMString pathstr, packstr;
+ CMStringW pathstr, packstr;
{
_TPattern *pathsplit = _TPattern::compile(L"(.*\\\\)(.*)\\.|$");
_TMatcher *m0 = pathsplit->createTMatcher(modpath);
@@ -469,7 +469,7 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString & {
_TMatcher *m0 = smiley->createTMatcher(tbuf);
while (m0->findNextMatch()) {
- CMString resname = m0->getGroup(2);
+ CMStringW resname = m0->getGroup(2);
if (resname.Find(L"http://") != -1) {
if (GetSmileyFile(resname, packstr))
continue;
@@ -519,7 +519,7 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString & if (!noerr) {
static const wchar_t errmsg[] = LPGENW("Smiley #%u in file %s for smiley pack %s not found.");
wchar_t msgtxt[1024];
- mir_snwprintf(msgtxt, TranslateTS(errmsg), smnum, resname.c_str(), modpath.c_str());
+ mir_snwprintf(msgtxt, TranslateW(errmsg), smnum, resname.c_str(), modpath.c_str());
CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, _T2A(msgtxt));
errorFound = true;
}
@@ -540,11 +540,11 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString & }
-static void DecodeHTML(CMString &str)
+static void DecodeHTML(CMStringW &str)
{
if (str.Find('&') != -1) {
- str = _TPattern::replace(CMString(L"<"), str, CMString(L"<"));
- str = _TPattern::replace(CMString(L">"), str, CMString(L">"));
+ str = _TPattern::replace(CMStringW(L"<"), str, CMStringW(L"<"));
+ str = _TPattern::replace(CMStringW(L">"), str, CMStringW(L">"));
}
}
@@ -571,7 +571,7 @@ static IStream* DecodeBase64Data(const char *pData) }
-bool SmileyPackType::LoadSmileyFileXEP(CMString &tbuf, bool onlyInfo, CMString&)
+bool SmileyPackType::LoadSmileyFileXEP(CMStringW &tbuf, bool onlyInfo, CMStringW&)
{
_TMatcher *m0, *m1, *m2;
@@ -584,7 +584,7 @@ bool SmileyPackType::LoadSmileyFileXEP(CMString &tbuf, bool onlyInfo, CMString&) m0 = settings_re->createTMatcher(tbuf);
if (m0->findFirstMatch()) {
- CMString settings = m0->getGroup(1);
+ CMStringW settings = m0->getGroup(1);
m1 = author_re->createTMatcher(settings);
if (m1->findFirstMatch()) {
@@ -622,7 +622,7 @@ bool SmileyPackType::LoadSmileyFileXEP(CMString &tbuf, bool onlyInfo, CMString&) m0 = images_re->createTMatcher(tbuf);
if (m0->findFirstMatch()) {
- CMString images = m0->getGroup(1);
+ CMStringW images = m0->getGroup(1);
m1 = imagedt_re->createTMatcher(images);
if (m1->findFirstMatch()) {
@@ -646,7 +646,7 @@ bool SmileyPackType::LoadSmileyFileXEP(CMString &tbuf, bool onlyInfo, CMString&) dat->m_ToolText = m0->getGroup(2);
DecodeHTML(dat->m_ToolText);
- CMString rec = m0->getGroup(3);
+ CMStringW rec = m0->getGroup(3);
m1 = expression_re->createTMatcher(rec);
if (m1->findFirstMatch()) {
@@ -665,7 +665,7 @@ bool SmileyPackType::LoadSmileyFileXEP(CMString &tbuf, bool onlyInfo, CMString&) m1 = image_re->createTMatcher(rec);
if (m1->findFirstMatch()) {
- CMString images = m1->getGroup(1);
+ CMStringW images = m1->getGroup(1);
m2 = imagedt_re->createTMatcher(images);
if (m2->findFirstMatch()) {
@@ -709,7 +709,7 @@ bool SmileyPackType::LoadSmileyFileXEP(CMString &tbuf, bool onlyInfo, CMString&) //
-bool SmileyPackListType::AddSmileyPack(CMString &filename, CMString &packname)
+bool SmileyPackListType::AddSmileyPack(CMStringW &filename, CMStringW &packname)
{
bool res = true;
if (GetSmileyPack(filename) == NULL) { //not exist yet, so add
@@ -725,13 +725,13 @@ bool SmileyPackListType::AddSmileyPack(CMString &filename, CMString &packname) }
-SmileyPackType* SmileyPackListType::GetSmileyPack(CMString &filename)
+SmileyPackType* SmileyPackListType::GetSmileyPack(CMStringW &filename)
{
- CMString modpath;
+ CMStringW modpath;
pathToAbsolute(filename, modpath);
for (int i = 0; i < m_SmileyPacks.getCount(); i++) {
- CMString modpath1;
+ CMStringW modpath1;
pathToAbsolute(m_SmileyPacks[i].GetFilename(), modpath1);
if (mir_wstrcmpi(modpath.c_str(), modpath1.c_str()) == 0) return &m_SmileyPacks[i];
}
@@ -749,8 +749,8 @@ void SmileyPackListType::ClearAndFreeAll() //
-SmileyCategoryType::SmileyCategoryType(SmileyPackListType *pSPS, const CMString &name,
- const CMString &displayName, const CMString &defaultFilename, SmcType typ)
+SmileyCategoryType::SmileyCategoryType(SmileyPackListType *pSPS, const CMStringW &name,
+ const CMStringW &displayName, const CMStringW &defaultFilename, SmcType typ)
{
m_pSmileyPackStore = pSPS;
type = typ;
@@ -800,7 +800,7 @@ void SmileyCategoryListType::ClearAndLoadAll(void) }
-SmileyCategoryType* SmileyCategoryListType::GetSmileyCategory(const CMString &name)
+SmileyCategoryType* SmileyCategoryListType::GetSmileyCategory(const CMStringW &name)
{
for (int i = 0; i < m_SmileyCategories.getCount(); i++)
if (name.CompareNoCase(m_SmileyCategories[i].GetName()) == 0)
@@ -816,7 +816,7 @@ SmileyCategoryType* SmileyCategoryListType::GetSmileyCategory(unsigned index) }
-SmileyPackType* SmileyCategoryListType::GetSmileyPack(CMString &categoryname)
+SmileyPackType* SmileyCategoryListType::GetSmileyPack(CMStringW &categoryname)
{
SmileyCategoryType *smc = GetSmileyCategory(categoryname);
return smc != NULL ? smc->GetSmileyPack() : NULL;
@@ -825,7 +825,7 @@ SmileyPackType* SmileyCategoryListType::GetSmileyPack(CMString &categoryname) void SmileyCategoryListType::SaveSettings(void)
{
- CMString catstr;
+ CMStringW catstr;
for (int i = 0; i < m_SmileyCategories.getCount(); i++) {
m_SmileyCategories[i].SaveSettings();
if (m_SmileyCategories[i].IsCustom()) {
@@ -837,7 +837,7 @@ void SmileyCategoryListType::SaveSettings(void) }
-void SmileyCategoryListType::AddAndLoad(const CMString &name, const CMString &displayName)
+void SmileyCategoryListType::AddAndLoad(const CMStringW &name, const CMStringW &displayName)
{
if (GetSmileyCategory(name) != NULL)
return;
@@ -849,7 +849,7 @@ void SmileyCategoryListType::AddAndLoad(const CMString &name, const CMString &di }
-void SmileyCategoryListType::AddCategory(const CMString &name, const CMString &displayName, SmcType typ, const CMString &defaultFilename)
+void SmileyCategoryListType::AddCategory(const CMStringW &name, const CMStringW &displayName, SmcType typ, const CMStringW &defaultFilename)
{
if (GetSmileyCategory(name) == NULL)
m_SmileyCategories.insert(new SmileyCategoryType(m_pSmileyPackStore, name, displayName, defaultFilename, typ));
@@ -867,14 +867,14 @@ bool SmileyCategoryListType::DeleteCustomCategory(int index) return false;
}
-void SmileyCategoryListType::AddAccountAsCategory(PROTOACCOUNT *acc, const CMString &defaultFile)
+void SmileyCategoryListType::AddAccountAsCategory(PROTOACCOUNT *acc, const CMStringW &defaultFile)
{
if (Proto_IsAccountEnabled(acc) && acc->szProtoName && IsSmileyProto(acc->szModuleName)) {
- CMString displayName(acc->tszAccountName ? acc->tszAccountName : _A2T(acc->szModuleName));
- CMString PhysProtoName, paths;
+ CMStringW displayName(acc->tszAccountName ? acc->tszAccountName : _A2T(acc->szModuleName));
+ CMStringW PhysProtoName, paths;
DBVARIANT dbv;
- if (db_get_ts(NULL, acc->szModuleName, "AM_BaseProto", &dbv) == 0) {
+ if (db_get_ws(NULL, acc->szModuleName, "AM_BaseProto", &dbv) == 0) {
PhysProtoName = L"AllProto";
PhysProtoName += dbv.ptszVal;
db_free(&dbv);
@@ -894,19 +894,19 @@ void SmileyCategoryListType::AddAccountAsCategory(PROTOACCOUNT *acc, const CMStr mir_snprintf(path, "Smileys\\nova\\%s.msl", packnam);
paths = _A2T(path);
- CMString patha;
+ CMStringW patha;
pathToAbsolute(paths, patha);
if (_waccess(patha.c_str(), 0) != 0)
paths = defaultFile;
}
- CMString tname(_A2T(acc->szModuleName));
+ CMStringW tname(_A2T(acc->szModuleName));
AddCategory(tname, displayName, acc->bIsVirtual ? smcVirtualProto : smcProto, paths);
}
}
-void SmileyCategoryListType::AddProtoAsCategory(char *acc, const CMString &defaultFile)
+void SmileyCategoryListType::AddProtoAsCategory(char *acc, const CMStringW &defaultFile)
{
if (acc == NULL)
return;
@@ -920,21 +920,21 @@ void SmileyCategoryListType::AddProtoAsCategory(char *acc, const CMString &defau char path[MAX_PATH];
mir_snprintf(path, "Smileys\\nova\\%s.msl", packnam);
- CMString paths = _A2T(path), patha;
+ CMStringW paths = _A2T(path), patha;
pathToAbsolute(paths, patha);
if (_waccess(patha.c_str(), 0) != 0)
paths = defaultFile;
- CMString dName(acc), displayName;
+ CMStringW dName(acc), displayName;
displayName.AppendFormat(TranslateT("%s global smiley pack"), dName.GetBuffer());
- CMString tname("AllProto");
+ CMStringW tname("AllProto");
tname += _A2T(acc);
AddCategory(tname, displayName, smcPhysProto, paths);
}
void SmileyCategoryListType::DeleteAccountAsCategory(PROTOACCOUNT *acc)
{
- CMString tname(_A2T(acc->szModuleName));
+ CMStringW tname(_A2T(acc->szModuleName));
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *proto = GetContactProto(hContact);
@@ -942,7 +942,7 @@ void SmileyCategoryListType::DeleteAccountAsCategory(PROTOACCOUNT *acc) continue;
DBVARIANT dbv;
- if (!db_get_ts(hContact, proto, "Transport", &dbv)) {
+ if (!db_get_ws(hContact, proto, "Transport", &dbv)) {
bool found = (tname.CompareNoCase(dbv.ptszVal) == 0);
db_free(&dbv);
if (found)
@@ -958,14 +958,14 @@ void SmileyCategoryListType::DeleteAccountAsCategory(PROTOACCOUNT *acc) }
}
-void SmileyCategoryListType::AddContactTransportAsCategory(MCONTACT hContact, const CMString &defaultFile)
+void SmileyCategoryListType::AddContactTransportAsCategory(MCONTACT hContact, const CMStringW &defaultFile)
{
char *proto = GetContactProto(hContact);
if (proto == NULL)
return;
DBVARIANT dbv;
- if (!db_get_ts(hContact, proto, "Transport", &dbv)) {
+ if (!db_get_ws(hContact, proto, "Transport", &dbv)) {
if (dbv.ptszVal[0] == '\0') {
db_free(&dbv);
return;
@@ -987,12 +987,12 @@ void SmileyCategoryListType::AddContactTransportAsCategory(MCONTACT hContact, co mir_free(trsp);
- CMString displayName = dbv.ptszVal;
+ CMStringW displayName = dbv.ptszVal;
if (packname != NULL) {
char path[MAX_PATH];
mir_snprintf(path, "Smileys\\nova\\%s.msl", packname);
- CMString paths = _A2T(path), patha;
+ CMStringW paths = _A2T(path), patha;
pathToAbsolute(paths, patha);
if (_waccess(patha.c_str(), 0) != 0)
@@ -1008,11 +1008,11 @@ void SmileyCategoryListType::AddContactTransportAsCategory(MCONTACT hContact, co void SmileyCategoryListType::AddAllProtocolsAsCategory(void)
{
- CMString displayName = TranslateT("Standard");
- CMString tname = L"Standard";
+ CMStringW displayName = TranslateT("Standard");
+ CMStringW tname = L"Standard";
AddCategory(tname, displayName, smcStd);
- const CMString &defaultFile = GetSmileyCategory(tname)->GetFilename();
+ const CMStringW &defaultFile = GetSmileyCategory(tname)->GetFilename();
PROTOCOLDESCRIPTOR **proto;
int protoCount = 0;
@@ -1032,7 +1032,7 @@ void SmileyCategoryListType::AddAllProtocolsAsCategory(void) for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
AddContactTransportAsCategory(hContact, defaultFile);
- CMString cats;
+ CMStringW cats;
opt.ReadCustomCategories(cats);
int cppv = 0;
@@ -1053,13 +1053,13 @@ void SmileyCategoryListType::AddAllProtocolsAsCategory(void) }
-SmileyLookup::SmileyLookup(const CMString &str, const bool regexs, const int ind, const CMString &smpt)
+SmileyLookup::SmileyLookup(const CMStringW &str, const bool regexs, const int ind, const CMStringW &smpt)
{
wchar_t msgtxt[1024];
m_ind = ind;
if (regexs) {
- static const CMString testString(L"Test String");
+ static const CMStringW testString(L"Test String");
m_pattern = _TPattern::compile(str);
m_valid = m_pattern != NULL;
if (m_valid) {
@@ -1068,13 +1068,13 @@ SmileyLookup::SmileyLookup(const CMString &str, const bool regexs, const int ind matcher->getStartingIndex() != matcher->getEndingIndex());
if (!m_valid) {
static const wchar_t errmsg[] = LPGENW("Regular expression \"%s\" in smiley pack \"%s\" could produce \"empty matches\".");
- mir_snwprintf(msgtxt, TranslateTS(errmsg), str.c_str(), smpt.c_str());
+ mir_snwprintf(msgtxt, TranslateW(errmsg), str.c_str(), smpt.c_str());
}
delete matcher;
}
else {
static const wchar_t errmsg[] = LPGENW("Regular expression \"%s\" in smiley pack \"%s\" malformed.");
- mir_snwprintf(msgtxt, TranslateTS(errmsg), str.c_str(), smpt.c_str());
+ mir_snwprintf(msgtxt, TranslateW(errmsg), str.c_str(), smpt.c_str());
}
if (!m_valid)
@@ -1094,7 +1094,7 @@ SmileyLookup::~SmileyLookup() }
-void SmileyLookup::Find(const CMString &str, SmileyLocVecType &smlcur, bool firstOnly) const
+void SmileyLookup::Find(const CMStringW &str, SmileyLocVecType &smlcur, bool firstOnly) const
{
if (!m_valid) return;
diff --git a/plugins/SmileyAdd/src/smileys.h b/plugins/SmileyAdd/src/smileys.h index cba4999442..c69d128618 100644 --- a/plugins/SmileyAdd/src/smileys.h +++ b/plugins/SmileyAdd/src/smileys.h @@ -42,7 +42,7 @@ protected: HICON m_SmileyIcon;
ImageBase *m_xepimg;
- CMString m_filepath;
+ CMStringW m_filepath;
void SetFlagsBit(unsigned flag, bool set)
{
@@ -51,17 +51,17 @@ protected: public:
- CMString m_TriggerText;
- CMString m_ToolText;
- CMString m_InsertText;
+ CMStringW m_TriggerText;
+ CMStringW m_ToolText;
+ CMStringW m_InsertText;
SmileyType();
~SmileyType();
- const CMString& GetTriggerText(void) const { return m_TriggerText; }
- const CMString& GetToolText(void) const { return m_ToolText; }
- const CMString& GetInsertText(void) const { return m_InsertText; }
- const CMString& GetFilePath(void) const { return m_filepath; }
+ const CMStringW& GetTriggerText(void) const { return m_TriggerText; }
+ const CMStringW& GetToolText(void) const { return m_ToolText; }
+ const CMStringW& GetInsertText(void) const { return m_InsertText; }
+ const CMStringW& GetFilePath(void) const { return m_filepath; }
bool IsHidden(void) const { return (m_flags & HiddenSmiley) != 0; }
bool IsRegEx(void) const { return (m_flags & RegExSmiley) != 0; }
@@ -96,7 +96,7 @@ public: void SetImList(HIMAGELIST hImLst, long i);
- bool LoadFromResource(const CMString &file, const int index);
+ bool LoadFromResource(const CMStringW &file, const int index);
bool LoadFromImage(IStream *pStream);
};
@@ -133,7 +133,7 @@ private: _TPattern *m_pattern;
int m_ind;
- CMString m_text;
+ CMStringW m_text;
bool m_valid;
public:
@@ -146,10 +146,10 @@ public: typedef SMOBJLIST<SmileyLocType> SmileyLocVecType;
SmileyLookup() { m_ind = 0; m_valid = false; m_pattern = NULL; };
- SmileyLookup(const CMString &str, const bool regexs, const int ind, const CMString &smpt);
+ SmileyLookup(const CMStringW &str, const bool regexs, const int ind, const CMStringW &smpt);
~SmileyLookup();
- void Find(const CMString &str, SmileyLocVecType &smlcur, bool firstOnly) const;
+ void Find(const CMStringW &str, SmileyLocVecType &smlcur, bool firstOnly) const;
int GetIndex(void) const { return m_ind; }
bool IsValid(void) const { return m_valid; }
};
@@ -164,12 +164,12 @@ public: POINT selec, win;
private:
- CMString m_Filename; //used as identification
- CMString m_Name;
- CMString m_Author;
- CMString m_Date;
- CMString m_Version;
- CMString m_ButtonSmiley;
+ CMStringW m_Filename; //used as identification
+ CMStringW m_Name;
+ CMStringW m_Author;
+ CMStringW m_Date;
+ CMStringW m_Version;
+ CMStringW m_ButtonSmiley;
HIMAGELIST m_hSmList;
@@ -181,9 +181,9 @@ private: bool errorFound;
void AddTriggersToSmileyLookup(void);
- void ReplaceAllSpecials(const CMString &Input, CMString &Output);
- bool LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString &modpath);
- bool LoadSmileyFileXEP(CMString &tbuf, bool onlyInfo, CMString &modpath);
+ void ReplaceAllSpecials(const CMStringW &Input, CMStringW &Output);
+ bool LoadSmileyFileMSL(CMStringW &tbuf, bool onlyInfo, CMStringW &modpath);
+ bool LoadSmileyFileXEP(CMStringW &tbuf, bool onlyInfo, CMStringW &modpath);
public:
SmileyPackType();
@@ -192,11 +192,11 @@ public: SmileyVectorType& GetSmileyList(void) { return m_SmileyList; }
SmileyLookupType* GetSmileyLookup(void) { return &m_SmileyLookup; }
- const CMString& GetFilename(void) const { return m_Filename; }
- const CMString& GetName(void) const { return m_Name; }
- const CMString& GetAuthor(void) const { return m_Author; }
- const CMString& GetDate(void) const { return m_Date; }
- const CMString& GetVersion(void) const { return m_Version; }
+ const CMStringW& GetFilename(void) const { return m_Filename; }
+ const CMStringW& GetName(void) const { return m_Name; }
+ const CMStringW& GetAuthor(void) const { return m_Author; }
+ const CMStringW& GetDate(void) const { return m_Date; }
+ const CMStringW& GetVersion(void) const { return m_Version; }
int SmileyCount(void) const { return m_SmileyList.getCount(); }
int VisibleSmileyCount(void) const { return m_VisibleCount; }
@@ -205,7 +205,7 @@ public: const wchar_t* GetButtonSmiley(void) const { return m_ButtonSmiley.c_str(); }
- bool LoadSmileyFile(const CMString &filename, const CMString &packname, bool onlyInfo, bool noerr = false);
+ bool LoadSmileyFile(const CMStringW &filename, const CMStringW &packname, bool onlyInfo, bool noerr = false);
void Clear(void);
};
@@ -222,9 +222,9 @@ private: public:
int NumberOfSmileyPacks(void) { return m_SmileyPacks.getCount(); }
- bool AddSmileyPack(CMString &filename, CMString &packname);
+ bool AddSmileyPack(CMStringW &filename, CMStringW &packname);
void ClearAndFreeAll(void);
- SmileyPackType* GetSmileyPack(CMString& filename);
+ SmileyPackType* GetSmileyPack(CMStringW& filename);
};
@@ -244,9 +244,9 @@ typedef enum class SmileyCategoryType
{
private:
- CMString m_Name;
- CMString m_DisplayName;
- CMString m_Filename; //functions as identification
+ CMStringW m_Name;
+ CMStringW m_DisplayName;
+ CMStringW m_Filename; //functions as identification
SmcType type;
@@ -256,11 +256,11 @@ private: public:
SmileyCategoryType() { type = smcNone; m_pSmileyPackStore = NULL; visible = true; };
- SmileyCategoryType(SmileyPackListType *pSPS, const CMString &name, const CMString &displayName, const CMString &defaultFilename, SmcType typ);
+ SmileyCategoryType(SmileyPackListType *pSPS, const CMStringW &name, const CMStringW &displayName, const CMStringW &defaultFilename, SmcType typ);
- const CMString& GetDisplayName(void) const { return m_DisplayName; }
- const CMString& GetName(void) const { return m_Name; }
- const CMString& GetFilename(void) const { return m_Filename; }
+ const CMStringW& GetDisplayName(void) const { return m_DisplayName; }
+ const CMStringW& GetName(void) const { return m_Name; }
+ const CMStringW& GetFilename(void) const { return m_Filename; }
bool IsCustom(void) { return type == smcCustom; }
bool IsProto(void) { return type == smcProto || type == smcPhysProto || type == smcTransportProto || type == smcVirtualProto; }
@@ -275,8 +275,8 @@ public: SmileyPackType* GetSmileyPack(void);
- void SetFilename(CMString& name) { m_Filename = name; }
- void SetDisplayName(CMString& name) { m_DisplayName = name; }
+ void SetFilename(CMStringW& name) { m_Filename = name; }
+ void SetDisplayName(CMStringW& name) { m_DisplayName = name; }
void SetVisible(bool vis) { visible = vis; }
void ClearFilename(void) { m_Filename.Empty(); }
@@ -298,20 +298,20 @@ private: public:
void SetSmileyPackStore(SmileyPackListType *pSPS) { m_pSmileyPackStore = pSPS; }
- SmileyCategoryType* GetSmileyCategory(const CMString& name);
+ SmileyCategoryType* GetSmileyCategory(const CMStringW& name);
SmileyCategoryType* GetSmileyCategory(unsigned index);
- SmileyPackType* GetSmileyPack(CMString& name);
+ SmileyPackType* GetSmileyPack(CMStringW& name);
SmileyCategoryVectorType* GetSmileyCategoryList(void) { return &m_SmileyCategories; };
int NumberOfSmileyCategories(void) { return m_SmileyCategories.getCount(); }
- void AddCategory(const CMString& name, const CMString& displayName, SmcType typ,
- const CMString& defaultFilename = CMString(L"Smileys\\nova\\default.msl"));
- void AddAndLoad(const CMString& name, const CMString& displayName);
+ void AddCategory(const CMStringW& name, const CMStringW& displayName, SmcType typ,
+ const CMStringW& defaultFilename = CMStringW(L"Smileys\\nova\\default.msl"));
+ void AddAndLoad(const CMStringW& name, const CMStringW& displayName);
void AddAllProtocolsAsCategory(void);
- void AddAccountAsCategory(PROTOACCOUNT *acc, const CMString& defaultFile);
- void AddProtoAsCategory(char *acc, const CMString& defaultFile);
- void AddContactTransportAsCategory(MCONTACT hContact, const CMString& defaultFile);
+ void AddAccountAsCategory(PROTOACCOUNT *acc, const CMStringW& defaultFile);
+ void AddProtoAsCategory(char *acc, const CMStringW& defaultFile);
+ void AddContactTransportAsCategory(MCONTACT hContact, const CMStringW& defaultFile);
void ClearAndLoadAll(void);
void ClearAll(void)
diff --git a/plugins/SmileyAdd/src/smltool.cpp b/plugins/SmileyAdd/src/smltool.cpp index 8db7726c1f..b2284343cd 100644 --- a/plugins/SmileyAdd/src/smltool.cpp +++ b/plugins/SmileyAdd/src/smltool.cpp @@ -196,7 +196,7 @@ void SmileyToolWindowType::InsertSmiley(void) CallFunctionAsync(smileyServiceCallback, p);
}
else {
- CMString insertText;
+ CMStringW insertText;
if (opt.SurroundSmileyWithSpaces) insertText = ' ';
insertText += sml->GetInsertText();
@@ -235,7 +235,7 @@ void SmileyToolWindowType::SmileySel(int but) ti.hwnd = m_hwndDialog;
ti.uId = (UINT_PTR)m_hwndDialog;
- const CMString &toolText = m_pSmileyPack->GetSmiley(m_CurrentHotTrack)->GetToolText();
+ const CMStringW &toolText = m_pSmileyPack->GetSmiley(m_CurrentHotTrack)->GetToolText();
ti.lpszText = const_cast<wchar_t*>(toolText.c_str());
SendMessage(m_hToolTip, TTM_UPDATETIPTEXT, 0, (LPARAM)&ti);
SendMessage(m_hToolTip, TTM_ACTIVATE, TRUE, 0);
diff --git a/plugins/SmileyAdd/src/stdafx.h b/plugins/SmileyAdd/src/stdafx.h index 4599a5a6f3..bd91bfe5a5 100644 --- a/plugins/SmileyAdd/src/stdafx.h +++ b/plugins/SmileyAdd/src/stdafx.h @@ -120,15 +120,15 @@ int UpdateSrmmDlg(WPARAM wParam, LPARAM lParam); //functions for general use (defined in general.cpp)
int CalculateTextHeight(HDC hdc, CHARFORMAT2 *chf);
-const wchar_t* GetImageExt(CMString &fname);
+const wchar_t* GetImageExt(CMStringW &fname);
MCONTACT DecodeMetaContact(MCONTACT hContact);
bool IsSmileyProto(char *proto);
HICON ImageList_GetIconFixed (HIMAGELIST himl, INT i, UINT fStyle);
-void pathToRelative(const CMString &pSrc, CMString &pOut);
-void pathToAbsolute(const CMString &pSrc, CMString &pOut);
+void pathToRelative(const CMStringW &pSrc, CMStringW &pOut);
+void pathToAbsolute(const CMStringW &pSrc, CMStringW &pOut);
bool InitGdiPlus(void);
void DestroyGdiPlus(void);
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index 6cdaf66110..59622de861 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -6,9 +6,9 @@ wchar_t* _getCOptS(wchar_t *buf, unsigned int buflen, MCONTACT hContact, const c {
DBVARIANT dbv = {0};
wcsnset(buf, 0, buflen);
- if (db_get_ts(hContact, PLUGIN_NAME, option, &dbv) != 0)
+ if (db_get_ws(hContact, PLUGIN_NAME, option, &dbv) != 0)
wcsncpy(buf, def, min(buflen, mir_wstrlen(def)+1));
- else if (dbv.type == DBVT_TCHAR) {
+ else if (dbv.type == DBVT_WCHAR) {
wcsncpy(buf, dbv.ptszVal, min(buflen, mir_wstrlen(dbv.ptszVal)+1));
}
db_free(&dbv);
@@ -21,7 +21,7 @@ wchar_t* _getMOptS(wchar_t *buf, unsigned int buflen, const char* module, const wcsnset(buf, 0, buflen);
if (db_get_s(NULL, module, option, &dbv) != 0)
wcsncpy(buf, def, min(buflen, mir_wstrlen(def)+1));
- else if (dbv.type == DBVT_TCHAR) {
+ else if (dbv.type == DBVT_WCHAR) {
wcsncpy(buf, dbv.ptszVal, min(buflen, mir_wstrlen(dbv.ptszVal)+1));
} else {
tmp = mir_a2u(dbv.pszVal);
diff --git a/plugins/Spamotron/src/stdafx.h b/plugins/Spamotron/src/stdafx.h index 1be69abae9..0ec06bf479 100644 --- a/plugins/Spamotron/src/stdafx.h +++ b/plugins/Spamotron/src/stdafx.h @@ -42,7 +42,7 @@ wchar_t* _getCOptS(wchar_t *buf, unsigned int buflen, MCONTACT hContact, const char* option, const wchar_t *def);
#define _getOptS(a,b,c,d) _getCOptS(a, b, NULL, c, d)
-#define _setCOptTS(a,b,c) db_set_ts(a, PLUGIN_NAME, b, c)
+#define _setCOptTS(a,b,c) db_set_ws(a, PLUGIN_NAME, b, c)
#define _setCOptS(a,b,c) db_set_s(a, PLUGIN_NAME, b, c)
#define _setOptTS(a,b) _setCOptTS(NULL, a, b)
diff --git a/plugins/SpellChecker/src/autoreplace.cpp b/plugins/SpellChecker/src/autoreplace.cpp index de4350eed3..5eb276939b 100644 --- a/plugins/SpellChecker/src/autoreplace.cpp +++ b/plugins/SpellChecker/src/autoreplace.cpp @@ -91,7 +91,7 @@ void AutoReplaceMap::writeAutoReplaceMap() wchar_t *p = wcsrchr(m_filename, '\\');
if (p != NULL) {
*p = 0;
- CreateDirectoryTreeT(m_filename);
+ CreateDirectoryTreeW(m_filename);
*p = '\\';
}
diff --git a/plugins/SpellChecker/src/dictionary.cpp b/plugins/SpellChecker/src/dictionary.cpp index 10f03b5c92..b5efcd4b29 100644 --- a/plugins/SpellChecker/src/dictionary.cpp +++ b/plugins/SpellChecker/src/dictionary.cpp @@ -390,7 +390,7 @@ protected: void appendToCustomDict(const wchar_t *word) { - CreateDirectoryTreeT(userPath); + CreateDirectoryTreeW(userPath); wchar_t filename[1024]; mir_snwprintf(filename, L"%s\\%s.cdic", userPath, language); @@ -756,7 +756,7 @@ BOOL CALLBACK EnumLocalesProc(LPTSTR lpLocaleString) else mir_wstrncpy(localName, dict->english_name, _countof(localName)); - mir_wstrncpy(dict->localized_name, TranslateTS(localName), _countof(dict->localized_name)); + mir_wstrncpy(dict->localized_name, TranslateW(localName), _countof(dict->localized_name)); } if (dict->localized_name[0] != 0) { @@ -783,7 +783,7 @@ void GetDictsInfo(LIST<Dictionary> &dicts) char lang[128]; WideCharToMultiByte(CP_ACP, 0, dict->language, -1, lang, sizeof(lang), NULL, NULL); - if (!db_get_ts(NULL, MODULE_NAME, lang, &dbv)) { + if (!db_get_ws(NULL, MODULE_NAME, lang, &dbv)) { mir_wstrncpy(dict->localized_name, dbv.ptszVal, _countof(dict->localized_name)); db_free(&dbv); } @@ -791,7 +791,7 @@ void GetDictsInfo(LIST<Dictionary> &dicts) if (dict->localized_name[0] == '\0') { for (size_t j = 0; j < _countof(aditionalLanguages); j++) { if (!mir_wstrcmp(aditionalLanguages[j].language, dict->language)) { - mir_wstrncpy(dict->localized_name, TranslateTS(aditionalLanguages[j].localized_name), _countof(dict->localized_name)); + mir_wstrncpy(dict->localized_name, TranslateW(aditionalLanguages[j].localized_name), _countof(dict->localized_name)); break; } } diff --git a/plugins/SpellChecker/src/options.cpp b/plugins/SpellChecker/src/options.cpp index 21309b391a..8f57cb2ed1 100644 --- a/plugins/SpellChecker/src/options.cpp +++ b/plugins/SpellChecker/src/options.cpp @@ -93,7 +93,7 @@ void LoadOptions() }
DBVARIANT dbv;
- if (!db_get_ts(NULL, MODULE_NAME, "DefaultLanguage", &dbv)) {
+ if (!db_get_ws(NULL, MODULE_NAME, "DefaultLanguage", &dbv)) {
mir_wstrncpy(opts.default_language, dbv.ptszVal, _countof(opts.default_language));
db_free(&dbv);
}
@@ -212,7 +212,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP int sel = SendDlgItemMessage(hwndDlg, IDC_DEF_LANG, CB_GETCURSEL, 0, 0);
if (sel >= languages.getCount())
sel = 0;
- db_set_ts(NULL, MODULE_NAME, "DefaultLanguage",
+ db_set_ws(NULL, MODULE_NAME, "DefaultLanguage",
(wchar_t *)languages[sel]->language);
mir_wstrcpy(opts.default_language, languages[sel]->language);
}
diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp index f40a0a6ee3..48cc788d8f 100644 --- a/plugins/SpellChecker/src/spellchecker.cpp +++ b/plugins/SpellChecker/src/spellchecker.cpp @@ -74,7 +74,7 @@ static int IconsChanged(WPARAM, LPARAM) StatusIconData sid = { sizeof(sid) }; sid.szModule = MODULE_NAME; sid.hIconDisabled = IcoLib_GetIcon("spellchecker_disabled"); - sid.flags = MBF_HIDDEN | MBF_TCHAR; + sid.flags = MBF_HIDDEN | MBF_UNICODE; for (int i = 0; i < languages.getCount(); i++) { sid.dwId = i; @@ -141,7 +141,7 @@ static int ModulesLoaded(WPARAM, LPARAM) GetModuleFileName(hInst, path, MAX_PATH); SKINICONDESC sid = { 0 }; - sid.flags = SIDF_ALL_TCHAR | SIDF_SORTED; + sid.flags = SIDF_ALL_UNICODE | SIDF_SORTED; sid.section.w = LPGENW("Spell Checker") L"/" LPGENW("Flags"); // Get language flags @@ -199,7 +199,7 @@ static int ModulesLoaded(WPARAM, LPARAM) StatusIconData sid = { sizeof(sid) }; sid.szModule = MODULE_NAME; sid.hIconDisabled = IcoLib_GetIcon("spellchecker_disabled"); - sid.flags = MBF_TCHAR | MBF_HIDDEN; + sid.flags = MBF_UNICODE | MBF_HIDDEN; for (int i = 0; i < languages.getCount(); i++) { sid.dwId = i; diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp index a3cab0e333..3c5a4a65e8 100644 --- a/plugins/SpellChecker/src/utils.cpp +++ b/plugins/SpellChecker/src/utils.cpp @@ -717,7 +717,7 @@ int GetClosestLanguage(wchar_t *lang_name) void GetUserProtoLanguageSetting(Dialog *dlg, MCONTACT hContact, char *group, char *setting, BOOL isProtocol = TRUE)
{
DBVARIANT dbv = { 0 };
- dbv.type = DBVT_TCHAR;
+ dbv.type = DBVT_WCHAR;
int caps = (isProtocol ? CallProtoService(group, PS_GETCAPS, PFLAGNUM_4, 0) : 0);
if (caps & PF4_INFOSETTINGSVC) {
@@ -729,11 +729,11 @@ void GetUserProtoLanguageSetting(Dialog *dlg, MCONTACT hContact, char *group, ch return;
}
else {
- if (db_get_ts(hContact, group, setting, &dbv))
+ if (db_get_ws(hContact, group, setting, &dbv))
return;
}
- if (dbv.type == DBVT_TCHAR && dbv.ptszVal != NULL) {
+ if (dbv.type == DBVT_WCHAR && dbv.ptszVal != NULL) {
wchar_t *lang = dbv.ptszVal;
for (int i = 0; i < languages.getCount(); i++) {
@@ -781,18 +781,18 @@ void GetContactLanguage(Dialog *dlg) dlg->lang_name[0] = '\0';
if (dlg->hContact == NULL) {
- if (!db_get_ts(NULL, MODULE_NAME, dlg->name, &dbv)) {
+ if (!db_get_ws(NULL, MODULE_NAME, dlg->name, &dbv)) {
mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
}
else {
- if (!db_get_ts(dlg->hContact, MODULE_NAME, "TalkLanguage", &dbv)) {
+ if (!db_get_ws(dlg->hContact, MODULE_NAME, "TalkLanguage", &dbv)) {
mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
- if (dlg->lang_name[0] == '\0' && !db_get_ts(dlg->hContact, "eSpeak", "TalkLanguage", &dbv)) {
+ if (dlg->lang_name[0] == '\0' && !db_get_ws(dlg->hContact, "eSpeak", "TalkLanguage", &dbv)) {
mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
@@ -801,12 +801,12 @@ void GetContactLanguage(Dialog *dlg) if (dlg->lang_name[0] == '\0') {
MCONTACT hMetaContact = db_mc_getMeta(dlg->hContact);
if (hMetaContact != NULL) {
- if (!db_get_ts(hMetaContact, MODULE_NAME, "TalkLanguage", &dbv)) {
+ if (!db_get_ws(hMetaContact, MODULE_NAME, "TalkLanguage", &dbv)) {
mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
- if (dlg->lang_name[0] == '\0' && !db_get_ts(hMetaContact, "eSpeak", "TalkLanguage", &dbv)) {
+ if (dlg->lang_name[0] == '\0' && !db_get_ws(hMetaContact, "eSpeak", "TalkLanguage", &dbv)) {
mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
@@ -1216,10 +1216,10 @@ BOOL HandleMenuSelection(Dialog *dlg, unsigned selection) SetNoUnderline(dlg);
if (dlg->hContact == NULL)
- db_set_ts(NULL, MODULE_NAME, dlg->name,
+ db_set_ws(NULL, MODULE_NAME, dlg->name,
languages[selection - LANGUAGE_MENU_ID_BASE]->language);
else
- db_set_ts(dlg->hContact, MODULE_NAME, "TalkLanguage",
+ db_set_ws(dlg->hContact, MODULE_NAME, "TalkLanguage",
languages[selection - LANGUAGE_MENU_ID_BASE]->language);
GetContactLanguage(dlg);
diff --git a/plugins/SplashScreen/src/bitmap_funcs.cpp b/plugins/SplashScreen/src/bitmap_funcs.cpp index c0d1531c17..0c45210801 100644 --- a/plugins/SplashScreen/src/bitmap_funcs.cpp +++ b/plugins/SplashScreen/src/bitmap_funcs.cpp @@ -131,7 +131,7 @@ bool MyBitmap::loadFromFile(wchar_t *fn) {
if (bits) free();
- HBITMAP hBmpLoaded = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)fn, IMGL_TCHAR);
+ HBITMAP hBmpLoaded = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)fn, IMGL_WCHAR);
if (!hBmpLoaded) {
#ifdef _DEBUG
logMessage(L"MyBitmap::loadFromFile", L"Bitmap load failed");
diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp index 9fa6d0263d..c5eb3608f9 100644 --- a/plugins/SplashScreen/src/main.cpp +++ b/plugins/SplashScreen/src/main.cpp @@ -83,14 +83,14 @@ void SplashMain() if (bstartup & (options.active == 1)) {
DBVARIANT dbv = { 0 };
- if (!db_get_ts(NULL, MODNAME, "VersionPrefix", &dbv)) {
+ if (!db_get_ws(NULL, MODNAME, "VersionPrefix", &dbv)) {
mir_wstrcpy(szPrefix, dbv.ptszVal);
db_free(&dbv);
}
else
mir_wstrcpy(szPrefix, L"");
- if (!db_get_ts(NULL, MODNAME, "Path", &dbv)) {
+ if (!db_get_ws(NULL, MODNAME, "Path", &dbv)) {
mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
@@ -107,7 +107,7 @@ void SplashMain() else
mir_wstrcpy(szSplashFile, inBuf);
- if (!db_get_ts(NULL, MODNAME, "Sound", &dbv)) {
+ if (!db_get_ws(NULL, MODNAME, "Sound", &dbv)) {
mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/SplashScreen/src/options.cpp b/plugins/SplashScreen/src/options.cpp index dce6380576..49aed98c8e 100644 --- a/plugins/SplashScreen/src/options.cpp +++ b/plugins/SplashScreen/src/options.cpp @@ -68,7 +68,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ReadDbConfig();
wchar_t inBuf[80];
DBVARIANT dbv = { 0 };
- if (!db_get_ts(NULL, MODNAME, "Path", &dbv)) {
+ if (!db_get_ws(NULL, MODNAME, "Path", &dbv)) {
mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
@@ -76,7 +76,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP mir_wstrcpy(inBuf, L"splash\\splash.png");
SetDlgItemText(hwndDlg, IDC_SPLASHPATH, inBuf);
- if (!db_get_ts(NULL, MODNAME, "Sound", &dbv)) {
+ if (!db_get_ws(NULL, MODNAME, "Sound", &dbv)) {
mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
@@ -84,7 +84,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP mir_wstrcpy(inBuf, L"sounds\\startup.wav");
SetDlgItemText(hwndDlg, IDC_SNDPATH, inBuf);
- if (!db_get_ts(NULL, MODNAME, "VersionPrefix", &dbv)) {
+ if (!db_get_ws(NULL, MODNAME, "VersionPrefix", &dbv)) {
mir_wstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
@@ -288,13 +288,13 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP wchar_t tmp[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_SPLASHPATH, tmp, _countof(tmp));
- db_set_ts(NULL, MODNAME, "Path", tmp);
+ db_set_ws(NULL, MODNAME, "Path", tmp);
GetDlgItemText(hwndDlg, IDC_SNDPATH, tmp, _countof(tmp));
- db_set_ts(NULL, MODNAME, "Sound", tmp);
+ db_set_ws(NULL, MODNAME, "Sound", tmp);
GetDlgItemText(hwndDlg, IDC_VERSIONPREFIX, tmp, _countof(tmp));
- db_set_ts(NULL, MODNAME, "VersionPrefix", tmp);
+ db_set_ws(NULL, MODNAME, "VersionPrefix", tmp);
mir_wstrcpy(szPrefix, tmp);
GetDlgItemText(hwndDlg, IDC_SHOWTIME, tmp, _countof(tmp));
diff --git a/plugins/StatusChange/src/main.cpp b/plugins/StatusChange/src/main.cpp index e9d9b17458..55e7a1ae94 100644 --- a/plugins/StatusChange/src/main.cpp +++ b/plugins/StatusChange/src/main.cpp @@ -317,7 +317,7 @@ int StatusChangeOptInit(WPARAM wParam, LPARAM) odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.pwszTitle = LPGENW("Status Change");
odp.pwszGroup = LPGENW("Status");
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pfnDlgProc = DlgProcStatusChangeOpts;
Options_AddPage(wParam, &odp);
return 0;
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp index 1cb68c1f1d..021674ab22 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp @@ -241,7 +241,7 @@ static int changeState(TAAAProtoSetting &setting, STATES newState) if (db_get_b(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_MSGCUSTOM), FALSE)) {
DBVARIANT dbv;
- if (!db_get_ts(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_STATUSMSG), &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_STATUSMSG), &dbv)) {
setting.szMsg = wcsdup(dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp index 1941273470..9435d0db54 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp @@ -127,7 +127,7 @@ INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L if (settings[i]->msg != NULL)
SetDlgItemTextA(hwndDlg, IDC_STATUSMSG, settings[i]->msg);
else {
- ptrW msg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, settings[i]->status, 0));
+ ptrW msg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGW, settings[i]->status, 0));
SetDlgItemText(hwndDlg, IDC_STATUSMSG, (msg != NULL) ? msg : L"");
}
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp index 58e2dba951..02516f3e9e 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp @@ -212,7 +212,7 @@ static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_SETITEMDATA, item, (LPARAM)statusModeList[i]);
if (statusModeList[i] == setting->lv1Status) {
SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_SETCURSEL, (WPARAM)item, 0);
- SetDlgItemText(hwndDlg, IDC_SETNASTR, CMString(FORMAT, TranslateT("minutes of %s mode"), statusMode));
+ SetDlgItemText(hwndDlg, IDC_SETNASTR, CMStringW(FORMAT, TranslateT("minutes of %s mode"), statusMode));
}
if (statusModeList[i] == setting->lv2Status)
SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_SETCURSEL, (WPARAM)item, 0);
@@ -227,7 +227,7 @@ static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0);
setting->lv1Status = (int)SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_GETCURSEL, 0, 0), 0);
- SetDlgItemText(hwndDlg, IDC_SETNASTR, CMString(FORMAT, TranslateT("minutes of %s mode"), pcli->pfnGetStatusModeDescription(setting->lv1Status, 0)));
+ SetDlgItemText(hwndDlg, IDC_SETNASTR, CMStringW(FORMAT, TranslateT("minutes of %s mode"), pcli->pfnGetStatusModeDescription(setting->lv1Status, 0)));
break;
case IDC_LV2STATUS:
diff --git a/plugins/StatusPlugins/KeepStatus/options.cpp b/plugins/StatusPlugins/KeepStatus/options.cpp index 147fcf0b5d..3a7328a2e3 100644 --- a/plugins/StatusPlugins/KeepStatus/options.cpp +++ b/plugins/StatusPlugins/KeepStatus/options.cpp @@ -570,7 +570,7 @@ int OptionsInit(WPARAM wparam, LPARAM) odp.hInstance = hInst;
odp.pwszGroup = LPGENW("Status");
odp.pwszTitle = LPGENW("KeepStatus");
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TABS);
odp.pfnDlgProc = DlgProcKsTabs;
Options_AddPage(wparam, &odp);
@@ -584,7 +584,7 @@ int OptionsInit(WPARAM wparam, LPARAM) odp.pszTemplate = MAKEINTRESOURCEA(IDD_PUOPT_KEEPSTATUS);
odp.pwszTitle = LPGENW("KeepStatus");
odp.pfnDlgProc = PopupOptDlgProc;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
Options_AddPage(wparam, &odp);
}
return 0;
diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index 31d8324e22..c53573bbf4 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -133,7 +133,7 @@ static wchar_t* GetLinkDescription(TSettingsList& protoSettings) if ( protoSettings.getCount() == 0 )
return NULL;
- CMString result(SHORTCUT_DESC);
+ CMStringW result(SHORTCUT_DESC);
for (int i=0; i < protoSettings.getCount(); i++) {
TSSSetting &p = protoSettings[i];
@@ -538,7 +538,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP if ( ar[j].szMsg != NULL)
ar[j].szMsg = wcsdup( ar[j].szMsg );
- ppo->tszName = db_get_tsa(NULL, MODULENAME, OptName(i, SETTING_PROFILENAME));
+ ppo->tszName = db_get_wsa(NULL, MODULENAME, OptName(i, SETTING_PROFILENAME));
if (ppo->tszName == NULL) {
if (i == defProfile)
ppo->tszName = mir_wstrdup( TranslateT("default"));
@@ -825,13 +825,13 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP db_set_b(NULL, MODULENAME, OptName(i, SETTING_INSUBMENU), po.inSubMenu);
db_set_b(NULL, MODULENAME, OptName(i, SETTING_REGHOTKEY), po.regHotkey);
db_set_w(NULL, MODULENAME, OptName(i, SETTING_HOTKEY), po.hotKey);
- db_set_ts(NULL, MODULENAME, OptName(i, SETTING_PROFILENAME), po.tszName);
+ db_set_ws(NULL, MODULENAME, OptName(i, SETTING_PROFILENAME), po.tszName);
TSettingsList& ar = *po.ps;
for (int j=0; j < ar.getCount(); j++) {
if ( ar[j].szMsg != NULL ) {
mir_snprintf(setting, "%s_%s", ar[j].szName, SETTING_PROFILE_STSMSG);
- db_set_ts(NULL, MODULENAME, OptName(i, setting), ar[j].szMsg);
+ db_set_ws(NULL, MODULENAME, OptName(i, setting), ar[j].szMsg);
}
db_set_w(NULL, MODULENAME, OptName(i, ar[j].szName), ar[j].status);
}
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp index 6cb631e3cb..03687e5834 100644 --- a/plugins/StatusPlugins/StartupStatus/profiles.cpp +++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp @@ -61,7 +61,7 @@ static int CreateMainMenuItems(WPARAM, LPARAM) { CMenuItem mi; mi.position = 2000100000; - mi.flags = CMIF_TCHAR; + mi.flags = CMIF_UNICODE; mcount = 0; int count = GetProfileCount(0, 0); for (int i = 0; i < count && mcount < MAX_MMITEMS; i++) { @@ -109,7 +109,7 @@ INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam) DBVARIANT dbv; char setting[80]; mir_snprintf(setting, "%d_%s", profile, SETTING_PROFILENAME); - if (db_get_ts(NULL, MODULENAME, setting, &dbv)) + if (db_get_ws(NULL, MODULENAME, setting, &dbv)) return -1; wcsncpy(buf, dbv.ptszVal, 128 - 1); buf[127] = 0; @@ -138,7 +138,7 @@ wchar_t *GetStatusMessage(int profile, char *szProto) for (int i = 0; i < pceCount; i++) { if ((pce[i].profile == profile) && (!mir_strcmp(pce[i].szProto, szProto))) { mir_snprintf(dbSetting, "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); - if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) { // reload from db + if (!db_get_ws(NULL, MODULENAME, dbSetting, &dbv)) { // reload from db pce[i].msg = (wchar_t*)realloc(pce[i].msg, sizeof(wchar_t)*(mir_wstrlen(dbv.ptszVal) + 1)); if (pce[i].msg != NULL) { mir_wstrcpy(pce[i].msg, dbv.ptszVal); @@ -162,7 +162,7 @@ wchar_t *GetStatusMessage(int profile, char *szProto) pce[pceCount].szProto = _strdup(szProto); pce[pceCount].msg = NULL; mir_snprintf(dbSetting, "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); - if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) { + if (!db_get_ws(NULL, MODULENAME, dbSetting, &dbv)) { pce[pceCount].msg = wcsdup(dbv.ptszVal); db_free(&dbv); } diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp index 13d708f0de..959d0c71de 100644 --- a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp +++ b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp @@ -172,7 +172,7 @@ static void SetLastStatusMessages(TSettingsList &ps) mir_snprintf(dbSetting, "%s%s", PREFIX_LASTMSG, ps[i].szName);
DBVARIANT dbv;
- if (ps[i].szMsg == NULL && !db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) {
+ if (ps[i].szMsg == NULL && !db_get_ws(NULL, MODULENAME, dbSetting, &dbv)) {
ps[i].szMsg = wcsdup(dbv.ptszVal); // remember this won't be freed
db_free(&dbv);
}
@@ -325,7 +325,7 @@ static int OnOkToExit(WPARAM, LPARAM) CallService(MS_NAS_GETSTATE, (WPARAM)&npi, 1);
}
if (npi.szMsg != NULL) {
- db_set_ts(NULL, MODULENAME, lastMsg, npi.tszMsg);
+ db_set_ws(NULL, MODULENAME, lastMsg, npi.tszMsg);
mir_free(npi.tszMsg);
}
}
diff --git a/plugins/StatusPlugins/commonstatus.cpp b/plugins/StatusPlugins/commonstatus.cpp index c04f8ab085..621f5f372c 100644 --- a/plugins/StatusPlugins/commonstatus.cpp +++ b/plugins/StatusPlugins/commonstatus.cpp @@ -120,7 +120,7 @@ wchar_t* GetDefaultStatusMessage(PROTOCOLSETTINGEX *ps, int newstatus) return mir_wstrdup(ps->szMsg);
}
- wchar_t *tMsg = (wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, newstatus, (LPARAM)ps->szName);
+ wchar_t *tMsg = (wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGW, newstatus, (LPARAM)ps->szName);
log_debugA("CommonStatus: Status message retrieved from general awaysys: %S", tMsg);
return tMsg;
}
diff --git a/plugins/StopSpamMod/src/options.cpp b/plugins/StopSpamMod/src/options.cpp index 8cc6139b5c..145f3c9352 100755 --- a/plugins/StopSpamMod/src/options.cpp +++ b/plugins/StopSpamMod/src/options.cpp @@ -322,7 +322,7 @@ MIRANDA_HOOK_EVENT(ME_OPT_INITIALISE, w, l) odp.pwszTitle = LPGENW("StopSpam");
odp.position = -1;
odp.hInstance = hInst;
- odp.flags = ODPF_TCHAR;
+ odp.flags = ODPF_UNICODE;
odp.pwszTab = LPGENW("General");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_MAIN);
diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index bb2086b078..5f3a810b60 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -21,9 +21,9 @@ wstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, c {
DBVARIANT dbv;
//if(db_get(hContact, szModule, szSetting, &dbv))
- if (db_get_ts(hContact, szModule, szSetting, &dbv))
+ if (db_get_ws(hContact, szModule, szSetting, &dbv))
return errorValue;
- // if(DBVT_TCHAR == dbv.type )
+ // if(DBVT_WCHAR == dbv.type )
errorValue = dbv.ptszVal;
db_free(&dbv);
return errorValue;
@@ -206,7 +206,7 @@ void LogSpamToFile(MCONTACT hContact, wstring message) if (hStopSpamLogDirH)
FoldersGetCustomPathT(hStopSpamLogDirH, pszName, MAX_PATH, L"");
else
- mir_wstrncpy(pszName, VARST(L"%miranda_logpath%"), _countof(pszName));
+ mir_wstrncpy(pszName, VARSW(L"%miranda_logpath%"), _countof(pszName));
wstring filename = pszName;
filename += L"\\stopspam_mod.log";
diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp index 3d022a2ba8..54c0019486 100644 --- a/plugins/StopSpamPlus/src/services.cpp +++ b/plugins/StopSpamPlus/src/services.cpp @@ -25,7 +25,7 @@ INT_PTR RemoveTempContacts(WPARAM, LPARAM lParam) {
for (MCONTACT hContact = db_find_first(); hContact;) {
MCONTACT hNext = db_find_next(hContact);
- ptrW szGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW szGroup(db_get_wsa(hContact, "CList", "Group"));
if (db_get_b(hContact, "CList", "NotOnList", 0) || (szGroup != NULL && (wcsstr(szGroup, L"Not In List") || wcsstr(szGroup, TranslateT("Not In List"))))) {
char *szProto = GetContactProto(hContact);
diff --git a/plugins/StopSpamPlus/src/settings.cpp b/plugins/StopSpamPlus/src/settings.cpp index 8e6e3cbbc6..d8f6e85ecd 100644 --- a/plugins/StopSpamPlus/src/settings.cpp +++ b/plugins/StopSpamPlus/src/settings.cpp @@ -4,7 +4,7 @@ tstring db_usage::DBGetPluginSetting(std::string const &name, tstring const &defValue)
{
DBVARIANT dbv;
- if (db_get_ts(NULL, pluginName, name.c_str(), &dbv))
+ if (db_get_ws(NULL, pluginName, name.c_str(), &dbv))
return defValue;
tstring value = dbv.ptszVal;
db_free(&dbv);
@@ -36,7 +36,7 @@ DWORD db_usage::DBGetPluginSetting(std::string const &name, DWORD const &defValu //writting to database--------------
void db_usage::DBSetPluginSetting(std::string const &name, tstring const &value)
{
- db_set_ts(NULL, pluginName, name.c_str(), value.c_str());
+ db_set_ws(NULL, pluginName, name.c_str(), value.c_str());
}
diff --git a/plugins/StopSpamPlus/src/settings.h b/plugins/StopSpamPlus/src/settings.h index 22c005649e..8c364569b2 100644 --- a/plugins/StopSpamPlus/src/settings.h +++ b/plugins/StopSpamPlus/src/settings.h @@ -61,13 +61,13 @@ public: db_setting<bool> RemTmpAll;
db_setting<bool> HistLog;
- Settings():Question("Question",TranslateTS(L"Spammers made me to install small anti-spam system you are now speaking with. "
+ Settings():Question("Question",TranslateW(L"Spammers made me to install small anti-spam system you are now speaking with. "
L"Please reply \"nospam\" without quotes and spaces if you want to contact me.\r\n"
L"Âíèìàíèå! Àíòèñïàì çàùèòà. Îòâåòüòå \"nospam\" áåç êàâû÷åê è ïðîáåëîâ, åñëè õîòèòå ñâÿçàòüñÿ ñî ìíîé."))
- ,AuthRepl("AuthReply",TranslateTS(L"StopSpam: send a message and reply to a anti-spam bot question.\r\n"
+ ,AuthRepl("AuthReply",TranslateW(L"StopSpam: send a message and reply to a anti-spam bot question.\r\n"
L"Àíòèñïàì: îòïðàâüòå ñîîáùåíèå è îòâåòüòå íà âîïðîñ àíòèñïàì ñèñòåìû."))
,Answer("Answer",L"nospam")
- ,Congratulation("Congratulation",TranslateTS(L"Congratulations! You just passed human/robot test. Now you can write me a message.\r\n"
+ ,Congratulation("Congratulation",TranslateW(L"Congratulations! You just passed human/robot test. Now you can write me a message.\r\n"
L"Ïîçäðàâëÿþ! Âû ïðîøëè àíòèñïàì ïðîâåðêó. Òåïåðü âû ìîæåòå ïèñàòü ìíå."))
,DisabledProtoList("DisabledProtoList","MetaContacts RSSNews")
,InfTalkProtection("InfTalkProtection", 1)
diff --git a/plugins/StopSpamPlus/src/stopspam.cpp b/plugins/StopSpamPlus/src/stopspam.cpp index ccd407d3d5..d7c8a36953 100644 --- a/plugins/StopSpamPlus/src/stopspam.cpp +++ b/plugins/StopSpamPlus/src/stopspam.cpp @@ -52,7 +52,7 @@ extern "C" int __declspec(dllexport) Load(void) CMenuItem mi;
SET_UID(mi, 0xf2164e17, 0xa4c1, 0x4b07, 0xae, 0x81, 0x9e, 0xae, 0x7f, 0xa2, 0x55, 0x13);
mi.position = -0x7FFFFFFF;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
mi.name.w = LPGENW("Remove Temporary Contacts");
mi.pszService = pluginName"/RemoveTempContacts";
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index b7116265d1..f85ad9bed1 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -233,7 +233,7 @@ static INT_PTR CB_SetButtonState(WPARAM wParam, LPARAM lParam) if (bbdi->hIcon) SendDlgItemMessage(hwndDlg, tempCID, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(bbdi->hIcon)); if (bbdi->pszTooltip) - SendDlgItemMessage(hwndDlg, tempCID, BUTTONADDTOOLTIP, (WPARAM)bbdi->ptszTooltip, (bbdi->bbbFlags & BBBF_ANSITOOLTIP) ? 0 : BATF_TCHAR); + SendDlgItemMessage(hwndDlg, tempCID, BUTTONADDTOOLTIP, (WPARAM)bbdi->ptszTooltip, (bbdi->bbbFlags & BBBF_ANSITOOLTIP) ? 0 : BATF_UNICODE); if (bbdi->bbbFlags) { Utils::showDlgControl(hwndDlg, tempCID, (bbdi->bbbFlags & BBSF_HIDDEN) ? SW_HIDE : SW_SHOW); Utils::enableDlgControl(hwndDlg, tempCID, !(bbdi->bbbFlags & BBSF_DISABLED)); @@ -463,7 +463,7 @@ static int BuildMenuObjectsTree(HWND hToolBarTree) tvis.item.iImage = tvis.item.iSelectedImage = 0; } else { - tvis.item.pszText = TranslateTS(cbd->m_ptszTooltip); + tvis.item.pszText = TranslateW(cbd->m_ptszTooltip); iImage = ImageList_AddIcon(himgl, IcoLib_GetIconByHandle(cbd->m_hIcon)); tvis.item.iImage = tvis.item.iSelectedImage = iImage; } @@ -491,7 +491,7 @@ static int BuildMenuObjectsTree(HWND hToolBarTree) tvis.item.iImage = tvis.item.iSelectedImage = -1; } else { - tvis.item.pszText = TranslateTS(cbd->m_ptszTooltip); + tvis.item.pszText = TranslateW(cbd->m_ptszTooltip); iImage = ImageList_AddIcon(himgl, IcoLib_GetIconByHandle(cbd->m_hIcon)); tvis.item.iImage = tvis.item.iSelectedImage = iImage; } @@ -803,7 +803,7 @@ void CustomButtonData::Accustom(HWND hwndBtn, TWindowData *dat) if (m_hIcon) SendMessage(hwndBtn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(m_hIcon)); if (m_ptszTooltip) - SendMessage(hwndBtn, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(m_ptszTooltip), BATF_TCHAR); + SendMessage(hwndBtn, BUTTONADDTOOLTIP, (WPARAM)TranslateW(m_ptszTooltip), BATF_UNICODE); SendMessage(hwndBtn, BUTTONSETCONTAINER, (LPARAM)dat->pContainer, 0); SendMessage(hwndBtn, BUTTONSETASTOOLBARBUTTON, TRUE, 0); @@ -1403,7 +1403,7 @@ void CB_ChangeButton(HWND hwndDlg, TWindowData *dat, CustomButtonData *cbd) if (cbd->m_hIcon) SendMessage(hwndBtn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(cbd->m_hIcon)); if (cbd->m_ptszTooltip) - SendMessage(hwndBtn, BUTTONADDTOOLTIP, (WPARAM)cbd->m_ptszTooltip, BATF_TCHAR); + SendMessage(hwndBtn, BUTTONADDTOOLTIP, (WPARAM)cbd->m_ptszTooltip, BATF_UNICODE); SendMessage(hwndBtn, BUTTONSETCONTAINER, (LPARAM)dat->pContainer, 0); SetWindowTextA(hwndBtn, cbd->m_pszModuleName); } diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index 3cec3e01bb..fc0a3a3169 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -795,7 +795,7 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData) if (g_Settings.bLogClassicIndicators)
str.Append(pszIndicator);
- CMString pszTemp(lin->bIsMe ? g_Settings.pszOutgoingNick : g_Settings.pszIncomingNick);
+ CMStringW pszTemp(lin->bIsMe ? g_Settings.pszOutgoingNick : g_Settings.pszIncomingNick);
pszTemp.Replace(L"%n", L"%s");
if (!lin->bIsMe) {
if (g_Settings.bClickableNicks)
diff --git a/plugins/TabSRMM/src/chat/muchighlight.cpp b/plugins/TabSRMM/src/chat/muchighlight.cpp index e6a00d5784..441183f454 100644 --- a/plugins/TabSRMM/src/chat/muchighlight.cpp +++ b/plugins/TabSRMM/src/chat/muchighlight.cpp @@ -49,13 +49,13 @@ void CMUCHighlight::init() m_fInitialized = true;
- if (0 == db_get_ts(0, CHAT_MODULE, "HighlightWords", &dbv)) {
+ if (0 == db_get_ws(0, CHAT_MODULE, "HighlightWords", &dbv)) {
m_TextPatternString = dbv.ptszVal;
_wsetlocale(LC_ALL, L"");
wcslwr(m_TextPatternString);
}
- if (0 == db_get_ts(0, CHAT_MODULE, "HighlightNames", &dbv))
+ if (0 == db_get_ws(0, CHAT_MODULE, "HighlightNames", &dbv))
m_NickPatternString = dbv.ptszVal;
m_dwFlags = M.GetByte(CHAT_MODULE, "HighlightEnabled", MATCH_TEXT);
@@ -188,12 +188,12 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L TranslateDialogDefault(hwndDlg);
{
DBVARIANT dbv = { 0 };
- if (!db_get_ts(0, CHAT_MODULE, "HighlightWords", &dbv)) {
+ if (!db_get_ws(0, CHAT_MODULE, "HighlightWords", &dbv)) {
::SetDlgItemText(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN, dbv.ptszVal);
::db_free(&dbv);
}
- if (!db_get_ts(0, CHAT_MODULE, "HighlightNames", &dbv)) {
+ if (!db_get_ws(0, CHAT_MODULE, "HighlightNames", &dbv)) {
::SetDlgItemText(hwndDlg, IDC_HIGHLIGHTNICKPATTERN, dbv.ptszVal);
::db_free(&dbv);
}
@@ -245,16 +245,16 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (iLen) {
szBuf = reinterpret_cast<wchar_t *>(mir_alloc((iLen + 2) * sizeof(wchar_t)));
::GetDlgItemText(hwndDlg, IDC_HIGHLIGHTNICKPATTERN, szBuf, iLen + 1);
- db_set_ts(0, CHAT_MODULE, "HighlightNames", szBuf);
+ db_set_ws(0, CHAT_MODULE, "HighlightNames", szBuf);
}
iLen = ::GetWindowTextLength(::GetDlgItem(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN));
if (iLen) {
szBuf = reinterpret_cast<wchar_t *>(mir_realloc(szBuf, sizeof(wchar_t) * (iLen + 2)));
::GetDlgItemText(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN, szBuf, iLen + 1);
- db_set_ts(0, CHAT_MODULE, "HighlightWords", szBuf);
+ db_set_ws(0, CHAT_MODULE, "HighlightWords", szBuf);
}
- else db_set_ts(0, CHAT_MODULE, "HighlightWords", L"");
+ else db_set_ws(0, CHAT_MODULE, "HighlightWords", L"");
mir_free(szBuf);
BYTE dwFlags = (::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTNICKENABLE) ? MATCH_NICKNAME : 0) |
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index 65ee0a3dee..64825d1b4f 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -225,7 +225,7 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM wcsncpy_s(lf->lfFaceName, L"Webdings", _TRUNCATE);
}
else {
- ptrW tszDefFace(db_get_tsa(NULL, szMod, str));
+ ptrW tszDefFace(db_get_wsa(NULL, szMod, str));
if (tszDefFace == NULL)
wcsncpy_s(lf->lfFaceName, fol[j].szDefFace, _TRUNCATE);
else
@@ -240,7 +240,7 @@ static HTREEITEM InsertBranch(HWND hwndTree, wchar_t* pszDescr, BOOL bExpanded) tvis.hParent = NULL;
tvis.hInsertAfter = TVI_LAST;
tvis.item.mask = TVIF_TEXT | TVIF_STATE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
- tvis.item.pszText = TranslateTS(pszDescr);
+ tvis.item.pszText = TranslateW(pszDescr);
tvis.item.stateMask = TVIS_EXPANDED | TVIS_BOLD;
tvis.item.state = (bExpanded ? TVIS_EXPANDED : 0) | TVIS_BOLD;
tvis.item.iImage = tvis.item.iSelectedImage = (bExpanded ? IMG_GRPOPEN : IMG_GRPCLOSED);
@@ -258,7 +258,7 @@ static void FillBranch(HWND hwndTree, HTREEITEM hParent, branch_t *branch, int n tvis.hParent = hParent;
tvis.hInsertAfter = TVI_LAST;
tvis.item.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
- tvis.item.pszText = TranslateTS(branch[i].szDescr);
+ tvis.item.pszText = TranslateW(branch[i].szDescr);
if (branch[i].iMode)
tvis.item.iImage = tvis.item.iSelectedImage = ((((M.GetDword(CHAT_MODULE, branch[i].szDBName, defaultval) & branch[i].iMode) & branch[i].iMode) != 0) ? IMG_CHECK : IMG_NOCHECK);
else
@@ -356,7 +356,7 @@ HICON LoadIconEx(char *pszIcoLibName) static void InitSetting(wchar_t* &ppPointer, const char *pszSetting, const wchar_t *pszDefault)
{
- ptrW val(db_get_tsa(NULL, CHAT_MODULE, pszSetting));
+ ptrW val(db_get_wsa(NULL, CHAT_MODULE, pszSetting));
replaceStrW(ppPointer, (val != NULL) ? val : pszDefault);
}
@@ -442,9 +442,9 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM if (iLen > 0) {
pszText = (wchar_t*)mir_realloc(pszText, (iLen + 2) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_GROUP, pszText, iLen + 1);
- db_set_ts(NULL, CHAT_MODULE, "AddToGroup", pszText);
+ db_set_ws(NULL, CHAT_MODULE, "AddToGroup", pszText);
}
- else db_set_ts(NULL, CHAT_MODULE, "AddToGroup", L"");
+ else db_set_ws(NULL, CHAT_MODULE, "AddToGroup", L"");
mir_free(pszText);
@@ -488,11 +488,11 @@ void RegisterFontServiceFonts() {
char szTemp[100];
LOGFONT lf;
- FontIDT fid = { 0 };
- ColourIDT cid = { 0 };
+ FontIDW fid = { 0 };
+ ColourIDW cid = { 0 };
- fid.cbSize = sizeof(FontIDT);
- cid.cbSize = sizeof(ColourIDT);
+ fid.cbSize = sizeof(FontIDW);
+ cid.cbSize = sizeof(ColourIDW);
strncpy(fid.dbSettingsGroup, FONTMODULE, _countof(fid.dbSettingsGroup));
@@ -552,7 +552,7 @@ void RegisterFontServiceFonts() wcsncpy(fid.backgroundName, LPGENW("Incoming background"), _countof(fid.backgroundName));
break;
}
- FontRegisterT(&fid);
+ FontRegisterW(&fid);
}
fontOptionsList = IP_fontOptionsList;
@@ -578,7 +578,7 @@ void RegisterFontServiceFonts() wcsncpy(fid.backgroundName, L"", _countof(fid.backgroundName));
wcsncpy(fid.group, LPGENW("Message Sessions"), _countof(fid.group));
}
- FontRegisterT(&fid);
+ FontRegisterW(&fid);
}
wcsncpy(cid.group, LPGENW("Message Sessions") L"/" LPGENW("Group chats"), _countof(cid.group));
@@ -599,18 +599,18 @@ void RegisterFontServiceFonts() cid.defcolour = RGB(0, 0, 0);
break;
}
- ColourRegisterT(&cid);
+ ColourRegisterW(&cid);
}
cid.order++;
wcsncpy_s(cid.name, LPGENW("Nick list background"), _TRUNCATE);
strncpy_s(cid.setting, "ColorNicklistBG", _TRUNCATE);
cid.defcolour = SRMSGDEFSET_BKGCOLOUR;
- ColourRegisterT(&cid);
+ ColourRegisterW(&cid);
cid.order++;
wcsncpy_s(cid.name, LPGENW("Group chat log background"), _TRUNCATE);
strncpy_s(cid.setting, "ColorLogBG", _TRUNCATE);
- ColourRegisterT(&cid);
+ ColourRegisterW(&cid);
// static colors (info panel, tool bar background etc...)
strncpy(fid.dbSettingsGroup, FONTMODULE, _countof(fid.dbSettingsGroup));
@@ -625,7 +625,7 @@ void RegisterFontServiceFonts() cid.defcolour = GetSysColor(_clrs[i].def & 0x000000ff);
else
cid.defcolour = _clrs[i].def;
- ColourRegisterT(&cid);
+ ColourRegisterW(&cid);
}
strncpy(cid.dbSettingsGroup, SRMSGMOD_T, _countof(fid.dbSettingsGroup));
@@ -641,7 +641,7 @@ void RegisterFontServiceFonts() else
cid.defcolour = _tabclrs[i].def;
- ColourRegisterT(&cid);
+ ColourRegisterW(&cid);
}
}
@@ -826,7 +826,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM if (iLen > 0) {
wchar_t *pszText1 = (wchar_t*)mir_alloc(iLen*sizeof(wchar_t) + 2);
GetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, pszText1, iLen + 1);
- db_set_ts(NULL, CHAT_MODULE, "LogDirectory", pszText1);
+ db_set_ws(NULL, CHAT_MODULE, "LogDirectory", pszText1);
mir_free(pszText1);
g_Settings.bLoggingEnabled = IsDlgButtonChecked(hwndDlg, IDC_LOGGING) == BST_CHECKED;
db_set_b(0, CHAT_MODULE, "LoggingEnabled", g_Settings.bLoggingEnabled);
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index 63f7f8134a..abedaddfdf 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -114,7 +114,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
mir_snwprintf(pd.lptzContactName, L"%s - %s", (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, pcli->pfnGetContactDisplayName(hContact, 0));
- wcsncpy_s(pd.lptzText, TranslateTS(szBuf), _TRUNCATE);
+ wcsncpy_s(pd.lptzText, TranslateW(szBuf), _TRUNCATE);
pd.iSeconds = g_Settings.iPopupTimeout;
if (g_Settings.iPopupStyle == 2) {
@@ -557,7 +557,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO AppendMenu(*hMenu, MF_SEPARATOR, 0, 0);
for (int i = 0; i < gcmi.nItems; i++) {
- wchar_t *ptszText = TranslateTS(gcmi.Item[i].pszDesc);
+ wchar_t *ptszText = TranslateW(gcmi.Item[i].pszDesc);
DWORD dwState = gcmi.Item[i].bDisabled ? MF_GRAYED : 0;
if (gcmi.Item[i].uType == MENU_NEWPOPUP) {
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index a38dfc6291..54c436ae8b 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -1819,7 +1819,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar SendDlgItemMessage(hwndDlg, IDC_CHAT_TOGGLESIDEBAR, BUTTONSETCONTAINER, (LPARAM)dat->pContainer, 0); SendDlgItemMessage(hwndDlg, IDC_CHAT_TOGGLESIDEBAR, BUTTONSETASFLATBTN, FALSE, 0); SendDlgItemMessage(hwndDlg, IDC_CHAT_TOGGLESIDEBAR, BUTTONSETASTOOLBARBUTTON, TRUE, 0); - SendDlgItemMessage(hwndDlg, IDC_CHAT_TOGGLESIDEBAR, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Expand or collapse the side bar"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_CHAT_TOGGLESIDEBAR, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Expand or collapse the side bar"), BATF_UNICODE); DM_InitTip(dat); BB_InitDlgButtons(dat); @@ -2564,14 +2564,14 @@ LABEL_SHOWWINDOW: case ID_SEARCH_GOOGLE: if (pszWord[0]) - Utils_OpenUrlT(CMString(FORMAT, L"http://www.google.com/search?q=%s", pszWord)); + Utils_OpenUrlT(CMStringW(FORMAT, L"http://www.google.com/search?q=%s", pszWord)); PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0); break; case ID_SEARCH_WIKIPEDIA: if (pszWord[0]) - Utils_OpenUrlT(CMString(FORMAT, L"http://en.wikipedia.org/wiki/%s", pszWord)); + Utils_OpenUrlT(CMStringW(FORMAT, L"http://en.wikipedia.org/wiki/%s", pszWord)); PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0); break; @@ -2789,7 +2789,7 @@ LABEL_SHOWWINDOW: if (g_Settings.bDoubleClick4Privat ? GetKeyState(VK_SHIFT) & 0x8000 : !(GetKeyState(VK_SHIFT) & 0x8000)) { LRESULT lResult = (LRESULT)SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETSEL, 0, 0); int start = LOWORD(lResult); - CMString tszName; + CMStringW tszName; if (start == 0) tszName.Format(L"%s: ", ui->pszNick); else @@ -2824,7 +2824,7 @@ LABEL_SHOWWINDOW: ptrA pszRtf(Message_GetFromStream(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE))); pci->SM_AddCommand(si->ptszID, si->pszModule, pszRtf); - CMString ptszText(ptrW(mir_utf8decodeW(pszRtf))); + CMStringW ptszText(ptrW(mir_utf8decodeW(pszRtf))); if (ptszText.IsEmpty()) break; @@ -3169,7 +3169,7 @@ LABEL_SHOWWINDOW: char *szKey = "TAB_ContainersW"; mir_snprintf(szIndex, "%d", iSelection - IDM_CONTAINERMENU); if (iSelection - IDM_CONTAINERMENU >= 0) { - if (!db_get_ts(NULL, szKey, szIndex, &dbv)) { + if (!db_get_ws(NULL, szKey, szIndex, &dbv)) { SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal); db_free(&dbv); } @@ -3212,7 +3212,7 @@ LABEL_SHOWWINDOW: if (pNewContainer == NULL) if ((pNewContainer = CreateContainer(szNewName, FALSE, dat->hContact)) == NULL) break; - db_set_ts(dat->hContact, SRMSGMOD_T, "containerW", szNewName); + db_set_ws(dat->hContact, SRMSGMOD_T, "containerW", szNewName); PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_DOCREATETAB_CHAT, (WPARAM)pNewContainer, (LPARAM)hwndDlg); if (iOldItems > 1) // there were more than 1 tab, container is still valid SendMessage(dat->pContainer->hwndActive, WM_SIZE, 0, 0); diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index e9923d78b2..3a9d346383 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -446,7 +446,7 @@ void CContactCache::updateStatusMsg(const char *szKey) if (m_szStatusMsg) mir_free(m_szStatusMsg); m_szStatusMsg = 0; - ptrW szStatus(db_get_tsa(hContact, "CList", "StatusMsg")); + ptrW szStatus(db_get_wsa(hContact, "CList", "StatusMsg")); if (szStatus != 0) m_szStatusMsg = (mir_wstrlen(szStatus) > 0 ? getNormalizedStatusMsg(szStatus) : 0); } @@ -454,7 +454,7 @@ void CContactCache::updateStatusMsg(const char *szKey) if (m_ListeningInfo) mir_free(m_ListeningInfo); m_ListeningInfo = 0; - ptrW szListeningTo(db_get_tsa(hContact, cc->szProto, "ListeningTo")); + ptrW szListeningTo(db_get_wsa(hContact, cc->szProto, "ListeningTo")); if (szListeningTo != 0 && *szListeningTo) m_ListeningInfo = szListeningTo.detach(); } @@ -462,7 +462,7 @@ void CContactCache::updateStatusMsg(const char *szKey) if (m_xStatusMsg) mir_free(m_xStatusMsg); m_xStatusMsg = 0; - ptrW szXStatusMsg(db_get_tsa(hContact, cc->szProto, "XStatusMsg")); + ptrW szXStatusMsg(db_get_wsa(hContact, cc->szProto, "XStatusMsg")); if (szXStatusMsg != 0 && *szXStatusMsg) m_xStatusMsg = szXStatusMsg.detach(); } @@ -526,7 +526,7 @@ wchar_t* CContactCache::getNormalizedStatusMsg(const wchar_t *src, bool fStripAl if (src == 0 || mir_wstrlen(src) < 2) return 0; - CMString dest; + CMStringW dest; for (int i = 0; src[i] != 0; i++) { if (src[i] == 0x0d || src[i] == '\t') diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 06d188730a..7d15fcd56d 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -803,7 +803,7 @@ panel_found: char szIndex[10];
itoa(iSelection - IDM_CONTAINERMENU, szIndex, 10);
if (iSelection - IDM_CONTAINERMENU >= 0) {
- ptrW tszName(db_get_tsa(NULL, CONTAINER_KEY, szIndex));
+ ptrW tszName(db_get_wsa(NULL, CONTAINER_KEY, szIndex));
if (tszName != NULL)
SendMessage((HWND)tci.lParam, DM_CONTAINERSELECTED, 0, tszName);
}
@@ -1037,7 +1037,7 @@ panel_found: }
if (dat) {
SendMessage(hwndDlg, DM_SETICON, (WPARAM)dat, (LPARAM)(dat->hXStatusIcon ? dat->hXStatusIcon : dat->hTabStatusIcon));
- CMString szTitle;
+ CMStringW szTitle;
if (Utils::FormatTitleBar(dat, pContainer->settings->szTitleFormat, szTitle))
SetWindowText(hwndDlg, szTitle);
}
@@ -1317,21 +1317,21 @@ panel_found: pContainer->szRelThemeFile[0] = pContainer->szAbsThemeFile[0] = 0;
mir_snprintf(szCname, "%s_theme", CONTAINER_PREFIX);
- if (!db_get_ts(pContainer->hContactFrom, SRMSGMOD_T, szCname, &dbv))
+ if (!db_get_ws(pContainer->hContactFrom, SRMSGMOD_T, szCname, &dbv))
szThemeName = dbv.ptszVal;
}
else {
Utils::ReadPrivateContainerSettings(pContainer);
if (szThemeName == NULL) {
mir_snprintf(szCname, "%s%d_theme", CONTAINER_PREFIX, pContainer->iContainerIndex);
- if (!db_get_ts(NULL, SRMSGMOD_T, szCname, &dbv))
+ if (!db_get_ws(NULL, SRMSGMOD_T, szCname, &dbv))
szThemeName = dbv.ptszVal;
}
}
Utils::SettingsToContainer(pContainer);
if (szThemeName != NULL) {
- PathToAbsoluteT(szThemeName, pContainer->szAbsThemeFile, M.getDataPath());
+ PathToAbsoluteW(szThemeName, pContainer->szAbsThemeFile, M.getDataPath());
wcsncpy_s(pContainer->szRelThemeFile, szThemeName, _TRUNCATE);
db_free(&dbv);
}
@@ -1722,7 +1722,7 @@ panel_found: if (mir_wstrlen(pContainer->szRelThemeFile) > 1) {
if (pContainer->fPrivateThemeChanged == TRUE) {
PathToRelativeT(pContainer->szRelThemeFile, pContainer->szAbsThemeFile, M.getDataPath());
- db_set_ts(hContact, SRMSGMOD_T, szCName, pContainer->szRelThemeFile);
+ db_set_ws(hContact, SRMSGMOD_T, szCName, pContainer->szRelThemeFile);
pContainer->fPrivateThemeChanged = FALSE;
}
}
@@ -1768,7 +1768,7 @@ TContainerData* TSAPI CreateContainer(const wchar_t *name, int iTemp, MCONTACT h do {
char szCounter[10];
itoa(i, szCounter, 10);
- ptrW tszName(db_get_tsa(NULL, CONTAINER_KEY, szCounter));
+ ptrW tszName(db_get_wsa(NULL, CONTAINER_KEY, szCounter));
if (tszName == NULL) {
if (iFirstFree != -1) {
pContainer->iContainerIndex = iFirstFree;
@@ -1776,7 +1776,7 @@ TContainerData* TSAPI CreateContainer(const wchar_t *name, int iTemp, MCONTACT h }
else pContainer->iContainerIndex = i;
- db_set_ts(NULL, CONTAINER_KEY, szCounter, name);
+ db_set_ws(NULL, CONTAINER_KEY, szCounter, name);
BuildContainerMenu();
break;
}
@@ -2016,7 +2016,7 @@ int TSAPI GetContainerNameForContact(MCONTACT hContact, wchar_t *szName, int iNa // use clist group names for containers...
if (M.GetByte("useclistgroups", 0)) {
- ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_wsa(hContact, "CList", "Group"));
if (tszGroup == NULL) {
wcsncpy_s(szName, iNameLen, L"default", _TRUNCATE);
return 0;
@@ -2026,7 +2026,7 @@ int TSAPI GetContainerNameForContact(MCONTACT hContact, wchar_t *szName, int iNa return 1;
}
- ptrW tszContainerName(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
+ ptrW tszContainerName(db_get_wsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
if (tszContainerName == NULL) {
wcsncpy_s(szName, iNameLen, L"default", _TRUNCATE);
return 0;
@@ -2040,14 +2040,14 @@ void TSAPI DeleteContainer(int iIndex) {
char szIndex[10];
itoa(iIndex, szIndex, 10);
- ptrW tszContainerName(db_get_tsa(NULL, CONTAINER_KEY, szIndex));
+ ptrW tszContainerName(db_get_wsa(NULL, CONTAINER_KEY, szIndex));
if (tszContainerName == NULL)
return;
- db_set_ts(NULL, CONTAINER_KEY, szIndex, L"**mir_free**");
+ db_set_ws(NULL, CONTAINER_KEY, szIndex, L"**mir_free**");
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- ptrW tszValue(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
+ ptrW tszValue(db_get_wsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
if (!mir_wstrcmp(tszValue, tszContainerName))
db_unset(hContact, SRMSGMOD_T, CONTAINER_SUBKEY);
}
@@ -2074,16 +2074,16 @@ void TSAPI RenameContainer(int iIndex, const wchar_t *szNew) char szIndex[10];
itoa(iIndex, szIndex, 10);
- ptrW tszContainerName(db_get_tsa(NULL, CONTAINER_KEY, szIndex));
+ ptrW tszContainerName(db_get_wsa(NULL, CONTAINER_KEY, szIndex));
if (tszContainerName == NULL)
return;
- db_set_ts(NULL, CONTAINER_KEY, szIndex, szNew);
+ db_set_ws(NULL, CONTAINER_KEY, szIndex, szNew);
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- ptrW tszValue(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
+ ptrW tszValue(db_get_wsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
if (!mir_wstrcmp(tszValue, tszContainerName))
- db_set_ts(hContact, SRMSGMOD_T, CONTAINER_SUBKEY, szNew);
+ db_set_ws(hContact, SRMSGMOD_T, CONTAINER_SUBKEY, szNew);
}
}
@@ -2105,7 +2105,7 @@ HMENU TSAPI BuildContainerMenu() while (true) {
char szCounter[10];
itoa(i, szCounter, 10);
- ptrW tszName(db_get_tsa(NULL, CONTAINER_KEY, szCounter));
+ ptrW tszName(db_get_wsa(NULL, CONTAINER_KEY, szCounter));
if (tszName == NULL)
break;
diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp index 9dbc431c96..c3adeb98e6 100644 --- a/plugins/TabSRMM/src/containeroptions.cpp +++ b/plugins/TabSRMM/src/containeroptions.cpp @@ -123,9 +123,9 @@ static void ShowPage(HWND hwndDlg, int iPage, BOOL fShow) Utils::showDlgControl(hwndDlg, o_pages[iPage].uIds[i], fShow ? SW_SHOW : SW_HIDE);
}
if (fShow) {
- SetDlgItemText(hwndDlg, IDC_TITLEBOX, TranslateTS(o_pages[iPage].szTitle));
+ SetDlgItemText(hwndDlg, IDC_TITLEBOX, TranslateW(o_pages[iPage].szTitle));
if (o_pages[iPage].szDesc != NULL)
- SetDlgItemText(hwndDlg, IDC_DESC, TranslateTS(o_pages[iPage].szDesc));
+ SetDlgItemText(hwndDlg, IDC_DESC, TranslateW(o_pages[iPage].szDesc));
else
SetDlgItemText(hwndDlg, IDC_DESC, L"");
}
@@ -173,7 +173,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, SendDlgItemMessage(hwndDlg, IDC_OWNAVATARMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Don't show them"));
for (int i = 0; i < nr_layouts; i++)
- SendDlgItemMessage(hwndDlg, IDC_SBARLAYOUT, CB_INSERTSTRING, -1, (LPARAM)TranslateTS(sblayouts[i].szName));
+ SendDlgItemMessage(hwndDlg, IDC_SBARLAYOUT, CB_INSERTSTRING, -1, (LPARAM)TranslateW(sblayouts[i].szName));
/* bits 24 - 31 of dwFlagsEx hold the side bar layout id */
SendDlgItemMessage(hwndDlg, IDC_SBARLAYOUT, CB_SETCURSEL, (WPARAM)((pContainer->settings->dwFlagsEx & 0xff000000) >> 24), 0);
@@ -187,7 +187,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, tvis.hParent = NULL;
tvis.hInsertAfter = TVI_LAST;
tvis.item.mask = TVIF_TEXT | TVIF_PARAM;
- tvis.item.pszText = TranslateTS(o_pages[i].szTitle);
+ tvis.item.pszText = TranslateW(o_pages[i].szTitle);
tvis.item.lParam = i;
HTREEITEM hItem = TreeView_InsertItem(hwndTree, &tvis);
if (i == 0)
@@ -336,7 +336,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, GetDlgItemText(hwndDlg, IDC_THEME, szFilename, _countof(szFilename));
szFilename[MAX_PATH - 1] = 0;
- PathToAbsoluteT(szFilename, szFinalThemeFile, M.getDataPath());
+ PathToAbsoluteW(szFilename, szFinalThemeFile, M.getDataPath());
if (mir_wstrcmp(szFilename, pContainer->szRelThemeFile))
pContainer->fPrivateThemeChanged = TRUE;
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index 5d69e24d89..4507a01a21 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -1010,7 +1010,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR if (PtInRect(&rc, pt) && ((rc.right - rc.left) < size.cx)) {
if (dat->bType == SESSIONTYPE_CHAT) {
- ptrW tszTopic(db_get_tsa(dat->hContact, dat->szProto, "Topic"));
+ ptrW tszTopic(db_get_wsa(dat->hContact, dat->szProto, "Topic"));
if (tszTopic != NULL) {
tooltip_active = TRUE;
CallService("mToolTip/ShowTipW", tszTopic, (LPARAM)&ti);
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 24f0fe2898..9c552aaaa9 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -421,7 +421,7 @@ static wchar_t* ShortenPreview(DBEVENTINFO* dbe) if (iPreviewLimit > 500 || iPreviewLimit == 0)
iPreviewLimit = 500;
- wchar_t *buf = DbGetEventTextT(dbe, CP_ACP);
+ wchar_t *buf = DbGetEventTextW(dbe, CP_ACP);
if (mir_wstrlen(buf) > iPreviewLimit) {
fAddEllipsis = true;
size_t iIndex = iPreviewLimit;
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 365fe0a812..ba3f54c5b9 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -51,7 +51,7 @@ void TSAPI DM_SaveLogAsRTF(const TWindowData *dat) wchar_t szInitialDir[MAX_PATH + 2]; mir_snwprintf(szInitialDir, L"%s%s\\", M.getDataPath(), L"\\Saved message logs"); - CreateDirectoryTreeT(szInitialDir); + CreateDirectoryTreeW(szInitialDir); OPENFILENAME ofn = { 0 }; ofn.lStructSize = sizeof(ofn); @@ -527,7 +527,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, DBVARIANT dbv = { 0 }; - if (0 == db_get_ts(dat->hContact, "UserInfo", "MyNotes", &dbv)) { + if (0 == db_get_ws(dat->hContact, "UserInfo", "MyNotes", &dbv)) { SetDlgItemText(hwndDlg, IDC_MESSAGE, dbv.ptszVal); mir_free(dbv.ptszVal); } @@ -537,7 +537,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, wchar_t *buf = (wchar_t*)mir_alloc((iLen + 2) * sizeof(wchar_t)); GetDlgItemText(hwndDlg, IDC_MESSAGE, buf, iLen + 1); - db_set_ts(dat->hContact, "UserInfo", "MyNotes", buf); + db_set_ws(dat->hContact, "UserInfo", "MyNotes", buf); SetDlgItemText(hwndDlg, IDC_MESSAGE, L""); if (!dat->bIsAutosizingInput) { @@ -981,7 +981,7 @@ static void LoadKLThread(LPVOID _param) Thread_SetName("TabSRMM: LoadKLThread"); DBVARIANT dbv; - if (!db_get_ts((UINT_PTR)_param, SRMSGMOD_T, "locale", &dbv)) { + if (!db_get_ws((UINT_PTR)_param, SRMSGMOD_T, "locale", &dbv)) { HKL hkl = LoadKeyboardLayout(dbv.ptszVal, 0); PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_SETLOCALE, (WPARAM)_param, (LPARAM)hkl); db_free(&dbv); @@ -997,7 +997,7 @@ void TSAPI DM_LoadLocale(TWindowData *dat) return; DBVARIANT dbv; - if (!db_get_ts(dat->hContact, SRMSGMOD_T, "locale", &dbv)) + if (!db_get_ws(dat->hContact, SRMSGMOD_T, "locale", &dbv)) db_free(&dbv); else { wchar_t szKLName[KL_NAMELENGTH + 1]; @@ -1005,11 +1005,11 @@ void TSAPI DM_LoadLocale(TWindowData *dat) wchar_t szBuf[20]; GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, szBuf, 20); mir_snwprintf(szKLName, L"0000%s", szBuf); - db_set_ts(dat->hContact, SRMSGMOD_T, "locale", szKLName); + db_set_ws(dat->hContact, SRMSGMOD_T, "locale", szKLName); } else { GetKeyboardLayoutName(szKLName); - db_set_ts(dat->hContact, SRMSGMOD_T, "locale", szKLName); + db_set_ws(dat->hContact, SRMSGMOD_T, "locale", szKLName); } } @@ -1082,7 +1082,7 @@ void TSAPI DM_SaveLocale(TWindowData *dat, WPARAM, LPARAM lParam) dat->hkl = (HKL)lParam; ActivateKeyboardLayout(dat->hkl, 0); GetKeyboardLayoutName(szKLName); - db_set_ts(dat->hContact, SRMSGMOD_T, "locale", szKLName); + db_set_ws(dat->hContact, SRMSGMOD_T, "locale", szKLName); GetLocaleID(dat, szKLName); UpdateReadChars(dat); } @@ -1764,7 +1764,7 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nClick dropdown to change this contact's favorite status."), bHasName ? dat->cache->getUIN() : TranslateT("No UID")); - SendDlgItemMessage(hwndDlg, IDC_NAME, BUTTONADDTOOLTIP, (WPARAM)fulluin, BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_NAME, BUTTONADDTOOLTIP, (WPARAM)fulluin, BATF_UNICODE); } } else wcsncpy_s(newtitle, L"Message Session", _TRUNCATE); diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index d901380ae2..c66f58eb3c 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -602,7 +602,7 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c) if (szOldStatus == 0 || szNewStatus == 0)
return;
- CMString text;
+ CMStringW text;
if (wStatus == ID_STATUS_OFFLINE)
text = TranslateT("signed off.");
else if (wOldStatus == ID_STATUS_OFFLINE)
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index ca05fe22c8..eef1b2a6a1 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -440,7 +440,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
DBVARIANT dbv;
- if (0 == db_get_ts(hContact, SRMSGMOD_T, "locale", &dbv)) {
+ if (0 == db_get_ws(hContact, SRMSGMOD_T, "locale", &dbv)) {
GetLocaleID(dat, dbv.ptszVal);
db_free(&dbv);
UpdateReadChars(dat);
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index f2888d3f99..99ace42793 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -502,7 +502,7 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) if (M.GetByte("ShowClientDescription", 1)) {
wchar_t temp[256];
- ptrW szVersion(db_get_tsa(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer"));
+ ptrW szVersion(db_get_wsa(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer"));
if (szVersion)
mir_snwprintf(temp, TranslateT(" Client: %s"), szVersion);
else
@@ -644,7 +644,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) pTmp += 2;
if (si->ptszStatusbarText[0] == '[' && pTmp > si->ptszStatusbarText) {
- CMString tszTemp(si->ptszStatusbarText, pTmp - si->ptszStatusbarText);
+ CMStringW tszTemp(si->ptszStatusbarText, pTmp - si->ptszStatusbarText);
CSkin::RenderText(hdc, m_dat->hThemeIP, tszTemp, &rcItem, DT_SINGLELINE | DT_END_ELLIPSIS | DT_NOPREFIX | DT_VCENTER,
CSkin::m_glowSize, m_ipConfig.clrs[IPFONTID_STATUS]);
}
@@ -884,7 +884,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) if (m_hwndConfig)
return;
- CMString str(FORMAT, RTF_DEFAULT_HEADER, 0, 0, 0, 30 * 15);
+ CMStringW str(FORMAT, RTF_DEFAULT_HEADER, 0, 0, 0, 30 * 15);
str.AppendFormat(TranslateT("\\ul\\b Status message:\\ul0\\b0 \\par %s"),
m_dat->cache->getStatusMsg() ? m_dat->cache->getStatusMsg() : TranslateT("No status message"));
@@ -892,7 +892,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) DBVARIANT dbv = { 0 };
if (BYTE xStatus = m_dat->cache->getXStatusId()) {
wchar_t *tszXStatusName = 0;
- if (0 == db_get_ts(m_dat->cache->getContact(), m_dat->cache->getProto(), "XStatusName", &dbv))
+ if (0 == db_get_ws(m_dat->cache->getContact(), m_dat->cache->getProto(), "XStatusName", &dbv))
tszXStatusName = dbv.ptszVal;
else if (xStatus > 0 && xStatus <= 31)
tszXStatusName = xStatusDescr[xStatus - 1];
@@ -910,7 +910,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) if (m_dat->cache->getListeningInfo())
str.AppendFormat(TranslateT("\\par\\par\\ul\\b Listening to:\\ul0\\b0 \\par %s"), m_dat->cache->getListeningInfo());
- if (0 == db_get_ts(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer", &dbv)) {
+ if (0 == db_get_ws(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer", &dbv)) {
str.AppendFormat(TranslateT("\\par\\par\\ul\\b Client:\\ul0\\b0 %s"), dbv.ptszVal);
::db_free(&dbv);
}
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index 73d017a64c..000043e8b6 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -123,9 +123,9 @@ INT_PTR CMimAPI::foldersPathChanged() Utils::ensureTralingBackslash(m_szChatLogsPath); } - CreateDirectoryTreeT(m_szProfilePath); - CreateDirectoryTreeT(m_szSkinsPath); - CreateDirectoryTreeT(m_szSavedAvatarsPath); + CreateDirectoryTreeW(m_szProfilePath); + CreateDirectoryTreeW(m_szSkinsPath); + CreateDirectoryTreeW(m_szSavedAvatarsPath); Skin->extractSkinsAndLogo(true); Skin->setupAeroSkins(); @@ -138,7 +138,7 @@ const wchar_t* CMimAPI::getUserDir() if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) wcsncpy_s(m_userDir, L"%miranda_userdata%", _TRUNCATE); else - wcsncpy_s(m_userDir, VARST(L"%miranda_userdata%"), _TRUNCATE); + wcsncpy_s(m_userDir, VARSW(L"%miranda_userdata%"), _TRUNCATE); Utils::ensureTralingBackslash(m_userDir); } @@ -155,8 +155,8 @@ void CMimAPI::InitPaths() wcsncpy_s(m_szSkinsPath, L"%miranda_path%\\Skins\\TabSRMM", _TRUNCATE); } else { - wcsncpy_s(m_szChatLogsPath, VARST(L"%miranda_logpath%"), _TRUNCATE); - wcsncpy_s(m_szSkinsPath, VARST(L"%miranda_path%\\Skins\\TabSRMM"), _TRUNCATE); + wcsncpy_s(m_szChatLogsPath, VARSW(L"%miranda_logpath%"), _TRUNCATE); + wcsncpy_s(m_szSkinsPath, VARSW(L"%miranda_path%\\Skins\\TabSRMM"), _TRUNCATE); } Utils::ensureTralingBackslash(m_szChatLogsPath); diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp index 333da241f8..120906e8e0 100644 --- a/plugins/TabSRMM/src/modplus.cpp +++ b/plugins/TabSRMM/src/modplus.cpp @@ -44,7 +44,7 @@ static wchar_t* getMenuEntry(int i) {
char MEntry[256];
mir_snprintf(MEntry, "MenuEntry_%u", i);
- return db_get_tsa(NULL, "tabmodplus", MEntry);
+ return db_get_wsa(NULL, "tabmodplus", MEntry);
}
static int RegisterCustomButton(WPARAM, LPARAM)
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index d43e5bb62e..e8ae781eda 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -1281,13 +1281,13 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l TABSRMM_FireEvent(dat->hContact, hwndDlg, MSG_WINDOW_EVT_OPENING, 0);
for (int i = 0; i < _countof(tooltips); i++)
- SendDlgItemMessage(hwndDlg, tooltips[i].id, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(tooltips[i].text), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, tooltips[i].id, BUTTONADDTOOLTIP, (WPARAM)TranslateW(tooltips[i].text), BATF_UNICODE);
SetDlgItemText(hwndDlg, IDC_LOGFROZENTEXT, dat->bNotOnList ? TranslateT("Contact not on list. You may add it...") :
TranslateT("Auto scrolling is disabled (press F12 to enable it)"));
- SendDlgItemMessage(hwndDlg, IDC_SAVE, BUTTONADDTOOLTIP, (WPARAM)pszIDCSAVE_close, BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Click for contact menu\nClick dropdown for window settings"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_SAVE, BUTTONADDTOOLTIP, (WPARAM)pszIDCSAVE_close, BATF_UNICODE);
+ SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Click for contact menu\nClick dropdown for window settings"), BATF_UNICODE);
SetDlgItemText(hwndDlg, IDC_RETRY, TranslateT("Retry"));
{
@@ -1342,7 +1342,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l // restore saved msg if any...
if (dat->hContact) {
- ptrW tszSavedMsg(db_get_tsa(dat->hContact, SRMSGMOD, "SavedMsg"));
+ ptrW tszSavedMsg(db_get_wsa(dat->hContact, SRMSGMOD, "SavedMsg"));
if (tszSavedMsg != 0) {
SETTEXTEX stx = { ST_DEFAULT, 1200 };
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, tszSavedMsg);
@@ -2545,7 +2545,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l mir_snprintf(szIndex, "%d", iSelection - IDM_CONTAINERMENU);
if (iSelection - IDM_CONTAINERMENU >= 0) {
- ptrW val(db_get_tsa(NULL, szKey, szIndex));
+ ptrW val(db_get_wsa(NULL, szKey, szIndex));
if (val)
SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)val);
}
@@ -2623,7 +2623,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (streamOut == NULL)
break;
- CMString decoded(ptrW(mir_utf8decodeW(streamOut)));
+ CMStringW decoded(ptrW(mir_utf8decodeW(streamOut)));
if (decoded.IsEmpty())
break;
@@ -2887,7 +2887,7 @@ quote_from_last: if ((pNewContainer = CreateContainer(szNewName, FALSE, dat->hContact)) == NULL)
break;
- db_set_ts(dat->hContact, SRMSGMOD_T, "containerW", szNewName);
+ db_set_ws(dat->hContact, SRMSGMOD_T, "containerW", szNewName);
dat->fIsReattach = TRUE;
PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_DOCREATETAB, (WPARAM)pNewContainer, dat->hContact);
if (iOldItems > 1) // there were more than 1 tab, container is still valid
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 06c130e036..4f647fdd79 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -187,7 +187,7 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic) ii.hbm = hbm;
ii.dwMask = IMGI_HBITMAP;
ii.fif = FIF_UNKNOWN; // get the format from the filename extension. png is default.
- CallService(MS_IMG_SAVE, (WPARAM)&ii, IMGL_TCHAR);
+ CallService(MS_IMG_SAVE, (WPARAM)&ii, IMGL_WCHAR);
}
}
@@ -834,7 +834,7 @@ char* TSAPI Message_GetFromStream(HWND hwndRtf, DWORD dwPassedFlags) static wchar_t tszRtfBreaks[] = L" \\\n\r";
-static void CreateColorMap(CMString &Text, int iCount, COLORREF *pSrc, int *pDst)
+static void CreateColorMap(CMStringW &Text, int iCount, COLORREF *pSrc, int *pDst)
{
const wchar_t *pszText = Text;
int iIndex = 1;
@@ -881,7 +881,7 @@ static int GetRtfIndex(int iCol, int iCount, int *pIndex) // convert rich edit code to bbcode (if wanted). Otherwise, strip all RTF formatting
// tags and return plain text
-BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors, COLORREF *pColors)
+BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMStringW &pszText, int iNumColors, COLORREF *pColors)
{
if (pszText.IsEmpty())
return FALSE;
@@ -904,7 +904,7 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors else idx += 5;
bool bInsideColor = false, bInsideUl = false;
- CMString res;
+ CMStringW res;
// iterate through all characters, if rtf control character found then take action
for (const wchar_t *p = pszText.GetString() + idx; *p;) {
@@ -1726,7 +1726,7 @@ void TSAPI GetClientIcon(TWindowData *dat) dat->hClientIcon = 0;
if (ServiceExists(MS_FP_GETCLIENTICONT)) {
- ptrW tszMirver(db_get_tsa(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "MirVer"));
+ ptrW tszMirver(db_get_wsa(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "MirVer"));
if (tszMirver)
dat->hClientIcon = Finger_GetClientIcon(tszMirver, 1);
}
@@ -1937,7 +1937,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp) ii.wszName = filename;
ii.dwMask = IMGI_HBITMAP;
ii.fif = FIF_JPEG;
- CallService(MS_IMG_SAVE, (WPARAM)&ii, IMGL_TCHAR);
+ CallService(MS_IMG_SAVE, (WPARAM)&ii, IMGL_WCHAR);
int totalCount = 0;
wchar_t **ppFiles = NULL;
diff --git a/plugins/TabSRMM/src/msgdlgutils.h b/plugins/TabSRMM/src/msgdlgutils.h index 1d7610caca..be46393656 100644 --- a/plugins/TabSRMM/src/msgdlgutils.h +++ b/plugins/TabSRMM/src/msgdlgutils.h @@ -45,7 +45,7 @@ void TSAPI AdjustBottomAvatarDisplay(TWindowData *dat); void TSAPI SetDialogToType(HWND hwndDlg);
void TSAPI FlashOnClist(HWND hwndDlg, TWindowData *dat, MEVENT hEvent, DBEVENTINFO *dbei);
char* TSAPI Message_GetFromStream(HWND hwndRtf, DWORD dwPassedFlags = 0);
-BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors, COLORREF *pColors);
+BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMStringW &pszText, int iNumColors, COLORREF *pColors);
void TSAPI GetMYUIN(TWindowData *dat);
void TSAPI SetMessageLog(TWindowData *dat);
void TSAPI SwitchMessageLog(TWindowData *dat, int iMode);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 088a42847b..6f0a78a476 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -420,7 +420,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, dat->cache->updateStats(TSessionStats::SET_LAST_RCV, mir_strlen((char *)dbei.pBlob));
wchar_t *formatted = NULL;
- wchar_t *msg = DbGetEventTextT(&dbei, CP_UTF8);
+ wchar_t *msg = DbGetEventTextW(&dbei, CP_UTF8);
if (!msg) {
mir_free(dbei.pBlob);
return NULL;
@@ -684,7 +684,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, str.Append(GetRTFFont(iFontIDOffset + (isSent ? MSGFONTID_MYTIME : MSGFONTID_YOURTIME)));
str.AppendChar(' ');
}
- AppendUnicodeToBuffer(str, TranslateTS(months[event_time.tm_mon]), MAKELONG(isSent, dat->bIsHistory));
+ AppendUnicodeToBuffer(str, TranslateW(months[event_time.tm_mon]), MAKELONG(isSent, dat->bIsHistory));
}
else skipToNext = TRUE;
break;
@@ -704,7 +704,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, str.Append(GetRTFFont(iFontIDOffset + (isSent ? MSGFONTID_MYTIME : MSGFONTID_YOURTIME)));
str.AppendChar(' ');
}
- AppendUnicodeToBuffer(str, TranslateTS(weekDays[event_time.tm_wday]), MAKELONG(isSent, dat->bIsHistory));
+ AppendUnicodeToBuffer(str, TranslateW(weekDays[event_time.tm_wday]), MAKELONG(isSent, dat->bIsHistory));
}
else skipToNext = TRUE;
break;
@@ -844,7 +844,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, str.AppendChar(' ');
}
- ptrW tszText(DbGetEventTextT(&dbei, CP_ACP));
+ ptrW tszText(DbGetEventTextW(&dbei, CP_ACP));
AppendUnicodeToBuffer(str, tszText, 0);
}
break;
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index 0be5543c4d..ac5bf6b4ce 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -173,7 +173,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox) FindClose(h);
SendMessage(hwndCombobox, CB_SETCURSEL, 0, 0);
- if (0 == db_get_ts(0, SRMSGMOD_T, "ContainerSkin", &dbv)) {
+ if (0 == db_get_ws(0, SRMSGMOD_T, "ContainerSkin", &dbv)) {
LRESULT lr = SendMessage(hwndCombobox, CB_GETCOUNT, 0, 0);
for (int i = 1; i < lr; i++) {
wchar_t *idata = (wchar_t*)SendMessage(hwndCombobox, CB_GETITEMDATA, i, 0);
@@ -344,7 +344,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L if (lr != CB_ERR && lr > 0) {
wchar_t *tszRelPath = (wchar_t*)SendDlgItemMessage(hwndDlg, IDC_SKINNAME, CB_GETITEMDATA, lr, 0);
if (tszRelPath && tszRelPath != (wchar_t*)CB_ERR)
- db_set_ts(0, SRMSGMOD_T, "ContainerSkin", tszRelPath);
+ db_set_ws(0, SRMSGMOD_T, "ContainerSkin", tszRelPath);
SendMessage(hwndDlg, WM_COMMAND, IDC_RELOADSKIN, 0);
}
else if (lr == 0) { // selected the <no skin> entry
@@ -398,7 +398,7 @@ void TreeViewInit(HWND hwndTree, UINT id, DWORD dwFlags, BOOL bFromMem) tvi.hParent = 0;
tvi.hInsertAfter = TVI_LAST;
tvi.item.mask = TVIF_TEXT | TVIF_STATE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
- tvi.item.pszText = TranslateTS(lvGroups[i].szName);
+ tvi.item.pszText = TranslateW(lvGroups[i].szName);
tvi.item.stateMask = TVIS_EXPANDED | TVIS_BOLD;
tvi.item.state = TVIS_EXPANDED | TVIS_BOLD;
tvi.item.iImage = tvi.item.iSelectedImage = IMG_GRPOPEN;
@@ -408,7 +408,7 @@ void TreeViewInit(HWND hwndTree, UINT id, DWORD dwFlags, BOOL bFromMem) for (int i = 0; lvItems[i].szName != NULL; i++) {
tvi.hParent = (HTREEITEM)lvGroups[lvItems[i].uGroup].handle;
tvi.hInsertAfter = TVI_LAST;
- tvi.item.pszText = TranslateTS(lvItems[i].szName);
+ tvi.item.pszText = TranslateW(lvItems[i].szName);
tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvi.item.lParam = i;
if (bFromMem == FALSE) {
@@ -1096,7 +1096,7 @@ static INT_PTR CALLBACK DlgProcContainerSettings(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_USEAERO, M.GetByte("useAero", 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_USEAEROPEEK, M.GetByte("useAeroPeek", 1) ? BST_CHECKED : BST_UNCHECKED);
for (int i = 0; i < CSkin::AERO_EFFECT_LAST; i++)
- SendDlgItemMessage(hwndDlg, IDC_AEROEFFECT, CB_INSERTSTRING, -1, (LPARAM)TranslateTS(CSkin::m_aeroEffects[i].tszName));
+ SendDlgItemMessage(hwndDlg, IDC_AEROEFFECT, CB_INSERTSTRING, -1, (LPARAM)TranslateW(CSkin::m_aeroEffects[i].tszName));
SendDlgItemMessage(hwndDlg, IDC_AEROEFFECT, CB_SETCURSEL, (WPARAM)CSkin::m_aeroEffect, 0);
Utils::enableDlgControl(hwndDlg, IDC_AEROEFFECT, PluginConfig.m_bIsVista);
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 57be74dd2b..e88962717b 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -816,7 +816,7 @@ static int TSAPI SetupIconLibConfig() SKINICONDESC sid = { 0 };
sid.defaultFile.w = szFilename;
- sid.flags = SIDF_PATH_TCHAR;
+ sid.flags = SIDF_PATH_UNICODE;
for (int n = 0; n < _countof(ICONBLOCKS); n++) {
sid.section.a = ICONBLOCKS[n].szSection;
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp index 6529bfaabf..36386a79b9 100644 --- a/plugins/TabSRMM/src/selectcontainer.cpp +++ b/plugins/TabSRMM/src/selectcontainer.cpp @@ -179,7 +179,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L TContainerData *pContainer = 0;
do {
mir_snprintf(szValue, "%d", iCounter);
- if (db_get_ts(NULL, szKey, szValue, &dbv))
+ if (db_get_ws(NULL, szKey, szValue, &dbv))
break; // end of list
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) {
if (wcsncmp(dbv.ptszVal, L"**mir_free**", CONTAINER_NAMELEN)) {
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index aed683997e..99bab331e2 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -450,13 +450,13 @@ void SendQueue::UpdateSaveAndSendButton(TWindowData *dat) if (len) { // looks complex but avoids flickering on the button while typing. if (!(dat->dwFlags & MWF_SAVEBTN_SAV)) { SendDlgItemMessage(hwndDlg, IDC_SAVE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)PluginConfig.g_buttonBarIcons[ICON_BUTTON_SAVE]); - SendDlgItemMessage(hwndDlg, IDC_SAVE, BUTTONADDTOOLTIP, (WPARAM)pszIDCSAVE_save, BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_SAVE, BUTTONADDTOOLTIP, (WPARAM)pszIDCSAVE_save, BATF_UNICODE); dat->dwFlags |= MWF_SAVEBTN_SAV; } } else { SendDlgItemMessage(hwndDlg, IDC_SAVE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)PluginConfig.g_buttonBarIcons[ICON_BUTTON_CANCEL]); - SendDlgItemMessage(hwndDlg, IDC_SAVE, BUTTONADDTOOLTIP, (WPARAM)pszIDCSAVE_close, BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_SAVE, BUTTONADDTOOLTIP, (WPARAM)pszIDCSAVE_close, BATF_UNICODE); dat->dwFlags &= ~MWF_SAVEBTN_SAV; } dat->textLen = len; @@ -667,7 +667,7 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b if (dat->pContainer->hwndActive == dat->hwnd) UpdateReadChars(dat); SendDlgItemMessage(dat->hwnd, IDC_SAVE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)PluginConfig.g_buttonBarIcons[ICON_BUTTON_CANCEL]); - SendDlgItemMessage(dat->hwnd, IDC_SAVE, BUTTONADDTOOLTIP, (WPARAM)pszIDCSAVE_close, BATF_TCHAR); + SendDlgItemMessage(dat->hwnd, IDC_SAVE, BUTTONADDTOOLTIP, (WPARAM)pszIDCSAVE_close, BATF_UNICODE); dat->dwFlags &= ~MWF_SAVEBTN_SAV; if (!fAvail) diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index 48c8168a55..abdb089cf8 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -81,7 +81,7 @@ static void LoadTemplatesFrom(TTemplateSet *tSet, MCONTACT hContact, int rtl) { for (int i = 0; i <= TMPL_ERRMSG; i++) { DBVARIANT dbv = { 0 }; - if (db_get_ts(hContact, rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[i], &dbv)) + if (db_get_ws(hContact, rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[i], &dbv)) continue; if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) wcsncpy_s(tSet->szTemplates[i], dbv.ptszVal, _TRUNCATE); @@ -96,12 +96,12 @@ void LoadDefaultTemplates() if (M.GetByte(RTLTEMPLATES_MODULE, "setup", 0) < 2) { for (int i = 0; i <= TMPL_ERRMSG; i++) - db_set_ts(NULL, RTLTEMPLATES_MODULE, TemplateNames[i], RTL_Default.szTemplates[i]); + db_set_ws(NULL, RTLTEMPLATES_MODULE, TemplateNames[i], RTL_Default.szTemplates[i]); db_set_b(0, RTLTEMPLATES_MODULE, "setup", 2); } if (M.GetByte(TEMPLATES_MODULE, "setup", 0) < 2) { for (int i = 0; i <= TMPL_ERRMSG; i++) - db_set_ts(NULL, TEMPLATES_MODULE, TemplateNames[i], LTR_Default.szTemplates[i]); + db_set_ws(NULL, TEMPLATES_MODULE, TemplateNames[i], LTR_Default.szTemplates[i]); db_set_b(0, TEMPLATES_MODULE, "setup", 2); } LoadTemplatesFrom(<R_Active, 0, 0); @@ -258,7 +258,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP Utils::enableDlgControl(hwndDlg, IDC_TEMPLATELIST, TRUE); Utils::enableDlgControl(hwndDlg, IDC_REVERT, FALSE); InvalidateRect(GetDlgItem(hwndDlg, IDC_TEMPLATELIST), NULL, FALSE); - db_set_ts(teInfo->hContact, teInfo->rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[teInfo->inEdit], newTemplate); + db_set_ws(teInfo->hContact, teInfo->rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[teInfo->inEdit], newTemplate); SendDlgItemMessage(hwndDlg, IDC_EDITTEMPLATE, EM_SETREADONLY, TRUE, 0); } break; diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index d2ba2c8e3c..f0ea77ee67 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -1002,7 +1002,7 @@ void CImageItem::Colorize(HBITMAP hBitmap, BYTE dr, BYTE dg, BYTE db, BYTE alpha HBITMAP TSAPI CImageItem::LoadPNG(const wchar_t *szFilename)
{
HBITMAP hBitmap = 0;
- hBitmap = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFilename, IMGL_TCHAR);
+ hBitmap = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFilename, IMGL_WCHAR);
return hBitmap;
}
@@ -1015,8 +1015,8 @@ HBITMAP TSAPI CImageItem::LoadPNG(const wchar_t *szFilename) void CSkin::setFileName()
{
DBVARIANT dbv;
- if (0 == db_get_ts(0, SRMSGMOD_T, "ContainerSkin", &dbv)) {
- PathToAbsoluteT(dbv.ptszVal, m_tszFileName, M.getSkinPath());
+ if (0 == db_get_ws(0, SRMSGMOD_T, "ContainerSkin", &dbv)) {
+ PathToAbsoluteW(dbv.ptszVal, m_tszFileName, M.getSkinPath());
db_free(&dbv);
}
else
@@ -1676,7 +1676,7 @@ void CSkin::setupAeroSkins() mir_snwprintf(tszFilename, L"%scustom_unknown.png", tszBasePath);
if (!PathFileExists(tszFilename))
mir_snwprintf(tszFilename, L"%sunknown.png", tszBasePath);
- PluginConfig.g_hbmUnknown = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_TCHAR);
+ PluginConfig.g_hbmUnknown = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_WCHAR);
if (PluginConfig.g_hbmUnknown == 0) {
HDC dc = GetDC(0);
PluginConfig.g_hbmUnknown = CreateCompatibleBitmap(dc, 20, 20);
@@ -1733,7 +1733,7 @@ void CSkin::setupAeroSkins() m_dwmColorRGB = RGB((BYTE)fr, (BYTE)fg, (BYTE)fb);
- FIBITMAP *fib = (FIBITMAP *)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_TCHAR | IMGL_RETURNDIB);
+ FIBITMAP *fib = (FIBITMAP *)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_WCHAR | IMGL_RETURNDIB);
HBITMAP hbm = FIF->FI_CreateHBITMAPFromDIB(fib);
@@ -1775,7 +1775,7 @@ void CSkin::setupAeroSkins() if (!PathFileExists(tszFilename))
mir_snwprintf(tszFilename, L"%stabskin_aero_glow.png", tszBasePath);
- fib = (FIBITMAP *)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_TCHAR | IMGL_RETURNDIB);
+ fib = (FIBITMAP *)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_WCHAR | IMGL_RETURNDIB);
COLORREF glowColor = M.GetDword(FONTMODULE, "aeroGlow", RGB(40, 40, 255));
hbm = FIF->FI_CreateHBITMAPFromDIB(fib);
@@ -1808,7 +1808,7 @@ void CSkin::setupAeroSkins() if (!PathFileExists(tszFilename))
mir_snwprintf(tszFilename, L"%stabskin_aero_button.png", tszBasePath);
- hbm = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_TCHAR);
+ hbm = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_WCHAR);
CImageItem::Colorize(hbm, GetRValue(m_dwmColorRGB),
GetGValue(m_dwmColorRGB),
@@ -2442,7 +2442,7 @@ void CSkin::extractSkinsAndLogo(bool fForceOverwrite) const if (tszBasePath[mir_wstrlen(tszBasePath) - 1] != '\\')
mir_wstrcat(tszBasePath, L"\\");
- CreateDirectoryTreeT(tszBasePath);
+ CreateDirectoryTreeW(tszBasePath);
m_fAeroSkinsValid = true;
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp index 0c05c1ba27..08dd764a9c 100644 --- a/plugins/TabSRMM/src/typingnotify.cpp +++ b/plugins/TabSRMM/src/typingnotify.cpp @@ -60,7 +60,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA switch (message) {
case WM_COMMAND:
if (HIWORD(wParam) == STN_CLICKED) {
- CallService(MS_MSG_SENDMESSAGET, (WPARAM)PUGetContact(hWnd), 0);
+ CallService(MS_MSG_SENDMESSAGEW, (WPARAM)PUGetContact(hWnd), 0);
PUDeletePopup(hWnd);
return 1;
}
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 5ce367b1a0..644134e6dd 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -241,7 +241,7 @@ static wchar_t* Trunc500(wchar_t *str) return str;
}
-bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMString &dest)
+bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMStringW &dest)
{
if (dat == 0)
return false;
@@ -286,7 +286,7 @@ bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMSt {
BYTE xStatus = dat->cache->getXStatusId();
if (dat->wStatus != ID_STATUS_OFFLINE && xStatus > 0 && xStatus <= 31) {
- ptrW szXStatus(db_get_tsa(dat->hContact, dat->szProto, "XStatusName"));
+ ptrW szXStatus(db_get_wsa(dat->hContact, dat->szProto, "XStatusName"));
dest.Append((szXStatus != NULL) ? Trunc500(szXStatus) : xStatusDescr[xStatus - 1]);
}
}
@@ -296,7 +296,7 @@ bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMSt {
BYTE xStatus = dat->cache->getXStatusId();
if (dat->wStatus != ID_STATUS_OFFLINE && xStatus > 0 && xStatus <= 31) {
- ptrW szXStatus(db_get_tsa(dat->hContact, dat->szProto, "XStatusName"));
+ ptrW szXStatus(db_get_wsa(dat->hContact, dat->szProto, "XStatusName"));
dest.Append((szXStatus != NULL) ? Trunc500(szXStatus) : xStatusDescr[xStatus - 1]);
}
else dest.Append(dat->szStatus && dat->szStatus[0] ? dat->szStatus : L"(undef)");
@@ -317,7 +317,7 @@ bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMSt case 'g':
{
- ptrW tszGroup(db_get_tsa(dat->hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_wsa(dat->hContact, "CList", "Group"));
if (tszGroup != NULL)
dest.Append(tszGroup);
}
@@ -363,7 +363,7 @@ WCHAR* Utils::FilterEventMarkers(WCHAR *wszText) void Utils::DoubleAmpersands(wchar_t *pszText, size_t len)
{
- CMString text(pszText);
+ CMStringW text(pszText);
text.Replace(L"&", L"&&");
mir_wstrncpy(pszText, text.c_str(), len);
}
@@ -573,7 +573,7 @@ void Utils::SaveContainerSettings(TContainerData *pContainer, const char *szSett if (mir_wstrlen(pContainer->szRelThemeFile) > 1) {
if (pContainer->fPrivateThemeChanged == TRUE) {
PathToRelativeT(pContainer->szRelThemeFile, pContainer->szAbsThemeFile, M.getDataPath());
- db_set_ts(NULL, SRMSGMOD_T, szCName, pContainer->szAbsThemeFile);
+ db_set_ws(NULL, SRMSGMOD_T, szCName, pContainer->szAbsThemeFile);
pContainer->fPrivateThemeChanged = FALSE;
}
}
@@ -1084,14 +1084,14 @@ LRESULT CWarning::show(const int uId, DWORD dwFlags, const wchar_t* tszTxt) else {
if (uId != -1) {
if (dwFlags & CWF_UNTRANSLATED)
- _s = TranslateTS(warnings[uId]);
+ _s = TranslateW(warnings[uId]);
else {
// revert to untranslated warning when the translated message
// is not well-formatted.
- _s = TranslateTS(warnings[uId]);
+ _s = TranslateW(warnings[uId]);
if (mir_wstrlen(_s) < 3 || 0 == wcschr(_s, '|'))
- _s = TranslateTS(warnings[uId]);
+ _s = TranslateW(warnings[uId]);
}
}
else
diff --git a/plugins/TabSRMM/src/utils.h b/plugins/TabSRMM/src/utils.h index cd6ca460a8..ce3ef737b1 100644 --- a/plugins/TabSRMM/src/utils.h +++ b/plugins/TabSRMM/src/utils.h @@ -56,7 +56,7 @@ public: static wchar_t* GetPreviewWithEllipsis(wchar_t *szText, size_t iMaxLen);
static wchar_t* FilterEventMarkers(wchar_t *wszText);
static LPCTSTR FormatRaw(TWindowData *dat, const wchar_t *msg, int flags, BOOL isSent);
- static bool FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMString &dest);
+ static bool FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMStringW &dest);
static char* FilterEventMarkers(char *szText);
static void DoubleAmpersands(wchar_t *pszText, size_t len);
static void RTF_CTableInit();
diff --git a/plugins/TipperYM/src/bitmap_func.cpp b/plugins/TipperYM/src/bitmap_func.cpp index fe9ecfce84..dcaf7b776c 100644 --- a/plugins/TipperYM/src/bitmap_func.cpp +++ b/plugins/TipperYM/src/bitmap_func.cpp @@ -154,7 +154,7 @@ void CreateFromBitmaps(bool bServiceTip) if (tszFileName && *tszFileName != 0) {
FIBITMAP *fib = NULL;
if (!skin.bCached) {
- FIBITMAP *fibLoad = (FIBITMAP *)CallService(MS_IMG_LOAD, (WPARAM)tszFileName, IMGL_TCHAR | IMGL_RETURNDIB);
+ FIBITMAP *fibLoad = (FIBITMAP *)CallService(MS_IMG_LOAD, (WPARAM)tszFileName, IMGL_WCHAR | IMGL_RETURNDIB);
if (!fibLoad) continue;
if (fii->FI_GetBPP(fibLoad) != 32)
diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp index 558faed14f..f0e86cabb9 100644 --- a/plugins/TipperYM/src/message_pump.cpp +++ b/plugins/TipperYM/src/message_pump.cpp @@ -161,7 +161,7 @@ unsigned int CALLBACK MessagePumpThread(void*) }
if (swzMsg) {
- db_set_ts((DWORD_PTR)clcitex->hItem, MODULE, "TempStatusMsg", swzMsg);
+ db_set_ws((DWORD_PTR)clcitex->hItem, MODULE, "TempStatusMsg", swzMsg);
mir_free(swzMsg);
}
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index ae1b3e931b..157982366c 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -36,7 +36,7 @@ extern int IsTrayProto(const wchar_t *swzProto, BOOL bExtendedTip) DBVARIANT dbv;
int result = 1;
- if (!db_get_ts(NULL, MODULE, szSetting, &dbv)) {
+ if (!db_get_ws(NULL, MODULE, szSetting, &dbv)) {
result = wcsstr(dbv.ptszVal, swzProto) ? 1 : 0;
db_free(&dbv);
}
@@ -77,7 +77,7 @@ void CreateDefaultItems() }
DIListNode *di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
- wcsncpy(di_node->di.swzLabel, TranslateTS(item->swzLabel), LABEL_LEN);
+ wcsncpy(di_node->di.swzLabel, TranslateW(item->swzLabel), LABEL_LEN);
wcsncpy(di_node->di.swzValue, item->swzValue, VALUE_LEN);
di_node->di.bLineAbove = false;
di_node->di.bValueNewline = defaultItemList[i].bValueNewline;
@@ -97,7 +97,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index) mir_snprintf(setting, "Name%d", index);
ds->swzName[0] = 0;
- if (db_get_ts(0, MODULE_ITEMS, setting, &dbv))
+ if (db_get_ws(0, MODULE_ITEMS, setting, &dbv))
return false;
wcsncpy(ds->swzName, dbv.ptszVal, _countof(ds->swzName));
@@ -140,7 +140,7 @@ void SaveDS(DISPLAYSUBST *ds, int index) char setting[512];
mir_snprintf(setting, "Name%d", index);
- db_set_ts(0, MODULE_ITEMS, setting, ds->swzName);
+ db_set_ws(0, MODULE_ITEMS, setting, ds->swzName);
mir_snprintf(setting, "Type%d", index);
db_set_b(0, MODULE_ITEMS, setting, (BYTE)ds->type);
mir_snprintf(setting, "Module%d", index);
@@ -158,7 +158,7 @@ bool LoadDI(DISPLAYITEM *di, int index) mir_snprintf(setting, "DILabel%d", index);
di->swzLabel[0] = 0;
- if (db_get_ts(0, MODULE_ITEMS, setting, &dbv))
+ if (db_get_ws(0, MODULE_ITEMS, setting, &dbv))
return false;
wcsncpy(di->swzLabel, dbv.ptszVal, _countof(di->swzLabel));
@@ -167,7 +167,7 @@ bool LoadDI(DISPLAYITEM *di, int index) mir_snprintf(setting, "DIValue%d", index);
di->swzValue[0] = 0;
- if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv)) {
+ if (!db_get_ws(0, MODULE_ITEMS, setting, &dbv)) {
wcsncpy(di->swzValue, dbv.ptszVal, _countof(di->swzValue));
di->swzValue[_countof(di->swzValue) - 1] = 0;
db_free(&dbv);
@@ -192,14 +192,14 @@ void SaveDI(DISPLAYITEM *di, int index) char setting[512];
mir_snprintf(setting, "DILabel%d", index);
- if (db_set_ts(0, MODULE_ITEMS, setting, di->swzLabel)) {
+ if (db_set_ws(0, MODULE_ITEMS, setting, di->swzLabel)) {
char buff[LABEL_LEN];
t2a(di->swzLabel, buff, LABEL_LEN);
db_set_s(0, MODULE_ITEMS, setting, buff);
}
mir_snprintf(setting, "DIValue%d", index);
- if (db_set_ts(0, MODULE_ITEMS, setting, di->swzValue)) {
+ if (db_set_ws(0, MODULE_ITEMS, setting, di->swzValue)) {
char buff[VALUE_LEN];
t2a(di->swzValue, buff, VALUE_LEN);
db_set_s(0, MODULE_ITEMS, setting, buff);
@@ -307,7 +307,7 @@ void LoadObsoleteSkinSetting() mir_snprintf(setting, "SPaintMode%d", i);
opt.transfMode[i] = (TransformationMode)db_get_b(0, MODULE, setting, 0);
mir_snprintf(setting, "SImgFile%d", i);
- if (!db_get_ts(NULL, MODULE, setting, &dbv)) {
+ if (!db_get_ws(NULL, MODULE, setting, &dbv)) {
opt.szImgFile[i] = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -515,7 +515,7 @@ void LoadOptions() LoadObsoleteSkinSetting();
}
else if (opt.skinMode == SM_IMAGE) {
- if (!db_get_ts(NULL, MODULE, "SkinName", &dbv)) {
+ if (!db_get_ws(NULL, MODULE, "SkinName", &dbv)) {
wcsncpy(opt.szSkinName, dbv.ptszVal, _countof(opt.szSkinName) - 1);
db_free(&dbv);
}
@@ -544,7 +544,7 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SetDlgItemText(hwndDlg, IDC_ED_VALUE, di->swzValue);
for (int i = 0; i < _countof(displayItemTypes); i++) {
- int index = SendDlgItemMessage(hwndDlg, IDC_CMB_TYPE, CB_ADDSTRING, (WPARAM)-1, (LPARAM)TranslateTS(displayItemTypes[i].title));
+ int index = SendDlgItemMessage(hwndDlg, IDC_CMB_TYPE, CB_ADDSTRING, (WPARAM)-1, (LPARAM)TranslateW(displayItemTypes[i].title));
SendDlgItemMessage(hwndDlg, IDC_CMB_TYPE, CB_SETITEMDATA, index, (LPARAM)displayItemTypes[i].type);
if (displayItemTypes[i].type == di->type)
SendDlgItemMessage(hwndDlg, IDC_CMB_TYPE, CB_SETCURSEL, index, 0);
@@ -555,7 +555,7 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP CheckDlgButton(hwndDlg, IDC_CHK_PARSETIPPERFIRST, di->bParseTipperVarsFirst ? BST_CHECKED : BST_UNCHECKED);
for (int i = 0; presetItems[i].szID; i++)
- SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_ADDSTRING, 0, (LPARAM)TranslateTS(presetItems[i].swzName));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_ADDSTRING, 0, (LPARAM)TranslateW(presetItems[i].swzName));
variables_skin_helpbutton(hwndDlg, IDC_BTN_VARIABLE);
@@ -587,7 +587,7 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP wchar_t buff[256];
SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
for (int i = 0; presetItems[i].szID; i++) {
- if (mir_wstrcmp(buff, TranslateTS(presetItems[i].swzName)) == 0) {
+ if (mir_wstrcmp(buff, TranslateW(presetItems[i].swzName)) == 0) {
if (presetItems[i].szNeededSubst[0])
EndDialog(hwndDlg, IDPRESETITEM + i);
else
@@ -623,8 +623,8 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP wchar_t buff[256];
SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
for (int i = 0; presetItems[i].szID; i++) {
- if (mir_wstrcmp(buff, TranslateTS(presetItems[i].swzName)) == 0) {
- SetDlgItemText(hwndDlg, IDC_ED_LABEL, TranslateTS(presetItems[i].swzLabel));
+ if (mir_wstrcmp(buff, TranslateW(presetItems[i].swzName)) == 0) {
+ SetDlgItemText(hwndDlg, IDC_ED_LABEL, TranslateW(presetItems[i].swzLabel));
SetDlgItemText(hwndDlg, IDC_ED_VALUE, presetItems[i].swzValue);
break;
}
@@ -664,7 +664,7 @@ INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l }
for (int i = 0; i < iTransFuncsCount; i++) {
- int index = SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_ADDSTRING, (WPARAM)-1, (LPARAM)TranslateTS(translations[i].swzName));
+ int index = SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_ADDSTRING, (WPARAM)-1, (LPARAM)TranslateW(translations[i].swzName));
SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_SETITEMDATA, index, (LPARAM)translations[i].id);
}
@@ -769,7 +769,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA for (int i = 0; i < _countof(btns); i++) {
SendDlgItemMessage(hwndDlg, btns[i].id, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, btns[i].id, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(btns[i].swzTooltip), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, btns[i].id, BUTTONADDTOOLTIP, (WPARAM)TranslateW(btns[i].swzTooltip), BATF_UNICODE);
if (btns[i].uintCoreIconId)
SendDlgItemMessage(hwndDlg, btns[i].id, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadIcon(btns[i].uintCoreIconId));
else {
@@ -1463,7 +1463,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM tvi.item.stateMask = TVIS_STATEIMAGEMASK;
for (int i = 0; i < _countof(extraIconName); i++) {
tvi.item.lParam = (LPARAM)&exIcons[i];
- tvi.item.pszText = TranslateTS(extraIconName[exIcons[i].order]);
+ tvi.item.pszText = TranslateW(extraIconName[exIcons[i].order]);
tvi.item.state = INDEXTOSTATEIMAGEMASK(exIcons[i].vis ? 2 : 1);
TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &tvi);
}
@@ -1703,19 +1703,19 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l iLastSel = RefreshSkinList(hwndDlg);
SendDlgItemMessage(hwndDlg, IDC_BTN_RELOADLIST, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_BTN_RELOADLIST, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Reload skin list"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_RELOADLIST, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Reload skin list"), BATF_UNICODE);
HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RELOAD));
SendDlgItemMessage(hwndDlg, IDC_BTN_RELOADLIST, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
SendDlgItemMessage(hwndDlg, IDC_BTN_APPLYSKIN, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_BTN_APPLYSKIN, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Apply skin"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_APPLYSKIN, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Apply skin"), BATF_UNICODE);
hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_APPLY));
SendDlgItemMessage(hwndDlg, IDC_BTN_APPLYSKIN, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
SendDlgItemMessage(hwndDlg, IDC_BTN_GETSKINS, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_BTN_GETSKINS, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Get more skins"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_GETSKINS, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Get more skins"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_BTN_GETSKINS, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadIcon(SKINICON_EVENT_URL));
@@ -1751,7 +1751,7 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (opt.szPreviewFile[0]) {
HDC hdcMem = CreateCompatibleDC(dis->hDC);
- HBITMAP hbmpPreview = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)opt.szPreviewFile, IMGL_TCHAR);
+ HBITMAP hbmpPreview = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)opt.szPreviewFile, IMGL_WCHAR);
if (hbmpPreview) {
int iWidth = dis->rcItem.right - dis->rcItem.left;
int iHeight = dis->rcItem.bottom - dis->rcItem.top;
@@ -1828,7 +1828,7 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l }
db_set_b(0, MODULE, "SkinEngine", opt.skinMode);
- db_set_ts(0, MODULE, "SkinName", opt.szSkinName);
+ db_set_ws(0, MODULE, "SkinName", opt.szSkinName);
DestroySkinBitmap();
SetDlgItemInt(hwndDlg, IDC_ED_TRANS, opt.iOpacity, FALSE);
@@ -1976,7 +1976,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
for (i = 0; i < _countof(trayTipItems); i++) {
- tvi.item.pszText = TranslateTS(trayTipItems[i]);
+ tvi.item.pszText = TranslateW(trayTipItems[i]);
tvi.item.state = INDEXTOSTATEIMAGEMASK(opt.iFirstItems & (1 << i) ? 2 : 1);
TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi);
tvi.item.state = INDEXTOSTATEIMAGEMASK(opt.iSecondItems & (1 << i) ? 2 : 1);
@@ -2045,7 +2045,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), item.hItem);
}
- db_set_ts(0, MODULE, "TrayProtocols", swzProtos);
+ db_set_ws(0, MODULE, "TrayProtocols", swzProtos);
swzProtos[0] = 0;
item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS));
@@ -2060,7 +2060,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), item.hItem);
}
- db_set_ts(0, MODULE, "TrayProtocolsEx", swzProtos);
+ db_set_ws(0, MODULE, "TrayProtocolsEx", swzProtos);
int count = 0;
opt.iFirstItems = 0;
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 117758d058..f10def056c 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -382,7 +382,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (pwd->bIsIconVisible[5]) { for (i = 0; opt.exIconsOrder[i] != 5; i++); if (ServiceExists(MS_FP_GETCLIENTICONT)) { - ptrW tszVersion(db_get_tsa(pwd->hContact, szProto, "MirVer")); + ptrW tszVersion(db_get_wsa(pwd->hContact, szProto, "MirVer")); if (tszVersion != NULL) { pwd->extraIcons[i].hIcon = Finger_GetClientIcon(tszVersion, 0); pwd->extraIcons[i].bDestroy = true; @@ -965,7 +965,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa case PUM_SETSTATUSTEXT: if (pwd && wParam == pwd->hContact) { - db_set_ts(pwd->hContact, MODULE, "TempStatusMsg", (wchar_t *)lParam); + db_set_ws(pwd->hContact, MODULE, "TempStatusMsg", (wchar_t *)lParam); pwd->bIsPainted = false; pwd->bNeedRefresh = true; SendMessage(hwnd, PUM_REFRESH_VALUES, TRUE, 0); diff --git a/plugins/TipperYM/src/skin_parser.cpp b/plugins/TipperYM/src/skin_parser.cpp index c115fd6643..8aa9c4869c 100644 --- a/plugins/TipperYM/src/skin_parser.cpp +++ b/plugins/TipperYM/src/skin_parser.cpp @@ -209,7 +209,7 @@ void ParseFontPart(FILE *fp, wchar_t *buff) if (mir_wstrlen(pch) > 32)
pch[32] = 0;
- db_set_ts(0, MODULE, szSetting, pch);
+ db_set_ws(0, MODULE, szSetting, pch);
}
}
else if (wcsstr(buff, L"color"))
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index bbcce4b4e7..a68dae28fa 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -173,7 +173,7 @@ wchar_t* GetLastMessageText(MCONTACT hContact, bool received) if (dbei.cbBlob == 0 || dbei.pBlob == 0) return 0; - wchar_t *buff = DbGetEventTextT( &dbei, CP_ACP ); + wchar_t *buff = DbGetEventTextW( &dbei, CP_ACP ); wchar_t *swzMsg = mir_wstrdup(buff); mir_free(buff); @@ -220,7 +220,7 @@ wchar_t* GetStatusMessageText(MCONTACT hContact) if (wStatus == ID_STATUS_OFFLINE) return NULL; - if (!db_get_ts(hContact, MODULE, "TempStatusMsg", &dbv)) { + if (!db_get_ws(hContact, MODULE, "TempStatusMsg", &dbv)) { if (mir_wstrlen(dbv.ptszVal) != 0) swzMsg = mir_wstrdup(dbv.ptszVal); db_free(&dbv); @@ -232,7 +232,7 @@ wchar_t* GetStatusMessageText(MCONTACT hContact) if (ProtoChainSend(hContact, PSS_GETAWAYMSG, 0, 0)) return NULL; - if (!db_get_ts(hContact, "CList", "StatusMsg", &dbv)) { + if (!db_get_ws(hContact, "CList", "StatusMsg", &dbv)) { if (mir_wstrlen(dbv.ptszVal) != 0) swzMsg = mir_wstrdup(dbv.ptszVal); db_free(&dbv); @@ -694,9 +694,9 @@ wchar_t* GetProtoStatusMessage(char *szProto, WORD wStatus) if (!(flags & Proto_Status2Flag(wStatus))) return NULL; - wchar_t *ptszText = (wchar_t *)CallProtoService(szProto, PS_GETMYAWAYMSG, 0, SGMA_TCHAR); + wchar_t *ptszText = (wchar_t *)CallProtoService(szProto, PS_GETMYAWAYMSG, 0, SGMA_UNICODE); if ((INT_PTR)ptszText == CALLSERVICE_NOTFOUND) - ptszText = (wchar_t *)CallService(MS_AWAYMSG_GETSTATUSMSGT, wStatus, (LPARAM)szProto); + ptszText = (wchar_t *)CallService(MS_AWAYMSG_GETSTATUSMSGW, wStatus, (LPARAM)szProto); else if (ptszText == NULL) { // try to use service without SGMA_TCHAR @@ -724,7 +724,7 @@ wchar_t* GetProtoExtraStatusTitle(char *szProto) if (!szProto) return NULL; - wchar_t *ptszText = db_get_tsa(0, szProto, "XStatusName"); + wchar_t *ptszText = db_get_wsa(0, szProto, "XStatusName"); if (!ptszText) { wchar_t buff[256]; if (EmptyXStatusToDefaultName(0, szProto, 0, buff, 256)) @@ -742,7 +742,7 @@ wchar_t* GetProtoExtraStatusMessage(char *szProto) if (!szProto) return NULL; - wchar_t *ptszText = db_get_tsa(0, szProto, "XStatusMsg"); + wchar_t *ptszText = db_get_wsa(0, szProto, "XStatusMsg"); if (ptszText == NULL) return NULL; @@ -778,7 +778,7 @@ wchar_t* GetListeningTo(char *szProto) if (!szProto) return NULL; - wchar_t *ptszText = db_get_tsa(0, szProto, "ListeningTo"); + wchar_t *ptszText = db_get_wsa(0, szProto, "ListeningTo"); if (opt.bLimitMsg) TruncateString(ptszText); @@ -792,7 +792,7 @@ wchar_t* GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *s char szSetting[128]; mir_snprintf(szSetting, "%s/%s/%s", szProto, szSlot, szValue); - wchar_t *ptszText = db_get_tsa(0, "AdvStatus", szSetting); + wchar_t *ptszText = db_get_wsa(0, "AdvStatus", szSetting); if (opt.bLimitMsg) TruncateString(ptszText); diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp index 4442d56285..6fc17f394d 100644 --- a/plugins/TipperYM/src/tipper.cpp +++ b/plugins/TipperYM/src/tipper.cpp @@ -22,8 +22,8 @@ Boston, MA 02111-1307, USA. HMODULE hInst;
-FontIDT fontTitle, fontLabels, fontValues, fontTrayTitle;
-ColourIDT colourBg, colourBorder, colourAvatarBorder, colourDivider, colourSidebar;
+FontIDW fontTitle, fontLabels, fontValues, fontTrayTitle;
+ColourIDW colourBg, colourBorder, colourAvatarBorder, colourDivider, colourSidebar;
HFONT hFontTitle, hFontLabels, hFontValues, hFontTrayTitle;
// hooked here so it's in the main thread
@@ -69,23 +69,23 @@ int ReloadFont(WPARAM, LPARAM) {
LOGFONT logFont;
if (hFontTitle) DeleteObject(hFontTitle);
- opt.colTitle = CallService(MS_FONT_GETT, (WPARAM)&fontTitle, (LPARAM)&logFont);
+ opt.colTitle = CallService(MS_FONT_GETW, (WPARAM)&fontTitle, (LPARAM)&logFont);
hFontTitle = CreateFontIndirect(&logFont);
if (hFontLabels) DeleteObject(hFontLabels);
- opt.colLabel = CallService(MS_FONT_GETT, (WPARAM)&fontLabels, (LPARAM)&logFont);
+ opt.colLabel = CallService(MS_FONT_GETW, (WPARAM)&fontLabels, (LPARAM)&logFont);
hFontLabels = CreateFontIndirect(&logFont);
if (hFontValues) DeleteObject(hFontValues);
- opt.colValue = CallService(MS_FONT_GETT, (WPARAM)&fontValues, (LPARAM)&logFont);
+ opt.colValue = CallService(MS_FONT_GETW, (WPARAM)&fontValues, (LPARAM)&logFont);
hFontValues = CreateFontIndirect(&logFont);
if (hFontTrayTitle) DeleteObject(hFontTrayTitle);
- opt.colTrayTitle = CallService(MS_FONT_GETT, (WPARAM)&fontTrayTitle, (LPARAM)&logFont);
+ opt.colTrayTitle = CallService(MS_FONT_GETW, (WPARAM)&fontTrayTitle, (LPARAM)&logFont);
hFontTrayTitle = CreateFontIndirect(&logFont);
- opt.colBg = CallService(MS_COLOUR_GETT, (WPARAM)&colourBg, 0);
- opt.colBorder = CallService(MS_COLOUR_GETT, (WPARAM)&colourBorder, 0);
- opt.colAvatarBorder = CallService(MS_COLOUR_GETT, (WPARAM)&colourAvatarBorder, 0);
- opt.colSidebar = CallService(MS_COLOUR_GETT, (WPARAM)&colourSidebar, 0);
- opt.colDivider = CallService(MS_COLOUR_GETT, (WPARAM)&colourDivider, 0);
+ opt.colBg = CallService(MS_COLOUR_GETW, (WPARAM)&colourBg, 0);
+ opt.colBorder = CallService(MS_COLOUR_GETW, (WPARAM)&colourBorder, 0);
+ opt.colAvatarBorder = CallService(MS_COLOUR_GETW, (WPARAM)&colourAvatarBorder, 0);
+ opt.colSidebar = CallService(MS_COLOUR_GETW, (WPARAM)&colourSidebar, 0);
+ opt.colDivider = CallService(MS_COLOUR_GETW, (WPARAM)&colourDivider, 0);
return 0;
}
@@ -123,52 +123,52 @@ int ReloadSkinFolder(WPARAM, LPARAM) void InitFonts()
{
- colourBg.cbSize = sizeof(ColourIDT);
+ colourBg.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colourBg.group, LPGENW("Tooltips"));
mir_wstrcpy(colourBg.name, LPGENW("Background"));
mir_strcpy(colourBg.dbSettingsGroup, MODULE);
mir_strcpy(colourBg.setting, "ColourBg");
colourBg.defcolour = RGB(219, 219, 219);
colourBg.order = 0;
- ColourRegisterT(&colourBg);
+ ColourRegisterW(&colourBg);
- colourBorder.cbSize = sizeof(ColourIDT);
+ colourBorder.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colourBorder.group, LPGENW("Tooltips"));
mir_wstrcpy(colourBorder.name, LPGENW("Border"));
mir_strcpy(colourBorder.dbSettingsGroup, MODULE);
mir_strcpy(colourBorder.setting, "BorderCol");
colourBorder.defcolour = 0;
colourBorder.order = 0;
- ColourRegisterT(&colourBorder);
+ ColourRegisterW(&colourBorder);
- colourAvatarBorder.cbSize = sizeof(ColourIDT);
+ colourAvatarBorder.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colourAvatarBorder.group, LPGENW("Tooltips"));
mir_wstrcpy(colourAvatarBorder.name, LPGENW("Avatar border"));
mir_strcpy(colourAvatarBorder.dbSettingsGroup, MODULE);
mir_strcpy(colourAvatarBorder.setting, "AvBorderCol");
colourAvatarBorder.defcolour = 0;
colourAvatarBorder.order = 0;
- ColourRegisterT(&colourAvatarBorder);
+ ColourRegisterW(&colourAvatarBorder);
- colourDivider.cbSize = sizeof(ColourIDT);
+ colourDivider.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colourDivider.group, LPGENW("Tooltips"));
mir_wstrcpy(colourDivider.name, LPGENW("Dividers"));
mir_strcpy(colourDivider.dbSettingsGroup, MODULE);
mir_strcpy(colourDivider.setting, "DividerCol");
colourDivider.defcolour = 0;
colourDivider.order = 0;
- ColourRegisterT(&colourDivider);
+ ColourRegisterW(&colourDivider);
- colourSidebar.cbSize = sizeof(ColourIDT);
+ colourSidebar.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colourSidebar.group, LPGENW("Tooltips"));
mir_wstrcpy(colourSidebar.name, LPGENW("Sidebar"));
mir_strcpy(colourSidebar.dbSettingsGroup, MODULE);
mir_strcpy(colourSidebar.setting, "SidebarCol");
colourSidebar.defcolour = RGB(192, 192, 192);
colourSidebar.order = 0;
- ColourRegisterT(&colourSidebar);
+ ColourRegisterW(&colourSidebar);
- fontTitle.cbSize = sizeof(FontIDT);
+ fontTitle.cbSize = sizeof(FontIDW);
fontTitle.flags = FIDF_ALLOWEFFECTS;
mir_wstrcpy(fontTitle.group, LPGENW("Tooltips"));
mir_wstrcpy(fontTitle.name, LPGENW("Title"));
@@ -184,7 +184,7 @@ void InitFonts() fontTitle.deffontsettings.colour = RGB(255, 0, 0);
fontTitle.flags |= FIDF_DEFAULTVALID;
- fontLabels.cbSize = sizeof(FontIDT);
+ fontLabels.cbSize = sizeof(FontIDW);
fontLabels.flags = FIDF_ALLOWEFFECTS;
mir_wstrcpy(fontLabels.group, LPGENW("Tooltips"));
mir_wstrcpy(fontLabels.name, LPGENW("Labels"));
@@ -200,7 +200,7 @@ void InitFonts() fontLabels.deffontsettings.colour = RGB(128, 128, 128);
fontLabels.flags |= FIDF_DEFAULTVALID;
- fontValues.cbSize = sizeof(FontIDT);
+ fontValues.cbSize = sizeof(FontIDW);
fontValues.flags = FIDF_ALLOWEFFECTS;
mir_wstrcpy(fontValues.group, LPGENW("Tooltips"));
mir_wstrcpy(fontValues.name, LPGENW("Values"));
@@ -216,7 +216,7 @@ void InitFonts() fontValues.deffontsettings.colour = RGB(0, 0, 0);
fontValues.flags |= FIDF_DEFAULTVALID;
- fontTrayTitle.cbSize = sizeof(FontIDT);
+ fontTrayTitle.cbSize = sizeof(FontIDW);
fontTrayTitle.flags = FIDF_ALLOWEFFECTS;
mir_wstrcpy(fontTrayTitle.group, LPGENW("Tooltips"));
mir_wstrcpy(fontTrayTitle.name, LPGENW("Tray title"));
@@ -232,10 +232,10 @@ void InitFonts() fontTrayTitle.deffontsettings.colour = RGB(0, 0, 0);
fontTrayTitle.flags |= FIDF_DEFAULTVALID;
- FontRegisterT(&fontTitle);
- FontRegisterT(&fontLabels);
- FontRegisterT(&fontValues);
- FontRegisterT(&fontTrayTitle);
+ FontRegisterW(&fontTitle);
+ FontRegisterW(&fontLabels);
+ FontRegisterW(&fontValues);
+ FontRegisterW(&fontTrayTitle);
hReloadFonts = HookEvent(ME_FONT_RELOAD, ReloadFont);
}
@@ -304,7 +304,7 @@ static INT_PTR ReloadSkin(WPARAM wParam, LPARAM lParam) SaveOptions();
db_set_b(0, MODULE, "SkinEngine", opt.skinMode);
- db_set_ts(0, MODULE, "SkinName", opt.szSkinName);
+ db_set_ws(0, MODULE, "SkinName", opt.szSkinName);
DestroySkinBitmap();
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp index 879f100f5d..c981322f81 100644 --- a/plugins/TipperYM/src/translations.cpp +++ b/plugins/TipperYM/src/translations.cpp @@ -567,9 +567,9 @@ wchar_t *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, // translate jabber mood
if (ProtoServiceExists(szModuleName, "/SendXML")) // jabber protocol?
{
- if (!db_get_ts(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get_ws(hContact, szModuleName, szSettingName, &dbv))
{
- wcsncpy(buff, TranslateTS(dbv.ptszVal), bufflen);
+ wcsncpy(buff, TranslateW(dbv.ptszVal), bufflen);
buff[bufflen - 1] = 0;
return buff;
}
@@ -584,13 +584,13 @@ wchar_t *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, if (ProtoServiceExists(szModuleName, PS_GETCUSTOMSTATUSEX))
{
xstatus.cbSize = sizeof(CUSTOM_STATUS);
- xstatus.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR;
+ xstatus.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_UNICODE;
xstatus.ptszName = szDefaultName;
xstatus.wParam = (WPARAM *)&status;
if (CallProtoService(szModuleName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus))
return 0;
- wcsncpy(buff, TranslateTS(szDefaultName), bufflen);
+ wcsncpy(buff, TranslateW(szDefaultName), bufflen);
buff[bufflen - 1] = 0;
return buff;
}
diff --git a/plugins/Toaster/src/main.cpp b/plugins/Toaster/src/main.cpp index 3aa449ad98..d97bd34b37 100644 --- a/plugins/Toaster/src/main.cpp +++ b/plugins/Toaster/src/main.cpp @@ -50,7 +50,7 @@ extern "C" int __declspec(dllexport) Load(void) DWORD dwAttributes = GetFileAttributes(wszTempDir);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
- CreateDirectoryTreeT(wszTempDir);
+ CreateDirectoryTreeW(wszTempDir);
}
else
{
diff --git a/plugins/Toaster/src/options.cpp b/plugins/Toaster/src/options.cpp index 0dcfe12f64..4fb6b54868 100644 --- a/plugins/Toaster/src/options.cpp +++ b/plugins/Toaster/src/options.cpp @@ -47,7 +47,7 @@ int OnOptionsInitialized(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.pwszTitle = L"Popups"; //_T(MODULE);
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.position = -790000000;
odp.pwszTab = _T(MODULE);
odp.pDialog = new COptions();
diff --git a/plugins/Toaster/src/toast_notification.cpp b/plugins/Toaster/src/toast_notification.cpp index 0ade7ce217..b815fd9e68 100644 --- a/plugins/Toaster/src/toast_notification.cpp +++ b/plugins/Toaster/src/toast_notification.cpp @@ -52,7 +52,7 @@ HRESULT ToastNotification::CreateXml(_Outptr_ ABI::Windows::Data::Xml::Dom::IXml {
HXML xmlImageNode = xmlAddChild(xmlBindingNode, L"image", NULL);
xmlAddAttr(xmlImageNode, L"id", L"1");
- xmlAddAttr(xmlImageNode, L"src", CMString(FORMAT, L"file:///%s", _imagePath));
+ xmlAddAttr(xmlImageNode, L"src", CMStringW(FORMAT, L"file:///%s", _imagePath));
}
HXML xmlTitleNode = xmlAddChild(xmlBindingNode, L"text", _caption != NULL ? _caption : L"Miranda NG");
diff --git a/plugins/Toaster/src/utils.h b/plugins/Toaster/src/utils.h index fe9e5998bd..2aa4802b8c 100644 --- a/plugins/Toaster/src/utils.h +++ b/plugins/Toaster/src/utils.h @@ -11,7 +11,7 @@ class ToasterImage ptrW tszId;
public:
- __inline explicit ToasterImage(HICON hIcon) : _hBitmap(NULL), tszId(CMString(FORMAT, L"%p", hIcon).Detach())
+ __inline explicit ToasterImage(HICON hIcon) : _hBitmap(NULL), tszId(CMStringW(FORMAT, L"%p", hIcon).Detach())
{
ICONINFO icon = { 0 };
if (GetIconInfo(hIcon, &icon))
@@ -21,7 +21,7 @@ public: }
}
- __inline explicit ToasterImage(HBITMAP bmp) : _hBitmap(bmp), tszId(CMString(FORMAT, L"%p", bmp).Detach())
+ __inline explicit ToasterImage(HBITMAP bmp) : _hBitmap(bmp), tszId(CMStringW(FORMAT, L"%p", bmp).Detach())
{
}
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index 2d7988e339..bea0343104 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -72,7 +72,7 @@ CTooltipNotify::~CTooltipNotify() void CTooltipNotify::RegisterFonts()
{
- FontIDT fontId = { sizeof(fontId) };
+ FontIDW fontId = { sizeof(fontId) };
wcsncpy(fontId.group, FONTSERV_GROUP, _countof(fontId.group) - 1);
strncpy(fontId.dbSettingsGroup, MODULENAME, _countof(fontId.dbSettingsGroup) - 1);
fontId.flags = FIDF_DEFAULTVALID;
@@ -84,7 +84,7 @@ void CTooltipNotify::RegisterFonts() fontId.order = 0;
wcsncpy(fontId.backgroundGroup, FONTSERV_GROUP, _countof(fontId.backgroundGroup) - 1);
- ColourIDT colorId = { sizeof(colorId) };
+ ColourIDW colorId = { sizeof(colorId) };
wcsncpy(colorId.group, FONTSERV_GROUP, _countof(colorId.group) - 1);
strncpy(colorId.dbSettingsGroup, MODULENAME, _countof(colorId.dbSettingsGroup) - 1);
colorId.flags = 0;
@@ -95,11 +95,11 @@ void CTooltipNotify::RegisterFonts() wcsncpy(fontId.name, s_fontTable[i].name, _countof(fontId.name) - 1);
strncpy(fontId.prefix, s_fontTable[i].fontPrefix, _countof(fontId.prefix) - 1);
wcsncpy(fontId.backgroundName, s_fontTable[i].name, _countof(fontId.backgroundName) - 1);
- ::FontRegisterT(&fontId);
+ ::FontRegisterW(&fontId);
wcsncpy(colorId.name, s_fontTable[i].name, _countof(colorId.name) - 1);
strncpy(colorId.setting, s_fontTable[i].clrPrefix, _countof(colorId.setting) - 1);
- ::ColourRegisterT(&colorId);
+ ::ColourRegisterW(&colorId);
}
}
@@ -116,12 +116,12 @@ void CTooltipNotify::GetFont(int iStatus, LOGFONT* lf, COLORREF* text, COLORREF* }
// name and group only
- FontIDT fontId = { sizeof(fontId), FONTSERV_GROUP, 0 };
+ FontIDW fontId = { sizeof(fontId), FONTSERV_GROUP, 0 };
wcsncpy(fontId.name, fontName, _countof(fontId.name) - 1);
- *text = (COLORREF)::CallService(MS_FONT_GETT, (WPARAM)&fontId, (LPARAM)lf);
- ColourIDT colorId = { sizeof(colorId), FONTSERV_GROUP, 0 };
+ *text = (COLORREF)::CallService(MS_FONT_GETW, (WPARAM)&fontId, (LPARAM)lf);
+ ColourIDW colorId = { sizeof(colorId), FONTSERV_GROUP, 0 };
wcsncpy(colorId.name, fontName, _countof(colorId.name) - 1);
- *bg = (COLORREF)::CallService(MS_COLOUR_GETT, (WPARAM)&colorId, 0);
+ *bg = (COLORREF)::CallService(MS_COLOUR_GETW, (WPARAM)&colorId, 0);
}
int CTooltipNotify::ModulesLoaded(WPARAM, LPARAM)
diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp index d02ab8240a..a8c037a7ac 100644 --- a/plugins/TopToolBar/src/toolbar.cpp +++ b/plugins/TopToolBar/src/toolbar.cpp @@ -440,7 +440,7 @@ INT_PTR TTBSetOptions(WPARAM wParam, LPARAM lParam) if (lParam == 0)
return -1;
- replaceStrW(b->ptszTooltip, TranslateTS(_A2T((LPCSTR)lParam)));
+ replaceStrW(b->ptszTooltip, TranslateW(_A2T((LPCSTR)lParam)));
SendMessage(b->hwnd, BUTTONADDTOOLTIP, (WPARAM)b->ptszTooltip, BATF_UNICODE);
return 1;
diff --git a/plugins/TopToolBar/src/toolbarwnd.cpp b/plugins/TopToolBar/src/toolbarwnd.cpp index 90f3199b24..8962a36af0 100644 --- a/plugins/TopToolBar/src/toolbarwnd.cpp +++ b/plugins/TopToolBar/src/toolbarwnd.cpp @@ -276,7 +276,7 @@ INT_PTR OnEventFire(WPARAM wParam, LPARAM) Frame.tname = L"Toolbar";
Frame.hWnd = g_ctrl->hWnd;
Frame.align = alTop;
- Frame.Flags = F_VISIBLE | F_NOBORDER | F_LOCKED | F_TCHAR;
+ Frame.Flags = F_VISIBLE | F_NOBORDER | F_LOCKED | F_UNICODE;
Frame.height = g_ctrl->nLastHeight;
Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
g_ctrl->hFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
@@ -299,7 +299,7 @@ int LoadBackgroundOptions() }
if (db_get_b(NULL, TTB_OPTDIR, "UseBitmap", TTBDEFAULT_USEBITMAP)) {
- ptrW tszBitmapName(db_get_tsa(NULL, TTB_OPTDIR, "BkBitmap"));
+ ptrW tszBitmapName(db_get_wsa(NULL, TTB_OPTDIR, "BkBitmap"));
if (tszBitmapName != NULL)
hBmpBackground = Bitmap_Load(tszBitmapName);
}
diff --git a/plugins/TopToolBar/src/topbutton.cpp b/plugins/TopToolBar/src/topbutton.cpp index 4be939ba8b..75a39c03a4 100644 --- a/plugins/TopToolBar/src/topbutton.cpp +++ b/plugins/TopToolBar/src/topbutton.cpp @@ -35,7 +35,7 @@ DWORD TopButtonInt::CheckFlags(DWORD Flags) }
if (BitChanged(TTBBF_SHOWTOOLTIP)) {
dwFlags ^= TTBBF_SHOWTOOLTIP;
- SendMessage(hwnd, BUTTONADDTOOLTIP, (WPARAM)((dwFlags & TTBBF_SHOWTOOLTIP) ? ptszTooltip : L""), BATF_TCHAR);
+ SendMessage(hwnd, BUTTONADDTOOLTIP, (WPARAM)((dwFlags & TTBBF_SHOWTOOLTIP) ? ptszTooltip : L""), BATF_UNICODE);
}
// next settings changing visual side, requires additional actions
if (BitChanged(TTBBF_VISIBLE)) {
@@ -98,7 +98,7 @@ void TopButtonInt::LoadSettings() pszName = db_get_sa(0, TTB_OPTDIR, AS(buf, buf2, "_name"));
mir_free(ptszProgram);
- ptszProgram = db_get_tsa(0, TTB_OPTDIR, AS(buf, buf2, "_lpath"));
+ ptszProgram = db_get_wsa(0, TTB_OPTDIR, AS(buf, buf2, "_lpath"));
arrangedpos = db_get_b(0, TTB_OPTDIR, AS(buf, buf2, "_Position"), Buttons.getCount());
if (db_get_b(0, TTB_OPTDIR, AS(buf, buf2, "_Visible"), oldv) > 0)
@@ -134,7 +134,7 @@ void TopButtonInt::SaveSettings(int *SepCnt, int *LaunchCnt) AS(buf2, "Launch", buf1);
db_set_s(0, TTB_OPTDIR, AS(buf, buf2, "_name"), pszName);
- db_set_ts(0, TTB_OPTDIR, AS(buf, buf2, "_lpath"), ptszProgram);
+ db_set_ws(0, TTB_OPTDIR, AS(buf, buf2, "_lpath"), ptszProgram);
db_set_b(0, TTB_OPTDIR, AS(buf, buf2, "_Position"), arrangedpos);
db_set_b(0, TTB_OPTDIR, AS(buf, buf2, "_Visible"), isVisible());
}
@@ -172,6 +172,6 @@ void TopButtonInt::SetBitmap() pTooltip = ptszTooltipUp;
}
if (pTooltip)
- SendMessage(hwnd, BUTTONADDTOOLTIP, (WPARAM)TranslateTH(hLangpack, pTooltip), BATF_TCHAR);
+ SendMessage(hwnd, BUTTONADDTOOLTIP, (WPARAM)TranslateW_LP(pTooltip, hLangpack), BATF_UNICODE);
}
}
diff --git a/plugins/TopToolBar/src/ttbopt.cpp b/plugins/TopToolBar/src/ttbopt.cpp index e4a2edd8e5..0b65ba0bfd 100644 --- a/plugins/TopToolBar/src/ttbopt.cpp +++ b/plugins/TopToolBar/src/ttbopt.cpp @@ -34,7 +34,7 @@ static HTREEITEM AddLine(HWND hTree,TopButtonInt *b, HTREEITEM hItem, HIMAGELIST else index = ImageList_AddIcon(il, b->hIconUp);
tmp = mir_a2u( b->pszName );
- tvis.item.pszText = TranslateTS(tmp);
+ tvis.item.pszText = TranslateW(tmp);
}
tvis.item.iImage = tvis.item.iSelectedImage = index;
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index 2366819516..04058633e6 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -84,8 +84,8 @@ BYTE online_count = 0; //font service support
/*-------------------------------------------------------------------------------------------------------------------*/
int TrafficFontHeight = 0;
-FontIDT TrafficFontID;
-ColourIDT TrafficBackgroundColorID;
+FontIDW TrafficFontID;
+ColourIDW TrafficBackgroundColorID;
//---------------------------------------------------------------------------------------------
// Äëÿ ToolTip
@@ -215,7 +215,7 @@ int TrafficCounterModulesLoaded(WPARAM, LPARAM) Traffic_PopupTimeoutValue = db_get_b(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_POPUP_TIMEOUT_VALUE, 5);
// Ôîðìàò ñ÷¸ò÷èêà äëÿ êàæäîãî àêòèâíîãî ïðîòîêîëà
- if (db_get_ts(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_COUNTER_FORMAT, &dbv) == 0) {
+ if (db_get_ws(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_COUNTER_FORMAT, &dbv) == 0) {
if (mir_wstrlen(dbv.ptszVal) > 0)
mir_wstrncpy(Traffic_CounterFormat, dbv.ptszVal, _countof(Traffic_CounterFormat));
//
@@ -227,7 +227,7 @@ int TrafficCounterModulesLoaded(WPARAM, LPARAM) }
// Ôîðìàò âñïëûâàþùèõ ïîäñêàçîê
- if (db_get_ts(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_TOOLTIP_FORMAT, &dbv) == 0) {
+ if (db_get_ws(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_TOOLTIP_FORMAT, &dbv) == 0) {
if (mir_wstrlen(dbv.ptszVal) > 0)
mir_wstrncpy(Traffic_TooltipFormat, dbv.ptszVal, _countof(Traffic_TooltipFormat));
//
@@ -244,7 +244,7 @@ int TrafficCounterModulesLoaded(WPARAM, LPARAM) OverallInfo.Total.Timer = db_get_dw(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_TOTAL_ONLINE_TIME, 0);
//register traffic font
- TrafficFontID.cbSize = sizeof(FontIDT);
+ TrafficFontID.cbSize = sizeof(FontIDW);
mir_wstrcpy(TrafficFontID.group, LPGENW("Traffic counter"));
mir_wstrcpy(TrafficFontID.name, LPGENW("Font"));
mir_strcpy(TrafficFontID.dbSettingsGroup, TRAFFIC_SETTINGS_GROUP);
@@ -256,16 +256,16 @@ int TrafficCounterModulesLoaded(WPARAM, LPARAM) TrafficFontID.deffontsettings.style = 0;
mir_wstrcpy(TrafficFontID.deffontsettings.szFace, L"Arial");
TrafficFontID.order = 0;
- FontRegisterT(&TrafficFontID);
+ FontRegisterW(&TrafficFontID);
// Ðåãèñòðèðóåì öâåò ôîíà
- TrafficBackgroundColorID.cbSize = sizeof(ColourIDT);
+ TrafficBackgroundColorID.cbSize = sizeof(ColourIDW);
mir_wstrcpy(TrafficBackgroundColorID.group, LPGENW("Traffic counter"));
mir_wstrcpy(TrafficBackgroundColorID.name, LPGENW("Font"));
mir_strcpy(TrafficBackgroundColorID.dbSettingsGroup, TRAFFIC_SETTINGS_GROUP);
mir_strcpy(TrafficBackgroundColorID.setting, "FontBkColor");
TrafficBackgroundColorID.defcolour = GetSysColor(COLOR_BTNFACE);
- ColourRegisterT(&TrafficBackgroundColorID);
+ ColourRegisterW(&TrafficBackgroundColorID);
HookEvent(ME_FONT_RELOAD, UpdateFonts);
@@ -333,9 +333,9 @@ void SaveSettings(BYTE OnlyCnt) db_set_b(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_POPUP_TIMEOUT_VALUE, Traffic_PopupTimeoutValue);
//
// Ôîðìàò ñ÷¸ò÷èêîâ
- db_set_ts(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_COUNTER_FORMAT, Traffic_CounterFormat);
+ db_set_ws(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_COUNTER_FORMAT, Traffic_CounterFormat);
- db_set_ts(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_TOOLTIP_FORMAT, Traffic_TooltipFormat);
+ db_set_ws(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_TOOLTIP_FORMAT, Traffic_TooltipFormat);
db_set_b(NULL, TRAFFIC_SETTINGS_GROUP, SETTINGS_ADDITION_SPACE, Traffic_AdditionSpace);
// Ñîõðàíÿåì ôëàãè
@@ -1163,14 +1163,14 @@ int UpdateFonts(WPARAM, LPARAM) {
LOGFONT logfont;
//if no font service
- if (!ServiceExists(MS_FONT_GETT)) return 0;
+ if (!ServiceExists(MS_FONT_GETW)) return 0;
//update traffic font
if (Traffic_h_font) DeleteObject(Traffic_h_font);
- Traffic_FontColor = CallService(MS_FONT_GETT, (WPARAM)&TrafficFontID, (LPARAM)&logfont);
+ Traffic_FontColor = CallService(MS_FONT_GETW, (WPARAM)&TrafficFontID, (LPARAM)&logfont);
Traffic_h_font = CreateFontIndirect(&logfont);
//
TrafficFontHeight = abs(logfont.lfHeight) + 1;
- Traffic_BkColor = CallService(MS_COLOUR_GETT, (WPARAM)&TrafficBackgroundColorID, 0);
+ Traffic_BkColor = CallService(MS_COLOUR_GETW, (WPARAM)&TrafficBackgroundColorID, 0);
// Êëþ÷åâîé öâåò
UseKeyColor = db_get_b(NULL, "ModernSettings", "UseKeyColor", 1);
diff --git a/plugins/TrafficCounter/src/opttree.cpp b/plugins/TrafficCounter/src/opttree.cpp index b75de3cca5..1fb69b220e 100644 --- a/plugins/TrafficCounter/src/opttree.cpp +++ b/plugins/TrafficCounter/src/opttree.cpp @@ -38,7 +38,7 @@ static void OptTree_TranslateItem(HWND hwndTree, HTREEITEM hItem) SendMessage(hwndTree, TVM_GETITEM, 0, (LPARAM)&tvi);
// Ïðîâåðèì, íàäî ëè ïåðåâîäèòü.
if ((tvi.lParam != -1) && (pOptions[tvi.lParam].dwFlag & OPTTREE_NOTRANSLATE)) return;
- tvi.pszText = TranslateTS(tvi.pszText);
+ tvi.pszText = TranslateW(tvi.pszText);
SendMessage(hwndTree, TVM_SETITEM, 0, (LPARAM)&tvi);
}
diff --git a/plugins/TrafficCounter/src/statistics.cpp b/plugins/TrafficCounter/src/statistics.cpp index 1815f8544c..85a6ac1281 100644 --- a/plugins/TrafficCounter/src/statistics.cpp +++ b/plugins/TrafficCounter/src/statistics.cpp @@ -301,7 +301,7 @@ void Stat_ReadFile(BYTE n) SYSTEMTIME stNow;
pszPath = Utils_ReplaceVarsT(L"%miranda_userdata%\\statistics");
- CreateDirectoryTreeT(pszPath);
+ CreateDirectoryTreeW(pszPath);
mir_snwprintf(FileName, L"%s\\%S.stat", pszPath, ProtoList[n].name);
mir_free(pszPath);
GetLocalTime(&stNow);
diff --git a/plugins/TranslitSwitcher/src/Layoutproc.cpp b/plugins/TranslitSwitcher/src/Layoutproc.cpp index 0f75d9f64b..043ccf20b4 100644 --- a/plugins/TranslitSwitcher/src/Layoutproc.cpp +++ b/plugins/TranslitSwitcher/src/Layoutproc.cpp @@ -705,7 +705,7 @@ int OnButtonPressed(WPARAM, LPARAM lParam) }
}
- ptrW tszSymbol(db_get_tsa(NULL, "TranslitSwitcher", "ResendSymbol"));
+ ptrW tszSymbol(db_get_wsa(NULL, "TranslitSwitcher", "ResendSymbol"));
if (!tszSymbol && sel) {
SetWindowText(hEdit, sel);
SendMessage(hEdit, EM_SETSEL, 0, (LPARAM)slen);
@@ -717,7 +717,7 @@ int OnButtonPressed(WPARAM, LPARAM lParam) SendMessage(cbcd->hwndFrom, WM_COMMAND, IDOK, 0);
}
else if (sel) {
- CMString tszFinal(FORMAT, L"%s %s", tszSymbol, sel);
+ CMStringW tszFinal(FORMAT, L"%s %s", tszSymbol, sel);
SetWindowText(hEdit, tszFinal.GetString());
SendMessage(hEdit, EM_SETSEL, 0, tszFinal.GetLength());
SendMessage(cbcd->hwndFrom, WM_COMMAND, IDOK, 0);
diff --git a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp index 046d982675..196ea89d6a 100644 --- a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp +++ b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp @@ -154,42 +154,42 @@ extern "C" __declspec(dllexport) int Load(void) HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
HOTKEYDESC hkd = { sizeof(hkd) };
- hkd.dwFlags = HKD_TCHAR;
+ hkd.dwFlags = HKD_UNICODE;
hkd.pszName = "TranslitSwitcher/ConvertAllOrSelected";
- hkd.ptszDescription = LPGENW("Convert All / Selected");
- hkd.ptszSection = L"TranslitSwitcher";
+ hkd.pwszDescription = LPGENW("Convert All / Selected");
+ hkd.pwszSection = L"TranslitSwitcher";
hkd.pszService = MS_TS_SWITCHLAYOUT;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL + HKCOMB_A, 'R') | HKF_MIRANDA_LOCAL;
Hotkey_Register(&hkd);
hkd.pszName = "TranslitSwitcher/ConvertLastOrSelected";
- hkd.ptszDescription = LPGENW("Convert Last / Selected");
+ hkd.pwszDescription = LPGENW("Convert Last / Selected");
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT + HKCOMB_A, 'R') | HKF_MIRANDA_LOCAL;
hkd.lParam = true;
Hotkey_Register(&hkd);
hkd.pszName = "TranslitSwitcher/TranslitAllOrSelected";
- hkd.ptszDescription = LPGENW("Translit All / Selected");
+ hkd.pwszDescription = LPGENW("Translit All / Selected");
hkd.pszService = MS_TS_TRANSLITLAYOUT;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL + HKCOMB_A, 'T') | HKF_MIRANDA_LOCAL;
hkd.lParam = false;
Hotkey_Register(&hkd);
hkd.pszName = "TranslitSwitcher/TranslitLastOrSelected";
- hkd.ptszDescription = LPGENW("Translit Last / Selected");
+ hkd.pwszDescription = LPGENW("Translit Last / Selected");
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT + HKCOMB_A, 'T') | HKF_MIRANDA_LOCAL;
hkd.lParam = true;
Hotkey_Register(&hkd);
hkd.pszName = "TranslitSwitcher/InvertCaseAllOrSelected";
- hkd.ptszDescription = LPGENW("Invert Case All / Selected");
+ hkd.pwszDescription = LPGENW("Invert Case All / Selected");
hkd.pszService = MS_TS_INVERTCASE;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL + HKCOMB_A, 'Y') | HKF_MIRANDA_LOCAL;
hkd.lParam = false;
Hotkey_Register(&hkd);
hkd.pszName = "TranslitSwitcher/InvertCaseLastOrSelected";
- hkd.ptszDescription = LPGENW("Invert Case Last / Selected");
+ hkd.pwszDescription = LPGENW("Invert Case Last / Selected");
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT + HKCOMB_A, 'Y') | HKF_MIRANDA_LOCAL;
hkd.lParam = true;
Hotkey_Register(&hkd);
diff --git a/plugins/UserGuide/src/main.cpp b/plugins/UserGuide/src/main.cpp index 3f37ede40b..a07c3eca60 100644 --- a/plugins/UserGuide/src/main.cpp +++ b/plugins/UserGuide/src/main.cpp @@ -24,7 +24,7 @@ static INT_PTR ShowGuideFile(WPARAM, LPARAM) LPTSTR pszDirName = (LPTSTR)mir_alloc(250*sizeof(wchar_t));
LPTSTR pszFileName = (LPTSTR)mir_alloc(250*sizeof(wchar_t));
- wchar_t *ptszHelpFile = db_get_tsa(NULL, "UserGuide", "PathToHelpFile");
+ wchar_t *ptszHelpFile = db_get_wsa(NULL, "UserGuide", "PathToHelpFile");
if (ptszHelpFile==0)
{
@@ -85,7 +85,7 @@ extern "C" __declspec(dllexport) int Load(void) CMenuItem mi;
SET_UID(mi, 0x6787c12d, 0xdc85, 0x409d, 0xaa, 0x6c, 0x1f, 0xfe, 0x5f, 0xe8, 0xc1, 0x18);
mi.position = 500000;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_HELP);
mi.name.w = LPGENW("User Guide");
mi.pszService = "UserGuide/ShowGuide";
diff --git a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp index 2eb24aff20..056bb048c4 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp @@ -344,7 +344,7 @@ void InitIcons() SKINICONDESC sid = { 0 };
sid.section.w = LPGENW("Country flags");
sid.pszName = szId; // name to refer to icon when playing and in db
- sid.flags = SIDF_SORTED | SIDF_TCHAR;
+ sid.flags = SIDF_SORTED | SIDF_UNICODE;
for (int i=0; i < nCountriesCount; i++) {
sid.description.w = mir_a2u(LPGEN(countries[i].szName));
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index b4f9ed84fd..c907d10ad7 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -664,7 +664,7 @@ int MAnnivDate::DBWriteAnniversaryDate(MCONTACT hContact, WORD wIndex) if (!DBWriteDateStamp(hContact, USERINFO, pszSetting)) {
// write description
mir_snprintf(pszSetting, "Anniv%dDesc", wIndex);
- db_set_ts(hContact, USERINFO, pszSetting, (LPTSTR)Description());
+ db_set_ws(hContact, USERINFO, pszSetting, (LPTSTR)Description());
return 0;
}
// delete date if written incompletely
diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp index 8108f38d2d..2f16ba1797 100644 --- a/plugins/UserInfoEx/src/classPsTree.cpp +++ b/plugins/UserInfoEx/src/classPsTree.cpp @@ -129,7 +129,7 @@ int CPsTree::AddDummyItem(LPCSTR pszGroup) OPTIONSDIALOGPAGE odp = { 0 }; odp.hInstance = ghInst; - odp.flags = ODPF_TCHAR; + odp.flags = ODPF_UNICODE; odp.pwszTitle = mir_utf8decodeW(pszGroup); INT_PTR rc = UserInfo_AddPage((WPARAM)&psh, &odp); diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index 22d6872017..f31c4fada9 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -255,7 +255,7 @@ int CPsTreeItem::ItemLabel(const BYTE bReadDBValue) LPTSTR ptszLabel = mir_utf8decodeW(pszName);
if (ptszLabel) {
- _ptszLabel = mir_wstrdup(TranslateTS(ptszLabel));
+ _ptszLabel = mir_wstrdup(TranslateW(ptszLabel));
mir_free(ptszLabel);
}
}
@@ -316,7 +316,7 @@ int CPsTreeItem::Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, BYTE bInitIconsOn bool bNeedFree = false;
SKINICONDESC sid = { 0 };
- sid.flags = SIDF_ALL_TCHAR;
+ sid.flags = SIDF_ALL_UNICODE;
sid.pszName = (LPSTR)pszIconName;
sid.description.w = _ptszLabel;
sid.section.w = _A2W(SECT_TREE);
@@ -482,7 +482,7 @@ WORD CPsTreeItem::DBSaveItemState(LPCSTR pszGroup, int iItemPosition, UINT iStat // save label
if ((dwFlags & PSTVF_LABEL_CHANGED) && (_dwFlags & PSTVF_LABEL_CHANGED))
- numErrors += db_set_ts(NULL, MODNAME, GlobalPropertyKey(SET_ITEM_LABEL), Label());
+ numErrors += db_set_ws(NULL, MODNAME, GlobalPropertyKey(SET_ITEM_LABEL), Label());
// save position
if ((dwFlags & PSTVF_POS_CHANGED) && !(dwFlags & PSTVF_SORTTREE))
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.cpp b/plugins/UserInfoEx/src/ctrl_annivedit.cpp index 3755643b45..05828dfc61 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.cpp +++ b/plugins/UserInfoEx/src/ctrl_annivedit.cpp @@ -590,7 +590,7 @@ void CAnnivEditCtrl::SetZodiacAndAge(MAnnivDate *mt) if (zod.pszName != NULL)
{
ShowWindow(GetDlgItem(_hwndDlg, TEXT_ZODIAC), SW_SHOW);
- SetDlgItemText(_hwndDlg, TEXT_ZODIAC, TranslateTS(zod.pszName));
+ SetDlgItemText(_hwndDlg, TEXT_ZODIAC, TranslateW(zod.pszName));
SendDlgItemMessage(_hwndDlg, IDC_ZODIAC, STM_SETIMAGE, IMAGE_ICON, (LPARAM)zod.hIcon);
}
else
diff --git a/plugins/UserInfoEx/src/ctrl_button.cpp b/plugins/UserInfoEx/src/ctrl_button.cpp index 59ccb0a1ee..38b8ef5fc3 100644 --- a/plugins/UserInfoEx/src/ctrl_button.cpp +++ b/plugins/UserInfoEx/src/ctrl_button.cpp @@ -544,7 +544,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L {
wchar_t szButton[MAX_PATH];
GetWindowText(bct->hwnd, szButton, _countof(szButton));
- SetWindowText(bct->hwnd, TranslateTS(szButton));
+ SetWindowText(bct->hwnd, TranslateW(szButton));
}
break;
case WM_SETFOCUS: // set keybord bFocus and redraw
diff --git a/plugins/UserInfoEx/src/ctrl_combo.cpp b/plugins/UserInfoEx/src/ctrl_combo.cpp index 4677b94a8c..8480e0f969 100644 --- a/plugins/UserInfoEx/src/ctrl_combo.cpp +++ b/plugins/UserInfoEx/src/ctrl_combo.cpp @@ -157,8 +157,8 @@ BOOL CCombo::OnInfoChanged(MCONTACT hContact, LPCSTR pszProto) case DBVT_BYTE: iVal = Find((int)dbv.bVal); break;
case DBVT_WORD: iVal = Find((int)dbv.wVal); break;
case DBVT_DWORD: iVal = Find((int)dbv.dVal); break;
- case DBVT_TCHAR:
- iVal = Find(TranslateTS(dbv.ptszVal));
+ case DBVT_WCHAR:
+ iVal = Find(TranslateW(dbv.ptszVal));
if (iVal == CB_ERR) {
// other
iVal = Find(_pList[_nList - 1].nID);
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp index 1e882cdfa9..f86c9be82c 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.cpp +++ b/plugins/UserInfoEx/src/ctrl_contact.cpp @@ -172,11 +172,11 @@ static INT_PTR CALLBACK DlgProc_EMail(HWND hDlg, UINT msg, WPARAM wParam, LPARAM wchar_t szButton[MAX_PATH];
HWND hBtn = GetDlgItem(hDlg, IDOK);
GetWindowText(hBtn, szButton, _countof(szButton));
- SetWindowText(hBtn, TranslateTS(szButton));
+ SetWindowText(hBtn, TranslateW(szButton));
hBtn = GetDlgItem(hDlg, IDCANCEL);
GetWindowText(hBtn, szButton, _countof(szButton));
- SetWindowText(hBtn, TranslateTS(szButton));
+ SetWindowText(hBtn, TranslateW(szButton));
}
return TRUE;
@@ -256,10 +256,10 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam hBtn = GetDlgItem(hDlg, IDOK);
GetWindowText(hBtn, szButton, _countof(szButton));
- SetWindowText(hBtn, TranslateTS(szButton));
+ SetWindowText(hBtn, TranslateW(szButton));
hBtn = GetDlgItem(hDlg, IDCANCEL);
GetWindowText(hBtn, szButton, _countof(szButton));
- SetWindowText(hBtn, TranslateTS(szButton));
+ SetWindowText(hBtn, TranslateW(szButton));
}
if (*cbi->pszVal) SetWindowText(hDlg, LPGENW("Edit phone number"));
if (cbi->wFlags & CBEXIF_SMS) CheckDlgButton(hDlg, CHECK_SMS, BST_CHECKED);
@@ -1430,7 +1430,7 @@ int CtrlContactWriteItemToDB( if (cbi.wFlags & CBEXIF_SMS)
mir_wstrncat(szVal, L" SMS", _countof(szVal) - mir_wstrlen(szVal));
- if (db_set_ts(hContact, pszModule, pszSetting, szVal)) return 1;
+ if (db_set_ws(hContact, pszModule, pszSetting, szVal)) return 1;
}
cbi.wFlags &= ~CTRLF_CHANGED;
cbi.wMask = CBEXIM_FLAGS;
@@ -1482,12 +1482,12 @@ int CtrlContactWriteMyItemsToDB( }
mir_snprintf(pszSetting, szFormatCat, i);
if (*szCat && wcsncmp(szCat, pszOther, ccOther)) {
- if (db_set_ts(hContact, pszModule, pszSetting, szCat)) return 1;
+ if (db_set_ws(hContact, pszModule, pszSetting, szCat)) return 1;
}
else
db_unset(hContact, pszModule, pszSetting);
mir_snprintf(pszSetting, szFormatVal, i);
- if (db_set_ts(hContact, pszModule, pszSetting, szVal)) return 1;
+ if (db_set_ws(hContact, pszModule, pszSetting, szVal)) return 1;
cbi.wFlags &= ~CTRLF_CHANGED;
cbi.wMask = CBEXIM_FLAGS;
CtrlContactWndProc(hCtrl, CBEXM_SETITEM, NULL, (LPARAM)&cbi);
diff --git a/plugins/UserInfoEx/src/ctrl_edit.cpp b/plugins/UserInfoEx/src/ctrl_edit.cpp index 874b6846dd..39d1be391b 100644 --- a/plugins/UserInfoEx/src/ctrl_edit.cpp +++ b/plugins/UserInfoEx/src/ctrl_edit.cpp @@ -136,7 +136,7 @@ BOOL CEditCtrl::OnInfoChanged(MCONTACT hContact, LPCSTR pszProto) _pszValue = mir_wstrdup(szText); break; - case DBVT_TCHAR: + case DBVT_WCHAR: if (dbv.ptszVal) { SetWindowText(_hwnd, dbv.ptszVal); _pszValue = dbv.ptszVal; @@ -190,7 +190,7 @@ void CEditCtrl::OnApply(MCONTACT hContact, LPCSTR pszProto) dbv.dVal = (DWORD)wcstol(val, NULL, 10); break; - case DBVT_TCHAR: + case DBVT_WCHAR: dbv.ptszVal = val; break; diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index 73e8018d72..8eab08d56b 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -601,7 +601,7 @@ class CAnnivList lvc.cx = db_get_w(NULL, MODNAME, pszSetting, defaultWidth);
lvc.mask = LVCF_WIDTH | LVCF_TEXT;
lvc.iSubItem = iSubItem;
- lvc.pszText = TranslateTS(pszText);
+ lvc.pszText = TranslateW(pszText);
return ListView_InsertColumn(_hList, lvc.iSubItem++, &lvc) == -1;
}
diff --git a/plugins/UserInfoEx/src/dlg_msgbox.cpp b/plugins/UserInfoEx/src/dlg_msgbox.cpp index 68aacb64fa..29ac9cd0df 100644 --- a/plugins/UserInfoEx/src/dlg_msgbox.cpp +++ b/plugins/UserInfoEx/src/dlg_msgbox.cpp @@ -664,7 +664,7 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI va_list vl;
va_start(vl, pszFormat);
- mir_vsnwprintf(tszMsg, _countof(tszMsg), TranslateTS(pszFormat), vl);
+ mir_vsnwprintf(tszMsg, _countof(tszMsg), TranslateW(pszFormat), vl);
va_end(vl);
MSGBOX mb = { 0 };
@@ -672,8 +672,8 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI mb.hParent = hParent;
mb.hiLogo = IcoLib_GetIcon(ICO_COMMON_MAIN);
mb.hiMsg = NULL;
- mb.ptszTitle = TranslateTS(pszTitle);
- mb.ptszInfoText = TranslateTS(pszInfo);
+ mb.ptszTitle = TranslateW(pszTitle);
+ mb.ptszInfoText = TranslateW(pszInfo);
mb.ptszMsg = tszMsg;
mb.uType = uType;
return MsgBoxService(NULL, (LPARAM)&mb);
@@ -691,7 +691,7 @@ INT_PTR CALLBACK MsgErr(HWND hParent, LPCTSTR pszFormat, ...) va_list vl;
va_start(vl, pszFormat);
- mir_vsnwprintf(tszMsg, TranslateTS(pszFormat), vl);
+ mir_vsnwprintf(tszMsg, TranslateW(pszFormat), vl);
va_end(vl);
MSGBOX mb = {0};
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 71f4fef8d7..e1c7a28f75 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -124,7 +124,7 @@ private: // check if icq is online
if (!IsProtoOnline((*_pPd)->szModuleName))
MsgBox(_pPs->hDlg, MB_ICON_WARNING, TranslateT("Upload details"),
- CMString(FORMAT, TranslateT("Protocol '%s' is offline"), _A2T((*_pPd)->szModuleName)),
+ CMStringW(FORMAT, TranslateT("Protocol '%s' is offline"), _A2T((*_pPd)->szModuleName)),
TranslateT("You are not currently connected to the ICQ network.\nYou must be online in order to update your information on the server.\n\nYour changes will be saved to database only."));
// start uploading process
@@ -507,7 +507,7 @@ static int InitDetails(WPARAM wParam, LPARAM lParam) if (lParam || bChangeDetailsEnabled) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = ghInst;
- odp.flags = ODPF_ICON | ODPF_TCHAR;
+ odp.flags = ODPF_ICON | ODPF_UNICODE;
odp.pwszGroup = IcoLib_GetDefaultIconFileName();
if (lParam) {
@@ -1094,14 +1094,14 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar LPCTSTR pszName;
if (!pPs->hContact)
pszName = TranslateT("Owner");
- else if (pdbcws && pdbcws->value.type == DBVT_TCHAR)
+ else if (pdbcws && pdbcws->value.type == DBVT_WCHAR)
pszName = pdbcws->value.ptszVal;
else
pszName = DB::Contact::DisplayName(pPs->hContact);
HWND hName = GetDlgItem(hDlg, TXT_NAME);
SetWindowText(hName, pszName);
- SetWindowText(hDlg, CMString(FORMAT, L"%s - %s", pszName, TranslateT("edit contact information")));
+ SetWindowText(hDlg, CMStringW(FORMAT, L"%s - %s", pszName, TranslateT("edit contact information")));
SetDlgItemText(hDlg, IDC_HEADERBAR, TranslateT("View personal user details and more"));
// redraw the name control
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp index 74f2a84c49..b8d878b188 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp @@ -257,7 +257,7 @@ MCONTACT CExImContactBase::toDB() // add group if (_pszGroup) { ptrW ptszGroup(mir_utf8decodeW(_pszGroup)); - db_set_ts(_hContact, MOD_CLIST, "Group", ptszGroup); + db_set_ws(_hContact, MOD_CLIST, "Group", ptszGroup); Clist_GroupCreate(NULL, ptszGroup); } } diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp index ea71cc0d20..aaf300bc55 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp @@ -191,7 +191,7 @@ BYTE CProgress::UpdateContact(LPCTSTR pszFormat, ...) va_list vl;
va_start(vl, pszFormat);
- mir_vsnwprintf(buf, _countof(buf), TranslateTS(pszFormat), vl);
+ mir_vsnwprintf(buf, _countof(buf), TranslateW(pszFormat), vl);
va_end(vl);
SetDlgItemText(_hDlg, TXT_CONTACT, buf);
}
@@ -218,7 +218,7 @@ BYTE CProgress::UpdateSetting(LPCTSTR pszFormat, ...) va_list vl;
va_start(vl, pszFormat);
- mir_vsnwprintf(buf, _countof(buf), TranslateTS(pszFormat), vl);
+ mir_vsnwprintf(buf, _countof(buf), TranslateW(pszFormat), vl);
va_end(vl);
GetDlgItemText(_hDlg, TXT_SETTING, tmp, _countof(tmp));
if (mir_wstrcmpi(tmp,buf))
diff --git a/plugins/UserInfoEx/src/mir_icolib.cpp b/plugins/UserInfoEx/src/mir_icolib.cpp index 33c1a84934..e836756b0d 100644 --- a/plugins/UserInfoEx/src/mir_icolib.cpp +++ b/plugins/UserInfoEx/src/mir_icolib.cpp @@ -135,7 +135,7 @@ LPTSTR IcoLib_GetDefaultIconFileName() wchar_t absolute[MAX_PATH];
for (int i = 0; i < _countof(path); i++) {
- PathToAbsoluteT(path[i], absolute);
+ PathToAbsoluteW(path[i], absolute);
if (PathFileExists(absolute))
return path[i];
}
@@ -157,7 +157,7 @@ static void IcoLib_CheckIconPackVersion(LPTSTR szIconPack) if (db_get_b(NULL, MODNAME, SET_ICONS_CHECKFILEVERSION, TRUE)) {
if (szIconPack) {
wchar_t szAbsolutePath[MAX_PATH];
- PathToAbsoluteT(szIconPack, szAbsolutePath);
+ PathToAbsoluteW(szIconPack, szAbsolutePath);
HMODULE hIconDll = LoadLibrary(szAbsolutePath);
if (hIconDll) {
@@ -227,7 +227,7 @@ static HANDLE IcoLib_RegisterIconHandleEx(LPSTR szIconID, LPSTR szDescription, L if (szIconID && szDescription && szSection) {
SKINICONDESC sid = { 0 };
- sid.flags = SIDF_ALL_TCHAR;
+ sid.flags = SIDF_ALL_UNICODE;
sid.pszName = szIconID;
sid.description.w = mir_a2u(szDescription);
sid.section.w = mir_a2u(szSection);
diff --git a/plugins/UserInfoEx/src/psp_about.cpp b/plugins/UserInfoEx/src/psp_about.cpp index d19175763e..760dabe314 100644 --- a/plugins/UserInfoEx/src/psp_about.cpp +++ b/plugins/UserInfoEx/src/psp_about.cpp @@ -49,7 +49,7 @@ INT_PTR CALLBACK PSPProcEdit(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam, TranslateDialogDefault(hDlg);
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_ABOUT, pszSetting, DBVT_TCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_ABOUT, pszSetting, DBVT_WCHAR));
// remove static edge in aero mode
if (IsAeroMode())
diff --git a/plugins/UserInfoEx/src/psp_company.cpp b/plugins/UserInfoEx/src/psp_company.cpp index 48797d60bd..496ff3f60f 100644 --- a/plugins/UserInfoEx/src/psp_company.cpp +++ b/plugins/UserInfoEx/src/psp_company.cpp @@ -46,12 +46,12 @@ INT_PTR CALLBACK PSPProcCompany(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar TranslateDialogDefault(hDlg);
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_COMPANY, SET_CONTACT_COMPANY, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_DEPARTMENT, SET_CONTACT_COMPANY_DEPARTMENT, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_OFFICE, SET_CONTACT_COMPANY_OFFICE, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_POSITION, SET_CONTACT_COMPANY_POSITION, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_SUPERIOR, SET_CONTACT_COMPANY_SUPERIOR, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_ASSISTENT, SET_CONTACT_COMPANY_ASSISTENT, DBVT_TCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_COMPANY, SET_CONTACT_COMPANY, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_DEPARTMENT, SET_CONTACT_COMPANY_DEPARTMENT, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_OFFICE, SET_CONTACT_COMPANY_OFFICE, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_POSITION, SET_CONTACT_COMPANY_POSITION, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_SUPERIOR, SET_CONTACT_COMPANY_SUPERIOR, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_ASSISTENT, SET_CONTACT_COMPANY_ASSISTENT, DBVT_WCHAR));
GetOccupationList(&nList, &pList);
pCtrlList->insert(CCombo::CreateObj(hDlg, EDIT_OCCUPATION, SET_CONTACT_COMPANY_OCCUPATION, DBVT_WORD, pList, nList));
diff --git a/plugins/UserInfoEx/src/psp_contact.cpp b/plugins/UserInfoEx/src/psp_contact.cpp index afb2061c38..47c9afaade 100644 --- a/plugins/UserInfoEx/src/psp_contact.cpp +++ b/plugins/UserInfoEx/src/psp_contact.cpp @@ -51,11 +51,11 @@ INT_PTR CALLBACK PSPProcContactHome(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM SendDlgItemMessage(hDlg, BTN_GOTO, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Open in browser"), MBBF_TCHAR);
TranslateDialogDefault(hDlg);
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_STREET, SET_CONTACT_STREET, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_CITY, SET_CONTACT_CITY, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_ZIP, SET_CONTACT_ZIP, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_STATE, SET_CONTACT_STATE, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_HOMEPAGE, SET_CONTACT_HOMEPAGE, DBVT_TCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_STREET, SET_CONTACT_STREET, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_CITY, SET_CONTACT_CITY, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_ZIP, SET_CONTACT_ZIP, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_STATE, SET_CONTACT_STATE, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_HOMEPAGE, SET_CONTACT_HOMEPAGE, DBVT_WCHAR));
GetCountryList(&nList, &pList);
pCtrlList->insert(CCombo::CreateObj(hDlg, EDIT_COUNTRY, SET_CONTACT_COUNTRY, DBVT_WORD, pList, nList));
@@ -197,11 +197,11 @@ INT_PTR CALLBACK PSPProcContactWork(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM SendDlgItemMessage(hDlg, BTN_GOTO, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Open in browser"), MBBF_TCHAR);
TranslateDialogDefault(hDlg);
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_STREET, SET_CONTACT_COMPANY_STREET, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_CITY, SET_CONTACT_COMPANY_CITY, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_ZIP, SET_CONTACT_COMPANY_ZIP, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_STATE, SET_CONTACT_COMPANY_STATE, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_HOMEPAGE, SET_CONTACT_COMPANY_HOMEPAGE, DBVT_TCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_STREET, SET_CONTACT_COMPANY_STREET, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_CITY, SET_CONTACT_COMPANY_CITY, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_ZIP, SET_CONTACT_COMPANY_ZIP, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_STATE, SET_CONTACT_COMPANY_STATE, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_HOMEPAGE, SET_CONTACT_COMPANY_HOMEPAGE, DBVT_WCHAR));
GetCountryList(&nList, &pList);
pCtrlList->insert(CCombo::CreateObj(hDlg, EDIT_COUNTRY, SET_CONTACT_COMPANY_COUNTRY, DBVT_WORD, pList, nList));
diff --git a/plugins/UserInfoEx/src/psp_general.cpp b/plugins/UserInfoEx/src/psp_general.cpp index e0e5e349b0..5d402909fc 100644 --- a/plugins/UserInfoEx/src/psp_general.cpp +++ b/plugins/UserInfoEx/src/psp_general.cpp @@ -46,13 +46,13 @@ INT_PTR CALLBACK PSPProcGeneral(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar SendDlgItemMessage(hDlg, IDC_PAGETITLE, WM_SETFONT, (WPARAM)hBoldFont, 0);
TranslateDialogDefault(hDlg);
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_TITLE, SET_CONTACT_TITLE, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_FIRSTNAME, SET_CONTACT_FIRSTNAME, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_SECONDNAME, SET_CONTACT_SECONDNAME, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_LASTNAME, SET_CONTACT_LASTNAME, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_NICK, SET_CONTACT_NICK, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_DISPLAYNAME, "CList", SET_CONTACT_MYHANDLE, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_PARTNER, SET_CONTACT_PARTNER, DBVT_TCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_TITLE, SET_CONTACT_TITLE, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_FIRSTNAME, SET_CONTACT_FIRSTNAME, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_SECONDNAME, SET_CONTACT_SECONDNAME, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_LASTNAME, SET_CONTACT_LASTNAME, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_NICK, SET_CONTACT_NICK, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_DISPLAYNAME, "CList", SET_CONTACT_MYHANDLE, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_PARTNER, SET_CONTACT_PARTNER, DBVT_WCHAR));
GetNamePrefixList(&nList, &pList);
pCtrlList->insert(CCombo::CreateObj(hDlg, EDIT_PREFIX, SET_CONTACT_PREFIX, DBVT_BYTE, pList, nList));
@@ -62,9 +62,9 @@ INT_PTR CALLBACK PSPProcGeneral(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar pCtrlList->insert(CCombo::CreateObj(hDlg, EDIT_MARITAL, SET_CONTACT_MARITAL, DBVT_BYTE, pList, nList));
GetLanguageList(&nList, &pList);
- pCtrlList->insert(CCombo::CreateObj(hDlg, EDIT_LANG1, SET_CONTACT_LANG1, DBVT_TCHAR, pList, nList));
- pCtrlList->insert(CCombo::CreateObj(hDlg, EDIT_LANG2, SET_CONTACT_LANG2, DBVT_TCHAR, pList, nList));
- pCtrlList->insert(CCombo::CreateObj(hDlg, EDIT_LANG3, SET_CONTACT_LANG3, DBVT_TCHAR, pList, nList));
+ pCtrlList->insert(CCombo::CreateObj(hDlg, EDIT_LANG1, SET_CONTACT_LANG1, DBVT_WCHAR, pList, nList));
+ pCtrlList->insert(CCombo::CreateObj(hDlg, EDIT_LANG2, SET_CONTACT_LANG2, DBVT_WCHAR, pList, nList));
+ pCtrlList->insert(CCombo::CreateObj(hDlg, EDIT_LANG3, SET_CONTACT_LANG3, DBVT_WCHAR, pList, nList));
}
}
break;
diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index 1c93297951..bdb41d321a 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -67,7 +67,7 @@ static void FORCEINLINE ComboBox_SetCurSelByItemDataPtr(HWND hCombo, LPARAM pDat static void FORCEINLINE ComboBox_AddItemWithData(HWND hCombo, LPTSTR ptszText, LPARAM pData)
{
- ComboBox_SetItemData(hCombo, ComboBox_AddString(hCombo, TranslateTS(ptszText)), pData);
+ ComboBox_SetItemData(hCombo, ComboBox_AddString(hCombo, TranslateW(ptszText)), pData);
}
/**
diff --git a/plugins/UserInfoEx/src/psp_origin.cpp b/plugins/UserInfoEx/src/psp_origin.cpp index b9d50cec7f..5c696c90b4 100644 --- a/plugins/UserInfoEx/src/psp_origin.cpp +++ b/plugins/UserInfoEx/src/psp_origin.cpp @@ -48,10 +48,10 @@ INT_PTR CALLBACK PSPProcOrigin(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara TranslateDialogDefault(hDlg);
SetTimer(hDlg, 1, 5000, NULL);
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_STREET, SET_CONTACT_ORIGIN_STREET, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_ZIP, SET_CONTACT_ORIGIN_ZIP, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_CITY, SET_CONTACT_ORIGIN_CITY, DBVT_TCHAR));
- pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_STATE, SET_CONTACT_ORIGIN_STATE, DBVT_TCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_STREET, SET_CONTACT_ORIGIN_STREET, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_ZIP, SET_CONTACT_ORIGIN_ZIP, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_CITY, SET_CONTACT_ORIGIN_CITY, DBVT_WCHAR));
+ pCtrlList->insert(CEditCtrl::CreateObj(hDlg, EDIT_STATE, SET_CONTACT_ORIGIN_STATE, DBVT_WCHAR));
GetCountryList(&nList, &pList);
pCtrlList->insert(CCombo::CreateObj(hDlg, EDIT_COUNTRY, SET_CONTACT_ORIGIN_COUNTRY, DBVT_WORD, pList, nList));
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp index 651054eb5c..85a0c98b08 100644 --- a/plugins/UserInfoEx/src/psp_profile.cpp +++ b/plugins/UserInfoEx/src/psp_profile.cpp @@ -490,7 +490,7 @@ static int ProfileList_AddItemlistFromDB( mir_snprintf(pszSetting, szValFormat, i);
if (DB::Setting::GetTString(hContact, pszModule, pszSetting, &dbvVal))
break;
- if (dbvVal.type != DBVT_TCHAR)
+ if (dbvVal.type != DBVT_WCHAR)
continue;
mir_snprintf(pszSetting, szCatFormat, i);
DB::Setting::GetAString(hContact, pszModule, pszSetting, &dbvCat);
@@ -1219,13 +1219,13 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR continue;
if (!(pItem->wFlags & (CTRLF_HASPROTO|CTRLF_HASMETA))) {
mir_snprintf(pszSetting, pFmt[iFmt].szValFmt, iItem);
- db_set_ts(hContact, pszModule, pszSetting, pItem->pszText[1]);
+ db_set_ws(hContact, pszModule, pszSetting, pItem->pszText[1]);
// save category
mir_snprintf(pszSetting, pFmt[iFmt].szCatFmt, iItem);
if (pItem->idstrList && pItem->iListItem > 0 && pItem->iListItem < pItem->idstrListCount)
db_set_s(hContact, pszModule, pszSetting, (LPSTR)pItem->idstrList[pItem->iListItem].pszText);
else if (pItem->pszText[0] && *pItem->pszText[0])
- db_set_ts(hContact, pszModule, pszSetting, (LPTSTR)pItem->pszText[0]);
+ db_set_ws(hContact, pszModule, pszSetting, (LPTSTR)pItem->pszText[0]);
else
db_unset(hContact, pszModule, pszSetting);
// redraw the item if required
@@ -1339,7 +1339,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR SetTextColor(cd->nmcd.hdc, GetSysColor(COLOR_3DSHADOW));
ProfileList_GetItemText(cd->nmcd.hdr.hwndFrom, cd->nmcd.dwItemSpec, 0, szText, MAX_PATH);
rc.left += 6;
- DrawText(cd->nmcd.hdc, TranslateTS(szText), -1, &rc, DT_NOCLIP | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
+ DrawText(cd->nmcd.hdc, TranslateW(szText), -1, &rc, DT_NOCLIP | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
rc.bottom -= 2;
rc.top = rc.bottom - 1;
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 63e077a06f..94e317b8e6 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -255,7 +255,7 @@ static int NotifyWithPopup(MCONTACT hContact, CEvent::EType eventType, int DaysT if (hContact) {
ppd.lchContact = hContact;
- mir_snwprintf(ppd.lptzContactName, L"%s - %s", TranslateTS(pszDesc), DB::Contact::DisplayName(hContact));
+ mir_snwprintf(ppd.lptzContactName, L"%s - %s", TranslateW(pszDesc), DB::Contact::DisplayName(hContact));
}
else mir_wstrncpy(ppd.lptzContactName, TranslateT("Reminder"), _countof(ppd.lptzContactName));
@@ -372,7 +372,7 @@ static BYTE CheckAnniversaries(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE int numAnniversaries = 0;
int Diff = 0;
MAnnivDate mta;
- CMString tszMsg;
+ CMStringW tszMsg;
if (gRemindOpts.RemindState == REMIND_ANNIV || gRemindOpts.RemindState == REMIND_ALL) {
for (int i = 0; i < ANID_LAST && !mta.DBGetAnniversaryDate(hContact, i); i++) {
diff --git a/plugins/UserInfoEx/src/svc_timezone_old.cpp b/plugins/UserInfoEx/src/svc_timezone_old.cpp index dfb93928ba..759a8a321a 100644 --- a/plugins/UserInfoEx/src/svc_timezone_old.cpp +++ b/plugins/UserInfoEx/src/svc_timezone_old.cpp @@ -440,7 +440,7 @@ WORD GetContactTimeZoneCtrl(MCONTACT hContact, LPCSTR pszProto, CTimeZone** pTim CTimeZone* pTz = NULL;
// try to read windows' timezone name from database
- flags = DB::Setting::GetCtrl(hContact, USERINFO, USERINFO, pszProto, SET_CONTACT_TIMEZONENAME, &dbv, DBVT_TCHAR);
+ flags = DB::Setting::GetCtrl(hContact, USERINFO, USERINFO, pszProto, SET_CONTACT_TIMEZONENAME, &dbv, DBVT_WCHAR);
if (flags == 0 || FAILED(TzMgr.find(&pTz, dbv.ptszVal))) {
db_free(&dbv);
diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index b0a46021ee..471502da27 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -150,14 +150,14 @@ wchar_t* getContactInfoT(BYTE type, MCONTACT hContact) return NULL;
case CCNF_GROUP:
- if ((res = db_get_tsa(hContact, "CList", "Group")) != NULL)
+ if ((res = db_get_wsa(hContact, "CList", "Group")) != NULL)
return res;
break;
case CNF_UNIQUEID:
//UID for ChatRoom
if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1)
- if ((res = db_get_tsa(hContact, szProto, "ChatRoomID")) != NULL)
+ if ((res = db_get_wsa(hContact, szProto, "ChatRoomID")) != NULL)
return res;
//UID for other contact
@@ -192,7 +192,7 @@ MCONTACT getContactFromString(const wchar_t *tszContact, DWORD dwFlags, int nMat }
// contact was not in cache, do a search
- CMString tmp;
+ CMStringW tmp;
int count = 0;
MCONTACT hContact;
LIST<void> arResults(1);
diff --git a/plugins/Variables/src/dbhelpers.h b/plugins/Variables/src/dbhelpers.h index 4531bf397f..b942337774 100644 --- a/plugins/Variables/src/dbhelpers.h +++ b/plugins/Variables/src/dbhelpers.h @@ -104,7 +104,7 @@ static int __inline DBDeleteIthSetting(DWORD i, MCONTACT hContact,const char *sz #define db_gets(a,b) db_get(NULL, MODULENAME, a, b)
#define db_setb(a,b) db_set_b(NULL, MODULENAME, a, (BYTE)(b))
#define db_sets(a,b) db_set_s(NULL, MODULENAME, a, b)
-#define db_setts(a,b) db_set_ts(NULL, MODULENAME, a, b)
+#define db_setts(a,b) db_set_ws(NULL, MODULENAME, a, b)
#define db_setw(a,b) db_set_w(NULL, MODULENAME, a, (WORD)(b))
#define db_setd(a,b) db_set_dw(NULL, MODULENAME, a, (DWORD)(b))
#define db_del(a) db_unset(NULL, MODULENAME, a);
diff --git a/plugins/Variables/src/help.cpp b/plugins/Variables/src/help.cpp index 7d663d4aae..c32efb2dcb 100644 --- a/plugins/Variables/src/help.cpp +++ b/plugins/Variables/src/help.cpp @@ -129,7 +129,7 @@ static INT_PTR CALLBACK clistDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM MCONTACT hItem, hContact = wParam; log_debugA("VARM_SETSUBJECT: %u", hContact); if (hContact == INVALID_CONTACT_ID) { - wchar_t *tszContact = db_get_tsa(NULL, MODULENAME, SETTING_SUBJECT); + wchar_t *tszContact = db_get_wsa(NULL, MODULENAME, SETTING_SUBJECT); log_debugA("VARM_SETSUBJECT: %s", tszContact); if (tszContact != NULL) { hContact = getContactFromString(tszContact, CI_PROTOID); @@ -204,7 +204,7 @@ static INT_PTR CALLBACK clistDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM if (hContact != NULL) { wchar_t *tszContact = encodeContactToString(hContact); if (tszContact != NULL) { - db_set_ts(NULL, MODULENAME, SETTING_SUBJECT, tszContact); + db_set_ws(NULL, MODULENAME, SETTING_SUBJECT, tszContact); mir_free(tszContact); } } break; @@ -403,7 +403,7 @@ static BOOL CALLBACK processTokenListMessage(HWND hwndDlg, UINT msg, WPARAM, LPA tszHelpDesc = mir_wstrdup(L"unknown"); lvItem.iSubItem = 1; - lvItem.pszText = TranslateTS(tszHelpDesc); + lvItem.pszText = TranslateW(tszHelpDesc); ListView_SetItem(hList, &lvItem); mir_free(tszHelpDesc); } @@ -422,7 +422,7 @@ static BOOL CALLBACK processTokenListMessage(HWND hwndDlg, UINT msg, WPARAM, LPA cat = getTokenCategory((TOKENREGISTEREX *)lvItem.lParam); if (cat != NULL) { - text = mir_wstrdup(TranslateTS(cat)); + text = mir_wstrdup(TranslateW(cat)); mir_free(cat); } else text = NULL; diff --git a/plugins/Variables/src/options.cpp b/plugins/Variables/src/options.cpp index d07ad89999..8be86a9349 100644 --- a/plugins/Variables/src/options.cpp +++ b/plugins/Variables/src/options.cpp @@ -26,7 +26,7 @@ static INT_PTR CALLBACK SetOptsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA TranslateDialogDefault(hwndDlg);
{
DBVARIANT dbv;
- if (!db_get_ts( NULL, MODULENAME, SETTING_STARTUPTEXT, &dbv )) {
+ if (!db_get_ws( NULL, MODULENAME, SETTING_STARTUPTEXT, &dbv )) {
SetDlgItemText(hwndDlg, IDC_FORMATTEXT, dbv.ptszVal);
db_free(&dbv);
}
@@ -90,7 +90,7 @@ static INT_PTR CALLBACK SetOptsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA break;
if (GetDlgItemText(hwndDlg, IDC_FORMATTEXT, szFormatText, len+1) != 0)
- db_set_ts(NULL, MODULENAME, SETTING_STARTUPTEXT, szFormatText);
+ db_set_ws(NULL, MODULENAME, SETTING_STARTUPTEXT, szFormatText);
mir_free(szFormatText);
}
diff --git a/plugins/Variables/src/parse_metacontacts.cpp b/plugins/Variables/src/parse_metacontacts.cpp index b8d2e9e324..9fc394c6f9 100644 --- a/plugins/Variables/src/parse_metacontacts.cpp +++ b/plugins/Variables/src/parse_metacontacts.cpp @@ -44,7 +44,7 @@ static wchar_t *parseGetParent(ARGUMENTSINFO *ai) szUniqueID = mir_wstrdup(tszID);
}
- return CMString(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
+ return CMStringW(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
}
static wchar_t *parseGetDefault(ARGUMENTSINFO *ai)
@@ -72,7 +72,7 @@ static wchar_t *parseGetDefault(ARGUMENTSINFO *ai) szUniqueID = mir_wstrdup(tszID);
}
- return CMString(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
+ return CMStringW(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
}
static wchar_t *parseGetMostOnline(ARGUMENTSINFO *ai)
@@ -100,7 +100,7 @@ static wchar_t *parseGetMostOnline(ARGUMENTSINFO *ai) szUniqueID = mir_wstrdup(tszID);
}
- return CMString(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
+ return CMStringW(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
}
void registerMetaContactsTokens()
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index 11eb8d0181..72493df3da 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -126,7 +126,7 @@ static wchar_t* parseDBProfileName(ARGUMENTSINFO *ai) return NULL;
wchar_t name[MAX_PATH];
- if (CallService(MS_DB_GETPROFILENAMET, _countof(name), (LPARAM)name))
+ if (CallService(MS_DB_GETPROFILENAMEW, _countof(name), (LPARAM)name))
return NULL;
return mir_wstrdup(name);
@@ -138,7 +138,7 @@ static wchar_t* parseDBProfilePath(ARGUMENTSINFO *ai) return NULL;
wchar_t path[MAX_PATH];
- if (CallService(MS_DB_GETPROFILEPATHT, _countof(path), (LPARAM)path))
+ if (CallService(MS_DB_GETPROFILEPATHW, _countof(path), (LPARAM)path))
return NULL;
return mir_wstrdup(path);
@@ -395,7 +395,7 @@ static wchar_t* parseSpecialContact(ARGUMENTSINFO *ai) if (szUniqueID == NULL)
return NULL;
- return CMString(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
+ return CMStringW(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
}
static BOOL isValidDbEvent(DBEVENTINFO *dbe, int flags)
@@ -579,7 +579,7 @@ static wchar_t* parseDbEvent(ARGUMENTSINFO *ai) return NULL;
}
- wchar_t *res = DbGetEventTextT(&dbe, CP_ACP);
+ wchar_t *res = DbGetEventTextW(&dbe, CP_ACP);
mir_free(dbe.pBlob);
return res;
}
@@ -589,7 +589,7 @@ static wchar_t* parseTranslate(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- wchar_t *res = TranslateTS(ai->targv[1]);
+ wchar_t *res = TranslateW(ai->targv[1]);
return (res == NULL) ? NULL : mir_wstrdup(res);
}
diff --git a/plugins/Variables/src/variables.cpp b/plugins/Variables/src/variables.cpp index ace282aac9..a6db523926 100644 --- a/plugins/Variables/src/variables.cpp +++ b/plugins/Variables/src/variables.cpp @@ -455,7 +455,7 @@ int LoadVarModule() if (db_get_b(NULL, MODULENAME, SETTING_PARSEATSTARTUP, 0)) { FORMATINFO fi = { 0 }; fi.cbSize = sizeof(fi); - fi.tszFormat = db_get_tsa(NULL, MODULENAME, SETTING_STARTUPTEXT); + fi.tszFormat = db_get_wsa(NULL, MODULENAME, SETTING_STARTUPTEXT); if (fi.tszFormat != NULL) { mir_free(formatString(&fi)); mir_free(fi.tszFormat); diff --git a/plugins/Watrack_MPD/src/init.cpp b/plugins/Watrack_MPD/src/init.cpp index d5328df19b..eedf62bd0c 100755 --- a/plugins/Watrack_MPD/src/init.cpp +++ b/plugins/Watrack_MPD/src/init.cpp @@ -59,7 +59,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) {
NETLIBUSER nlu = {0};
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.ptszDescriptiveName = TranslateT("Watrack MPD connection");
nlu.szSettingsModule = __PLUGIN_NAME;
ghNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
diff --git a/plugins/Watrack_MPD/src/options.cpp b/plugins/Watrack_MPD/src/options.cpp index 3178947f61..1944953c62 100755 --- a/plugins/Watrack_MPD/src/options.cpp +++ b/plugins/Watrack_MPD/src/options.cpp @@ -51,10 +51,10 @@ static INT_PTR CALLBACK DlgProcWaMpdOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM db_set_w(NULL, szModuleName, "Port", (WORD)GetDlgItemInt(hwndDlg, IDC_PORT, NULL, FALSE)); gbPort = (WORD)GetDlgItemInt(hwndDlg, IDC_PORT, NULL, FALSE); GetDlgItemText(hwndDlg, IDC_SERVER, szText, _countof(szText)); - db_set_ts(NULL, szModuleName, "Server", szText); + db_set_ws(NULL, szModuleName, "Server", szText); mir_wstrcpy(gbHost, szText); GetDlgItemText(hwndDlg, IDC_PASSWORD, szText, _countof(szText)); - db_set_ts(NULL, szModuleName, "Password", szText); + db_set_ws(NULL, szModuleName, "Password", szText); mir_wstrcpy(gbPassword, szText); return TRUE; } @@ -74,7 +74,7 @@ int WaMpdOptInit(WPARAM wParam,LPARAM) odp.pwszTitle = LPGENW("Winamp Track"); odp.pwszGroup = LPGENW("Plugins"); odp.pwszTab = LPGENW("Watrack MPD"); - odp.flags=ODPF_BOLDGROUPS|ODPF_TCHAR; + odp.flags=ODPF_BOLDGROUPS|ODPF_UNICODE; odp.pfnDlgProc = DlgProcWaMpdOpts; Options_AddPage(wParam, &odp); return 0; diff --git a/plugins/Watrack_MPD/src/utilities.cpp b/plugins/Watrack_MPD/src/utilities.cpp index c3e9e40cc8..1a833a8126 100755 --- a/plugins/Watrack_MPD/src/utilities.cpp +++ b/plugins/Watrack_MPD/src/utilities.cpp @@ -19,6 +19,6 @@ wchar_t* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, wchar_t* szDef) { - wchar_t *szRes = db_get_tsa(hContact, szModule, szSetting); + wchar_t *szRes = db_get_wsa(hContact, szModule, szSetting); return szRes ? szRes : mir_wstrdup(szDef); } diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index c1c2f26f67..b3190f0b78 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -226,8 +226,8 @@ extern "C" int __declspec(dllexport) Load(void) InitServices();
// add sound event
- SkinAddNewSoundExT("weatherupdated", _A2W(WEATHERPROTONAME), LPGENW("Weather Condition Changed"));
- SkinAddNewSoundExT("weatheralert", _A2W(WEATHERPROTONAME), LPGENW("Weather Alert Issued"));
+ SkinAddNewSoundExW("weatherupdated", _A2W(WEATHERPROTONAME), LPGENW("Weather Condition Changed"));
+ SkinAddNewSoundExW("weatheralert", _A2W(WEATHERPROTONAME), LPGENW("Weather Alert Issued"));
// window needed for popup commands
wchar_t SvcFunc[100];
diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index c9a276a484..8cdd7c98ed 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -44,7 +44,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) if (IsMyContact(hContact)) {
DBVARIANT dbv;
// check ID to see if the contact already exist in the database
- if (!db_get_ts(hContact, WEATHERPROTONAME, "ID", &dbv)) {
+ if (!db_get_ws(hContact, WEATHERPROTONAME, "ID", &dbv)) {
if (!mir_wstrcmpi(psr->email.w, dbv.ptszVal)) {
// remove the flag for not on list and hidden, thus make the contact visible
// and add them on the list
@@ -75,7 +75,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) // set settings by obtaining the default for the service
if (psr->lastName.w[0] != 0) {
WIDATA *sData = GetWIData(svc);
- db_set_ts(hContact, WEATHERPROTONAME, "MapURL", sData->DefaultMap);
+ db_set_ws(hContact, WEATHERPROTONAME, "MapURL", sData->DefaultMap);
db_set_s(hContact, WEATHERPROTONAME, "InfoURL", sData->DefaultURL);
}
else { // if no valid service is found, create empty strings for MapURL and InfoURL
@@ -83,15 +83,15 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) db_set_s(hContact, WEATHERPROTONAME, "InfoURL", "");
}
// write the other info and settings to the database
- db_set_ts(hContact, WEATHERPROTONAME, "ID", psr->email.w);
- db_set_ts(hContact, WEATHERPROTONAME, "Nick", psr->nick.w);
+ db_set_ws(hContact, WEATHERPROTONAME, "ID", psr->email.w);
+ db_set_ws(hContact, WEATHERPROTONAME, "Nick", psr->nick.w);
db_set_w(hContact, WEATHERPROTONAME, "Status", ID_STATUS_OFFLINE);
AvatarDownloaded(hContact);
wchar_t str[256];
mir_snwprintf(str, TranslateT("Current weather information for %s."), psr->nick.w);
- db_set_ts(hContact, WEATHERPROTONAME, "About", str);
+ db_set_ws(hContact, WEATHERPROTONAME, "About", str);
// make the last update tags to something invalid
db_set_s(hContact, WEATHERPROTONAME, "LastLog", "never");
@@ -107,13 +107,13 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) GetStationID(hContact, opt.Default, _countof(opt.Default));
opt.DefStn = hContact;
- if (!db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
+ if (!db_get_ws(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
// notification message box
mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
db_free(&dbv);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
- db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default);
+ db_set_ws(NULL, WEATHERPROTONAME, "Default", opt.Default);
}
// display the Edit Settings dialog box
EditSettings(hContact, 0);
@@ -255,7 +255,7 @@ int IDSearchProc(wchar_t *sID, const int searchId, WIIDSEARCH *sData, wchar_t *s // set the search result and broadcast it
PROTOSEARCHRESULT psr = { sizeof(psr) };
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.nick.w = str;
psr.firstName.w = L" ";
psr.lastName.w = svcname;
@@ -286,7 +286,7 @@ int IDSearch(wchar_t *sID, const int searchId) else {
// return an empty contact on "#"
PROTOSEARCHRESULT psr = { sizeof(psr) };
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.nick.w = TranslateT("<Enter station name here>"); // to be entered
psr.firstName.w = L" ";
psr.lastName.w = L"";
@@ -348,7 +348,7 @@ int NameSearchProc(wchar_t *name, const int searchId, WINAMESEARCH *sData, wchar // set the data and broadcast it
PROTOSEARCHRESULT psr = { sizeof(psr) };
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.nick.w = Name;
psr.firstName.w = L" ";
psr.lastName.w = svcname;
@@ -386,7 +386,7 @@ int NameSearchProc(wchar_t *name, const int searchId, WINAMESEARCH *sData, wchar wcsncpy(Name, name, _countof(Name));
PROTOSEARCHRESULT psr = { sizeof(psr) };
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.nick.w = Name;
psr.firstName.w = L"";
psr.lastName.w = svcname;
diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp index 80e7d5f970..9903cbf010 100644 --- a/plugins/Weather/src/weather_contacts.cpp +++ b/plugins/Weather/src/weather_contacts.cpp @@ -41,7 +41,7 @@ INT_PTR ViewLog(WPARAM wParam, LPARAM lParam) {
// see if the log path is set
DBVARIANT dbv;
- if (!db_get_ts(wParam, WEATHERPROTONAME, "Log", &dbv)) {
+ if (!db_get_ws(wParam, WEATHERPROTONAME, "Log", &dbv)) {
if (dbv.pszVal[0] != 0)
ShellExecute((HWND)lParam, L"open", dbv.ptszVal, L"", L"", SW_SHOW);
db_free(&dbv);
@@ -60,7 +60,7 @@ INT_PTR LoadForecast(WPARAM wParam, LPARAM) GetStationID(wParam, id, _countof(id));
if (id[0] != 0) {
// check if the complte forecast URL is set. If it is not, display warning and quit
- if (db_get_tstatic(wParam, WEATHERPROTONAME, "InfoURL", loc2, _countof(loc2)) || loc2[0] == 0) {
+ if (db_get_wstatic(wParam, WEATHERPROTONAME, "InfoURL", loc2, _countof(loc2)) || loc2[0] == 0) {
MessageBox(NULL, NO_FORECAST_URL, TranslateT("Weather Protocol"), MB_ICONINFORMATION);
return 1;
}
@@ -78,7 +78,7 @@ INT_PTR WeatherMap(WPARAM wParam, LPARAM) GetStationID(wParam, id, _countof(id));
if (id[0] != 0) {
// check if the weather map URL is set. If it is not, display warning and quit
- if (db_get_tstatic(wParam, WEATHERPROTONAME, "MapURL", loc2, _countof(loc2)) || loc2[0] == 0) {
+ if (db_get_wstatic(wParam, WEATHERPROTONAME, "MapURL", loc2, _countof(loc2)) || loc2[0] == 0) {
MessageBox(NULL, NO_MAP_URL, TranslateT("Weather Protocol"), MB_ICONINFORMATION);
return 1;
}
@@ -145,30 +145,30 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA SendDlgItemMessage(hwndDlg, IDC_RESET2, BUTTONSETASFLATBTN, TRUE, 0);
// set tooltip for the buttons
- SendDlgItemMessage(hwndDlg, IDC_GETNAME, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Get city name from ID"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_SVCINFO, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Weather INI information"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_BROWSE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Browse"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_VIEW1, BUTTONADDTOOLTIP, (WPARAM)LPGENW("View webpage"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_RESET1, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset to default"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_VIEW2, BUTTONADDTOOLTIP, (WPARAM)LPGENW("View webpage"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_RESET2, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset to default"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_GETNAME, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Get city name from ID"), BATF_UNICODE);
+ SendDlgItemMessage(hwndDlg, IDC_SVCINFO, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Weather INI information"), BATF_UNICODE);
+ SendDlgItemMessage(hwndDlg, IDC_BROWSE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Browse"), BATF_UNICODE);
+ SendDlgItemMessage(hwndDlg, IDC_VIEW1, BUTTONADDTOOLTIP, (WPARAM)LPGENW("View webpage"), BATF_UNICODE);
+ SendDlgItemMessage(hwndDlg, IDC_RESET1, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset to default"), BATF_UNICODE);
+ SendDlgItemMessage(hwndDlg, IDC_VIEW2, BUTTONADDTOOLTIP, (WPARAM)LPGENW("View webpage"), BATF_UNICODE);
+ SendDlgItemMessage(hwndDlg, IDC_RESET2, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset to default"), BATF_UNICODE);
// save the handle for the contact
WindowList_Add(hWindowList, hwndDlg, hContact);
// start to get the settings
// if the setting not exist, leave the dialog box blank
- if (!db_get_ts(hContact, WEATHERPROTONAME, "ID", &dbv)) {
+ if (!db_get_ws(hContact, WEATHERPROTONAME, "ID", &dbv)) {
SetDlgItemText(hwndDlg, IDC_ID, dbv.ptszVal);
// check if the station is a default station
CheckDlgButton(hwndDlg, IDC_DEFA, mir_wstrcmp(dbv.ptszVal, opt.Default) != 0 ? BST_CHECKED : BST_UNCHECKED);
db_free(&dbv);
}
- if (!db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
+ if (!db_get_ws(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
SetDlgItemText(hwndDlg, IDC_NAME, dbv.ptszVal);
db_free(&dbv);
}
- if (!db_get_ts(hContact, WEATHERPROTONAME, "Log", &dbv)) {
+ if (!db_get_ws(hContact, WEATHERPROTONAME, "Log", &dbv)) {
SetDlgItemText(hwndDlg, IDC_LOG, dbv.ptszVal);
// if the log path is not empty, check the checkbox for external log
if (dbv.ptszVal[0]) CheckDlgButton(hwndDlg, IDC_External, BST_CHECKED);
@@ -182,11 +182,11 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA CheckDlgButton(hwndDlg, IDC_DAutoUpdate, db_get_b(hContact, WEATHERPROTONAME, "DAutoUpdate", FALSE) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_Internal, db_get_b(hContact, WEATHERPROTONAME, "History", 0) ? BST_CHECKED : BST_UNCHECKED);
- if (!db_get_ts(hContact, WEATHERPROTONAME, "InfoURL", &dbv)) {
+ if (!db_get_ws(hContact, WEATHERPROTONAME, "InfoURL", &dbv)) {
SetDlgItemText(hwndDlg, IDC_IURL, dbv.ptszVal);
db_free(&dbv);
}
- if (!db_get_ts(hContact, WEATHERPROTONAME, "MapURL", &dbv)) {
+ if (!db_get_ws(hContact, WEATHERPROTONAME, "MapURL", &dbv)) {
SetDlgItemText(hwndDlg, IDC_MURL, dbv.ptszVal);
db_free(&dbv);
}
@@ -341,30 +341,30 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA // temporary disable the protocol while applying the change
// start writing the new settings to database
GetDlgItemText(hwndDlg, IDC_ID, str, _countof(str));
- db_set_ts(hContact, WEATHERPROTONAME, "ID", str);
+ db_set_ws(hContact, WEATHERPROTONAME, "ID", str);
if ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_DEFA)) { // if default station is set
mir_wstrcpy(opt.Default, str);
opt.DefStn = hContact;
- db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default);
+ db_set_ws(NULL, WEATHERPROTONAME, "Default", opt.Default);
}
GetDlgItemText(hwndDlg, IDC_NAME, city, _countof(city));
- db_set_ts(hContact, WEATHERPROTONAME, "Nick", city);
+ db_set_ws(hContact, WEATHERPROTONAME, "Nick", city);
mir_snwprintf(str2, TranslateT("Current weather information for %s."), city);
if ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)) {
GetDlgItemText(hwndDlg, IDC_LOG, str, _countof(str));
- db_set_ts(hContact, WEATHERPROTONAME, "Log", str);
+ db_set_ws(hContact, WEATHERPROTONAME, "Log", str);
}
else db_unset(hContact, WEATHERPROTONAME, "Log");
GetDlgItemText(hwndDlg, IDC_IURL, str, _countof(str));
- db_set_ts(hContact, WEATHERPROTONAME, "InfoURL", str);
+ db_set_ws(hContact, WEATHERPROTONAME, "InfoURL", str);
GetDlgItemText(hwndDlg, IDC_MURL, str, _countof(str));
- db_set_ts(hContact, WEATHERPROTONAME, "MapURL", str);
+ db_set_ws(hContact, WEATHERPROTONAME, "MapURL", str);
db_set_w(hContact, WEATHERPROTONAME, "Status", ID_STATUS_OFFLINE);
db_set_w(hContact, WEATHERPROTONAME, "StatusIcon", ID_STATUS_OFFLINE);
AvatarDownloaded(hContact);
- db_set_ts(hContact, WEATHERPROTONAME, "About", str2);
+ db_set_ws(hContact, WEATHERPROTONAME, "About", str2);
db_set_b(hContact, WEATHERPROTONAME, "History", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_Internal));
db_set_b(hContact, WEATHERPROTONAME, "Overwrite", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_Overwrite));
db_set_b(hContact, WEATHERPROTONAME, "File", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_External));
@@ -436,7 +436,7 @@ int ContactDeleted(WPARAM wParam, LPARAM) removeWindow(wParam);
// exit this function if it is not default station
- ptrW tszID(db_get_tsa(wParam, WEATHERPROTONAME, "ID"));
+ ptrW tszID(db_get_wsa(wParam, WEATHERPROTONAME, "ID"));
if (tszID != NULL)
if (mir_wstrcmp(tszID, opt.Default))
return 0;
@@ -445,7 +445,7 @@ int ContactDeleted(WPARAM wParam, LPARAM) // start looking for other weather stations
for (MCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) {
- tszID = db_get_tsa(hContact, WEATHERPROTONAME, "ID");
+ tszID = db_get_wsa(hContact, WEATHERPROTONAME, "ID");
if (tszID == NULL)
continue;
@@ -454,13 +454,13 @@ int ContactDeleted(WPARAM wParam, LPARAM) if (mir_wstrcmp(opt.Default, tszID)) {
wcsncpy_s(opt.Default, tszID, _TRUNCATE);
opt.DefStn = hContact;
- ptrW tszNick(db_get_tsa(hContact, WEATHERPROTONAME, "Nick"));
+ ptrW tszNick(db_get_wsa(hContact, WEATHERPROTONAME, "Nick"));
if (tszNick != NULL) {
wchar_t str[255];
mir_snwprintf(str, TranslateT("%s is now the default weather station"), (wchar_t*)tszNick);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
- db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default);
+ db_set_ws(NULL, WEATHERPROTONAME, "Default", opt.Default);
return 0; // exit this function quickly
}
}
@@ -468,7 +468,7 @@ int ContactDeleted(WPARAM wParam, LPARAM) // got here if no more weather station left
opt.Default[0] = 0; // no default station
opt.DefStn = NULL;
- db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default);
+ db_set_ws(NULL, WEATHERPROTONAME, "Default", opt.Default);
return 0;
}
diff --git a/plugins/Weather/src/weather_conv.cpp b/plugins/Weather/src/weather_conv.cpp index 168fd77d09..15428e3839 100644 --- a/plugins/Weather/src/weather_conv.cpp +++ b/plugins/Weather/src/weather_conv.cpp @@ -391,12 +391,12 @@ WORD GetIcon(const wchar_t* cond, WIDATA *Data) j++;
// using the format _T("# Weather <condition name> <counter> #"
mir_snwprintf(LangPackStr, L"# Weather %s %i #", statusStr[i], j);
- wcsncpy_s(LangPackStr1, TranslateTS(LangPackStr), _TRUNCATE);
+ wcsncpy_s(LangPackStr1, TranslateW(LangPackStr), _TRUNCATE);
CharLowerBuff(LangPackStr1, (DWORD)mir_wstrlen(LangPackStr1));
if (wcsstr(cond, LangPackStr1) != NULL)
return statusValue[i];
// loop until the translation string exists (ie, the translated string is differ from original)
- } while (mir_wstrcmp(TranslateTS(LangPackStr), LangPackStr));
+ } while (mir_wstrcmp(TranslateW(LangPackStr), LangPackStr));
}
return NA;
@@ -548,8 +548,8 @@ wchar_t* GetDisplay(WEATHERINFO *w, const wchar_t *dis, wchar_t* str) mir_strcat(name, temp);
}
// access the database to get its value
- if (!db_get_ts(w->hContact, WEATHERCONDITION, name, &dbv)) {
- if (dbv.ptszVal != TranslateTS(NODATA) && dbv.ptszVal != TranslateT("<Error>"))
+ if (!db_get_ws(w->hContact, WEATHERCONDITION, name, &dbv)) {
+ if (dbv.ptszVal != TranslateW(NODATA) && dbv.ptszVal != TranslateT("<Error>"))
mir_wstrcat(str, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp index f8df3f7f18..eea3edf81b 100644 --- a/plugins/Weather/src/weather_data.cpp +++ b/plugins/Weather/src/weather_data.cpp @@ -33,7 +33,7 @@ saving individual weather data for a weather contact. void GetStationID(MCONTACT hContact, wchar_t* id, int idlen)
{
// accessing the database
- if (db_get_tstatic(hContact, WEATHERPROTONAME, "ID", id, idlen))
+ if (db_get_wstatic(hContact, WEATHERPROTONAME, "ID", id, idlen))
id[0] = 0;
}
@@ -49,35 +49,35 @@ WEATHERINFO LoadWeatherInfo(MCONTACT hContact) winfo.hContact = hContact;
GetStationID(hContact, winfo.id, _countof(winfo.id));
- if (db_get_tstatic(hContact, WEATHERPROTONAME, "Nick", winfo.city, _countof(winfo.city)))
+ if (db_get_wstatic(hContact, WEATHERPROTONAME, "Nick", winfo.city, _countof(winfo.city)))
wcsncpy(winfo.city, NODATA, _countof(winfo.city) - 1);
- if (db_get_tstatic(hContact, WEATHERCONDITION, "Update", winfo.update, _countof(winfo.update)))
+ if (db_get_wstatic(hContact, WEATHERCONDITION, "Update", winfo.update, _countof(winfo.update)))
wcsncpy(winfo.update, NODATA, _countof(winfo.update) - 1);
- if (db_get_tstatic(hContact, WEATHERCONDITION, "Condition", winfo.cond, _countof(winfo.cond)))
+ if (db_get_wstatic(hContact, WEATHERCONDITION, "Condition", winfo.cond, _countof(winfo.cond)))
wcsncpy(winfo.cond, NODATA, _countof(winfo.cond) - 1);
- if (db_get_tstatic(hContact, WEATHERCONDITION, "Temperature", winfo.temp, _countof(winfo.temp)))
+ if (db_get_wstatic(hContact, WEATHERCONDITION, "Temperature", winfo.temp, _countof(winfo.temp)))
wcsncpy(winfo.temp, NODATA, _countof(winfo.temp) - 1);
- if (db_get_tstatic(hContact, WEATHERCONDITION, "High", winfo.high, _countof(winfo.high)))
+ if (db_get_wstatic(hContact, WEATHERCONDITION, "High", winfo.high, _countof(winfo.high)))
wcsncpy(winfo.high, NODATA, _countof(winfo.high) - 1);
- if (db_get_tstatic(hContact, WEATHERCONDITION, "Low", winfo.low, _countof(winfo.low)))
+ if (db_get_wstatic(hContact, WEATHERCONDITION, "Low", winfo.low, _countof(winfo.low)))
wcsncpy(winfo.low, NODATA, _countof(winfo.low) - 1);
- if (db_get_tstatic(hContact, WEATHERCONDITION, "Sunset", winfo.sunset, _countof(winfo.sunset)))
+ if (db_get_wstatic(hContact, WEATHERCONDITION, "Sunset", winfo.sunset, _countof(winfo.sunset)))
wcsncpy(winfo.sunset, NODATA, _countof(winfo.sunset) - 1);
- if (db_get_tstatic(hContact, WEATHERCONDITION, "Sunrise", winfo.sunrise, _countof(winfo.sunrise)))
+ if (db_get_wstatic(hContact, WEATHERCONDITION, "Sunrise", winfo.sunrise, _countof(winfo.sunrise)))
wcsncpy(winfo.sunrise, NODATA, _countof(winfo.sunrise) - 1);
- if (db_get_tstatic(hContact, WEATHERCONDITION, "Wind Speed", winfo.wind, _countof(winfo.wind)))
+ if (db_get_wstatic(hContact, WEATHERCONDITION, "Wind Speed", winfo.wind, _countof(winfo.wind)))
wcsncpy(winfo.wind, NODATA, _countof(winfo.wind) - 1);
- if (db_get_tstatic(hContact, WEATHERCONDITION, "Wind Direction", winfo.winddir, _countof(winfo.winddir)))
+ if (db_get_wstatic(hContact, WEATHERCONDITION, "Wind Direction", winfo.winddir, _countof(winfo.winddir)))
wcsncpy(winfo.winddir, NODATA, _countof(winfo.winddir) - 1);
- if (db_get_tstatic(hContact, WEATHERCONDITION, "Dewpoint", winfo.dewpoint, _countof(winfo.dewpoint)))
+ if (db_get_wstatic(hContact, WEATHERCONDITION, "Dewpoint", winfo.dewpoint, _countof(winfo.dewpoint)))
wcsncpy(winfo.dewpoint, NODATA, _countof(winfo.dewpoint) - 1);
- if (db_get_tstatic(hContact, WEATHERCONDITION, "Pressure", winfo.pressure, _countof(winfo.pressure)))
+ if (db_get_wstatic(hContact, WEATHERCONDITION, "Pressure", winfo.pressure, _countof(winfo.pressure)))
wcsncpy(winfo.pressure, NODATA, _countof(winfo.pressure) - 1);
- if (db_get_tstatic(hContact, WEATHERCONDITION, "Visibility", winfo.vis, _countof(winfo.vis)))
+ if (db_get_wstatic(hContact, WEATHERCONDITION, "Visibility", winfo.vis, _countof(winfo.vis)))
wcsncpy(winfo.vis, NODATA, _countof(winfo.vis) - 1);
- if (db_get_tstatic(hContact, WEATHERCONDITION, "Humidity", winfo.humid, _countof(winfo.humid)))
+ if (db_get_wstatic(hContact, WEATHERCONDITION, "Humidity", winfo.humid, _countof(winfo.humid)))
wcsncpy(winfo.humid, NODATA, _countof(winfo.humid) - 1);
- if (db_get_tstatic(hContact, WEATHERCONDITION, "Feel", winfo.feel, _countof(winfo.feel)))
+ if (db_get_wstatic(hContact, WEATHERCONDITION, "Feel", winfo.feel, _countof(winfo.feel)))
wcsncpy(winfo.feel, NODATA, _countof(winfo.feel) - 1);
winfo.status = (WORD)db_get_w(hContact, WEATHERPROTONAME, "StatusIcon", ID_STATUS_OFFLINE);
@@ -88,13 +88,13 @@ WEATHERINFO LoadWeatherInfo(MCONTACT hContact) // return 0 on success
int DBGetData(MCONTACT hContact, char *setting, DBVARIANT *dbv)
{
- if (db_get_ts(hContact, WEATHERCONDITION, setting, dbv)) {
+ if (db_get_ws(hContact, WEATHERCONDITION, setting, dbv)) {
size_t len = mir_strlen(setting) + 1;
char *set = (char*)alloca(len + 1);
*set = '#';
memcpy(set + 1, setting, len);
- if (db_get_ts(hContact, WEATHERCONDITION, set, dbv))
+ if (db_get_ws(hContact, WEATHERCONDITION, set, dbv))
return 1;
}
return 0;
@@ -117,8 +117,8 @@ void EraseAllInfo() db_set_w(hContact, WEATHERPROTONAME, "StatusIcon", ID_STATUS_OFFLINE);
db_unset(hContact, "CList", "MyHandle");
// clear all data
- if (db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
- db_set_ts(hContact, WEATHERPROTONAME, "Nick", TranslateT("<Enter city name here>"));
+ if (db_get_ws(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
+ db_set_ws(hContact, WEATHERPROTONAME, "Nick", TranslateT("<Enter city name here>"));
db_set_s(hContact, WEATHERPROTONAME, "LastLog", "never");
db_set_s(hContact, WEATHERPROTONAME, "LastCondition", "None");
db_set_s(hContact, WEATHERPROTONAME, "LastTemperature", "None");
@@ -130,7 +130,7 @@ void EraseAllInfo() // reset update tag
db_set_b(hContact, WEATHERPROTONAME, "IsUpdated", FALSE);
// reset logging settings
- if (!db_get_ts(hContact, WEATHERPROTONAME, "Log", &dbv)) {
+ if (!db_get_ws(hContact, WEATHERPROTONAME, "Log", &dbv)) {
db_set_b(hContact, WEATHERPROTONAME, "File", (BYTE)(dbv.ptszVal[0] != 0));
db_free(&dbv);
}
@@ -141,7 +141,7 @@ void EraseAllInfo() GetStationID(hContact, opt.Default, _countof(opt.Default));
opt.DefStn = hContact;
- if (!db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
+ if (!db_get_ws(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
db_free(&dbv);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
@@ -149,7 +149,7 @@ void EraseAllInfo() }
// get the handle of the default station
if (opt.DefStn == NULL) {
- if (!db_get_ts(hContact, WEATHERPROTONAME, "ID", &dbv)) {
+ if (!db_get_ws(hContact, WEATHERPROTONAME, "ID", &dbv)) {
if (!mir_wstrcmp(dbv.ptszVal, opt.Default))
opt.DefStn = hContact;
db_free(&dbv);
@@ -163,19 +163,19 @@ void EraseAllInfo() // if (ContactCount != 0) status = ONLINE;
// in case where the default station is missing
if (opt.DefStn == NULL && ContactCount != 0) {
- if (!db_get_ts(LastContact, WEATHERPROTONAME, "ID", &dbv)) {
+ if (!db_get_ws(LastContact, WEATHERPROTONAME, "ID", &dbv)) {
wcsncpy(opt.Default, dbv.ptszVal, _countof(opt.Default) - 1);
db_free(&dbv);
}
opt.DefStn = LastContact;
- if (!db_get_ts(LastContact, WEATHERPROTONAME, "Nick", &dbv)) {
+ if (!db_get_ws(LastContact, WEATHERPROTONAME, "Nick", &dbv)) {
mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
db_free(&dbv);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
}
// save option in case of default station changed
- db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default);
+ db_set_ws(NULL, WEATHERPROTONAME, "Default", opt.Default);
}
void ConvertDataValue(WIDATAITEM *UpdateData, wchar_t *Data)
@@ -183,7 +183,7 @@ void ConvertDataValue(WIDATAITEM *UpdateData, wchar_t *Data) wchar_t str[MAX_DATA_LEN];
// convert the unit
- if (mir_wstrcmp(Data, TranslateT("<Error>")) && mir_wstrcmp(Data, NODATA) && mir_wstrcmp(Data, TranslateTS(NODATA))) {
+ if (mir_wstrcmp(Data, TranslateT("<Error>")) && mir_wstrcmp(Data, NODATA) && mir_wstrcmp(Data, TranslateW(NODATA))) {
// temperature
if (!mir_wstrcmp(UpdateData->Name, L"Temperature") || !mir_wstrcmp(UpdateData->Name, L"High") ||
!mir_wstrcmp(UpdateData->Name, L"Low") || !mir_wstrcmp(UpdateData->Name, L"Feel") ||
@@ -417,7 +417,7 @@ void DBDataManage(MCONTACT hContact, WORD Mode, WPARAM wParam, LPARAM) char *szSetting = arSettings[i];
DBVARIANT dbv;
- if (!db_get_ts(hContact, WEATHERCONDITION, szSetting, &dbv)) {
+ if (!db_get_ws(hContact, WEATHERCONDITION, szSetting, &dbv)) {
switch (Mode) {
case WDBM_REMOVE:
db_unset(hContact, WEATHERCONDITION, szSetting);
@@ -432,7 +432,7 @@ void DBDataManage(MCONTACT hContact, WORD Mode, WPARAM wParam, LPARAM) LV_ITEM lvi = { 0 };
lvi.mask = LVIF_TEXT | LVIF_PARAM;
lvi.lParam = i;
- lvi.pszText = TranslateTS(_A2T(szSetting));
+ lvi.pszText = TranslateW(_A2T(szSetting));
lvi.iItem = ListView_InsertItem(hList, &lvi);
lvi.pszText = dbv.ptszVal;
ListView_SetItemText(hList, lvi.iItem, 1, dbv.ptszVal);
diff --git a/plugins/Weather/src/weather_http.cpp b/plugins/Weather/src/weather_http.cpp index 7b48509a4d..82b9707d80 100644 --- a/plugins/Weather/src/weather_http.cpp +++ b/plugins/Weather/src/weather_http.cpp @@ -154,7 +154,7 @@ void NetlibInit(void) {
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_NOHTTPSOPTION | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_NOHTTPSOPTION | NUF_UNICODE;
nlu.szSettingsModule = WEATHERPROTONAME;
nlu.ptszDescriptiveName = TranslateT("Weather HTTP connections");
hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
diff --git a/plugins/Weather/src/weather_info.cpp b/plugins/Weather/src/weather_info.cpp index e6ed5291e9..d78be15988 100644 --- a/plugins/Weather/src/weather_info.cpp +++ b/plugins/Weather/src/weather_info.cpp @@ -114,7 +114,7 @@ INT_PTR CALLBACK DlgProcINIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM) lvc.fmt = LVCFMT_LEFT;
for (int i = 0; i < 7; ++i) {
lvc.iSubItem = i;
- lvc.pszText = TranslateTS(columns[i].name);
+ lvc.pszText = TranslateW(columns[i].name);
lvc.cx = columns[i].size;
ListView_InsertColumn(hIniList, i, &lvc);
}
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index aa47bb3580..6d414a8f7e 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -157,16 +157,16 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara clr = db_get_dw(NULL, WEATHERPROTONAME, "ColorMwinFrame", GetSysColor(COLOR_3DFACE));
{
- FontIDT fntid = { 0 };
+ FontIDW fntid = { 0 };
mir_wstrcpy(fntid.group, _A2W(WEATHERPROTONAME));
mir_wstrcpy(fntid.name, LPGENW("Frame Font"));
- fntc = CallService(MS_FONT_GETT, (WPARAM)&fntid, (LPARAM)&lfnt);
+ fntc = CallService(MS_FONT_GETW, (WPARAM)&fntid, (LPARAM)&lfnt);
mir_wstrcpy(fntid.name, LPGENW("Frame Title Font"));
- fntc1 = CallService(MS_FONT_GETT, (WPARAM)&fntid, (LPARAM)&lfnt1);
+ fntc1 = CallService(MS_FONT_GETW, (WPARAM)&fntid, (LPARAM)&lfnt1);
}
- ptrW tszInfo(db_get_tsa(data->hContact, WEATHERCONDITION, "WeatherInfo"));
+ ptrW tszInfo(db_get_wsa(data->hContact, WEATHERCONDITION, "WeatherInfo"));
GetClientRect(hwnd, &rc);
@@ -238,7 +238,7 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara static void addWindow(MCONTACT hContact)
{
DBVARIANT dbv;
- if (db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv))
+ if (db_get_ws(hContact, WEATHERPROTONAME, "Nick", &dbv))
return;
wchar_t winname[512];
@@ -255,7 +255,7 @@ static void addWindow(MCONTACT hContact) Frame.cbSize = sizeof(Frame);
Frame.hWnd = hWnd;
Frame.align = alBottom;
- Frame.Flags = F_VISIBLE | F_NOBORDER | F_TCHAR;
+ Frame.Flags = F_VISIBLE | F_NOBORDER | F_UNICODE;
Frame.height = 32;
DWORD frameID = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
@@ -324,17 +324,17 @@ void InitMwin(void) wndclass.lpszClassName = L"WeatherFrame";
RegisterClass(&wndclass);
- ColourIDT colourid = { 0 };
- colourid.cbSize = sizeof(ColourIDT);
+ ColourIDW colourid = { 0 };
+ colourid.cbSize = sizeof(ColourIDW);
mir_strcpy(colourid.dbSettingsGroup, WEATHERPROTONAME);
mir_strcpy(colourid.setting, "ColorMwinFrame");
mir_wstrcpy(colourid.name, LPGENW("Frame Background"));
mir_wstrcpy(colourid.group, _A2W(WEATHERPROTONAME));
colourid.defcolour = GetSysColor(COLOR_3DFACE);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
- FontIDT fontid = { 0 };
- fontid.cbSize = sizeof(FontIDT);
+ FontIDW fontid = { 0 };
+ fontid.cbSize = sizeof(FontIDW);
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID;
mir_strcpy(fontid.dbSettingsGroup, WEATHERPROTONAME);
mir_wstrcpy(fontid.group, _A2W(WEATHERPROTONAME));
@@ -349,12 +349,12 @@ void InitMwin(void) mir_wstrcpy(fontid.deffontsettings.szFace, L"Verdana");
mir_wstrcpy(fontid.backgroundGroup, _A2W(WEATHERPROTONAME));
mir_wstrcpy(fontid.backgroundName, LPGENW("Frame Background"));
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
fontid.deffontsettings.style = DBFONTF_BOLD;
mir_wstrcpy(fontid.name, LPGENW("Frame Title Font"));
mir_strcpy(fontid.prefix, "fnt1");
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
for (MCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME))
if (db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0))
diff --git a/plugins/Weather/src/weather_opt.cpp b/plugins/Weather/src/weather_opt.cpp index c971ef7857..6e9374dea6 100644 --- a/plugins/Weather/src/weather_opt.cpp +++ b/plugins/Weather/src/weather_opt.cpp @@ -114,50 +114,50 @@ void LoadOptions(void) opt.dUnit = db_get_w(NULL, WEATHERPROTONAME, "dUnit", 1);
opt.eUnit = db_get_w(NULL, WEATHERPROTONAME, "eUnit", 2);
- ptrW szValue(db_get_tsa(NULL, WEATHERPROTONAME, "DegreeSign"));
+ ptrW szValue(db_get_wsa(NULL, WEATHERPROTONAME, "DegreeSign"));
wcsncpy_s(opt.DegreeSign, (szValue == NULL) ? L"" : szValue, _TRUNCATE);
opt.DoNotAppendUnit = db_get_b(NULL, WEATHERPROTONAME, "DoNotAppendUnit", 0);
opt.NoFrac = db_get_b(NULL, WEATHERPROTONAME, "NoFractions", 0);
// texts
- if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "DisplayText"))
- wSetData(&opt.cText, TranslateTS(szValue));
+ if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "DisplayText"))
+ wSetData(&opt.cText, TranslateW(szValue));
else
SetTextDefault("C");
- if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "BriefTextTitle"))
- wSetData(&opt.bTitle, TranslateTS(szValue));
+ if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "BriefTextTitle"))
+ wSetData(&opt.bTitle, TranslateW(szValue));
else
SetTextDefault("b");
- if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "BriefText"))
- wSetData(&opt.bText, TranslateTS(szValue));
+ if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "BriefText"))
+ wSetData(&opt.bText, TranslateW(szValue));
else
SetTextDefault("B");
- if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "NoteText"))
- wSetData(&opt.nText, TranslateTS(szValue));
+ if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "NoteText"))
+ wSetData(&opt.nText, TranslateW(szValue));
else
SetTextDefault("N");
- if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "ExtText"))
- wSetData(&opt.eText, TranslateTS(szValue));
+ if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "ExtText"))
+ wSetData(&opt.eText, TranslateW(szValue));
else
SetTextDefault("E");
- if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "HistoryText"))
- wSetData(&opt.hText, TranslateTS(szValue));
+ if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "HistoryText"))
+ wSetData(&opt.hText, TranslateW(szValue));
else
SetTextDefault("H");
- if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "ExtraText"))
- wSetData(&opt.xText, TranslateTS(szValue));
+ if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "ExtraText"))
+ wSetData(&opt.xText, TranslateW(szValue));
else
SetTextDefault("X");
- if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "StatusText"))
- wSetData(&opt.sText, TranslateTS(szValue));
+ if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "StatusText"))
+ wSetData(&opt.sText, TranslateW(szValue));
else
SetTextDefault("S");
@@ -179,18 +179,18 @@ void LoadOptions(void) // popup delay
opt.pDelay = db_get_dw(NULL, WEATHERPROTONAME, "PopupDelay", 0);
// popup texts
- if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "PopupTitle"))
+ if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "PopupTitle"))
wSetData(&opt.pTitle, szValue);
else
SetTextDefault("P");
- if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "PopupText"))
+ if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "PopupText"))
wSetData(&opt.pText, szValue);
else
SetTextDefault("p");
// misc
- if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "Default"))
+ if (szValue = db_get_wsa(NULL, WEATHERPROTONAME, "Default"))
wcsncpy_s(opt.Default, szValue, _TRUNCATE);
else
opt.Default[0] = 0;
@@ -215,18 +215,18 @@ void SaveOptions(void) db_set_w(NULL, WEATHERPROTONAME, "pUnit", opt.pUnit);
db_set_w(NULL, WEATHERPROTONAME, "dUnit", opt.dUnit);
db_set_w(NULL, WEATHERPROTONAME, "eUnit", opt.eUnit);
- db_set_ts(NULL, WEATHERPROTONAME, "DegreeSign", opt.DegreeSign);
+ db_set_ws(NULL, WEATHERPROTONAME, "DegreeSign", opt.DegreeSign);
db_set_b(NULL, WEATHERPROTONAME, "DoNotAppendUnit", (BYTE)opt.DoNotAppendUnit);
db_set_b(NULL, WEATHERPROTONAME, "NoFractions", (BYTE)opt.NoFrac);
// texts
- db_set_ts(NULL, WEATHERPROTONAME, "DisplayText", opt.cText);
- db_set_ts(NULL, WEATHERPROTONAME, "BriefTextTitle", opt.bTitle);
- db_set_ts(NULL, WEATHERPROTONAME, "BriefText", opt.bText);
- db_set_ts(NULL, WEATHERPROTONAME, "NoteText", opt.nText);
- db_set_ts(NULL, WEATHERPROTONAME, "ExtText", opt.eText);
- db_set_ts(NULL, WEATHERPROTONAME, "HistoryText", opt.hText);
- db_set_ts(NULL, WEATHERPROTONAME, "ExtraText", opt.xText);
- db_set_ts(NULL, WEATHERPROTONAME, "StatusText", opt.sText);
+ db_set_ws(NULL, WEATHERPROTONAME, "DisplayText", opt.cText);
+ db_set_ws(NULL, WEATHERPROTONAME, "BriefTextTitle", opt.bTitle);
+ db_set_ws(NULL, WEATHERPROTONAME, "BriefText", opt.bText);
+ db_set_ws(NULL, WEATHERPROTONAME, "NoteText", opt.nText);
+ db_set_ws(NULL, WEATHERPROTONAME, "ExtText", opt.eText);
+ db_set_ws(NULL, WEATHERPROTONAME, "HistoryText", opt.hText);
+ db_set_ws(NULL, WEATHERPROTONAME, "ExtraText", opt.xText);
+ db_set_ws(NULL, WEATHERPROTONAME, "StatusText", opt.sText);
// advanced
db_set_b(NULL, WEATHERPROTONAME, "DisableConditionIcon", (BYTE)opt.DisCondIcon);
// popup options
@@ -245,10 +245,10 @@ void SaveOptions(void) // popup delay
db_set_dw(NULL, WEATHERPROTONAME, "PopupDelay", opt.pDelay);
// popup texts
- db_set_ts(NULL, WEATHERPROTONAME, "PopupTitle", opt.pTitle);
- db_set_ts(NULL, WEATHERPROTONAME, "PopupText", opt.pText);
+ db_set_ws(NULL, WEATHERPROTONAME, "PopupTitle", opt.pTitle);
+ db_set_ws(NULL, WEATHERPROTONAME, "PopupText", opt.pText);
// misc stuff
- db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default);
+ db_set_ws(NULL, WEATHERPROTONAME, "Default", opt.Default);
}
//============ MAIN OPTIONS ============
diff --git a/plugins/Weather/src/weather_popup.cpp b/plugins/Weather/src/weather_popup.cpp index 6e1ddba4ea..c94e12a7ea 100644 --- a/plugins/Weather/src/weather_popup.cpp +++ b/plugins/Weather/src/weather_popup.cpp @@ -259,9 +259,9 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_PMENU));
hMenu1 = GetSubMenu(hMenu, 0);
GetMenuString(hMenu1, opt.LeftClickAction, str, _countof(str), MF_BYCOMMAND);
- SetDlgItemText(hdlg, IDC_LeftClick, TranslateTS(str));
+ SetDlgItemText(hdlg, IDC_LeftClick, TranslateW(str));
GetMenuString(hMenu1, opt.RightClickAction, str, _countof(str), MF_BYCOMMAND);
- SetDlgItemText(hdlg, IDC_RightClick, TranslateTS(str));
+ SetDlgItemText(hdlg, IDC_RightClick, TranslateW(str));
DestroyMenu(hMenu);
// other options
@@ -342,7 +342,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_PMENU));
hMenu1 = GetSubMenu(hMenu, 0);
GetMenuString(hMenu1, opt.RightClickAction, str, _countof(str), MF_BYCOMMAND);
- SetDlgItemText(hdlg, IDC_RightClick, TranslateTS(str));
+ SetDlgItemText(hdlg, IDC_RightClick, TranslateW(str));
DestroyMenu(hMenu);
break;
@@ -362,7 +362,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_PMENU));
hMenu1 = GetSubMenu(hMenu, 0);
GetMenuString(hMenu1, opt.LeftClickAction, str, _countof(str), MF_BYCOMMAND);
- SetDlgItemText(hdlg, IDC_LeftClick, TranslateTS(str));
+ SetDlgItemText(hdlg, IDC_LeftClick, TranslateW(str));
DestroyMenu(hMenu);
break;
diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp index e301a0302d..705288a25f 100644 --- a/plugins/Weather/src/weather_svcs.cpp +++ b/plugins/Weather/src/weather_svcs.cpp @@ -178,7 +178,7 @@ static void __cdecl WeatherGetAwayMsgThread(void *arg) MCONTACT hContact = (DWORD_PTR)arg;
DBVARIANT dbv;
- if (!db_get_ts(hContact, "CList", "StatusMsg", &dbv)) {
+ if (!db_get_ws(hContact, "CList", "StatusMsg", &dbv)) {
ProtoBroadcastAck(WEATHERPROTONAME, hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp index c6159a10a3..148f53ba65 100644 --- a/plugins/Weather/src/weather_update.cpp +++ b/plugins/Weather/src/weather_update.cpp @@ -45,7 +45,7 @@ int UpdateWeather(MCONTACT hContact) // log to netlib log for debug purpose
Netlib_LogfT(hNetlibUser, L"************************************************************************");
- int dbres = db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv);
+ int dbres = db_get_ws(hContact, WEATHERPROTONAME, "Nick", &dbv);
Netlib_LogfT(hNetlibUser, L"<-- Start update for station -->");
@@ -76,23 +76,23 @@ int UpdateWeather(MCONTACT hContact) WEATHERINFO winfo = LoadWeatherInfo(hContact);
// translate weather condition
- mir_wstrcpy(winfo.cond, TranslateTS(winfo.cond));
+ mir_wstrcpy(winfo.cond, TranslateW(winfo.cond));
// compare the old condition and determine if the weather had changed
if (opt.UpdateOnlyConditionChanged) { // consider condition change
- if (!db_get_ts(hContact, WEATHERPROTONAME, "LastCondition", &dbv)) {
+ if (!db_get_ws(hContact, WEATHERPROTONAME, "LastCondition", &dbv)) {
if (mir_wstrcmpi(winfo.cond, dbv.ptszVal)) Ch = TRUE; // the weather condition is changed
db_free(&dbv);
}
else Ch = TRUE;
- if (!db_get_ts(hContact, WEATHERPROTONAME, "LastTemperature", &dbv)) {
+ if (!db_get_ws(hContact, WEATHERPROTONAME, "LastTemperature", &dbv)) {
if (mir_wstrcmpi(winfo.temp, dbv.ptszVal)) Ch = TRUE; // the temperature is changed
db_free(&dbv);
}
else Ch = TRUE;
}
else { // consider update time change
- if (!db_get_ts(hContact, WEATHERPROTONAME, "LastUpdate", &dbv)) {
+ if (!db_get_ws(hContact, WEATHERPROTONAME, "LastUpdate", &dbv)) {
if (mir_wstrcmpi(winfo.update, dbv.ptszVal)) Ch = TRUE; // the update time is changed
db_free(&dbv);
}
@@ -100,7 +100,7 @@ int UpdateWeather(MCONTACT hContact) }
// have weather alert issued?
- dbres = db_get_ts(hContact, WEATHERCONDITION, "Alert", &dbv);
+ dbres = db_get_ws(hContact, WEATHERCONDITION, "Alert", &dbv);
if (!dbres && dbv.ptszVal[0] != 0) {
if (opt.AlertPopup && !db_get_b(hContact, WEATHERPROTONAME, "DPopUp", 0) && Ch) {
// display alert popup
@@ -117,10 +117,10 @@ int UpdateWeather(MCONTACT hContact) if (!dbres) db_free(&dbv);
// backup current condition for checking if the weather is changed or not
- db_set_ts(hContact, WEATHERPROTONAME, "LastLog", winfo.update);
- db_set_ts(hContact, WEATHERPROTONAME, "LastCondition", winfo.cond);
- db_set_ts(hContact, WEATHERPROTONAME, "LastTemperature", winfo.temp);
- db_set_ts(hContact, WEATHERPROTONAME, "LastUpdate", winfo.update);
+ db_set_ws(hContact, WEATHERPROTONAME, "LastLog", winfo.update);
+ db_set_ws(hContact, WEATHERPROTONAME, "LastCondition", winfo.cond);
+ db_set_ws(hContact, WEATHERPROTONAME, "LastTemperature", winfo.temp);
+ db_set_ws(hContact, WEATHERPROTONAME, "LastUpdate", winfo.update);
// display condition on contact list
if (opt.DisCondIcon && winfo.status != ID_STATUS_OFFLINE)
@@ -130,11 +130,11 @@ int UpdateWeather(MCONTACT hContact) AvatarDownloaded(hContact);
GetDisplay(&winfo, opt.cText, str2);
- db_set_ts(hContact, "CList", "MyHandle", str2);
+ db_set_ws(hContact, "CList", "MyHandle", str2);
GetDisplay(&winfo, opt.sText, str2);
if (str2[0])
- db_set_ts(hContact, "CList", "StatusMsg", str2);
+ db_set_ws(hContact, "CList", "StatusMsg", str2);
else
db_unset(hContact, "CList", "StatusMsg");
@@ -142,9 +142,9 @@ int UpdateWeather(MCONTACT hContact) // save descriptions in MyNotes
GetDisplay(&winfo, opt.nText, str2);
- db_set_ts(hContact, "UserInfo", "MyNotes", str2);
+ db_set_ws(hContact, "UserInfo", "MyNotes", str2);
GetDisplay(&winfo, opt.xText, str2);
- db_set_ts(hContact, WEATHERCONDITION, "WeatherInfo", str2);
+ db_set_ws(hContact, WEATHERCONDITION, "WeatherInfo", str2);
// set the update tag
db_set_b(hContact, WEATHERPROTONAME, "IsUpdated", TRUE);
@@ -166,7 +166,7 @@ int UpdateWeather(MCONTACT hContact) if (db_get_b(hContact, WEATHERPROTONAME, "File", 0)) {
// external log
- if (!db_get_ts(hContact, WEATHERPROTONAME, "Log", &dbv)) {
+ if (!db_get_ws(hContact, WEATHERPROTONAME, "Log", &dbv)) {
// for the option for overwriting the file, delete old file first
if (db_get_b(hContact, WEATHERPROTONAME, "Overwrite", 0))
DeleteFile(dbv.ptszVal);
@@ -459,7 +459,7 @@ int GetWeatherData(MCONTACT hContact) // to get a data value.
GetDataValue(&Item->Item, DataValue, &szInfo);
if (mir_wstrcmp(Item->Item.Name, L"Condition") && mir_wstrcmpi(Item->Item.Unit, L"Cond"))
- wcsncpy(DataValue, TranslateTS(DataValue), MAX_DATA_LEN - 1);
+ wcsncpy(DataValue, TranslateW(DataValue), MAX_DATA_LEN - 1);
break;
case WID_SET:
@@ -495,7 +495,7 @@ int GetWeatherData(MCONTACT hContact) break;
case'\"': // constant, add it to the result string
- mir_wstrncat(DataValue, TranslateTS(str2), _countof(DataValue) - mir_wstrlen(DataValue));
+ mir_wstrncat(DataValue, TranslateW(str2), _countof(DataValue) - mir_wstrlen(DataValue));
DataValue[_countof(DataValue) - 1] = 0;
break;
}
@@ -536,40 +536,40 @@ int GetWeatherData(MCONTACT hContact) // write the 2 strings created from the break operation
if (Item->Item.End[0])
- db_set_ts(hContact, WEATHERCONDITION, _T2A(Item->Item.End), end);
+ db_set_ws(hContact, WEATHERCONDITION, _T2A(Item->Item.End), end);
break;
}
}
// don't store data if it is not available
if ((DataValue[0] != 0 && mir_wstrcmp(DataValue, NODATA) &&
- mir_wstrcmp(DataValue, TranslateTS(NODATA)) && mir_wstrcmp(Item->Item.Name, L"Ignore")) ||
+ mir_wstrcmp(DataValue, TranslateW(NODATA)) && mir_wstrcmp(Item->Item.Name, L"Ignore")) ||
(!mir_wstrcmp(Item->Item.Name, L"Alert") && i == 0)) {
// temporary workaround for mToolTip to show feel-like temperature
if (!mir_wstrcmp(Item->Item.Name, L"Feel"))
- db_set_ts(hContact, WEATHERCONDITION, "Heat Index", DataValue);
+ db_set_ws(hContact, WEATHERCONDITION, "Heat Index", DataValue);
GetStationID(hContact, Svc, _countof(Svc));
if (!mir_wstrcmp(Svc, opt.Default))
- db_set_ts(NULL, DEFCURRENTWEATHER, _T2A(Item->Item.Name), DataValue);
+ db_set_ws(NULL, DEFCURRENTWEATHER, _T2A(Item->Item.Name), DataValue);
if (!mir_wstrcmp(Item->Item.Name, L"Condition")) {
wchar_t buf[128], *cbuf;
mir_snwprintf(buf, L"#%s Weather", DataValue);
- cbuf = TranslateTS(buf);
+ cbuf = TranslateW(buf);
if (cbuf[0] == '#')
- cbuf = TranslateTS(DataValue);
- db_set_ts(hContact, WEATHERCONDITION, _T2A(Item->Item.Name), cbuf);
+ cbuf = TranslateW(DataValue);
+ db_set_ws(hContact, WEATHERCONDITION, _T2A(Item->Item.Name), cbuf);
CharLowerBuff(DataValue, (DWORD)mir_wstrlen(DataValue));
cond = GetIcon(DataValue, Data);
}
else if (mir_wstrcmpi(Item->Item.Unit, L"Cond") == 0) {
wchar_t buf[128], *cbuf;
mir_snwprintf(buf, L"#%s Weather", DataValue);
- cbuf = TranslateTS(buf);
+ cbuf = TranslateW(buf);
if (cbuf[0] == '#')
- cbuf = TranslateTS(DataValue);
- db_set_ts(hContact, WEATHERCONDITION, _T2A(Item->Item.Name), cbuf);
+ cbuf = TranslateW(DataValue);
+ db_set_ws(hContact, WEATHERCONDITION, _T2A(Item->Item.Name), cbuf);
}
- else db_set_ts(hContact, WEATHERCONDITION, _T2A(Item->Item.Name), DataValue);
+ else db_set_ws(hContact, WEATHERCONDITION, _T2A(Item->Item.Name), DataValue);
}
Item = Item->Next;
}
@@ -578,7 +578,7 @@ int GetWeatherData(MCONTACT hContact) // assign condition icon
db_set_w(hContact, WEATHERPROTONAME, "StatusIcon", cond);
- db_set_ts(hContact, WEATHERPROTONAME, "MirVer", Data->DisplayName);
+ db_set_ws(hContact, WEATHERPROTONAME, "MirVer", Data->DisplayName);
return 0;
}
diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp index a47782293c..e3beb4f848 100644 --- a/plugins/WebView/src/main.cpp +++ b/plugins/WebView/src/main.cpp @@ -164,13 +164,13 @@ extern "C" int __declspec(dllexport) Load() InitServices();
//add sound event to options
- SkinAddNewSoundExT("webviewalert", MODULENAMEW, LPGENW("Alert event"));
+ SkinAddNewSoundExW("webviewalert", MODULENAMEW, LPGENW("Alert event"));
//value is 1 if menu is disabled
db_set_b(NULL, MODULENAME, MENU_IS_DISABLED_KEY, 1);
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
if ( db_get_b(NULL, MODULENAME, MENU_OFF, 0)) {
//value is 0 if menu is enabled
db_set_b(NULL, MODULENAME, MENU_IS_DISABLED_KEY, 0);
@@ -230,7 +230,7 @@ extern "C" int __declspec(dllexport) Load() }
// contact menu
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
SET_UID(mi, 0xadc6a9a4, 0xdf7, 0x4f63, 0x89, 0x11, 0x8e, 0x42, 0x1d, 0xd6, 0x29, 0x31);
CreateServiceFunction("Open web page", WebsiteMenuCommand);
diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp index 39cbf6dfc7..4cfc3f1d0d 100644 --- a/plugins/WebView/src/webview.cpp +++ b/plugins/WebView/src/webview.cpp @@ -173,7 +173,7 @@ int Doubleclick(WPARAM wParam, LPARAM) int action = db_get_b(hContact, MODULENAME, DBLE_WIN_KEY, 1);
if (action == 0) {
- ptrW url(db_get_tsa(hContact, MODULENAME, "URL"));
+ ptrW url(db_get_wsa(hContact, MODULENAME, "URL"));
Utils_OpenUrlT(url);
db_set_w(hContact, MODULENAME, "Status", ID_STATUS_ONLINE);
@@ -240,7 +240,7 @@ int SendToRichEdit(HWND hWindow, char *truncated, COLORREF rgbText, COLORREF rgb cfFM.dwEffects = bold | italic | underline;
- if (!db_get_ts(NULL, MODULENAME, FONT_FACE_KEY, &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, FONT_FACE_KEY, &dbv)) {
mir_wstrcpy(cfFM.szFaceName, dbv.ptszVal);
db_free(&dbv);
}
@@ -443,7 +443,7 @@ int OnTopMenuCommand(WPARAM, LPARAM, MCONTACT singlecontact) INT_PTR WebsiteMenuCommand(WPARAM wParam, LPARAM)
{
MCONTACT hContact = wParam;
- ptrW url(db_get_tsa(hContact, MODULENAME, "URL"));
+ ptrW url(db_get_wsa(hContact, MODULENAME, "URL"));
if (url)
Utils_OpenUrlT(url);
diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index eee757a5e8..f5e40cb45d 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -30,7 +30,7 @@ int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_COMMAND:
case WM_CONTEXTMENU:
MCONTACT hContact = PUGetContact(hWnd);
- ptrW url( db_get_tsa(hContact, MODULENAME, URL_KEY));
+ ptrW url( db_get_wsa(hContact, MODULENAME, URL_KEY));
if (message == WM_COMMAND) { // left click
if(hContact != NULL) {
@@ -115,7 +115,7 @@ int PopupAlert(WPARAM wParam, LPARAM lParam) if( ((HANDLE)wParam) != NULL) {
DBVARIANT dbv;
- db_get_ts(wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv);
+ db_get_ws(wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv);
mir_wstrncpy(ppd.lptzContactName, dbv.ptszVal, _countof(ppd.lptzContactName));
db_free(&dbv);
}
@@ -192,7 +192,7 @@ int ErrorMsgs(WPARAM wParam, LPARAM lParam) PUShowMessageT(newdisplaytext, SM_WARNING);
}
else if ( ServiceExists("OSD/Announce") && db_get_b(NULL, MODULENAME, ERROR_POPUP_KEY, 0)) {
- mir_snwprintf(newdisplaytext, L"%s: %s", ptszContactName, TranslateTS(displaytext));
+ mir_snwprintf(newdisplaytext, L"%s: %s", ptszContactName, TranslateW(displaytext));
CallService("OSD/Announce", (WPARAM)newdisplaytext, 0);
}
else if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) {
@@ -200,7 +200,7 @@ int ErrorMsgs(WPARAM wParam, LPARAM lParam) webview_tip.cbSize = sizeof(MIRANDASYSTRAYNOTIFY);
webview_tip.szProto = NULL;
webview_tip.tszInfoTitle = ptszContactName;
- webview_tip.tszInfo = TranslateTS(displaytext);
+ webview_tip.tszInfo = TranslateW(displaytext);
webview_tip.dwInfoFlags = NIIF_ERROR | NIIF_INTERN_UNICODE;
webview_tip.uTimeout = 15000;
CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM) &webview_tip);
@@ -445,7 +445,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn else {
fwrite(tempraw, mir_strlen(tempraw), 1, pcachefile); //smaller cache
fclose(pcachefile);
- db_set_ts(hContact, MODULENAME, CACHE_FILE_KEY, newcachepath);
+ db_set_ws(hContact, MODULENAME, CACHE_FILE_KEY, newcachepath);
}
// end write to cache
@@ -656,7 +656,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn WErrorPopup((UINT_PTR)contactname, TranslateT("Cannot write to file 2"));
else {
fwrite(raw, mir_strlen(raw), 1, pcachefile); //smaller cache
- db_set_ts(hContact, MODULENAME, CACHE_FILE_KEY, newcachepath);
+ db_set_ws(hContact, MODULENAME, CACHE_FILE_KEY, newcachepath);
fclose(pcachefile);
}
// end write to cache
diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index a45f188ac1..462b903628 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -129,8 +129,8 @@ static MCONTACT FindContactByUrl(HWND hwndDlg) GetWindowText(hwndDlg, titlebartxt, _countof(titlebartxt));
for (MCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) {
- ptrW db1( db_get_tsa(hContact, MODULENAME, URL_KEY));
- ptrW db2( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY));
+ ptrW db1( db_get_wsa(hContact, MODULENAME, URL_KEY));
+ ptrW db2( db_get_wsa(hContact, MODULENAME, PRESERVE_NAME_KEY));
if (!mir_wstrcmp(urltext, db1) && !mir_wstrcmp(titlebartxt, db2)) {
contactcount++;
@@ -161,7 +161,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA WindowList_Add(hWindowList, hwndDlg, hContact2);
url[0] = '\0';
- if (!db_get_ts(hContact2, MODULENAME, URL_KEY, &dbv)) {
+ if (!db_get_ws(hContact2, MODULENAME, URL_KEY, &dbv)) {
wcsncpy_s(url, dbv.ptszVal, _TRUNCATE);
db_free(&dbv);
}
@@ -183,29 +183,29 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SendDlgItemMessage(hwndDlg, IDC_DATA, EM_SETBKGNDCOLOR, 0, colour);
SendDlgItemMessage(hwndDlg, IDC_UPDATE_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_UPDATE), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
- SendDlgItemMessage(hwndDlg, IDC_UPDATE_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Update data"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_UPDATE_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Update data"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_FIND_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_FIND), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
- SendDlgItemMessage(hwndDlg, IDC_FIND_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Find"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_FIND_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Find"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_OPTIONS_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_OPTIONS), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
- SendDlgItemMessage(hwndDlg, IDC_OPTIONS_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Contact options"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_OPTIONS_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Contact options"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_ALERT_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_ALERT), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
- SendDlgItemMessage(hwndDlg, IDC_ALERT_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Alert options"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_ALERT_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Alert options"), BATF_UNICODE);
SendDlgItemMessage(hwndDlg, IDC_STOP, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_STOP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
- SendDlgItemMessage(hwndDlg, IDC_STOP, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Stop processing"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_STOP, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Stop processing"), BATF_UNICODE);
- SendDlgItemMessage(hwndDlg, IDC_OPEN_URL, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Click here to open this URL in a browser window."), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_OPEN_URL, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Click here to open this URL in a browser window."), BATF_UNICODE);
if (!db_get_b(hContact2, MODULENAME, ON_TOP_KEY, 0)) {
SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_UNSTICK), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
- SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Stick to the front"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Stick to the front"), BATF_UNICODE);
}
else {
SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_STICK), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
- SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Disable stick to the front"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Disable stick to the front"), BATF_UNICODE);
}
SendDlgItemMessage(hwndDlg, IDC_DATA, WM_SETFONT, (WPARAM) h_font, 1);
@@ -369,7 +369,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ptszToolTip = TranslateT("Disable stick to the front");
}
SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_UNSTICK), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
- SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BUTTONADDTOOLTIP, (WPARAM)ptszToolTip, BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BUTTONADDTOOLTIP, (WPARAM)ptszToolTip, BATF_UNICODE);
SetWindowPos(hwndDlg, hTopmost, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
}
break;
diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp index 55299017a5..75fca2a20f 100644 --- a/plugins/WebView/src/webview_getdata.cpp +++ b/plugins/WebView/src/webview_getdata.cpp @@ -131,7 +131,7 @@ void GetData(void *param) EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE_BUTTON), 1);
SetDlgItemText(hwndDlg, IDC_STATUSBAR, TranslateT("Download in progress, please wait..."));
- db_set_ts(hContact, "CList", "StatusMsg", TranslateT("Updating..."));
+ db_set_ws(hContact, "CList", "StatusMsg", TranslateT("Updating..."));
db_set_w(hContact, MODULENAME, "Status", ID_STATUS_DND); // download
NETLIBHTTPREQUEST *nlhrReply = (NETLIBHTTPREQUEST *) CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM) hNetlibUser, (LPARAM) & nlhr);
@@ -142,7 +142,7 @@ void GetData(void *param) wchar_t *statusText = TranslateT("The server replied with a failure code");
SetDlgItemText(hwndDlg, IDC_STATUSBAR, statusText);
WErrorPopup(hContact, statusText);
- db_set_ts(hContact, "CList", "StatusMsg", statusText);
+ db_set_ws(hContact, "CList", "StatusMsg", statusText);
}
if (nlhrReply->dataLength) {
trunccount = 0;
@@ -158,7 +158,7 @@ void GetData(void *param) wchar_t *statusText = TranslateT("The server is down or lagging.");
SetDlgItemText(hwndDlg, IDC_STATUSBAR, statusText);
WErrorPopup(hContact, statusText);
- db_set_ts(hContact, "CList", "StatusMsg", statusText);
+ db_set_ws(hContact, "CList", "StatusMsg", statusText);
}
if (!(nlhrReply))
@@ -248,7 +248,7 @@ void GetData(void *param) if (db_get_b(hContact, MODULENAME, U_ALLSITE_KEY, 0) == 0) {
wchar_t *statusText = TranslateT("Both search strings not found or strings not set.");
WErrorPopup(hContact, statusText);
- db_set_ts(hContact, "CList", "StatusMsg", statusText);
+ db_set_ws(hContact, "CList", "StatusMsg", statusText);
DownloadSuccess = 0;
SetDlgItemText(hwndDlg, IDC_STATUSBAR, statusText);
@@ -286,7 +286,7 @@ void GetData(void *param) db_free(&dbv);
}
else {
- db_get_ts(hContact, "CList", "MyHandle", &dbv);
+ db_get_ws(hContact, "CList", "MyHandle", &dbv);
memset(&temptime, 0, sizeof(temptime));
memset(&tstr, 0, sizeof(tstr));
ftime = time(NULL);
@@ -298,7 +298,7 @@ void GetData(void *param) if (db_get_b(hContact, MODULENAME, USE_24_HOUR_KEY, 0) == 1)
strftime(temptime, 128, "(%b %d,%H:%M:%S)", nTime);
- db_set_ts(hContact, MODULENAME, PRESERVE_NAME_KEY, dbv.ptszVal);
+ db_set_ws(hContact, MODULENAME, PRESERVE_NAME_KEY, dbv.ptszVal);
if (db_get_b(hContact, MODULENAME, CONTACT_PREFIX_KEY, 1) == 1)
mir_snprintf(tstr, "%s %s", temptime, dbv.pszVal);
if (db_get_b(hContact, MODULENAME, CONTACT_PREFIX_KEY, 1) == 0)
@@ -359,7 +359,7 @@ LBL_Stop: wchar_t *statusText = TranslateT("Processing data stopped by user.") SetDlgItemText(hwndDlg, IDC_STATUSBAR, statusText);
db_set_b(hContact, MODULENAME, STOP_KEY, 0);
db_set_w(hContact, MODULENAME, "Status", ID_STATUS_ONLINE);
- db_set_ts(hContact, "CList", "StatusMsg", statusText);
+ db_set_ws(hContact, "CList", "StatusMsg", statusText);
AlreadyDownloading = 0;
return;
}
@@ -444,11 +444,11 @@ LBL_Stop: wchar_t *statusText = TranslateT("Processing data stopped by user.") if (TherewasAlert) {
db_set_w(hContact, MODULENAME, "Status", ID_STATUS_OCCUPIED);
- db_set_ts(hContact, "CList", "StatusMsg", TranslateT("Alert!"));
+ db_set_ws(hContact, "CList", "StatusMsg", TranslateT("Alert!"));
}
else {
db_set_w(hContact, MODULENAME, "Status", ID_STATUS_ONLINE);
- db_set_ts(hContact, "CList", "StatusMsg", TranslateT("Online"));
+ db_set_ws(hContact, "CList", "StatusMsg", TranslateT("Online"));
}
}
diff --git a/plugins/WebView/src/webview_opts.cpp b/plugins/WebView/src/webview_opts.cpp index 69d878fbd6..393388ea34 100644 --- a/plugins/WebView/src/webview_opts.cpp +++ b/plugins/WebView/src/webview_opts.cpp @@ -283,15 +283,15 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l EnableWindow(GetDlgItem(hwndDlg, IDC_ALERT_APPLY), 0);
- if (!db_get_ts(hContact, MODULENAME, ALERT_STRING_KEY, &dbv)) {
+ if (!db_get_ws(hContact, MODULENAME, ALERT_STRING_KEY, &dbv)) {
SetDlgItemText(hwndDlg, IDC_ALERT_STRING, dbv.ptszVal);
db_free(&dbv);
}
- if (!db_get_ts(hContact, MODULENAME, ALRT_S_STRING_KEY, &dbv)) {
+ if (!db_get_ws(hContact, MODULENAME, ALRT_S_STRING_KEY, &dbv)) {
SetDlgItemText(hwndDlg, IDC_START2, dbv.ptszVal);
db_free(&dbv);
}
- if (!db_get_ts(hContact, MODULENAME, ALRT_E_STRING_KEY, &dbv)) {
+ if (!db_get_ws(hContact, MODULENAME, ALRT_E_STRING_KEY, &dbv)) {
SetDlgItemText(hwndDlg, IDC_END2, dbv.ptszVal);
db_free(&dbv);
}
@@ -300,14 +300,14 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l CheckDlgButton(hwndDlg, IDC_24_HOUR, db_get_b(hContact, MODULENAME, USE_24_HOUR_KEY, 0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_ALWAYS_LOG, db_get_b(hContact, MODULENAME, ALWAYS_LOG_KEY, 0) ? BST_CHECKED : BST_UNCHECKED);
- SetDlgItemText(hwndDlg, IDC_ALERT_TYPE, TranslateTS(AlertTypes[db_get_b(hContact, MODULENAME, ALRT_INDEX_KEY, 0)]));
- SetDlgItemText(hwndDlg, IDC_EVENT_TYPE, TranslateTS(EventTypes[db_get_b(hContact, MODULENAME, EVNT_INDEX_KEY, 0)]));
+ SetDlgItemText(hwndDlg, IDC_ALERT_TYPE, TranslateW(AlertTypes[db_get_b(hContact, MODULENAME, ALRT_INDEX_KEY, 0)]));
+ SetDlgItemText(hwndDlg, IDC_EVENT_TYPE, TranslateW(EventTypes[db_get_b(hContact, MODULENAME, EVNT_INDEX_KEY, 0)]));
for (i = 0; i < _countof(AlertTypes); i++)
- SendDlgItemMessage(hwndDlg, IDC_ALERT_TYPE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(AlertTypes[i]));
+ SendDlgItemMessage(hwndDlg, IDC_ALERT_TYPE, CB_ADDSTRING, 0, (LPARAM)TranslateW(AlertTypes[i]));
for (i = 0; i < _countof(EventTypes); i++)
- SendDlgItemMessage(hwndDlg, IDC_EVENT_TYPE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(EventTypes[i]));
+ SendDlgItemMessage(hwndDlg, IDC_EVENT_TYPE, CB_ADDSTRING, 0, (LPARAM)TranslateW(EventTypes[i]));
if (db_get_b(hContact, MODULENAME, ENABLE_ALERTS_KEY, 0)) {
CheckDlgButton(hwndDlg, IDC_ENABLE_ALERTS, BST_UNCHECKED);
@@ -412,7 +412,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l }
}
- if (!db_get_ts(hContact, MODULENAME, FILE_KEY, &dbv)) {
+ if (!db_get_ws(hContact, MODULENAME, FILE_KEY, &dbv)) {
SetDlgItemText(hwndDlg, IDC_FILENAME, dbv.ptszVal);
db_free(&dbv);
}
@@ -746,19 +746,19 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l }
GetDlgItemText(hwndDlg, IDC_FILENAME, buf, _countof(buf));
- db_set_ts(hContact, MODULENAME, FILE_KEY, buf);
+ db_set_ws(hContact, MODULENAME, FILE_KEY, buf);
db_set_b(hContact, MODULENAME, APPEND_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_APPEND));
db_set_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SAVE_AS_RAW));
GetDlgItemText(hwndDlg, IDC_ALERT_STRING, buf, _countof(buf));
- db_set_ts(hContact, MODULENAME, ALERT_STRING_KEY, buf);
+ db_set_ws(hContact, MODULENAME, ALERT_STRING_KEY, buf);
GetDlgItemText(hwndDlg, IDC_START2, buf, _countof(buf));
- db_set_ts(hContact, MODULENAME, ALRT_S_STRING_KEY, buf);
+ db_set_ws(hContact, MODULENAME, ALRT_S_STRING_KEY, buf);
GetDlgItemText(hwndDlg, IDC_END2, buf, _countof(buf));
- db_set_ts(hContact, MODULENAME, ALRT_E_STRING_KEY, buf);
+ db_set_ws(hContact, MODULENAME, ALRT_E_STRING_KEY, buf);
db_set_b(hContact, MODULENAME, CONTACT_PREFIX_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PREFIX));
@@ -823,25 +823,25 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_APPLY), 0);
- if (!db_get_ts(hContact, MODULENAME, URL_KEY, &dbv)) {
+ if (!db_get_ws(hContact, MODULENAME, URL_KEY, &dbv)) {
SetDlgItemText(hwndDlg, IDC_URL, dbv.ptszVal);
db_free(&dbv);
}
- if (!db_get_ts(hContact, MODULENAME, START_STRING_KEY, &dbv)) {
+ if (!db_get_ws(hContact, MODULENAME, START_STRING_KEY, &dbv)) {
SetDlgItemText(hwndDlg, IDC_START, dbv.ptszVal);
db_free(&dbv);
}
- if (!db_get_ts(hContact, MODULENAME, END_STRING_KEY, &dbv)) {
+ if (!db_get_ws(hContact, MODULENAME, END_STRING_KEY, &dbv)) {
SetDlgItemText(hwndDlg, IDC_END, dbv.ptszVal);
db_free(&dbv);
}
- if (db_get_ts(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
+ if (db_get_ws(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
db_free(&dbv);
- db_get_ts(hContact, "CList", "MyHandle", &dbv);
- db_set_ts(hContact, MODULENAME, PRESERVE_NAME_KEY, dbv.ptszVal);
+ db_get_ws(hContact, "CList", "MyHandle", &dbv);
+ db_set_ws(hContact, MODULENAME, PRESERVE_NAME_KEY, dbv.ptszVal);
db_free(&dbv);
}
- if (!db_get_ts(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
+ if (!db_get_ws(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
SetDlgItemText(hwndDlg, IDC_SITE_NAME, dbv.ptszVal);
db_free(&dbv);
}
@@ -850,7 +850,7 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SendDlgItemMessage(hwndDlg, IDC_RWSPACE, TBM_SETRANGE, FALSE, MAKELONG(0, 4));
SendDlgItemMessage(hwndDlg, IDC_RWSPACE, TBM_SETPOS, TRUE, db_get_b(hContact, MODULENAME, RWSPACE_KEY, 0));
- SetDlgItemText(hwndDlg, IDC_RWSPC_TEXT, TranslateTS(szTrackerBarDescr[SendDlgItemMessage(hwndDlg, IDC_RWSPACE, TBM_GETPOS, 0, 0)]));
+ SetDlgItemText(hwndDlg, IDC_RWSPC_TEXT, TranslateW(szTrackerBarDescr[SendDlgItemMessage(hwndDlg, IDC_RWSPACE, TBM_GETPOS, 0, 0)]));
EnableWindow(GetDlgItem(hwndDlg, IDC_RWSPACE), (IsDlgButtonChecked(hwndDlg, IDC_CLEAN)));
EnableWindow(GetDlgItem(hwndDlg, IDC_RWSPC_TEXT), (IsDlgButtonChecked(hwndDlg, IDC_CLEAN)));
@@ -876,7 +876,7 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM break;
case WM_HSCROLL:
- SetDlgItemText(hwndDlg, IDC_RWSPC_TEXT, TranslateTS(szTrackerBarDescr[SendDlgItemMessage(hwndDlg, IDC_RWSPACE, TBM_GETPOS, 0, 0)]));
+ SetDlgItemText(hwndDlg, IDC_RWSPC_TEXT, TranslateW(szTrackerBarDescr[SendDlgItemMessage(hwndDlg, IDC_RWSPACE, TBM_GETPOS, 0, 0)]));
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_APPLY), 1);
break;
@@ -918,10 +918,10 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
GetDlgItemText(hwndDlg, IDC_START, string, _countof(string));
- db_set_ts(hContact, MODULENAME, ALRT_S_STRING_KEY, string);
+ db_set_ws(hContact, MODULENAME, ALRT_S_STRING_KEY, string);
GetDlgItemText(hwndDlg, IDC_END, string, _countof(string));
- db_set_ts(hContact, MODULENAME, ALRT_E_STRING_KEY, string);
+ db_set_ws(hContact, MODULENAME, ALRT_E_STRING_KEY, string);
db_set_w(hContact, MODULENAME, EVNT_INDEX_KEY, 2);
}
@@ -1013,17 +1013,17 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
GetDlgItemText(hwndDlg, IDC_URL, url, _countof(url));
- db_set_ts(hContact, MODULENAME, URL_KEY, url);
- db_set_ts(hContact, MODULENAME, "Homepage", url);
+ db_set_ws(hContact, MODULENAME, URL_KEY, url);
+ db_set_ws(hContact, MODULENAME, "Homepage", url);
GetDlgItemText(hwndDlg, IDC_START, str, _countof(str));
- db_set_ts(hContact, MODULENAME, START_STRING_KEY, str);
+ db_set_ws(hContact, MODULENAME, START_STRING_KEY, str);
GetDlgItemText(hwndDlg, IDC_END, str, _countof(str));
- db_set_ts(hContact, MODULENAME, END_STRING_KEY, str);
+ db_set_ws(hContact, MODULENAME, END_STRING_KEY, str);
GetDlgItemText(hwndDlg, IDC_SITE_NAME, str, _countof(str));
- db_set_ts(hContact, "CList", "MyHandle", str);
+ db_set_ws(hContact, "CList", "MyHandle", str);
db_set_b(hContact, MODULENAME, DBLE_WIN_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DBLE_WIN));
db_set_b(hContact, MODULENAME, U_ALLSITE_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_U_ALLSITE));
@@ -1103,7 +1103,7 @@ INT_PTR CALLBACK DlgProcOpt(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara CheckDlgButton(hwndDlg, IDC_NO_PROTECT, db_get_b(NULL, MODULENAME, NO_PROTECT_KEY, 0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DATAPOPUP, db_get_b(NULL, MODULENAME, DATA_POPUP_KEY, 0) ? BST_CHECKED : BST_UNCHECKED);
- if (!db_get_ts(NULL, MODULENAME, FONT_FACE_KEY, &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, FONT_FACE_KEY, &dbv)) {
SetDlgItemText(hwndDlg, IDC_TYPEFACE, dbv.ptszVal);
db_free(&dbv);
}
@@ -1269,7 +1269,7 @@ INT_PTR CALLBACK DlgProcOpt(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara wchar_t str[100];
GetDlgItemText(hwndDlg, IDC_TYPEFACE, str, _countof(str));
- db_set_ts(NULL, MODULENAME, FONT_FACE_KEY, str);
+ db_set_ws(NULL, MODULENAME, FONT_FACE_KEY, str);
db_set_b(NULL, MODULENAME, FONT_SIZE_KEY, (GetDlgItemInt(hwndDlg, IDC_FONTSIZE, NULL, FALSE)));
db_set_b(NULL, MODULENAME, FONT_SCRIPT_KEY, ((BYTE)SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_GETCURSEL, 0, 0), 0)));
diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp index b3d8a70504..9958e98629 100644 --- a/plugins/WebView/src/webview_services.cpp +++ b/plugins/WebView/src/webview_services.cpp @@ -46,12 +46,12 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) // A contact is renamed if (!strcmp(cws->szSetting, "MyHandle")) { - ptrW oldName( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY)); + ptrW oldName( db_get_wsa(hContact, MODULENAME, PRESERVE_NAME_KEY)); if (oldName == NULL) return 0; wchar_t nick[100]; - ptrW oldnick( db_get_tsa(hContact, "CList", "MyHandle")); + ptrW oldnick( db_get_wsa(hContact, "CList", "MyHandle")); if (oldnick != NULL) wcsncpy_s(nick, oldnick, _TRUNCATE); else @@ -74,9 +74,9 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) } if ( wcschr(nick, '(') == 0) { - db_set_ts(hContact, MODULENAME, PRESERVE_NAME_KEY, nick); - db_set_ts(hContact, MODULENAME, "Nick", nick); - db_set_ts(hContact, "CList", "MyHandle", nick); + db_set_ws(hContact, MODULENAME, PRESERVE_NAME_KEY, nick); + db_set_ws(hContact, MODULENAME, "Nick", nick); + db_set_ws(hContact, "CList", "MyHandle", nick); } // TEST GET NAME FOR CACHE @@ -99,7 +99,7 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) fclose(pcachefile); if (mir_wstrcmp(newcachepath, renamedcachepath)) { MoveFile(newcachepath, renamedcachepath); - db_set_ts(hContact, MODULENAME, CACHE_FILE_KEY, renamedcachepath); + db_set_ws(hContact, MODULENAME, CACHE_FILE_KEY, renamedcachepath); } } } @@ -115,7 +115,7 @@ int SiteDeleted(WPARAM wParam, LPARAM) if (mir_strcmp(GetContactProto(hContact), MODULENAME)) return 0; - ptrW contactName( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY)); + ptrW contactName( db_get_wsa(hContact, MODULENAME, PRESERVE_NAME_KEY)); // TEST GET NAME FOR CACHE wchar_t cachepath[MAX_PATH], cachedirectorypath[MAX_PATH], newcachepath[MAX_PATH + 50]; @@ -167,7 +167,7 @@ INT_PTR PingWebsiteMenuCommand(WPARAM wParam, LPARAM) return 0; } - ptrW url( db_get_tsa(wParam, MODULENAME, "URL")); + ptrW url( db_get_wsa(wParam, MODULENAME, "URL")); if (url == NULL) return 0; @@ -353,7 +353,7 @@ INT_PTR AddToList(WPARAM, LPARAM lParam) // search for existing contact for (hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) { // check ID to see if the contact already exist in the database - if (db_get_ts(hContact, MODULENAME, "URL", &dbv)) + if (db_get_ws(hContact, MODULENAME, "URL", &dbv)) continue; if (!mir_wstrcmpi(psr->nick.w, dbv.ptszVal)) { // remove the flag for not on list and hidden, thus make the @@ -405,7 +405,7 @@ INT_PTR AddToList(WPARAM, LPARAM lParam) if (Nend) *Nend = '\0'; for (MCONTACT hContact2 = db_find_first(MODULENAME); hContact2 != NULL; hContact2 = db_find_next(hContact2, MODULENAME)) { - if (!db_get_ts(hContact2, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { + if (!db_get_ws(hContact2, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { if (!mir_wstrcmpi(Newnick, dbv.ptszVal)) { // remove the flag for not on list and hidden, thus make the // contact visible @@ -431,13 +431,13 @@ INT_PTR AddToList(WPARAM, LPARAM lParam) } //end convert - db_set_ts(hContact, "CList", "MyHandle", Newnick); - db_set_ts(hContact, MODULENAME, PRESERVE_NAME_KEY, Newnick); - db_set_ts(hContact, MODULENAME, "Nick", Newnick); + db_set_ws(hContact, "CList", "MyHandle", Newnick); + db_set_ws(hContact, MODULENAME, PRESERVE_NAME_KEY, Newnick); + db_set_ws(hContact, MODULENAME, "Nick", Newnick); db_set_b(hContact, MODULENAME, CLEAR_DISPLAY_KEY, 1); db_set_s(hContact, MODULENAME, START_STRING_KEY, ""); - db_set_ts(hContact, MODULENAME, URL_KEY, psr->nick.w); - db_set_ts(hContact, MODULENAME, "Homepage", psr->nick.w); + db_set_ws(hContact, MODULENAME, URL_KEY, psr->nick.w); + db_set_ws(hContact, MODULENAME, "Homepage", psr->nick.w); db_set_b(hContact, MODULENAME, U_ALLSITE_KEY, 1); db_set_w(hContact, MODULENAME, "Status", ID_STATUS_ONLINE); diff --git a/plugins/WhenWasIt/src/WhenWasIt.cpp b/plugins/WhenWasIt/src/WhenWasIt.cpp index cb5da2f666..0fbf8a0cb0 100644 --- a/plugins/WhenWasIt/src/WhenWasIt.cpp +++ b/plugins/WhenWasIt/src/WhenWasIt.cpp @@ -131,8 +131,8 @@ extern "C" int __declspec(dllexport) Load(void) hotkey.pszService = MS_WWI_CHECK_BIRTHDAYS;
Hotkey_Register(&hotkey);
- SkinAddNewSoundExT(BIRTHDAY_NEAR_SOUND, LPGENW("WhenWasIt"), LPGENW("Birthday near"));
- SkinAddNewSoundExT(BIRTHDAY_TODAY_SOUND, LPGENW("WhenWasIt"), LPGENW("Birthday today"));
+ SkinAddNewSoundExW(BIRTHDAY_NEAR_SOUND, LPGENW("WhenWasIt"), LPGENW("Birthday near"));
+ SkinAddNewSoundExW(BIRTHDAY_TODAY_SOUND, LPGENW("WhenWasIt"), LPGENW("Birthday today"));
Log("%s", "Leaving function " __FUNCTION__);
return 0;
diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index 24af71cc3d..984fc1b5b2 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -99,18 +99,18 @@ int AddInfoToComboBoxes(HWND hWnd) int i;
for (i = 0; i < cShowAgeMode; i++)
- SendDlgItemMessage(hWnd, IDC_AGE_COMBOBOX, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szShowAgeMode[i]));
+ SendDlgItemMessage(hWnd, IDC_AGE_COMBOBOX, CB_ADDSTRING, 0, (LPARAM)TranslateW(szShowAgeMode[i]));
for (i = 0; i < cSaveModule; i++)
- SendDlgItemMessage(hWnd, IDC_DEFAULT_MODULE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szSaveModule[i]));
+ SendDlgItemMessage(hWnd, IDC_DEFAULT_MODULE, CB_ADDSTRING, 0, (LPARAM)TranslateW(szSaveModule[i]));
for (i = 0; i < cPopupClick; i++) {
- SendDlgItemMessage(hWnd, IDC_LEFT_CLICK, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szPopupClick[i]));
- SendDlgItemMessage(hWnd, IDC_RIGHT_CLICK, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szPopupClick[i]));
+ SendDlgItemMessage(hWnd, IDC_LEFT_CLICK, CB_ADDSTRING, 0, (LPARAM)TranslateW(szPopupClick[i]));
+ SendDlgItemMessage(hWnd, IDC_RIGHT_CLICK, CB_ADDSTRING, 0, (LPARAM)TranslateW(szPopupClick[i]));
}
for (i = 0; i < cNotifyFor; i++)
- SendDlgItemMessage(hWnd, IDC_NOTIFYFOR, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szNotifyFor[i]));
+ SendDlgItemMessage(hWnd, IDC_NOTIFYFOR, CB_ADDSTRING, 0, (LPARAM)TranslateW(szNotifyFor[i]));
return i;
}
@@ -406,7 +406,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l Window_SetIcon_IcoLib(hWnd, hAddBirthdayContact);
for (int i = 0; i < cSaveModule; i++)
- SendDlgItemMessage(hWnd, IDC_COMPATIBILITY, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szSaveModule[i]));
+ SendDlgItemMessage(hWnd, IDC_COMPATIBILITY, CB_ADDSTRING, 0, (LPARAM)TranslateW(szSaveModule[i]));
SendDlgItemMessage(hWnd, IDC_COMPATIBILITY, CB_SETCURSEL, commonData.cDefaultModule, 0);
break;
diff --git a/plugins/WhenWasIt/src/hooked_events.cpp b/plugins/WhenWasIt/src/hooked_events.cpp index d263f72196..f2e6619413 100644 --- a/plugins/WhenWasIt/src/hooked_events.cpp +++ b/plugins/WhenWasIt/src/hooked_events.cpp @@ -49,7 +49,7 @@ static int OnOptionsInitialise(WPARAM wParam, LPARAM) odp.pwszTitle = LPGENW("Birthdays");
odp.pwszGroup = LPGENW("Contacts");
odp.groupPosition = 910000000;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pfnDlgProc = DlgProcOptions;
Options_AddPage(wParam, &odp);
return 0;
diff --git a/plugins/WhenWasIt/src/icons.cpp b/plugins/WhenWasIt/src/icons.cpp index 5526639a3e..dbe48f467b 100644 --- a/plugins/WhenWasIt/src/icons.cpp +++ b/plugins/WhenWasIt/src/icons.cpp @@ -32,7 +32,7 @@ HANDLE hWWIExtraIcons = (HANDLE)-1; static HANDLE AddIcon(char *name, char *description, wchar_t *tszPath, int iDefaultIdx)
{
SKINICONDESC sid = { 0 };
- sid.flags = SIDF_PATH_TCHAR;
+ sid.flags = SIDF_PATH_UNICODE;
sid.section.a = LPGEN("WhenWasIt");
sid.description.a = description;
sid.pszName = name;
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp index 7ac4d016a5..90585fe508 100644 --- a/plugins/WhenWasIt/src/services.cpp +++ b/plugins/WhenWasIt/src/services.cpp @@ -299,7 +299,7 @@ int DoImport(wchar_t *fileName) SaveBirthday(hContact, year, month, day, mode);
}
else {
- CMString msg(FORMAT, TranslateT("Could not find UID '%s [%S]' in current database, skipping"), szHandle, szProto);
+ CMStringW msg(FORMAT, TranslateT("Could not find UID '%s [%S]' in current database, skipping"), szHandle, szProto);
ShowPopupMessage(TranslateT("Warning"), msg, hImportBirthdays);
}
}
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index fc2ff253db..acf8f278b7 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -24,9 +24,9 @@ static PLUGININFOEX pluginInfo = void LoadOptions()
{
DBVARIANT dbv = { 0 };
- dbv.type = DBVT_TCHAR;
+ dbv.type = DBVT_WCHAR;
memset(&WumfOptions, 0, sizeof(WumfOptions));
- if (db_get_ts(NULL, MODULENAME, OPT_FILE, &dbv) == 0)
+ if (db_get_ws(NULL, MODULENAME, OPT_FILE, &dbv) == 0)
{
wcsncpy(WumfOptions.LogFile, dbv.ptszVal, 255);
db_free(&dbv);
@@ -447,7 +447,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg,UINT msg,WPARAM wparam,LPARAM lpara db_set_b(NULL, MODULENAME, LOG_COMP, (BYTE)WumfOptions.LogComp);
db_set_b(NULL, MODULENAME, ALERT_COMP, (BYTE)WumfOptions.AlertComp);
GetDlgItemText(hwndDlg, IDC_FILE, WumfOptions.LogFile, _countof(WumfOptions.LogFile));
- db_set_ts(NULL, MODULENAME, OPT_FILE, WumfOptions.LogFile);
+ db_set_ws(NULL, MODULENAME, OPT_FILE, WumfOptions.LogFile);
}
}
break;
diff --git a/plugins/WinterSpeak/src/ConfigDatabase.cpp b/plugins/WinterSpeak/src/ConfigDatabase.cpp index ed7ff2db52..a67506ad8e 100644 --- a/plugins/WinterSpeak/src/ConfigDatabase.cpp +++ b/plugins/WinterSpeak/src/ConfigDatabase.cpp @@ -105,15 +105,15 @@ void ConfigDatabase::load() //------------------------------------------------------------------------------
void ConfigDatabase::save()
{
- db_set_ts(NULL, SPEAK, ENGINE, m_voice_desc.engine.c_str());
- db_set_ts(NULL, SPEAK, VOICE, m_voice_desc.voice.c_str());
+ db_set_ws(NULL, SPEAK, ENGINE, m_voice_desc.engine.c_str());
+ db_set_ws(NULL, SPEAK, VOICE, m_voice_desc.voice.c_str());
db_set_dw(NULL, SPEAK, VOLUME, m_voice_desc.volume);
db_set_dw(NULL, SPEAK, PITCH, m_voice_desc.pitch);
db_set_dw(NULL, SPEAK, RATE, m_voice_desc.rate);
db_set_dw(NULL, SPEAK, ACTIVE_FLAGS, m_active_flags);
- db_set_ts(NULL, SPEAK, WELCOME_MSG, m_welcome_msg.c_str());
+ db_set_ws(NULL, SPEAK, WELCOME_MSG, m_welcome_msg.c_str());
for (ActiveUsersMap::iterator i = m_active_users.begin(); i != m_active_users.end(); ++i)
{
@@ -133,7 +133,7 @@ std::wstring ConfigDatabase::DBGetContactSettingString(const char *szModule, con std::wstring ret = def;
DBVARIANT dbv;
- if (!db_get_ts(NULL, szModule, szSetting, &dbv))
+ if (!db_get_ws(NULL, szModule, szSetting, &dbv))
{
ret = dbv.pwszVal;
}
diff --git a/plugins/WinterSpeak/src/main.cpp b/plugins/WinterSpeak/src/main.cpp index d01560d6f4..d19d290d42 100644 --- a/plugins/WinterSpeak/src/main.cpp +++ b/plugins/WinterSpeak/src/main.cpp @@ -72,7 +72,7 @@ int dialogOptionsInitialise(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_hInst;
odp.pwszGroup = LPGENW("Speak");
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
if (g_speak_config)
{
diff --git a/plugins/XSoundNotify/src/dialog.cpp b/plugins/XSoundNotify/src/dialog.cpp index ca68cabc9f..7529110f34 100644 --- a/plugins/XSoundNotify/src/dialog.cpp +++ b/plugins/XSoundNotify/src/dialog.cpp @@ -52,7 +52,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP }
EnableWindow(GetDlgItem(hwndDlg, IDC_CONT_BUTTON_CHOOSE_SOUND), TRUE);
DBVARIANT dbv = { 0 };
- if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
+ if (!db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_CONT_BUTTON_TEST_PLAY), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CONT_BUTTON_RESET_SOUND), TRUE);
SetDlgItemText(hwndDlg, IDC_CONT_LABEL_SOUND, PathFindFileName(dbv.ptszVal));
@@ -67,7 +67,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP CheckDlgButton(hwndDlg, IDC_CONT_IGNORE_SOUND, db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0) ? BST_CHECKED : BST_UNCHECKED);
p = XSN_Users.find((XSN_Data *)&hContact);
if (p == NULL) {
- ptrW name(db_get_tsa(hContact, SETTINGSNAME, SETTINGSKEY));
+ ptrW name(db_get_wsa(hContact, SETTINGSNAME, SETTINGSKEY));
if (name != NULL)
XSN_Users.insert(new XSN_Data(hContact, name, IsDlgButtonChecked(hwndDlg, IDC_CONT_IGNORE_SOUND) ? 1 : 0));
}
@@ -82,7 +82,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP if (mir_wstrcmpi(p->path, L"")) {
wchar_t shortpath[MAX_PATH];
PathToRelativeT(p->path, shortpath);
- db_set_ts(hContact, SETTINGSNAME, SETTINGSKEY, shortpath);
+ db_set_ws(hContact, SETTINGSNAME, SETTINGSKEY, shortpath);
}
db_set_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, p->ignore);
}
@@ -134,16 +134,16 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP isIgnoreSound = 0;
if (p == NULL) {
DBVARIANT dbv;
- if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
+ if (!db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
wchar_t longpath[MAX_PATH] = { 0 };
- PathToAbsoluteT(dbv.ptszVal, longpath);
+ PathToAbsoluteW(dbv.ptszVal, longpath);
SkinPlaySoundFile(longpath);
db_free(&dbv);
}
}
else {
wchar_t longpath[MAX_PATH] = { 0 };
- PathToAbsoluteT(p->path, longpath);
+ PathToAbsoluteW(p->path, longpath);
SkinPlaySoundFile(longpath);
}
break;
@@ -167,9 +167,9 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP p = XSN_Users.find((XSN_Data *)&hContact);
if (p == NULL) {
DBVARIANT dbv;
- if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
+ if (!db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
wchar_t longpath[MAX_PATH];
- PathToAbsoluteT(dbv.ptszVal, longpath);
+ PathToAbsoluteW(dbv.ptszVal, longpath);
XSN_Users.insert(new XSN_Data(hContact, longpath, IsDlgButtonChecked(hwndDlg, IDC_CONT_IGNORE_SOUND) ? 1 : 0));
db_free(&dbv);
}
diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp index 61a846a53e..1fab9fedf2 100644 --- a/plugins/XSoundNotify/src/options.cpp +++ b/plugins/XSoundNotify/src/options.cpp @@ -96,7 +96,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l MCONTACT hContact = (MCONTACT)SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_GETITEMDATA, cursel, 0);
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_CHOOSE_SOUND), TRUE);
DBVARIANT dbv = { 0 };
- if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv))
+ if (!db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv))
{
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_TEST_PLAY), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_RESET_SOUND), TRUE);
@@ -163,16 +163,16 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l isIgnoreSound = 0;
if (p == NULL) {
DBVARIANT dbv;
- if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
+ if (!db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
wchar_t longpath[MAX_PATH];
- PathToAbsoluteT(dbv.ptszVal, longpath);
+ PathToAbsoluteW(dbv.ptszVal, longpath);
SkinPlaySoundFile(longpath);
db_free(&dbv);
}
}
else {
wchar_t longpath[MAX_PATH] = { 0 };
- PathToAbsoluteT(p->path, longpath);
+ PathToAbsoluteW(p->path, longpath);
SkinPlaySoundFile(longpath);
}
}
@@ -204,9 +204,9 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l XSN_Data *p = XSN_Users.find((XSN_Data *)&hContact);
if (p == NULL) {
DBVARIANT dbv;
- if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
+ if (!db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
wchar_t longpath[MAX_PATH];
- PathToAbsoluteT(dbv.ptszVal, longpath);
+ PathToAbsoluteW(dbv.ptszVal, longpath);
XSN_Users.insert(new XSN_Data(hContact, longpath, IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0));
db_free(&dbv);
}
@@ -227,7 +227,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (mir_wstrcmpi(XSN_Users[i]->path, L"")) {
wchar_t shortpath[MAX_PATH];
PathToRelativeT(XSN_Users[i]->path, shortpath);
- db_set_ts(XSN_Users[i]->hContact, SETTINGSNAME, SETTINGSKEY, shortpath);
+ db_set_ws(XSN_Users[i]->hContact, SETTINGSNAME, SETTINGSKEY, shortpath);
}
db_set_b(XSN_Users[i]->hContact, SETTINGSNAME, SETTINGSIGNOREKEY, XSN_Users[i]->ignore);
}
@@ -242,7 +242,7 @@ INT OptInit(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 100000000;
odp.hInstance = hInst;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.pwszGroup = LPGENW("Sounds");
odp.pwszTitle = LPGENW("XSound Notify");
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index 02ea729792..af0d731e50 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -78,7 +78,7 @@ void InitSelfSounds() wchar_t infobuf[256];
mir_snwprintf(infobuf, L"%s [%s]", TranslateT("Self status"), protos[i]->tszAccountName);
- SkinAddNewSoundExT(namebuf, infobuf, pcli->pfnGetStatusModeDescription(selfSounds[j].iStatus, 0));
+ SkinAddNewSoundExW(namebuf, infobuf, pcli->pfnGetStatusModeDescription(selfSounds[j].iStatus, 0));
}
}
}
@@ -117,9 +117,9 @@ static int ProcessEvent(WPARAM hContact, LPARAM lParam) isIgnoreSound = db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0);
DBVARIANT dbv;
- if (!isIgnoreSound && !db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
+ if (!isIgnoreSound && !db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
wchar_t PlaySoundPath[MAX_PATH] = { 0 };
- PathToAbsoluteT(dbv.ptszVal, PlaySoundPath);
+ PathToAbsoluteW(dbv.ptszVal, PlaySoundPath);
isOwnSound = 0;
SkinPlaySoundFile(PlaySoundPath);
db_free(&dbv);
@@ -141,15 +141,15 @@ static int ProcessChatEvent(WPARAM, LPARAM lParam) MCONTACT hContact = pci->FindRoom(gcd->pszModule, gcd->ptszID);
if (hContact != 0) {
- ptrW nick(db_get_tsa(hContact, gcd->pszModule, "MyNick"));
+ ptrW nick(db_get_wsa(hContact, gcd->pszModule, "MyNick"));
if (nick == NULL || gce->ptszText == NULL)
return 0;
if (wcsstr(gce->ptszText, nick)) {
isIgnoreSound = db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0);
DBVARIANT dbv;
- if (!isIgnoreSound && !db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
+ if (!isIgnoreSound && !db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
wchar_t PlaySoundPath[MAX_PATH] = { 0 };
- PathToAbsoluteT(dbv.ptszVal, PlaySoundPath);
+ PathToAbsoluteW(dbv.ptszVal, PlaySoundPath);
isOwnSound = 0;
SkinPlaySoundFile(PlaySoundPath);
db_free(&dbv);
@@ -180,7 +180,7 @@ static int OnLoadInit(WPARAM, LPARAM) CMenuItem mi;
SET_UID(mi, 0x5d72ca1f, 0xc52, 0x436d, 0x81, 0x47, 0x29, 0xf6, 0xc3, 0x28, 0xb5, 0xd1);
mi.position = -0x7FFFFFFF;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
mi.name.w = LPGENW("Custom contact sound");
mi.pszService = "XSoundNotify/ContactMenuCommand";
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index 2dae05544b..606622e27f 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -647,10 +647,10 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D evt.ptszTooltip = tszMsg; pcli->pfnAddEvent(&evt); } - db_set_ts(ActualAccount->hContact, "CList", "StatusMsg", tszMsg); + db_set_ws(ActualAccount->hContact, "CList", "StatusMsg", tszMsg); if (nflags & YAMN_ACC_CONTNICK) - db_set_ts(ActualAccount->hContact, YAMN_DBMODULE, "Nick", tszMsg); + db_set_ws(ActualAccount->hContact, YAMN_DBMODULE, "Nick", tszMsg); } if ((nflags & YAMN_ACC_POP) && diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index 73e21c95af..aca078ca62 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -62,10 +62,10 @@ static void GetProfileDirectory(wchar_t *szPath, int cbPath) //This is copied from Miranda's sources. In 0.2.1.0 it is needed, in newer vesions of Miranda use MS_DB_GETPROFILEPATH service { wchar_t tszOldPath[MAX_PATH]; - CallService(MS_DB_GETPROFILEPATHT, _countof(tszOldPath), (LPARAM)tszOldPath); + CallService(MS_DB_GETPROFILEPATHW, _countof(tszOldPath), (LPARAM)tszOldPath); mir_wstrcat(tszOldPath, L"\\*.book"); - VARST ptszNewPath( L"%miranda_userdata%"); + VARSW ptszNewPath( L"%miranda_userdata%"); SHFILEOPSTRUCT file_op = { NULL, @@ -265,10 +265,10 @@ extern "C" int __declspec(dllexport) Load(void) YAMN_STATUS = ID_STATUS_OFFLINE; // we get the Miranda Root Path - PathToAbsoluteT( L".", szMirandaDir); + PathToAbsoluteW( L".", szMirandaDir); // retrieve the current profile name - CallService(MS_DB_GETPROFILENAMET, (WPARAM)_countof(ProfileName), (LPARAM)ProfileName); //not to pass entire array to fcn + CallService(MS_DB_GETPROFILENAMEW, (WPARAM)_countof(ProfileName), (LPARAM)ProfileName); //not to pass entire array to fcn wchar_t *fc = wcsrchr(ProfileName, '.'); if ( fc != NULL ) *fc = 0; diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp index 9b2d0da53e..edf298d3e6 100644 --- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp @@ -1544,12 +1544,12 @@ wchar_t* WINAPI GetErrorString(DWORD Code) mir_snwprintf(ErrorString, ERRORSTR_MAXLEN, TranslateT("Error %d-%d-%d-%d:"), ErrorCode->AppError, ErrorCode->POP3Error, ErrorCode->NetError, ErrorCode->SystemError);
if (ErrorCode->POP3Error)
- mir_snwprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateTS(POP3Errors[ErrorCode->POP3Error - 1]));
+ mir_snwprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateW(POP3Errors[ErrorCode->POP3Error - 1]));
if (ErrorCode->NetError) {
if (ErrorCode->SSL)
- mir_snwprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateTS(SSLErrors[ErrorCode->NetError - 1]));
+ mir_snwprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateW(SSLErrors[ErrorCode->NetError - 1]));
else
- mir_snwprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateTS(NetlibErrors[ErrorCode->NetError - 4]));
+ mir_snwprintf(ErrorString, ERRORSTR_MAXLEN, L"%s\n%s", ErrorString, TranslateW(NetlibErrors[ErrorCode->NetError - 4]));
}
return ErrorString;
diff --git a/plugins/YAPP/src/yapp.cpp b/plugins/YAPP/src/yapp.cpp index 79f787dbc7..20e7d3d5c9 100644 --- a/plugins/YAPP/src/yapp.cpp +++ b/plugins/YAPP/src/yapp.cpp @@ -11,8 +11,8 @@ MNOTIFYLINK *notifyLink = 0; // used to work around a bug in neweventnotify and others with the address passed in the GetPluginData function
bool ignore_gpd_passed_addy = false;
-FontIDT font_id_firstline = {0}, font_id_secondline = {0}, font_id_time = {0};
-ColourIDT colour_id_bg = {0}, colour_id_border = {0}, colour_id_sidebar = {0}, colour_id_titleunderline = {0};
+FontIDW font_id_firstline = {0}, font_id_secondline = {0}, font_id_time = {0};
+ColourIDW colour_id_bg = {0}, colour_id_border = {0}, colour_id_sidebar = {0}, colour_id_titleunderline = {0};
COLORREF colBg = GetSysColor(COLOR_3DSHADOW);
HFONT hFontFirstLine = 0, hFontSecondLine = 0, hFontTime = 0;
@@ -57,19 +57,19 @@ int ReloadFont(WPARAM, LPARAM) {
LOGFONT log_font;
if (hFontFirstLine) DeleteObject(hFontFirstLine);
- colFirstLine = CallService(MS_FONT_GETT, (WPARAM)&font_id_firstline, (LPARAM)&log_font);
+ colFirstLine = CallService(MS_FONT_GETW, (WPARAM)&font_id_firstline, (LPARAM)&log_font);
hFontFirstLine = CreateFontIndirect(&log_font);
if (hFontSecondLine) DeleteObject(hFontSecondLine);
- colSecondLine = CallService(MS_FONT_GETT, (WPARAM)&font_id_secondline, (LPARAM)&log_font);
+ colSecondLine = CallService(MS_FONT_GETW, (WPARAM)&font_id_secondline, (LPARAM)&log_font);
hFontSecondLine = CreateFontIndirect(&log_font);
if (hFontTime) DeleteObject(hFontTime);
- colTime = CallService(MS_FONT_GETT, (WPARAM)&font_id_time, (LPARAM)&log_font);
+ colTime = CallService(MS_FONT_GETW, (WPARAM)&font_id_time, (LPARAM)&log_font);
hFontTime = CreateFontIndirect(&log_font);
- colBg = CallService(MS_COLOUR_GETT, (WPARAM)&colour_id_bg, 0);
- colBorder = CallService(MS_COLOUR_GETT, (WPARAM)&colour_id_border, 0);
- colSidebar = CallService(MS_COLOUR_GETT, (WPARAM)&colour_id_sidebar, 0);
- colTitleUnderline = CallService(MS_COLOUR_GETT, (WPARAM)&colour_id_titleunderline, 0);
+ colBg = CallService(MS_COLOUR_GETW, (WPARAM)&colour_id_bg, 0);
+ colBorder = CallService(MS_COLOUR_GETW, (WPARAM)&colour_id_border, 0);
+ colSidebar = CallService(MS_COLOUR_GETW, (WPARAM)&colour_id_sidebar, 0);
+ colTitleUnderline = CallService(MS_COLOUR_GETW, (WPARAM)&colour_id_titleunderline, 0);
return 0;
}
@@ -92,7 +92,7 @@ int TTBLoaded(WPARAM, LPARAM) static void InitFonts()
{
- font_id_firstline.cbSize = sizeof(FontIDT);
+ font_id_firstline.cbSize = sizeof(FontIDW);
font_id_firstline.flags = FIDF_ALLOWEFFECTS;
mir_wstrcpy(font_id_firstline.group, LPGENW("Popups"));
mir_wstrcpy(font_id_firstline.name, LPGENW("First line"));
@@ -101,9 +101,9 @@ static void InitFonts() mir_wstrcpy(font_id_firstline.backgroundGroup, L"Popups");
mir_wstrcpy(font_id_firstline.backgroundName, L"Background");
font_id_firstline.order = 0;
- FontRegisterT(&font_id_firstline);
+ FontRegisterW(&font_id_firstline);
- font_id_secondline.cbSize = sizeof(FontIDT);
+ font_id_secondline.cbSize = sizeof(FontIDW);
font_id_secondline.flags = FIDF_ALLOWEFFECTS;
mir_wstrcpy(font_id_secondline.group, LPGENW("Popups"));
mir_wstrcpy(font_id_secondline.name, LPGENW("Second line"));
@@ -112,9 +112,9 @@ static void InitFonts() mir_wstrcpy(font_id_secondline.backgroundGroup, L"Popups");
mir_wstrcpy(font_id_secondline.backgroundName, L"Background");
font_id_secondline.order = 1;
- FontRegisterT(&font_id_secondline);
+ FontRegisterW(&font_id_secondline);
- font_id_time.cbSize = sizeof(FontIDT);
+ font_id_time.cbSize = sizeof(FontIDW);
font_id_time.flags = FIDF_ALLOWEFFECTS;
mir_wstrcpy(font_id_time.group, LPGENW("Popups"));
mir_wstrcpy(font_id_time.name, LPGENW("Time"));
@@ -123,43 +123,43 @@ static void InitFonts() mir_wstrcpy(font_id_time.backgroundGroup, L"Popups");
mir_wstrcpy(font_id_time.backgroundName, L"Background");
font_id_time.order = 2;
- FontRegisterT(&font_id_time);
+ FontRegisterW(&font_id_time);
- colour_id_bg.cbSize = sizeof(ColourIDT);
+ colour_id_bg.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colour_id_bg.group, LPGENW("Popups"));
mir_wstrcpy(colour_id_bg.name, LPGENW("Background"));
mir_strcpy(colour_id_bg.dbSettingsGroup, MODULE);
mir_strcpy(colour_id_bg.setting, "ColourBg");
colour_id_bg.defcolour = GetSysColor(COLOR_3DSHADOW);
colour_id_bg.order = 0;
- ColourRegisterT(&colour_id_bg);
+ ColourRegisterW(&colour_id_bg);
- colour_id_border.cbSize = sizeof(ColourIDT);
+ colour_id_border.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colour_id_border.group, LPGENW("Popups"));
mir_wstrcpy(colour_id_border.name, LPGENW("Border"));
mir_strcpy(colour_id_border.dbSettingsGroup, MODULE);
mir_strcpy(colour_id_border.setting, "ColourBorder");
colour_id_border.defcolour = RGB(0, 0, 0);
colour_id_border.order = 1;
- ColourRegisterT(&colour_id_border);
+ ColourRegisterW(&colour_id_border);
- colour_id_sidebar.cbSize = sizeof(ColourIDT);
+ colour_id_sidebar.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colour_id_sidebar.group, LPGENW("Popups"));
mir_wstrcpy(colour_id_sidebar.name, LPGENW("Sidebar"));
mir_strcpy(colour_id_sidebar.dbSettingsGroup, MODULE);
mir_strcpy(colour_id_sidebar.setting, "ColourSidebar");
colour_id_sidebar.defcolour = RGB(128, 128, 128);
colour_id_sidebar.order = 2;
- ColourRegisterT(&colour_id_sidebar);
+ ColourRegisterW(&colour_id_sidebar);
- colour_id_titleunderline.cbSize = sizeof(ColourIDT);
+ colour_id_titleunderline.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colour_id_titleunderline.group, LPGENW("Popups"));
mir_wstrcpy(colour_id_titleunderline.name, LPGENW("Title underline"));
mir_strcpy(colour_id_titleunderline.dbSettingsGroup, MODULE);
mir_strcpy(colour_id_titleunderline.setting, "ColourTitleUnderline");
colour_id_titleunderline.defcolour = GetSysColor(COLOR_3DSHADOW);
colour_id_titleunderline.order = 3;
- ColourRegisterT(&colour_id_titleunderline);
+ ColourRegisterW(&colour_id_titleunderline);
ReloadFont(0, 0);
}
@@ -172,7 +172,7 @@ void InitMenuItems(void) Menu_ConfigureItem(hMenuRoot, MCI_OPT_UID, "043A641A-2767-4C57-AA57-9233D6F9DC54");
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.root = hMenuRoot;
SET_UID(mi, 0x92c386ae, 0x6e81, 0x452d, 0xb5, 0x71, 0x87, 0x46, 0xe9, 0x2, 0x66, 0xe9);
diff --git a/plugins/YAPP/src/yapp_history_dlg.cpp b/plugins/YAPP/src/yapp_history_dlg.cpp index c3b7a08e35..cd8d2f7720 100644 --- a/plugins/YAPP/src/yapp_history_dlg.cpp +++ b/plugins/YAPP/src/yapp_history_dlg.cpp @@ -566,7 +566,7 @@ void LoadHistoryColumns(HWND hHistoryList) for (i = 0; i < cHistoryColumns; i++)
{
- col.pszText = TranslateTS(szHistoryColumns[i]);
+ col.pszText = TranslateW(szHistoryColumns[i]);
col.cx = cxHistoryColumns[i];
ListView_InsertColumn(hHistoryList, i, &col);
}
diff --git a/plugins/YARelay/src/main.cpp b/plugins/YARelay/src/main.cpp index 3e2112eb27..c3d9ae62d6 100644 --- a/plugins/YARelay/src/main.cpp +++ b/plugins/YARelay/src/main.cpp @@ -230,7 +230,7 @@ extern "C" int __declspec(dllexport) Load() iForwardOnStatus = db_get_dw(NULL, "yaRelay", "ForwardOnStatus", STATUS_OFFLINE | STATUS_AWAY | STATUS_NA);
- wchar_t *szForwardTemplate = db_get_tsa(NULL, "yaRelay", "ForwardTemplate");
+ wchar_t *szForwardTemplate = db_get_wsa(NULL, "yaRelay", "ForwardTemplate");
if (szForwardTemplate){
wcsncpy(tszForwardTemplate, szForwardTemplate, _countof(tszForwardTemplate));
mir_free(szForwardTemplate);
diff --git a/plugins/YARelay/src/options.cpp b/plugins/YARelay/src/options.cpp index 66a00bbe04..a0222e0bef 100644 --- a/plugins/YARelay/src/options.cpp +++ b/plugins/YARelay/src/options.cpp @@ -172,7 +172,7 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, db_set_dw(NULL, "yaRelay", "ForwardFrom", (DWORD)hForwardFrom);
db_set_dw(NULL, "yaRelay", "ForwardTo", (DWORD)hForwardTo);
db_set_dw(NULL, "yaRelay", "ForwardOnStatus", iForwardOnStatus);
- db_set_ts(NULL, "yaRelay", "ForwardTemplate", tszForwardTemplate);
+ db_set_ws(NULL, "yaRelay", "ForwardTemplate", tszForwardTemplate);
db_set_dw(NULL, "yaRelay", "Split", iSplit);
db_set_dw(NULL, "yaRelay", "SplitMaxSize", iSplitMaxSize);
db_set_dw(NULL, "yaRelay", "SendParts", iSendParts);
diff --git a/plugins/YahooGroups/src/hooked_events.cpp b/plugins/YahooGroups/src/hooked_events.cpp index 774537e696..722075e1f6 100644 --- a/plugins/YahooGroups/src/hooked_events.cpp +++ b/plugins/YahooGroups/src/hooked_events.cpp @@ -58,7 +58,7 @@ int OnOptionsInitialise(WPARAM wParam, LPARAM) odp.pwszTitle = LPGENW("Yahoo Groups");
odp.pwszGroup = LPGENW("Plugins");
odp.groupPosition = 810000000;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pfnDlgProc = DlgProcOptions;
Options_AddPage(wParam, &odp);
return 0;
diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp index c2e11e5c54..4f0f58d421 100644 --- a/plugins/ZeroNotification/src/main.cpp +++ b/plugins/ZeroNotification/src/main.cpp @@ -70,7 +70,7 @@ static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *value tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
for (i = 0; i < nValues; i++) {
tvis.item.lParam = values[i].style;
- tvis.item.pszText = TranslateTS(values[i].szDescr);
+ tvis.item.pszText = TranslateW(values[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.state = INDEXTOSTATEIMAGEMASK((style&tvis.item.lParam) != 0 ? 2 : 1);
TreeView_InsertItem(hwndTree, &tvis);
@@ -206,7 +206,7 @@ static int OptionsInitialize(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 100000000;
odp.hInstance = hInst;
- odp.flags = ODPF_TCHAR;
+ odp.flags = ODPF_UNICODE;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NOSOUND);
odp.pwszTitle = LPGENW("Zero Notifications");
odp.pwszGroup = LPGENW("Plugins");
@@ -236,7 +236,7 @@ extern "C" __declspec(dllexport) int Load(void) CMenuItem mi;
mi.position = -0x7FFFFFFF;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
UpdateMenuItem();
SET_UID(mi, 0x6bd635eb, 0xc4bb, 0x413b, 0xb9, 0x3, 0x81, 0x6d, 0x8f, 0xf1, 0x9b, 0xb0);
diff --git a/plugins/wbOSD/src/events.cpp b/plugins/wbOSD/src/events.cpp index e2207bd059..2aba79e1dd 100644 --- a/plugins/wbOSD/src/events.cpp +++ b/plugins/wbOSD/src/events.cpp @@ -20,7 +20,7 @@ void showmsgwnd(unsigned int param) {
logmsg("showmsgwnd");
if (db_get_b(NULL,THIS_MODULE, "showMessageWindow", DEFAULT_SHOWMSGWIN))
- CallService(MS_MSG_SENDMESSAGET, (WPARAM)param, 0);
+ CallService(MS_MSG_SENDMESSAGEW, (WPARAM)param, 0);
}
LRESULT ShowOSD(wchar_t *str, int timeout, COLORREF color, MCONTACT user)
@@ -154,7 +154,7 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent) wcsncpy(buf, DEFAULT_MESSAGEFORMAT,_countof(buf));
DBVARIANT dbv;
- if(!db_get_ts(NULL,THIS_MODULE,"message_format",&dbv)) {
+ if(!db_get_ws(NULL,THIS_MODULE,"message_format",&dbv)) {
mir_wstrcpy(buf, dbv.ptszVal);
db_free(&dbv);
}
@@ -185,12 +185,12 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent) if ( i1 == 1 )
c1 = mir_wstrdup(pcli->pfnGetContactDisplayName(wParam, 0));
else if ( i1 == 2 )
- c1 = DbGetEventTextT( &dbe, 0 );
+ c1 = DbGetEventTextW( &dbe, 0 );
if ( i2 == 1 )
c2 = mir_wstrdup(pcli->pfnGetContactDisplayName(wParam, 0));
else if ( i2 == 2 )
- c2 = DbGetEventTextT( &dbe, 0 );
+ c2 = DbGetEventTextW( &dbe, 0 );
wchar_t buffer[512];
mir_snwprintf(buffer, buf, c1, c2);
diff --git a/plugins/wbOSD/src/options.cpp b/plugins/wbOSD/src/options.cpp index 3749330a0f..f0d278b074 100644 --- a/plugins/wbOSD/src/options.cpp +++ b/plugins/wbOSD/src/options.cpp @@ -127,7 +127,7 @@ void loadDBSettings(plgsettings *ps) ps->showWhen = db_get_dw(NULL, THIS_MODULE, "showWhen", DEFAULT_SHOWWHEN);
DBVARIANT dbv;
- if (!db_get_ts(NULL, THIS_MODULE, "message_format", &dbv)) {
+ if (!db_get_ws(NULL, THIS_MODULE, "message_format", &dbv)) {
mir_wstrcpy(ps->msgformat, dbv.ptszVal);
db_free(&dbv);
}
@@ -149,7 +149,7 @@ void loadDBSettings(plgsettings *ps) ps->lf.lfQuality = db_get_b(NULL, THIS_MODULE, "fntQuality", DEFAULT_FNT_QUALITY);
ps->lf.lfPitchAndFamily = db_get_b(NULL, THIS_MODULE, "fntPitchAndFamily", DEFAULT_FNT_PITCHANDFAM);
- if (!db_get_ts(NULL, THIS_MODULE, "fntFaceName", &dbv)) {
+ if (!db_get_ws(NULL, THIS_MODULE, "fntFaceName", &dbv)) {
mir_wstrcpy(ps->lf.lfFaceName, dbv.ptszVal);
db_free(&dbv);
}
@@ -176,7 +176,7 @@ void saveDBSettings(plgsettings *ps) db_set_b(NULL, THIS_MODULE, "transparent", ps->transparent);
db_set_b(NULL, THIS_MODULE, "messages", ps->messages);
db_set_b(NULL, THIS_MODULE, "a_user", ps->a_user);
- db_set_ts(NULL, THIS_MODULE, "message_format", ps->msgformat);
+ db_set_ws(NULL, THIS_MODULE, "message_format", ps->msgformat);
db_set_b(NULL, THIS_MODULE, "align", ps->align);
db_set_b(NULL, THIS_MODULE, "salign", ps->salign);
@@ -201,7 +201,7 @@ void saveDBSettings(plgsettings *ps) db_set_b(NULL, THIS_MODULE, "fntClipPrecision", ps->lf.lfClipPrecision);
db_set_b(NULL, THIS_MODULE, "fntQuality", ps->lf.lfQuality);
db_set_b(NULL, THIS_MODULE, "fntPitchAndFamily", ps->lf.lfPitchAndFamily);
- db_set_ts(NULL, THIS_MODULE, "fntFaceName", ps->lf.lfFaceName);
+ db_set_ws(NULL, THIS_MODULE, "fntFaceName", ps->lf.lfFaceName);
db_set_dw(NULL, THIS_MODULE, "announce", ps->announce);
@@ -417,7 +417,7 @@ int OptionsInit(WPARAM wparam, LPARAM) odp.pwszGroup = LPGENW("Plugins");
odp.pwszTitle = LPGENW("OSD");
odp.pfnDlgProc = OptDlgProc;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
Options_AddPage(wparam, &odp);
return 0;
}
diff --git a/protocols/AimOscar/src/avatars.cpp b/protocols/AimOscar/src/avatars.cpp index 9a8a160503..fa966348e1 100644 --- a/protocols/AimOscar/src/avatars.cpp +++ b/protocols/AimOscar/src/avatars.cpp @@ -118,15 +118,15 @@ void CAimProto::avatar_retrieval_handler(const char* sn, const char* /*hash*/, c int CAimProto::get_avatar_filename(MCONTACT hContact, wchar_t* pszDest, size_t cbLen, const wchar_t *ext)
{
- int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
+ int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARSW(L"%miranda_avatarcache%"), m_szModuleName);
if (ext && _waccess(pszDest, 0))
- CreateDirectoryTreeT(pszDest);
+ CreateDirectoryTreeW(pszDest);
size_t tPathLen2 = tPathLen;
DBVARIANT dbv;
- if (getTString(hContact, AIM_KEY_AH, &dbv)) return GAIR_NOAVATAR;
+ if (getWString(hContact, AIM_KEY_AH, &dbv)) return GAIR_NOAVATAR;
tPathLen += mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s", dbv.ptszVal);
db_free(&dbv);
diff --git a/protocols/AimOscar/src/file.cpp b/protocols/AimOscar/src/file.cpp index a186b29fa8..007359eb8f 100644 --- a/protocols/AimOscar/src/file.cpp +++ b/protocols/AimOscar/src/file.cpp @@ -335,7 +335,7 @@ int CAimProto::receiving_file(file_transfer *ft, HANDLE hServerPacketRecver, NET if (ft->pfts.tszCurrentFile) {
wchar_t* dir = get_dir(ft->pfts.tszCurrentFile);
- CreateDirectoryTreeT(dir);
+ CreateDirectoryTreeW(dir);
mir_free(dir);
oft->type = _htons(ft->pfts.currentFileProgress ? 0x0205 : 0x0202);
@@ -491,7 +491,7 @@ file_transfer::file_transfer(MCONTACT hCont, char* nick, char* cookie) memset(this, 0, sizeof(*this));
pfts.cbSize = sizeof(pfts);
- pfts.flags = PFTS_TCHAR;
+ pfts.flags = PFTS_UNICODE;
pfts.hContact = hCont;
hContact = hCont;
diff --git a/protocols/AimOscar/src/links.cpp b/protocols/AimOscar/src/links.cpp index d759679d9f..15aab1fb90 100644 --- a/protocols/AimOscar/src/links.cpp +++ b/protocols/AimOscar/src/links.cpp @@ -127,7 +127,7 @@ static INT_PTR ServiceParseAimLink(WPARAM, LPARAM lParam) MCONTACT hContact = proto->contact_from_sn(sn, true, true);
if (hContact)
- CallService(MS_MSG_SENDMESSAGET, hContact, (LPARAM)msg);
+ CallService(MS_MSG_SENDMESSAGEW, hContact, (LPARAM)msg);
mir_free(sn);
return 0;
diff --git a/protocols/AimOscar/src/popup.cpp b/protocols/AimOscar/src/popup.cpp index 7e52cd572c..082e6fe606 100644 --- a/protocols/AimOscar/src/popup.cpp +++ b/protocols/AimOscar/src/popup.cpp @@ -80,7 +80,7 @@ void CAimProto::ShowPopup(const char* msg, int flags, char* url) }
wchar_t *msgt = (flags & TCHAR_POPUP) ? mir_wstrdup((wchar_t*)msg) : mir_a2u(msg);
- wcsncpy_s(ppd.lptzText, TranslateTS(msgt), _TRUNCATE);
+ wcsncpy_s(ppd.lptzText, TranslateW(msgt), _TRUNCATE);
mir_free(msgt);
if (!ServiceExists(MS_POPUP_ADDPOPUPT))
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index 0a1f2e9e35..3530efa2ed 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -50,7 +50,7 @@ CAimProto::CAimProto(const char* aProtoName, const wchar_t* aUserName) : NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
@@ -58,7 +58,7 @@ CAimProto::CAimProto(const char* aProtoName, const wchar_t* aUserName) : char szP2P[128];
mir_snprintf(szP2P, "%sP2P", m_szModuleName);
- nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_UNICODE;
mir_snwprintf(descr, TranslateT("%s client-to-client connections"), m_tszUserName);
nlu.szSettingsModule = szP2P;
nlu.minIncomingPorts = 1;
@@ -555,7 +555,7 @@ void __cdecl CAimProto::get_online_msg_thread(void* arg) MCONTACT hContact = (UINT_PTR)arg;
DBVARIANT dbv;
- if (!db_get_ts(hContact, MOD_KEY_CL, OTH_KEY_SM, &dbv)) {
+ if (!db_get_ws(hContact, MOD_KEY_CL, OTH_KEY_SM, &dbv)) {
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
diff --git a/protocols/AimOscar/src/server.cpp b/protocols/AimOscar/src/server.cpp index db3679447b..a41ea0d5ce 100644 --- a/protocols/AimOscar/src/server.cpp +++ b/protocols/AimOscar/src/server.cpp @@ -1250,7 +1250,7 @@ void CAimProto::snac_received_message(SNAC &snac, HANDLE hServerConn, unsigned s wchar_t* filenameT = mir_utf8decodeW(filename);
PROTORECVFILET pre = { 0 };
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(NULL);
pre.descr.w = mir_utf8decodeW(msg_buf);
diff --git a/protocols/AimOscar/src/ui.cpp b/protocols/AimOscar/src/ui.cpp index 71ebfb2e10..0613134dd1 100755 --- a/protocols/AimOscar/src/ui.cpp +++ b/protocols/AimOscar/src/ui.cpp @@ -683,7 +683,7 @@ int CAimProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = -1900000000;
- odp.flags = ODPF_USERINFOTAB | ODPF_TCHAR;
+ odp.flags = ODPF_USERINFOTAB | ODPF_UNICODE;
odp.hInstance = hInstance;
odp.pwszTitle = m_tszUserName;
odp.dwInitParam = LPARAM(this);
@@ -1061,7 +1061,7 @@ int CAimProto::OnOptionsInit(WPARAM wParam, LPARAM) odp.pwszGroup = LPGENW("Network");
odp.pwszTitle = m_tszUserName;
odp.dwInitParam = LPARAM(this);
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.pwszTab = LPGENW("Basic");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_AIM);
diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp index 10a18ba5af..c5a7519817 100755 --- a/protocols/AimOscar/src/utility.cpp +++ b/protocols/AimOscar/src/utility.cpp @@ -533,12 +533,12 @@ int CAimProto::open_contact_file(const char*, const wchar_t* file, const char*, {
path = (wchar_t*)mir_alloc(MAX_PATH * sizeof(wchar_t));
- int pos = mir_snwprintf(path, MAX_PATH, L"%s\\%S", VARST(L"%miranda_userdata%"), m_szModuleName);
+ int pos = mir_snwprintf(path, MAX_PATH, L"%s\\%S", VARSW(L"%miranda_userdata%"), m_szModuleName);
if (contact_dir)
pos += mir_snwprintf(path + pos, MAX_PATH - pos, L"\\%S", m_szModuleName);
if (_waccess(path, 0))
- CreateDirectoryTreeT(path);
+ CreateDirectoryTreeW(path);
mir_snwprintf(path + pos, MAX_PATH - pos, L"\\%s", file);
int fid = _wopen(path, _O_CREAT | _O_RDWR | _O_BINARY, _S_IREAD);
diff --git a/protocols/Dummy/src/dummy_proto.cpp b/protocols/Dummy/src/dummy_proto.cpp index 2a75554c83..801d977a8e 100644 --- a/protocols/Dummy/src/dummy_proto.cpp +++ b/protocols/Dummy/src/dummy_proto.cpp @@ -38,7 +38,7 @@ void CDummyProto::SearchIdAckThread(void *targ) { PROTOSEARCHRESULT psr = { 0 }; psr.cbSize = sizeof(psr); - psr.flags = PSR_TCHAR; + psr.flags = PSR_UNICODE; psr.id.w = (wchar_t*)targ; ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, targ, (LPARAM)&psr); @@ -173,8 +173,8 @@ MCONTACT CDummyProto::AddToList(int flags, PROTOSEARCHRESULT* psr) db_unset(hContact, "CList", "Hidden"); db_unset(hContact, "CList", "NotOnList"); } - setTString(hContact, uniqueIdSetting, psr->id.w); - setTString(hContact, "Nick", psr->id.w); + setWString(hContact, uniqueIdSetting, psr->id.w); + setWString(hContact, "Nick", psr->id.w); } return hContact; diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp index 55c7f046e6..14d8d6030b 100644 --- a/protocols/FacebookRM/src/avatars.cpp +++ b/protocols/FacebookRM/src/avatars.cpp @@ -126,7 +126,7 @@ void FacebookProto::UpdateAvatarWorker(void *) std::wstring FacebookProto::GetAvatarFolder()
{
wchar_t path[MAX_PATH];
- mir_snwprintf(path, L"%s\\%s", VARST(L"%miranda_avatarcache%"), m_tszUserName);
+ mir_snwprintf(path, L"%s\\%s", VARSW(L"%miranda_avatarcache%"), m_tszUserName);
return path;
}
diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp index eeb44b4c59..9720dc06b3 100644 --- a/protocols/FacebookRM/src/chat.cpp +++ b/protocols/FacebookRM/src/chat.cpp @@ -101,7 +101,7 @@ int FacebookProto::OnGCEvent(WPARAM, LPARAM lParam) if (!hContact) break; - CallService(MS_MSG_SENDMESSAGET, hContact); + CallService(MS_MSG_SENDMESSAGEW, hContact); break; } @@ -285,8 +285,8 @@ INT_PTR FacebookProto::OnJoinChat(WPARAM hContact, LPARAM) if (!m_enableChat || IsSpecialChatRoom(hContact)) return 0; - ptrW idT(getTStringA(hContact, "ChatRoomID")); - ptrW nameT(getTStringA(hContact, "Nick")); + ptrW idT(getWStringA(hContact, "ChatRoomID")); + ptrW nameT(getWStringA(hContact, "Nick")); ptrA threadId(getStringA(hContact, FACEBOOK_KEY_TID)); if (!idT || !nameT || !threadId) @@ -338,7 +338,7 @@ INT_PTR FacebookProto::OnJoinChat(WPARAM hContact, LPARAM) INT_PTR FacebookProto::OnLeaveChat(WPARAM wParam, LPARAM) { - ptrW idT(wParam ? getTStringA(wParam, "ChatRoomID") : NULL); + ptrW idT(wParam ? getWStringA(wParam, "ChatRoomID") : NULL); GCDEST gcd = { m_szModuleName, NULL, GC_EVENT_CONTROL }; gcd.ptszID = idT; diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index 63bdec6d32..7c16a70ead 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -727,13 +727,13 @@ void facebook_client::insert_reader(MCONTACT hContact, time_t timestamp, const s std::wstring treaders; // Load old readers - ptrW told(parent->getTStringA(hContact, FACEBOOK_KEY_MESSAGE_READERS)); + ptrW told(parent->getWStringA(hContact, FACEBOOK_KEY_MESSAGE_READERS)); if (told) treaders = std::wstring(told) + L", "; // Append new reader name and remember them treaders += utils::text::prepare_name(treaderName, true); - parent->setTString(hContact, FACEBOOK_KEY_MESSAGE_READERS, treaders.c_str()); + parent->setWString(hContact, FACEBOOK_KEY_MESSAGE_READERS, treaders.c_str()); } parent->setDword(hContact, FACEBOOK_KEY_MESSAGE_READ, timestamp); @@ -925,9 +925,9 @@ bool facebook_client::login(const char *username, const char *password) // 2) Approve last unknown login if (resp.data.find("name=\"submit[This was me]\"") != std::string::npos) { - CMString tszTitle; + CMStringW tszTitle; tszTitle.AppendFormat(L"%s - %s", parent->m_tszUserName, TranslateT("Check last login")); - CMString tszMessage(TranslateT("Do you recognize this activity?")); + CMStringW tszMessage(TranslateT("Do you recognize this activity?")); std::string activity = utils::text::slashu_to_utf8(utils::text::source_get_value(&resp.data, 3, "<body", "</strong></div>", "</div>")); activity = utils::text::trim(utils::text::html_entities_decode(utils::text::remove_html(activity))); @@ -1685,7 +1685,7 @@ bool facebook_client::save_url(const std::string &url, const std::wstring &filen // Create folder if necessary std::wstring dir = filename.substr(0, filename.rfind('\\')); if (_waccess(dir.c_str(), 0)) - CreateDirectoryTreeT(dir.c_str()); + CreateDirectoryTreeW(dir.c_str()); // Write to file FILE *f = _wfopen(filename.c_str(), L"wb"); diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index ad82b665be..8893287514 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -463,12 +463,12 @@ MCONTACT FacebookProto::AddToContactList(facebook_user* fbu, bool force_add, boo std::string homepage = FACEBOOK_URL_PROFILE + fbu->user_id; setString(hContact, "Homepage", homepage.c_str()); - setTString(hContact, "MirVer", fbu->getMirVer()); + setWString(hContact, "MirVer", fbu->getMirVer()); db_unset(hContact, "CList", "MyHandle"); if (m_tszDefaultGroup) - db_set_ts(hContact, "CList", "Group", m_tszDefaultGroup); + db_set_ws(hContact, "CList", "Group", m_tszDefaultGroup); setByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, fbu->type); diff --git a/protocols/FacebookRM/src/dialogs.cpp b/protocols/FacebookRM/src/dialogs.cpp index 8574cf9431..b28dfa3f7a 100644 --- a/protocols/FacebookRM/src/dialogs.cpp +++ b/protocols/FacebookRM/src/dialogs.cpp @@ -159,7 +159,7 @@ void GetSelectedContacts(FacebookProto *proto, MCONTACT hItem, HWND hwndList, st if (userId) fu->user_id = userId; - ptrW realName(proto->getTStringA(hItem, FACEBOOK_KEY_NICK)); + ptrW realName(proto->getWStringA(hItem, FACEBOOK_KEY_NICK)); if (realName) fu->real_name = _T2A(realName); @@ -201,7 +201,7 @@ INT_PTR CALLBACK FBMindProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara SendDlgItemMessage(hwnd, IDC_MINDMSG, EM_LIMITTEXT, FACEBOOK_MIND_LIMIT, 0); SendDlgItemMessage(hwnd, IDC_URL, EM_LIMITTEXT, 1024, 0); - ptrW place(data->proto->getTStringA(FACEBOOK_KEY_PLACE)); + ptrW place(data->proto->getWStringA(FACEBOOK_KEY_PLACE)); SetDlgItemText(hwnd, IDC_PLACE, place != NULL ? place : L"Miranda NG"); bShowContacts = data->proto->getByte("PostStatusExpand", 0) > 0; @@ -284,7 +284,7 @@ INT_PTR CALLBACK FBMindProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara int wall_id = SendDlgItemMessage(hwnd, IDC_WALL, CB_GETCURSEL, 0, 0); int privacy_id = SendDlgItemMessage(hwnd, IDC_PRIVACY, CB_GETCURSEL, 0, 0); - data->proto->setTString(FACEBOOK_KEY_PLACE, placeT); + data->proto->setWString(FACEBOOK_KEY_PLACE, placeT); data->proto->setByte("PostStatusExpand", bShowContacts); // remember last wall, only when there are more options @@ -406,7 +406,7 @@ INT_PTR CALLBACK FBOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp if (tstr[0] != '\0') { proto->m_tszDefaultGroup = mir_wstrdup(tstr); - proto->setTString(FACEBOOK_KEY_DEF_GROUP, tstr); + proto->setWString(FACEBOOK_KEY_DEF_GROUP, tstr); Clist_GroupCreate(0, tstr); } else { diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index cd17067e89..6d4e7471ef 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -775,9 +775,9 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector<faceboo client = FACEBOOK_CLIENT_OTHER; } - ptrW oldClient(proto->getTStringA(hContact, "MirVer")); + ptrW oldClient(proto->getWStringA(hContact, "MirVer")); if (!oldClient || mir_wstrcmp(oldClient, client)) - proto->setTString(hContact, "MirVer", client); + proto->setWString(hContact, "MirVer", client); } } } @@ -818,9 +818,9 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector<faceboo } */ - /* ptrW client(getTStringA(fbu->handle, "MirVer")); + /* ptrW client(getWStringA(fbu->handle, "MirVer")); if (!client || mir_wstrcmp(client, fbu->getMirVer())) - setTString(fbu->handle, "MirVer", fbu->getMirVer()); + setWString(fbu->handle, "MirVer", fbu->getMirVer()); */ const JSONNode &a_ = (*itNodes)["a"]; // possible values: 0, 2 (something more?) @@ -894,9 +894,9 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector<faceboo client = FACEBOOK_CLIENT_OTHER; }*/ - ptrW oldClient(proto->getTStringA(hContact, "MirVer")); + ptrW oldClient(proto->getWStringA(hContact, "MirVer")); if (!oldClient || mir_wstrcmp(oldClient, client)) - proto->setTString(hContact, "MirVer", client); + proto->setWString(hContact, "MirVer", client); } } } else if (t == "ticker_update:home") { diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index 3a3e00905c..cbc7848bc4 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -294,7 +294,7 @@ void FacebookProto::ProcessUnreadMessage(void *pParam) AddChat(room->thread_id.c_str(), room->chat_name.c_str()); hChatContact = ChatIDToHContact(room->thread_id); // Set thread id (TID) for later - setTString(hChatContact, FACEBOOK_KEY_TID, room->thread_id.c_str()); + setWString(hChatContact, FACEBOOK_KEY_TID, room->thread_id.c_str()); for (std::map<std::string, std::string>::iterator jt = room->participants.begin(); jt != room->participants.end(); ) { AddChatContact(room->thread_id.c_str(), jt->first.c_str(), jt->second.c_str()); @@ -414,7 +414,7 @@ void FacebookProto::LoadLastMessages(void *pParam) AddChat(room->thread_id.c_str(), room->chat_name.c_str()); hChatContact = ChatIDToHContact(room->thread_id); // Set thread id (TID) for later - setTString(hChatContact, FACEBOOK_KEY_TID, room->thread_id.c_str()); + setWString(hChatContact, FACEBOOK_KEY_TID, room->thread_id.c_str()); for (std::map<std::string, std::string>::iterator jt = room->participants.begin(); jt != room->participants.end();) { AddChatContact(room->thread_id.c_str(), jt->first.c_str(), jt->second.c_str()); @@ -805,7 +805,7 @@ void FacebookProto::ReceiveMessages(std::vector<facebook_message> &messages, boo if (!hChatContact) { // hopefully shouldn't happen, but who knows? - debugLog(L"!!! No hChatContact for %s", fbc->thread_id.c_str()); + debugLogW(L"!!! No hChatContact for %s", fbc->thread_id.c_str()); continue; } @@ -1245,7 +1245,7 @@ void FacebookProto::SearchAckThread(void *targ) PROTOSEARCHRESULT psr = { 0 }; psr.cbSize = sizeof(psr); - psr.flags = PSR_TCHAR; + psr.flags = PSR_UNICODE; psr.id.w = tid; psr.nick.w = tnick; psr.firstName.w = tname; @@ -1306,7 +1306,7 @@ void FacebookProto::SearchIdAckThread(void *targ) PROTOSEARCHRESULT psr = { 0 }; psr.cbSize = sizeof(psr); - psr.flags = PSR_TCHAR; + psr.flags = PSR_UNICODE; psr.id.w = tid; psr.firstName.w = tname; psr.lastName.w = tsurname; diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 667738556f..4af360a747 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. FacebookProto::FacebookProto(const char* proto_name, const wchar_t* username) : PROTO<FacebookProto>(proto_name, username), - m_tszDefaultGroup(getTStringA(FACEBOOK_KEY_DEF_GROUP)) + m_tszDefaultGroup(getWStringA(FACEBOOK_KEY_DEF_GROUP)) { facy.parent = this; @@ -48,7 +48,7 @@ FacebookProto::FacebookProto(const char* proto_name, const wchar_t* username) : m_locale = locale; // Load custom page prefix, if set - ptrW pagePrefix(getTStringA(FACEBOOK_KEY_PAGE_PREFIX)); + ptrW pagePrefix(getWStringA(FACEBOOK_KEY_PAGE_PREFIX)); m_pagePrefix = (pagePrefix != NULL) ? _T2A(pagePrefix, CP_UTF8) : TEXT_EMOJI_PAGE; if (m_tszDefaultGroup == NULL) @@ -84,7 +84,7 @@ FacebookProto::FacebookProto(const char* proto_name, const wchar_t* username) : // Create standard network connection wchar_t descr[512]; NETLIBUSER nlu = { sizeof(nlu) }; - nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR; + nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE; nlu.szSettingsModule = m_szModuleName; mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName); nlu.ptszDescriptiveName = descr; @@ -380,7 +380,7 @@ int FacebookProto::GetInfo(MCONTACT hContact, int) INT_PTR FacebookProto::GetMyAwayMsg(WPARAM, LPARAM lParam) { - ptrW statusMsg(getTStringA("StatusMsg")); + ptrW statusMsg(getWStringA("StatusMsg")); if (statusMsg == NULL || statusMsg[0] == '\0') return 0; @@ -501,7 +501,7 @@ int FacebookProto::OnOptionsInit(WPARAM wParam, LPARAM) odp.hInstance = g_hInstance; odp.pwszTitle = m_tszUserName; odp.dwInitParam = LPARAM(this); - odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE; + odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE; odp.position = 271828; odp.pwszGroup = LPGENW("Network"); @@ -564,7 +564,7 @@ INT_PTR FacebookProto::OnMind(WPARAM wParam, LPARAM) wall->title = wcsdup(TranslateT("Own wall")); } else - wall->title = getTStringA(hContact, FACEBOOK_KEY_NICK); + wall->title = getWStringA(hContact, FACEBOOK_KEY_NICK); post_status_data *data = new post_status_data(this, wall); @@ -782,9 +782,9 @@ INT_PTR FacebookProto::CancelFriendship(WPARAM wParam, LPARAM lParam) if (isChatRoom(hContact) || (deleting && getByte(hContact, FACEBOOK_KEY_CONTACT_TYPE) != CONTACT_FRIEND)) return 0; - ptrW tname(getTStringA(hContact, FACEBOOK_KEY_NICK)); + ptrW tname(getWStringA(hContact, FACEBOOK_KEY_NICK)); if (tname == NULL) - tname = getTStringA(hContact, FACEBOOK_KEY_ID); + tname = getWStringA(hContact, FACEBOOK_KEY_ID); if (tname == NULL) return 1; @@ -926,7 +926,7 @@ void FacebookProto::OpenUrl(std::string url) ptrW data(mir_utf8decodeW(url.c_str())); // Check if there is user defined browser for opening links - ptrW browser(getTStringA(FACEBOOK_KEY_OPEN_URL_BROWSER)); + ptrW browser(getWStringA(FACEBOOK_KEY_OPEN_URL_BROWSER)); if (browser != NULL) // If so, use it to open this link ForkThread(&FacebookProto::OpenUrlThread, new open_url(browser, data)); @@ -1011,7 +1011,7 @@ void FacebookProto::InitPopups() // Client mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Client errors")); mir_snprintf(name, "%s_%s", m_szModuleName, "Client"); - ppc.ptszDescription = desc; + ppc.pwszDescription = desc; ppc.pszName = name; ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("facebook")); ppc.colorBack = RGB(191, 0, 0); // red @@ -1022,7 +1022,7 @@ void FacebookProto::InitPopups() // Newsfeeds mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Wall posts")); mir_snprintf(name, "%s_%s", m_szModuleName, "Newsfeed"); - ppc.ptszDescription = desc; + ppc.pwszDescription = desc; ppc.pszName = name; ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("newsfeed")); ppc.colorBack = RGB(255, 255, 255); // white @@ -1033,7 +1033,7 @@ void FacebookProto::InitPopups() // Notifications mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Notifications")); mir_snprintf(name, "%s_%s", m_szModuleName, "Notification"); - ppc.ptszDescription = desc; + ppc.pwszDescription = desc; ppc.pszName = name; ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("notification")); ppc.colorBack = RGB(59, 89, 152); // Facebook's blue @@ -1044,7 +1044,7 @@ void FacebookProto::InitPopups() // Others mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Other events")); mir_snprintf(name, "%s_%s", m_szModuleName, "Other"); - ppc.ptszDescription = desc; + ppc.pwszDescription = desc; ppc.pszName = name; ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("facebook")); ppc.colorBack = RGB(255, 255, 255); // white @@ -1055,7 +1055,7 @@ void FacebookProto::InitPopups() // Friendship changes mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Friendship events")); mir_snprintf(name, "%s_%s", m_szModuleName, "Friendship"); - ppc.ptszDescription = desc; + ppc.pwszDescription = desc; ppc.pszName = name; ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("friendship")); ppc.colorBack = RGB(47, 71, 122); // Facebook's darker blue @@ -1066,7 +1066,7 @@ void FacebookProto::InitPopups() // Ticker mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Real-time friends activity")); mir_snprintf(name, "%s_%s", m_szModuleName, "Ticker"); - ppc.ptszDescription = desc; + ppc.pwszDescription = desc; ppc.pszName = name; ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("newsfeed")); ppc.colorBack = RGB(255, 255, 255); // white @@ -1077,7 +1077,7 @@ void FacebookProto::InitPopups() // On this day (memories) mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Memories")); mir_snprintf(name, "%s_%s", m_szModuleName, "Memories"); - ppc.ptszDescription = desc; + ppc.pwszDescription = desc; ppc.pszName = name; ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("memories")); ppc.colorBack = RGB(255, 255, 255); // white @@ -1098,19 +1098,19 @@ void FacebookProto::InitHotkeys() HOTKEYDESC hkd = { sizeof(hkd) }; hkd.pszName = text; hkd.pszService = text; - hkd.ptszSection = m_tszUserName; - hkd.dwFlags = HKD_TCHAR; + hkd.pwszSection = m_tszUserName; + hkd.dwFlags = HKD_UNICODE; mir_strcpy(tDest, "/VisitProfile"); - hkd.ptszDescription = LPGENW("Visit profile"); + hkd.pwszDescription = LPGENW("Visit profile"); Hotkey_Register(&hkd); mir_strcpy(tDest, "/VisitNotifications"); - hkd.ptszDescription = LPGENW("Visit notifications"); + hkd.pwszDescription = LPGENW("Visit notifications"); Hotkey_Register(&hkd); mir_strcpy(tDest, "/Mind"); - hkd.ptszDescription = LPGENW("Show 'Share status' window"); + hkd.pwszDescription = LPGENW("Show 'Share status' window"); hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT | HOTKEYF_EXT, 'F'); Hotkey_Register(&hkd); } @@ -1120,12 +1120,12 @@ void FacebookProto::InitHotkeys() */ void FacebookProto::InitSounds() { - SkinAddNewSoundExT("Notification", m_tszUserName, LPGENW("Notification")); - SkinAddNewSoundExT("NewsFeed", m_tszUserName, LPGENW("Newsfeed event")); - SkinAddNewSoundExT("OtherEvent", m_tszUserName, LPGENW("Other event")); - SkinAddNewSoundExT("Friendship", m_tszUserName, LPGENW("Friendship event")); - SkinAddNewSoundExT("Ticker", m_tszUserName, LPGENW("Ticker event")); - SkinAddNewSoundExT("Memories", m_tszUserName, LPGENW("Memories")); + SkinAddNewSoundExW("Notification", m_tszUserName, LPGENW("Notification")); + SkinAddNewSoundExW("NewsFeed", m_tszUserName, LPGENW("Newsfeed event")); + SkinAddNewSoundExW("OtherEvent", m_tszUserName, LPGENW("Other event")); + SkinAddNewSoundExW("Friendship", m_tszUserName, LPGENW("Friendship event")); + SkinAddNewSoundExW("Ticker", m_tszUserName, LPGENW("Ticker event")); + SkinAddNewSoundExW("Memories", m_tszUserName, LPGENW("Memories")); } /** @@ -1151,7 +1151,7 @@ void FacebookProto::MessageRead(MCONTACT hContact) if (isChatRoom(hContact)) { // Load readers names - ptrW treaders(getTStringA(hContact, FACEBOOK_KEY_MESSAGE_READERS)); + ptrW treaders(getWStringA(hContact, FACEBOOK_KEY_MESSAGE_READERS)); mir_snwprintf(st.tszText, TranslateT("Message read: %s by %s"), ttime, treaders ? treaders : L"???"); CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st); } else if (!ServiceExists(MS_MESSAGESTATE_UPDATE)){ diff --git a/protocols/GTalkExt/src/avatar.cpp b/protocols/GTalkExt/src/avatar.cpp index 9c87926832..84de3a28d8 100644 --- a/protocols/GTalkExt/src/avatar.cpp +++ b/protocols/GTalkExt/src/avatar.cpp @@ -33,7 +33,7 @@ LPTSTR CreateAvaFile(HANDLE *hFile)
{
wchar_t name[MAX_PATH + 2];
- if (CallService(MS_DB_GETPROFILENAMET, (WPARAM)_countof(name), (LPARAM)&name))
+ if (CallService(MS_DB_GETPROFILENAMEW, (WPARAM)_countof(name), (LPARAM)&name))
return NULL;
wchar_t *p = wcsrchr(name, '.');
@@ -41,12 +41,12 @@ LPTSTR CreateAvaFile(HANDLE *hFile) *p = 0;
wchar_t path[MAX_PATH + 2];
- if (CallService(MS_DB_GETPROFILEPATHT, (WPARAM)_countof(path), (LPARAM)&path))
+ if (CallService(MS_DB_GETPROFILEPATHW, (WPARAM)_countof(path), (LPARAM)&path))
return NULL;
wchar_t full[MAX_PATH + 2];
mir_snwprintf(full, AVA_FILE_NAME_FORMAT, path, name);
- CreateDirectoryTreeT(full);
+ CreateDirectoryTreeW(full);
HANDLE h = CreateFile(full, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
if (h == INVALID_HANDLE_VALUE)
@@ -156,5 +156,5 @@ void SetAvatar(MCONTACT hContact) if (ava)
CallService(MS_AV_SETAVATART, hContact, (LPARAM)L"");
CallService(MS_AV_SETAVATART, hContact, (LPARAM)avaFile);
- db_set_ts(hContact, SRMM_MODULE_NAME, SRMM_AVATAR_SETTING_NAME, avaFile);
+ db_set_ws(hContact, SRMM_MODULE_NAME, SRMM_AVATAR_SETTING_NAME, avaFile);
}
diff --git a/protocols/GTalkExt/src/db.cpp b/protocols/GTalkExt/src/db.cpp index 691e065bc3..1d18ed6121 100644 --- a/protocols/GTalkExt/src/db.cpp +++ b/protocols/GTalkExt/src/db.cpp @@ -24,10 +24,10 @@ LPTSTR ReadJidSetting(LPCSTR name, LPCTSTR jid)
{
- return db_get_tsa(0, name, _T2A(jid));
+ return db_get_wsa(0, name, _T2A(jid));
}
void WriteJidSetting(LPCSTR name, LPCTSTR jid, LPCTSTR setting)
{
- db_set_ts(0, name, _T2A(jid), setting);
+ db_set_ws(0, name, _T2A(jid), setting);
}
diff --git a/protocols/GTalkExt/src/inbox.cpp b/protocols/GTalkExt/src/inbox.cpp index 2e73250e7d..f5433032a0 100644 --- a/protocols/GTalkExt/src/inbox.cpp +++ b/protocols/GTalkExt/src/inbox.cpp @@ -196,7 +196,7 @@ void OpenUrl(LPCSTR acc, LPCTSTR mailbox, LPCTSTR url) void OpenContactInbox(LPCSTR szModuleName)
{
- ptrW tszJid(db_get_tsa(0, szModuleName, "jid"));
+ ptrW tszJid(db_get_wsa(0, szModuleName, "jid"));
if (tszJid == NULL)
return;
diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp index e2243609ca..e80e573742 100644 --- a/protocols/GTalkExt/src/notifications.cpp +++ b/protocols/GTalkExt/src/notifications.cpp @@ -54,7 +54,7 @@ LPCSTR GetJidAcc(LPCTSTR jid) Proto_EnumAccounts(&count, &protos);
for (int i = 0; i < count; i++) {
if (getJabberApi(protos[i]->szModuleName)) {
- ptrW tszJid(db_get_tsa(0, protos[i]->szModuleName, "jid"));
+ ptrW tszJid(db_get_wsa(0, protos[i]->szModuleName, "jid"));
if (!mir_wstrcmpi(jid, tszJid))
return protos[i]->szModuleName;
}
@@ -179,12 +179,12 @@ MCONTACT SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTST if (displayName == NULL) {
wchar_t *tszTemp = (wchar_t*)alloca((mir_wstrlen(jid) + mir_wstrlen(unreadCount) + 3 + 1) * sizeof(wchar_t));
FormatPseudocontactDisplayName(tszTemp, jid, unreadCount);
- db_set_ts(hContact, CLIST_MODULE_NAME, CONTACT_DISPLAY_NAME_SETTING, tszTemp);
+ db_set_ws(hContact, CLIST_MODULE_NAME, CONTACT_DISPLAY_NAME_SETTING, tszTemp);
}
- else db_set_ts(hContact, CLIST_MODULE_NAME, CONTACT_DISPLAY_NAME_SETTING, displayName);
+ else db_set_ws(hContact, CLIST_MODULE_NAME, CONTACT_DISPLAY_NAME_SETTING, displayName);
- db_set_ts(hContact, CLIST_MODULE_NAME, STATUS_MSG_SETTING, TranslateTS(MAIL_NOTIFICATIONS));
- db_set_ts(hContact, SHORT_PLUGIN_NAME, UNREAD_THREADS_SETTING, unreadCount);
+ db_set_ws(hContact, CLIST_MODULE_NAME, STATUS_MSG_SETTING, TranslateW(MAIL_NOTIFICATIONS));
+ db_set_ws(hContact, SHORT_PLUGIN_NAME, UNREAD_THREADS_SETTING, unreadCount);
return hContact;
}
@@ -263,7 +263,7 @@ void UnreadThreadNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unre POPUPDATAT data = { 0 };
FormatPseudocontactDisplayName(&data.lptzContactName[0], jid, unreadCount);
- CMString tszSenders;
+ CMStringW tszSenders;
for (int i = 0; i < SENDER_COUNT; i++) {
const SENDER &p = mtn->senders[i];
if (p.addr == NULL)
@@ -276,9 +276,9 @@ void UnreadThreadNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unre }
if (ReadCheckbox(0, IDC_ADDSNIP, (UINT_PTR)TlsGetValue(itlsSettings)))
- mir_snwprintf(data.lptzText, TranslateTS(FULL_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str(), mtn->snip);
+ mir_snwprintf(data.lptzText, TranslateW(FULL_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str(), mtn->snip);
else
- mir_snwprintf(data.lptzText, TranslateTS(SHORT_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str());
+ mir_snwprintf(data.lptzText, TranslateW(SHORT_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str());
ShowNotification(acc, &data, jid, url, unreadCount);
}
diff --git a/protocols/GTalkExt/src/options.cpp b/protocols/GTalkExt/src/options.cpp index 9183d773e4..378f83404c 100644 --- a/protocols/GTalkExt/src/options.cpp +++ b/protocols/GTalkExt/src/options.cpp @@ -155,8 +155,8 @@ INT_PTR CALLBACK AccOptionsDlgProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lPa void ShowTestPopup(HWND wnd)
{
POPUPDATAT data = { 0 };
- mir_snwprintf(data.lptzContactName, TranslateTS(TEST_LETTER_INBOX));
- mir_snwprintf(data.lptzText, TranslateTS(FULL_NOTIFICATION_FORMAT), TranslateTS(TEST_LETTER_SUBJECT), TranslateTS(TEST_LETTER_SENDER), TranslateTS(TEST_LETTER_SNIP));
+ mir_snwprintf(data.lptzContactName, TranslateW(TEST_LETTER_INBOX));
+ mir_snwprintf(data.lptzText, TranslateW(FULL_NOTIFICATION_FORMAT), TranslateW(TEST_LETTER_SUBJECT), TranslateW(TEST_LETTER_SENDER), TranslateW(TEST_LETTER_SNIP));
int len = SendDlgItemMessage(wnd, IDC_TIMEOUTEDIT, WM_GETTEXTLENGTH, 0, 0) + 1;
LPTSTR timeout = (LPTSTR)_alloca(len * sizeof(wchar_t));
diff --git a/protocols/GTalkExt/src/tipper_items.cpp b/protocols/GTalkExt/src/tipper_items.cpp index 929078c2f7..5f7baa7f27 100644 --- a/protocols/GTalkExt/src/tipper_items.cpp +++ b/protocols/GTalkExt/src/tipper_items.cpp @@ -74,18 +74,18 @@ void SetLabelProp(int index, LPSTR setting) {
sprintf(setting, LABEL_SETTING_PROP, index); //!!!!!!!!!!!!!!
- ptrW tszProp(db_get_tsa(0, TIPPER_ITEMS_MOD_NAME, setting));
+ ptrW tszProp(db_get_wsa(0, TIPPER_ITEMS_MOD_NAME, setting));
if (tszProp == NULL)
return;
- ptrW tszLastWritten(db_get_tsa(0, SHORT_PLUGIN_NAME, LAST_WRITTEN_LABEL_SETTING));
+ ptrW tszLastWritten(db_get_wsa(0, SHORT_PLUGIN_NAME, LAST_WRITTEN_LABEL_SETTING));
if (tszLastWritten == NULL)
return;
if (!mir_wstrcmp(tszProp, tszLastWritten)) {
- LPTSTR label = TranslateTS(UNREAD_THREADS_LABEL);
- db_set_ts(0, SHORT_PLUGIN_NAME, LAST_WRITTEN_LABEL_SETTING, label);
- db_set_ts(0, TIPPER_ITEMS_MOD_NAME, setting, label);
+ LPTSTR label = TranslateW(UNREAD_THREADS_LABEL);
+ db_set_ws(0, SHORT_PLUGIN_NAME, LAST_WRITTEN_LABEL_SETTING, label);
+ db_set_ws(0, TIPPER_ITEMS_MOD_NAME, setting, label);
}
}
@@ -103,7 +103,7 @@ void AddTipperItem() for (i = 0; i < itemCount; i++) {
mir_snprintf(setting, l, VALUE_SETTING_PROP, i);
- ptrW tszSetting(db_get_tsa(0, TIPPER_ITEMS_MOD_NAME, setting));
+ ptrW tszSetting(db_get_wsa(0, TIPPER_ITEMS_MOD_NAME, setting));
if (tszSetting) {
if (!mir_wstrcmp(UNREAD_THREADS_RAW, tszSetting)) {
SetLabelProp(i, setting);
@@ -117,14 +117,14 @@ void AddTipperItem() #define WRITE_TIPPER_PROPS(index, value)\
mir_snprintf(setting, l, TipperItemProps[##index##], 0);\
- db_set_ts(0, TIPPER_ITEMS_MOD_NAME, setting, ##value##)
+ db_set_ws(0, TIPPER_ITEMS_MOD_NAME, setting, ##value##)
#define WRITE_TIPPER_PROPB(index, value)\
mir_snprintf(setting, l, TipperItemProps[##index##], 0);\
db_set_b(0, TIPPER_ITEMS_MOD_NAME, setting, ##value##)
- LPTSTR label = TranslateTS(UNREAD_THREADS_LABEL);
+ LPTSTR label = TranslateW(UNREAD_THREADS_LABEL);
- db_set_ts(0, SHORT_PLUGIN_NAME, LAST_WRITTEN_LABEL_SETTING, label);
+ db_set_ws(0, SHORT_PLUGIN_NAME, LAST_WRITTEN_LABEL_SETTING, label);
WRITE_TIPPER_PROPS(0, label);
WRITE_TIPPER_PROPB(1, 0);
diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp index 764cc426ef..9587cd11b0 100644 --- a/protocols/Gadu-Gadu/src/avatar.cpp +++ b/protocols/Gadu-Gadu/src/avatar.cpp @@ -28,14 +28,14 @@ //
void GGPROTO::getAvatarFilename(MCONTACT hContact, wchar_t *pszDest, int cbLen)
{
- int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARST( L"%miranda_avatarcache%"), m_szModuleName);
+ int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARSW( L"%miranda_avatarcache%"), m_szModuleName);
if (_waccess(pszDest, 0)) {
- int ret = CreateDirectoryTreeT(pszDest);
+ int ret = CreateDirectoryTreeW(pszDest);
if (ret == 0)
- debugLog(L"getAvatarFilename(): Created new directory for avatar cache: %s.", pszDest);
+ debugLogW(L"getAvatarFilename(): Created new directory for avatar cache: %s.", pszDest);
else {
- debugLog(L"getAvatarFilename(): Can not create directory for avatar cache: %s. errno=%d: %s", pszDest, errno, ws_strerror(errno));
+ debugLogW(L"getAvatarFilename(): Can not create directory for avatar cache: %s. errno=%d: %s", pszDest, errno, ws_strerror(errno));
wchar_t error[512];
mir_snwprintf(error, TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, ws_strerror(errno), pszDest);
showpopup(m_tszUserName, error, GG_POPUP_ERROR | GG_POPUP_ALLOW_MSGBOX | GG_POPUP_ONCE);
@@ -267,9 +267,9 @@ void __cdecl GGPROTO::avatarrequestthread(void*) _write(file_fd, resp->pData, resp->dataLength);
_close(file_fd);
result = 1;
- debugLog(L"avatarrequestthread() new avatar_transfers item. Saved data to file=%s.", ai.filename);
+ debugLogW(L"avatarrequestthread() new avatar_transfers item. Saved data to file=%s.", ai.filename);
} else {
- debugLog(L"avatarrequestthread(): _wopen file %s error. errno=%d: %s", ai.filename, errno, ws_strerror(errno));
+ debugLogW(L"avatarrequestthread(): _wopen file %s error. errno=%d: %s", ai.filename, errno, ws_strerror(errno));
wchar_t error[512];
mir_snwprintf(error, TranslateT("Cannot create avatar file. ERROR: %d: %s\n%s"), errno, ws_strerror(errno), ai.filename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
@@ -361,7 +361,7 @@ void __cdecl GGPROTO::setavatarthread(void *param) wchar_t *szFilename = (wchar_t*)param;
int file_fd = _wopen(szFilename, _O_RDONLY | _O_BINARY, _S_IREAD);
if (file_fd == -1) {
- debugLog(L"setavatarthread(): Failed to open avatar file errno=%d: %s", errno, ws_strerror(errno));
+ debugLogW(L"setavatarthread(): Failed to open avatar file errno=%d: %s", errno, ws_strerror(errno));
wchar_t error[512];
mir_snwprintf(error, TranslateT("Cannot open avatar file. ERROR: %d: %s\n%s"), errno, ws_strerror(errno), szFilename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index dec48051e4..8440ab94ab 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -69,7 +69,7 @@ void GGPROTO::disconnect() gg_EnterCriticalSection(&modemsg_mutex, "disconnect", 6, "modemsg_mutex", 1);
szMsg = mir_utf8encodeW(modemsg.online);
gg_LeaveCriticalSection(&modemsg_mutex, "disconnect", 6, 1, "modemsg_mutex", 1);
- if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_ONLINE, "Default"), &dbv, DBVT_TCHAR)) {
+ if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_ONLINE, "Default"), &dbv, DBVT_WCHAR)) {
if (dbv.ptszVal && *(dbv.ptszVal))
szMsg = mir_utf8encodeW(dbv.ptszVal);
db_free(&dbv);
@@ -79,7 +79,7 @@ void GGPROTO::disconnect() gg_EnterCriticalSection(&modemsg_mutex, "disconnect", 7, "modemsg_mutex", 1);
szMsg = mir_utf8encodeW(modemsg.away);
gg_LeaveCriticalSection(&modemsg_mutex, "disconnect", 7, 1, "modemsg_mutex", 1);
- if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_AWAY, "Default"), &dbv, DBVT_TCHAR)) {
+ if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_AWAY, "Default"), &dbv, DBVT_WCHAR)) {
if (dbv.ptszVal && *(dbv.ptszVal))
szMsg = mir_utf8encodeW(dbv.ptszVal);
db_free(&dbv);
@@ -89,7 +89,7 @@ void GGPROTO::disconnect() gg_EnterCriticalSection(&modemsg_mutex, "disconnect", 8, "modemsg_mutex", 1);
szMsg = mir_utf8encodeW(modemsg.dnd);
gg_LeaveCriticalSection(&modemsg_mutex, "disconnect", 8, 1, "modemsg_mutex", 1);
- if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_DND, "Default"), &dbv, DBVT_TCHAR)) {
+ if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_DND, "Default"), &dbv, DBVT_WCHAR)) {
if (dbv.ptszVal && *(dbv.ptszVal))
szMsg = mir_utf8encodeW(dbv.ptszVal);
db_free(&dbv);
@@ -99,7 +99,7 @@ void GGPROTO::disconnect() gg_EnterCriticalSection(&modemsg_mutex, "disconnect", 9, "modemsg_mutex", 1);
szMsg = mir_utf8encodeW(modemsg.freechat);
gg_LeaveCriticalSection(&modemsg_mutex, "disconnect", 9, 1, "modemsg_mutex", 1);
- if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_FREECHAT, "Default"), &dbv, DBVT_TCHAR)) {
+ if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_FREECHAT, "Default"), &dbv, DBVT_WCHAR)) {
if (dbv.ptszVal && *(dbv.ptszVal))
szMsg = mir_utf8encodeW(dbv.ptszVal);
db_free(&dbv);
@@ -109,7 +109,7 @@ void GGPROTO::disconnect() gg_EnterCriticalSection(&modemsg_mutex, "disconnect", 10, "modemsg_mutex", 1);
szMsg = mir_utf8encodeW(modemsg.invisible);
gg_LeaveCriticalSection(&modemsg_mutex, "disconnect", 10, 1, "modemsg_mutex", 1);
- if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_INVISIBLE, "Default"), &dbv, DBVT_TCHAR)) {
+ if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_INVISIBLE, "Default"), &dbv, DBVT_WCHAR)) {
if (dbv.ptszVal && *(dbv.ptszVal))
szMsg = mir_utf8encodeW(dbv.ptszVal);
db_free(&dbv);
@@ -381,7 +381,7 @@ retry: p.status_descr = mir_utf8encodeW(getstatusmsg(m_iDesiredStatus));
p.status = status_m2gg(m_iDesiredStatus, p.status_descr != NULL);
- debugLog(L"mainthread() (%x): Connecting with number %d, status %d and description \"%s\".", this, p.uin, m_iDesiredStatus,
+ debugLogW(L"mainthread() (%x): Connecting with number %d, status %d and description \"%s\".", this, p.uin, m_iDesiredStatus,
p.status_descr ? getstatusmsg(m_iDesiredStatus) : L"<none>");
gg_LeaveCriticalSection(&modemsg_mutex, "mainthread", 13, 1, "modemsg_mutex", 1);
@@ -418,7 +418,7 @@ retry: // Lookup for error desciption
if (errno == EACCES) {
for (int i = 0; reason[i].type; i++) if (reason[i].type == gg_failno) {
- perror = TranslateTS(reason[i].str);
+ perror = TranslateW(reason[i].str);
break;
}
}
@@ -426,7 +426,7 @@ retry: mir_snwprintf(error, TranslateT("Connection cannot be established. errno=%d: %s"), errno, ws_strerror(errno));
perror = error;
}
- debugLog(L"mainthread() (%x): %s", this, perror);
+ debugLogW(L"mainthread() (%x): %s", this, perror);
if (getByte(GG_KEY_SHOWCERRORS, GG_KEYDEF_SHOWCERRORS))
showpopup(m_tszUserName, perror, GG_POPUP_ERROR | GG_POPUP_ALLOW_MSGBOX | GG_POPUP_ONCE);
@@ -548,7 +548,7 @@ retry: if (e->event.ack.seq && e->event.ack.recipient)
{
ProtoBroadcastAck(getcontact((DWORD)e->event.ack.recipient, 0, 0, NULL),
- ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE) e->event.ack.seq, 0);
+ ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)e->event.ack.seq, 0);
}
break;
@@ -654,7 +654,7 @@ retry: GGSEARCHRESULT psr;
memset(&psr, 0, sizeof(psr));
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.nick.w = __nickname;
psr.firstName.w = __firstname;
psr.lastName.w = __lastname;
@@ -669,36 +669,36 @@ retry: {
// Change nickname if it's not present
if (__nickname && (res->seq == GG_SEQ_GETNICK || res->seq == GG_SEQ_CHINFO))
- setTString(hContact, GG_KEY_NICK, __nickname);
+ setWString(hContact, GG_KEY_NICK, __nickname);
if (__nickname)
- setTString(hContact, GG_KEY_PD_NICKNAME, __nickname);
+ setWString(hContact, GG_KEY_PD_NICKNAME, __nickname);
else if (res->seq == GG_SEQ_CHINFO)
delSetting(GG_KEY_PD_NICKNAME);
// Change other info
if (__city)
- setTString(hContact, GG_KEY_PD_CITY, __city);
+ setWString(hContact, GG_KEY_PD_CITY, __city);
else if (res->seq == GG_SEQ_CHINFO)
delSetting(GG_KEY_PD_CITY);
if (__firstname)
- setTString(hContact, GG_KEY_PD_FIRSTNAME, __firstname);
+ setWString(hContact, GG_KEY_PD_FIRSTNAME, __firstname);
else if (res->seq == GG_SEQ_CHINFO)
delSetting(GG_KEY_PD_FIRSTNAME);
if (__lastname)
- setTString(hContact, GG_KEY_PD_LASTNAME, __lastname);
+ setWString(hContact, GG_KEY_PD_LASTNAME, __lastname);
else if (res->seq == GG_SEQ_CHINFO)
delSetting(GG_KEY_PD_LASTNAME);
if (__familyname)
- setTString(hContact, GG_KEY_PD_FAMILYNAME, __familyname);
+ setWString(hContact, GG_KEY_PD_FAMILYNAME, __familyname);
else if (res->seq == GG_SEQ_CHINFO)
delSetting(GG_KEY_PD_FAMILYNAME);
if (__familycity)
- setTString(hContact, GG_KEY_PD_FAMILYCITY, __familycity);
+ setWString(hContact, GG_KEY_PD_FAMILYCITY, __familycity);
else if (res->seq == GG_SEQ_CHINFO)
delSetting(GG_KEY_PD_FAMILYCITY);
@@ -837,7 +837,7 @@ retry: gce.ptszNick = (wchar_t*) pcli->pfnGetContactDisplayName( getcontact(e->event.msg.sender, 1, 0, NULL), 0);
gce.time = (!(e->event.msg.msgclass & GG_CLASS_OFFLINE) || e->event.msg.time > (t - timeDeviation)) ? t : e->event.msg.time;
gce.dwFlags = GCEF_ADDTOLOG;
- debugLog(L"mainthread() (%x): Conference message to room %s & id %s.", this, chat, id);
+ debugLogW(L"mainthread() (%x): Conference message to room %s & id %s.", this, chat, id);
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
mir_free(messageT);
}
@@ -898,7 +898,7 @@ retry: wchar_t* messageT = mir_utf8decodeW(e->event.multilogon_msg.message);
gce.ptszText = messageT;
wchar_t* nickT;
- if (!getTString(GG_KEY_NICK, &dbv)){
+ if (!getWString(GG_KEY_NICK, &dbv)){
nickT = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -907,7 +907,7 @@ retry: gce.time = e->event.multilogon_msg.time;
gce.bIsMe = 1;
gce.dwFlags = GCEF_ADDTOLOG;
- debugLog(L"mainthread() (%x): Sent conference message to room %s.", this, chat);
+ debugLogW(L"mainthread() (%x): Sent conference message to room %s.", this, chat);
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
mir_free(messageT);
mir_free(nickT);
@@ -1055,7 +1055,7 @@ retry: wchar_t* filenameT = mir_a2u((char*)dcc7->filename);
PROTORECVFILET pre = {0};
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(NULL);
pre.descr.w = filenameT;
@@ -1273,7 +1273,7 @@ int GGPROTO::contactdeleted(WPARAM hContact, LPARAM) // Terminate conference if contact is deleted
DBVARIANT dbv;
- if ( isChatRoom(hContact) && !getTString(hContact, "ChatRoomID", &dbv) && gc_enabled)
+ if ( isChatRoom(hContact) && !getWString(hContact, "ChatRoomID", &dbv) && gc_enabled)
{
GCDEST gcd = { m_szModuleName, dbv.ptszVal, GC_EVENT_CONTROL };
GCEVENT gce = { sizeof(gce), &gcd };
@@ -1347,7 +1347,7 @@ int GGPROTO::dbsettingchanged(WPARAM hContact, LPARAM lParam) // Groupchat window contact is being renamed
DBVARIANT dbv;
- if (isChatRoom(hContact) && !getTString(hContact, "ChatRoomID", &dbv))
+ if (isChatRoom(hContact) && !getWString(hContact, "ChatRoomID", &dbv))
{
// Most important... check redundancy (fucking cascading)
static int cascade = 0;
@@ -1377,7 +1377,7 @@ int GGPROTO::dbsettingchanged(WPARAM hContact, LPARAM lParam) if (!strcmp(cws->szSetting, "MyHandle")){
wchar_t* ptszVal = sttSettingToTchar(&(cws->value));
if(ptszVal==NULL) return 0;
- setTString(hContact, GG_KEY_NICK, ptszVal);
+ setWString(hContact, GG_KEY_NICK, ptszVal);
mir_free(ptszVal);
}
@@ -1538,7 +1538,7 @@ MCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, wchar_t *szNick) MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (!hContact) {
- debugLog(L"getcontact(): Failed to create Gadu-Gadu contact %s", szNick);
+ debugLogW(L"getcontact(): Failed to create Gadu-Gadu contact %s", szNick);
return NULL;
}
@@ -1558,7 +1558,7 @@ MCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, wchar_t *szNick) // If nick specified use it
if (szNick)
- setTString(hContact, GG_KEY_NICK, szNick);
+ setWString(hContact, GG_KEY_NICK, szNick);
else if (isonline()) {
// Search for that nick
gg_pubdir50_t req = gg_pubdir50_new(GG_PUBDIR50_SEARCH);
@@ -1571,7 +1571,7 @@ MCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, wchar_t *szNick) gg_LeaveCriticalSection(&sess_mutex, "getcontact", 31, 1, "sess_mutex", 1);
gg_pubdir50_free(req);
wchar_t* uinT = mir_a2u(ditoa(uin));
- setTString(hContact, GG_KEY_NICK, uinT);
+ setWString(hContact, GG_KEY_NICK, uinT);
mir_free(uinT);
debugLogA("getcontact(): Search for nick on uin: %d", uin);
}
@@ -1701,8 +1701,8 @@ void GGPROTO::changecontactstatus(uin_t uin, int status, const wchar_t *idescr, // Check if there's description and if it's not empty
if (idescr && *idescr)
{
- debugLog(L"changecontactstatus(): Saving for %d status descr \"%s\".", uin, idescr);
- db_set_ts(hContact, "CList", GG_KEY_STATUSDESCR, idescr);
+ debugLogW(L"changecontactstatus(): Saving for %d status descr \"%s\".", uin, idescr);
+ db_set_ws(hContact, "CList", GG_KEY_STATUSDESCR, idescr);
} else {
// Remove status if there's nothing
db_unset(hContact, "CList", GG_KEY_STATUSDESCR);
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp index 1aceff00a9..a662970ddf 100644 --- a/protocols/Gadu-Gadu/src/dialogs.cpp +++ b/protocols/Gadu-Gadu/src/dialogs.cpp @@ -112,7 +112,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule ptstr = str; mir_snwprintf(str, L"%S", dbv.pszVal); break; - case DBVT_TCHAR: + case DBVT_WCHAR: unspecified = (special == SVS_ZEROISUNSPEC && dbv.ptszVal[0] == '\0'); ptstr = dbv.ptszVal; break; @@ -870,13 +870,13 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, int GGPROTO::options_init(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { 0 }; - odp.flags = ODPF_TCHAR; + odp.flags = ODPF_UNICODE; odp.position = 1003000; odp.hInstance = hInstance; odp.pwszGroup = LPGENW("Network"); odp.pwszTitle = m_tszUserName; odp.dwInitParam = (LPARAM)this; - odp.flags = ODPF_TCHAR | ODPF_BOLDGROUPS | ODPF_DONTTRANSLATE; + odp.flags = ODPF_UNICODE | ODPF_BOLDGROUPS | ODPF_DONTTRANSLATE; odp.pwszTab = LPGENW("General"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GG_GENERAL); @@ -918,7 +918,7 @@ int GGPROTO::details_init(WPARAM wParam, LPARAM lParam) } OPTIONSDIALOGPAGE odp = { 0 }; - odp.flags = ODPF_DONTTRANSLATE | ODPF_TCHAR; + odp.flags = ODPF_DONTTRANSLATE | ODPF_UNICODE; odp.hInstance = hInstance; odp.pfnDlgProc = gg_detailsdlgproc; odp.position = -1900000000; diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp index 38909300a0..682e3656d0 100644 --- a/protocols/Gadu-Gadu/src/filetransfer.cpp +++ b/protocols/Gadu-Gadu/src/filetransfer.cpp @@ -384,7 +384,7 @@ void __cdecl GGPROTO::dccmainthread(void*) wchar_t* filenameT = mir_utf8decodeW((char*)dcc->file_info.filename);
PROTORECVFILET pre = {0};
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(NULL);
pre.descr.w = filenameT;
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index 18e264e031..88b3c060f5 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -174,9 +174,9 @@ void GGPROTO::cleanuplastplugin(DWORD version) debugLogA("cleanuplastplugin() 1: version=%d Cleaning junk avatar files from < 0.11.0.2", version);
wchar_t avatarsPath[MAX_PATH];
- mir_snwprintf(avatarsPath, L"%s\\%s", VARST( L"%miranda_avatarcache%"), m_tszUserName);
+ mir_snwprintf(avatarsPath, L"%s\\%s", VARSW( L"%miranda_avatarcache%"), m_tszUserName);
- debugLog(L"cleanuplastplugin() 1: miranda_avatarcache = %s", avatarsPath);
+ debugLogW(L"cleanuplastplugin() 1: miranda_avatarcache = %s", avatarsPath);
wchar_t spec[MAX_PATH + 10];
mir_snwprintf(spec, L"%s\\*.(null)", avatarsPath);
@@ -187,7 +187,7 @@ void GGPROTO::cleanuplastplugin(DWORD version) wchar_t filePathT [2*MAX_PATH + 10];
mir_snwprintf(filePathT, L"%s\\%s", avatarsPath, ffd.cFileName);
if (!_waccess(filePathT, 0)){
- debugLog(L"cleanuplastplugin() 1: remove file = %s", filePathT);
+ debugLogW(L"cleanuplastplugin() 1: remove file = %s", filePathT);
_wremove(filePathT);
}
} while (FindNextFile(hFind, &ffd) != 0);
@@ -287,7 +287,7 @@ void GGPROTO::menus_init() CMenuItem mi;
mi.root = hRoot;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.name.w = LPGENW("Conference");
mi.position = 200001;
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index be0a8943fe..1001112208 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -44,7 +44,7 @@ GGPROTO::GGPROTO(const char *pszProtoName, const wchar_t *tszUserName) : NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_TCHAR | NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS;
+ nlu.flags = NUF_UNICODE | NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS;
nlu.szSettingsModule = m_szModuleName;
nlu.ptszDescriptiveName = name;
@@ -68,7 +68,7 @@ GGPROTO::GGPROTO(const char *pszProtoName, const wchar_t *tszUserName) : db_set_resident(m_szModuleName, GG_KEY_AVATARREQUESTED);
wchar_t szPath[MAX_PATH];
- mir_snwprintf(szPath, L"%s\\%s\\ImageCache", (wchar_t*)VARST(L"%miranda_userdata%"), m_tszUserName);
+ mir_snwprintf(szPath, L"%s\\%s\\ImageCache", (wchar_t*)VARSW(L"%miranda_userdata%"), m_tszUserName);
hImagesFolder = FoldersRegisterCustomPathT(LPGEN("Images"), m_szModuleName, szPath, m_tszUserName);
DWORD dwVersion;
@@ -595,9 +595,9 @@ void __cdecl GGPROTO::getawaymsgthread(void *arg) MCONTACT hContact = (UINT_PTR)arg;
debugLogA("getawaymsgthread(): started");
gg_sleep(100, FALSE, "getawaymsgthread", 106, 1);
- if (!db_get_s(hContact, "CList", GG_KEY_STATUSDESCR, &dbv, DBVT_TCHAR)) {
+ if (!db_get_s(hContact, "CList", GG_KEY_STATUSDESCR, &dbv, DBVT_WCHAR)) {
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal);
- debugLog(L"getawaymsgthread(): Reading away msg <%s>.", dbv.ptszVal);
+ debugLogW(L"getawaymsgthread(): Reading away msg <%s>.", dbv.ptszVal);
db_free(&dbv);
}
else {
@@ -627,7 +627,7 @@ int GGPROTO::SetAwayMsg(int iStatus, const wchar_t *newMsg) int status = gg_normalizestatus(iStatus);
wchar_t **msgPtr;
- debugLog(L"SetAwayMsg(): PS_SETAWAYMSG(%d, \"%s\".)", iStatus, newMsg);
+ debugLogW(L"SetAwayMsg(): PS_SETAWAYMSG(%d, \"%s\".)", iStatus, newMsg);
gg_EnterCriticalSection(&modemsg_mutex, "SetAwayMsg", 55, "modemsg_mutex", 1);
// Select proper our msg ptr
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp index 52d5399ef8..29f3e39abc 100644 --- a/protocols/Gadu-Gadu/src/groupchat.cpp +++ b/protocols/Gadu-Gadu/src/groupchat.cpp @@ -58,7 +58,7 @@ void GGPROTO::gc_menus_init(HGENMENU hRoot) {
if (gc_enabled) {
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.root = hRoot;
// Conferencing
@@ -128,7 +128,7 @@ int GGPROTO::gc_event(WPARAM, LPARAM lParam) // Window terminated (Miranda exit)
if (gch->pDest->iType == SESSION_TERMINATE)
{
- debugLog(L"gc_event(): Terminating chat %x, id %s from chat window...", chat, gch->pDest->ptszID);
+ debugLogW(L"gc_event(): Terminating chat %x, id %s from chat window...", chat, gch->pDest->ptszID);
// Destroy chat entry
free(chat->recipients);
list_remove(&chats, chat, 1);
@@ -137,7 +137,7 @@ int GGPROTO::gc_event(WPARAM, LPARAM lParam) for (MCONTACT hContact = db_find_first(); hContact; ) {
MCONTACT hNext = db_find_next(hContact);
DBVARIANT dbv;
- if (!getTString(hContact, "ChatRoomID", &dbv)) {
+ if (!getWString(hContact, "ChatRoomID", &dbv)) {
if (dbv.ptszVal && !mir_wstrcmp(gch->pDest->ptszID, dbv.ptszVal))
CallService(MS_DB_CONTACT_DELETE, hContact, 0);
db_free(&dbv);
@@ -158,7 +158,7 @@ int GGPROTO::gc_event(WPARAM, LPARAM lParam) gce.ptszUID = id;
gce.ptszText = gch->ptszText;
wchar_t* nickT;
- if (!getTString(GG_KEY_NICK, &dbv)){
+ if (!getWString(GG_KEY_NICK, &dbv)){
nickT = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -173,7 +173,7 @@ int GGPROTO::gc_event(WPARAM, LPARAM lParam) gce.time = time(NULL);
gce.bIsMe = 1;
gce.dwFlags = GCEF_ADDTOLOG;
- debugLog(L"gc_event(): Sending conference message to room %s, \"%s\".", gch->pDest->ptszID, gch->ptszText);
+ debugLogW(L"gc_event(): Sending conference message to room %s, \"%s\".", gch->pDest->ptszID, gch->ptszText);
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
mir_free(nickT);
@@ -191,7 +191,7 @@ int GGPROTO::gc_event(WPARAM, LPARAM lParam) if ((uin = _wtoi(gch->ptszUID)) && (hContact = getcontact(uin, 1, 0, NULL)))
CallService(MS_MSG_SENDMESSAGE, hContact, 0);
}
- debugLog(L"gc_event(): Unhandled event %d, chat %x, uin %d, text \"%s\".", gch->pDest->iType, chat, uin, gch->ptszText);
+ debugLogW(L"gc_event(): Unhandled event %d, chat %x, uin %d, text \"%s\".", gch->pDest->iType, chat, uin, gch->ptszText);
return 0;
}
@@ -246,9 +246,9 @@ wchar_t* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_cou if (found == recipients_count)
{
if (chat->ignore)
- debugLog(L"gc_getchat(): Ignoring existing id %s, size %d.", chat->id, chat->recipients_count);
+ debugLogW(L"gc_getchat(): Ignoring existing id %s, size %d.", chat->id, chat->recipients_count);
else
- debugLog(L"gc_getchat(): Returning existing id %s, size %d.", chat->id, chat->recipients_count);
+ debugLogW(L"gc_getchat(): Returning existing id %s, size %d.", chat->id, chat->recipients_count);
return !(chat->ignore) ? chat->id : NULL;
}
}
@@ -295,7 +295,7 @@ wchar_t* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_cou for(; i < recipients_count; i++)
chat->recipients[i] = recipients[i];
if (sender) chat->recipients[i] = sender;
- debugLog(L"gc_getchat(): Ignoring new chat %s, count %d.", chat->id, chat->recipients_count);
+ debugLogW(L"gc_getchat(): Ignoring new chat %s, count %d.", chat->id, chat->recipients_count);
list_add(&chats, chat, 0);
return NULL;
}
@@ -330,7 +330,7 @@ wchar_t* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_cou // Create new room
if (CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM) &gcwindow)) {
- debugLog(L"gc_getchat(): Cannot create new chat window %s.", chat->id);
+ debugLogW(L"gc_getchat(): Cannot create new chat window %s.", chat->id);
free(name);
free(chat);
return NULL;
@@ -353,7 +353,7 @@ wchar_t* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_cou UIN2IDT(uin, id);
wchar_t* nickT;
- if (!getTString(GG_KEY_NICK, &dbv)) {
+ if (!getWString(GG_KEY_NICK, &dbv)) {
nickT = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
} else {
@@ -364,7 +364,7 @@ wchar_t* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_cou gce.bIsMe = 1;
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
mir_free(nickT);
- debugLog(L"gc_getchat(): Myself %s: %s (%s) to the list...", gce.ptszUID, gce.ptszNick, gce.ptszStatus);
+ debugLogW(L"gc_getchat(): Myself %s: %s (%s) to the list...", gce.ptszUID, gce.ptszNick, gce.ptszStatus);
}
else debugLogA("gc_getchat(): Myself adding failed with uin %d !!!", uin);
@@ -386,14 +386,14 @@ wchar_t* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_cou gce.ptszNick = TranslateT("'Unknown'");
gce.bIsMe = 0;
gce.dwFlags = 0;
- debugLog(L"gc_getchat(): Added %s: %s (%s) to the list...", gce.ptszUID, gce.ptszNick, gce.ptszStatus);
+ debugLogW(L"gc_getchat(): Added %s: %s (%s) to the list...", gce.ptszUID, gce.ptszNick, gce.ptszStatus);
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
}
gcd.iType = GC_EVENT_CONTROL;
CallServiceSync(MS_GC_EVENT, SESSION_INITDONE, (LPARAM)&gce);
CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, (LPARAM)&gce);
- debugLog(L"gc_getchat(): Returning new chat window %s, count %d.", chat->id, chat->recipients_count);
+ debugLogW(L"gc_getchat(): Returning new chat window %s, count %d.", chat->id, chat->recipients_count);
list_add(&chats, chat, 0);
return chat->id;
}
@@ -641,7 +641,7 @@ int GGPROTO::gc_changenick(MCONTACT hContact, wchar_t *ptszNick) gce.ptszUID = id;
gce.ptszText = ptszNick;
- debugLog(L"gc_changenick(): Found room %s with uin %d, sending nick change %s.", chat->id, uin, id);
+ debugLogW(L"gc_changenick(): Found room %s with uin %d, sending nick change %s.", chat->id, uin, id);
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
break;
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp index 106b8e2d5f..719d78591d 100644 --- a/protocols/Gadu-Gadu/src/image.cpp +++ b/protocols/Gadu-Gadu/src/image.cpp @@ -264,11 +264,11 @@ int gg_img_saveimage(HWND hwnd, GGIMAGEENTRY *dat) {
fwrite(dat->lpData, dat->nSize, 1, fp);
fclose(fp);
- gg->debugLog(L"gg_img_saveimage(): Image saved to %s.", szFileName);
+ gg->debugLogW(L"gg_img_saveimage(): Image saved to %s.", szFileName);
}
else
{
- gg->debugLog(L"gg_img_saveimage(): Cannot save image to %s.", szFileName);
+ gg->debugLogW(L"gg_img_saveimage(): Cannot save image to %s.", szFileName);
MessageBox(hwnd, TranslateT("Image cannot be written to disk."), gg->m_tszUserName, MB_OK | MB_ICONERROR);
}
}
@@ -398,22 +398,21 @@ static INT_PTR CALLBACK gg_img_dlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP else dat->gg->debugLogA("gg_img_dlgproc(): WM_INITDIALOG Creation event not found, but someone might be waiting.");
// Making buttons flat
- SendDlgItemMessage(hwndDlg, IDC_IMG_PREV, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_IMG_NEXT, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_IMG_DELETE, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_IMG_SAVE, BUTTONSETASFLATBTN, TRUE, 0);
-
- // Setting images for buttons
- SendDlgItemMessage(hwndDlg, IDC_IMG_PREV, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("previous", FALSE));
- SendDlgItemMessage(hwndDlg, IDC_IMG_NEXT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("next", FALSE));
- SendDlgItemMessage(hwndDlg, IDC_IMG_DELETE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("delete", FALSE));
- SendDlgItemMessage(hwndDlg, IDC_IMG_SAVE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("save", FALSE));
-
- // Setting tooltips for buttons
- SendDlgItemMessage(hwndDlg, IDC_IMG_PREV, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Previous image"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_IMG_NEXT, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Next image"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_IMG_DELETE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Delete image from the list"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_IMG_SAVE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Save image to disk"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_IMG_PREV, BUTTONSETASFLATBTN, TRUE, 0);
+ SendDlgItemMessage(hwndDlg, IDC_IMG_PREV, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("previous", FALSE));
+ SendDlgItemMessage(hwndDlg, IDC_IMG_PREV, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Previous image"), BATF_UNICODE);
+
+ SendDlgItemMessage(hwndDlg, IDC_IMG_NEXT, BUTTONSETASFLATBTN, TRUE, 0);
+ SendDlgItemMessage(hwndDlg, IDC_IMG_NEXT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("next", FALSE));
+ SendDlgItemMessage(hwndDlg, IDC_IMG_NEXT, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Next image"), BATF_UNICODE);
+
+ SendDlgItemMessage(hwndDlg, IDC_IMG_SAVE, BUTTONSETASFLATBTN, TRUE, 0);
+ SendDlgItemMessage(hwndDlg, IDC_IMG_SAVE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("save", FALSE));
+ SendDlgItemMessage(hwndDlg, IDC_IMG_SAVE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Save image to disk"), BATF_UNICODE);
+
+ SendDlgItemMessage(hwndDlg, IDC_IMG_DELETE, BUTTONSETASFLATBTN, TRUE, 0);
+ SendDlgItemMessage(hwndDlg, IDC_IMG_DELETE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx("delete", FALSE));
+ SendDlgItemMessage(hwndDlg, IDC_IMG_DELETE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Delete image from the list"), BATF_UNICODE);
// Set main window image
Window_SetIcon_IcoLib(hwndDlg, GetIconHandle(IDI_IMAGE));
@@ -812,11 +811,11 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img) }
if ( _waccess(szPath, 0)){
- int ret = CreateDirectoryTreeT(szPath);
+ int ret = CreateDirectoryTreeW(szPath);
if (ret == 0){
- debugLog(L"img_displayasmsg(): Created new directory for image cache: %s.", szPath);
+ debugLogW(L"img_displayasmsg(): Created new directory for image cache: %s.", szPath);
} else {
- debugLog(L"img_displayasmsg(): Can not create directory for image cache: %s. errno=%d: %s", szPath, errno, strerror(errno));
+ debugLogW(L"img_displayasmsg(): Can not create directory for image cache: %s. errno=%d: %s", szPath, errno, strerror(errno));
wchar_t error[512];
mir_snwprintf(error, TranslateT("Cannot create image cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR | GG_POPUP_ALLOW_MSGBOX | GG_POPUP_ONCE);
@@ -840,7 +839,7 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img) res = fwrite(dat->lpData, dat->nSize, 1, fp) > 0;
fclose(fp);
} else {
- debugLog(L"img_displayasmsg(): Cannot open file %s for write image. errno=%d: %s", szPath, errno, strerror(errno));
+ debugLogW(L"img_displayasmsg(): Cannot open file %s for write image. errno=%d: %s", szPath, errno, strerror(errno));
wchar_t error[512];
mir_snwprintf(error, TranslateT("Cannot save received image to file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
@@ -857,9 +856,9 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img) pre.timestamp = time(NULL);
pre.szMessage = szMessage;
ProtoChainRecvMsg(hContact, &pre);
- debugLog(L"img_displayasmsg(): Image saved to %s.", szPath);
+ debugLogW(L"img_displayasmsg(): Image saved to %s.", szPath);
}
- else debugLog(L"img_displayasmsg(): Cannot save image to %s.", szPath);
+ else debugLogW(L"img_displayasmsg(): Cannot save image to %s.", szPath);
return 0;
}
@@ -961,7 +960,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, wchar_t *szFileName) FILE *fp = _wfopen(szFileName, L"rb");
if (!fp) {
free(dat);
- debugLog(L"img_loadpicture(): fopen(\"%s\", \"rb\" failed. errno=%d: %s)", szFileName, errno, strerror(errno));
+ debugLogW(L"img_loadpicture(): fopen(\"%s\", \"rb\" failed. errno=%d: %s)", szFileName, errno, strerror(errno));
wchar_t error[512];
mir_snwprintf(error, TranslateT("Cannot open image file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szFileName);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
@@ -973,7 +972,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, wchar_t *szFileName) {
fclose(fp);
free(dat);
- debugLog(L"img_loadpicture(): Zero file size \"%s\" failed.", szFileName);
+ debugLogW(L"img_loadpicture(): Zero file size \"%s\" failed.", szFileName);
return NULL;
}
// Maximum acceptable image size
@@ -981,7 +980,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, wchar_t *szFileName) {
fclose(fp);
free(dat);
- debugLog(L"img_loadpicture(): Image size of \"%s\" exceeds 255 KB.", szFileName);
+ debugLogW(L"img_loadpicture(): Image size of \"%s\" exceeds 255 KB.", szFileName);
MessageBox(NULL, TranslateT("Image exceeds maximum allowed size of 255 KB."), m_tszUserName, MB_OK | MB_ICONEXCLAMATION);
return NULL;
}
@@ -992,7 +991,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, wchar_t *szFileName) free(dat->lpData);
fclose(fp);
free(dat);
- debugLog(L"img_loadpicture(): Reading file \"%s\" failed.", szFileName);
+ debugLogW(L"img_loadpicture(): Reading file \"%s\" failed.", szFileName);
return NULL;
}
fclose(fp);
@@ -1037,7 +1036,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, wchar_t *szFileName) }
// Load image from file
else
- dat->hBitmap = (HBITMAP) CallService(MS_IMG_LOAD, (WPARAM) szFileName, IMGL_TCHAR);
+ dat->hBitmap = (HBITMAP) CallService(MS_IMG_LOAD, (WPARAM) szFileName, IMGL_WCHAR);
// If everything is fine return the handle
if (dat->hBitmap) return dat;
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index 6e8e3f43f0..b2b686b4dc 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -32,7 +32,7 @@ char *gg_makecontacts(GGPROTO *gg, int cr) // Readup FirstName
DBVARIANT dbv;
- if (!gg->getTString(hContact, GG_KEY_PD_FIRSTNAME, &dbv))
+ if (!gg->getWString(hContact, GG_KEY_PD_FIRSTNAME, &dbv))
{
char* pszValA = mir_u2a(dbv.ptszVal);
string_append(s, dbv.pszVal);
@@ -41,7 +41,7 @@ char *gg_makecontacts(GGPROTO *gg, int cr) }
string_append_c(s, ';');
// Readup LastName
- if (!gg->getTString(hContact, GG_KEY_PD_LASTNAME, &dbv))
+ if (!gg->getWString(hContact, GG_KEY_PD_LASTNAME, &dbv))
{
char* pszValA = mir_u2a(dbv.ptszVal);
string_append(s, dbv.pszVal);
@@ -51,11 +51,11 @@ char *gg_makecontacts(GGPROTO *gg, int cr) string_append_c(s, ';');
// Readup Nick
- if (!db_get_ts(hContact, "CList", "MyHandle", &dbv) || !gg->getTString(hContact, GG_KEY_NICK, &dbv))
+ if (!db_get_ws(hContact, "CList", "MyHandle", &dbv) || !gg->getWString(hContact, GG_KEY_NICK, &dbv))
{
char* dbvA = mir_u2a(dbv.ptszVal);
DBVARIANT dbv2;
- if (!gg->getTString(hContact, GG_KEY_PD_NICKNAME, &dbv2))
+ if (!gg->getWString(hContact, GG_KEY_PD_NICKNAME, &dbv2))
{
char* pszValA = mir_u2a(dbv2.ptszVal);
string_append(s, pszValA);
@@ -218,18 +218,18 @@ void GGPROTO::parsecontacts(char *contacts) if (hContact && strGroup) {
ptrW tszGrpName( mir_a2u(strGroup));
Clist_GroupCreate(0, tszGrpName);
- db_set_ts(hContact, "CList", "Group", tszGrpName);
+ db_set_ws(hContact, "CList", "Group", tszGrpName);
}
// Write misc data
if (hContact && strFirstName){
wchar_t *tstrFirstName = mir_a2u(strFirstName);
- setTString(hContact, GG_KEY_PD_FIRSTNAME, tstrFirstName);
+ setWString(hContact, GG_KEY_PD_FIRSTNAME, tstrFirstName);
mir_free(tstrFirstName);
}
if (hContact && strLastName){
wchar_t *tstrLastName = mir_a2u(strLastName);
- setTString(hContact, GG_KEY_PD_LASTNAME, tstrLastName);
+ setWString(hContact, GG_KEY_PD_LASTNAME, tstrLastName);
mir_free(tstrLastName);
}
if (hContact && strPhone) db_set_s(hContact, "UserInfo", "MyPhone0", strPhone); // Store now in User Info
@@ -280,7 +280,7 @@ INT_PTR GGPROTO::import_server(WPARAM, LPARAM) gg_LeaveCriticalSection(&sess_mutex, "import_server", 65, 1, "sess_mutex", 1);
mir_snwprintf(error, TranslateT("List cannot be imported because of error:\n\t%s (Error: %d)"), ws_strerror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
- debugLog(L"import_server(): Cannot import list. errno:%d: %s", errno, ws_strerror(errno));
+ debugLogW(L"import_server(): Cannot import list. errno:%d: %s", errno, ws_strerror(errno));
}
gg_LeaveCriticalSection(&sess_mutex, "import_server", 65, 2, "sess_mutex", 1);
@@ -318,7 +318,7 @@ INT_PTR GGPROTO::remove_server(WPARAM, LPARAM) gg_LeaveCriticalSection(&sess_mutex, "remove_server", 66, 1, "sess_mutex", 1);
mir_snwprintf(error, TranslateT("List cannot be removed because of error: %s (Error: %d)"), ws_strerror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
- debugLog(L"remove_server(): Cannot remove list. errno=%d: %s", errno, ws_strerror(errno));
+ debugLogW(L"remove_server(): Cannot remove list. errno=%d: %s", errno, ws_strerror(errno));
}
gg_LeaveCriticalSection(&sess_mutex, "remove_server", 66, 2, "sess_mutex", 1);
@@ -392,7 +392,7 @@ INT_PTR GGPROTO::import_text(WPARAM, LPARAM) wchar_t error[256];
mir_snwprintf(error, TranslateT("List cannot be imported from file \"%s\" because of error:\n\t%s (Error: %d)"), str, _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
- debugLog(L"import_text(): Cannot import list from file \"%s\". errno=%d: %s", str, errno, _tcserror(errno));
+ debugLogW(L"import_text(): Cannot import list from file \"%s\". errno=%d: %s", str, errno, _tcserror(errno));
if (f)
fclose(f);
return 0;
@@ -436,7 +436,7 @@ INT_PTR GGPROTO::export_text(WPARAM, LPARAM) ofn.lpstrDefExt = L"txt";
#ifdef DEBUGMODE
- debugLog(L"export_text(%s).", str);
+ debugLogW(L"export_text(%s).", str);
#endif
if (!GetSaveFileName(&ofn)) return 0;
@@ -454,7 +454,7 @@ INT_PTR GGPROTO::export_text(WPARAM, LPARAM) wchar_t error[128];
mir_snwprintf(error, TranslateT("List cannot be exported to file \"%s\" because of error:\n\t%s (Error: %d)"), str, _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
- debugLog(L"export_text(): Cannot export list to file \"%s\". errno=%d: %s", str, errno, _tcserror(errno));
+ debugLogW(L"export_text(): Cannot export list to file \"%s\". errno=%d: %s", str, errno, _tcserror(errno));
}
return 0;
@@ -498,7 +498,7 @@ INT_PTR GGPROTO::export_server(WPARAM, LPARAM) gg_LeaveCriticalSection(&sess_mutex, "export_server", 67, 1, "sess_mutex", 1);
mir_snwprintf(error, TranslateT("List cannot be exported because of error:\n\t%s (Error: %d)"), ws_strerror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
- debugLog(L"export_server(): Cannot export list. errno=%d: %s", errno, ws_strerror(errno));
+ debugLogW(L"export_server(): Cannot export list. errno=%d: %s", errno, ws_strerror(errno));
}
gg_LeaveCriticalSection(&sess_mutex, "export_server", 67, 2, "sess_mutex", 1);
@@ -515,7 +515,7 @@ INT_PTR GGPROTO::export_server(WPARAM, LPARAM) void GGPROTO::import_init(HGENMENU hRoot)
{
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.root = hRoot;
// Import from server item
diff --git a/protocols/Gadu-Gadu/src/links.cpp b/protocols/Gadu-Gadu/src/links.cpp index cc388ac8e8..6fc1a996ca 100644 --- a/protocols/Gadu-Gadu/src/links.cpp +++ b/protocols/Gadu-Gadu/src/links.cpp @@ -116,7 +116,7 @@ void GGPROTO::links_instance_init() {
if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE)) {
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.position = g_Instances.getCount();
mi.name.w = m_tszUserName;
hInstanceMenuItem = Menu_AddItem(hInstanceMenu, &mi, this);
diff --git a/protocols/Gadu-Gadu/src/ownerinfo.cpp b/protocols/Gadu-Gadu/src/ownerinfo.cpp index c89521354f..6a11db6a33 100644 --- a/protocols/Gadu-Gadu/src/ownerinfo.cpp +++ b/protocols/Gadu-Gadu/src/ownerinfo.cpp @@ -59,7 +59,7 @@ void __cdecl GGPROTO::remindpasswordthread(void *param) wchar_t error[128];
mir_snwprintf(error, TranslateT("Password could not be reminded because of error:\n\t%s (Error: %d)"), ws_strerror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
- debugLog(L"remindpasswordthread(): Password could not be reminded. errno=%d: %s", errno, ws_strerror(errno));
+ debugLogW(L"remindpasswordthread(): Password could not be reminded. errno=%d: %s", errno, ws_strerror(errno));
}
else
{
diff --git a/protocols/Gadu-Gadu/src/popups.cpp b/protocols/Gadu-Gadu/src/popups.cpp index 7712477bc2..0d68758a86 100644 --- a/protocols/Gadu-Gadu/src/popups.cpp +++ b/protocols/Gadu-Gadu/src/popups.cpp @@ -79,7 +79,7 @@ void GGPROTO::initpopups() puc.cbSize = sizeof(puc);
puc.PluginWindowProc = PopupWindowProc;
puc.flags = PCF_TCHAR;
- puc.ptszDescription = szDescr;
+ puc.pwszDescription = szDescr;
puc.pszName = szName;
puc.colorBack = RGB(173, 206, 247);
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp index e0fde48c40..fbb314a22c 100644 --- a/protocols/Gadu-Gadu/src/services.cpp +++ b/protocols/Gadu-Gadu/src/services.cpp @@ -188,7 +188,7 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam) //directly check if contact has protected user avatar set by AVS, and if yes return it as protocol avatar
DBVARIANT dbv;
- if (!db_get_ts(pai->hContact, "ContactPhoto", "Backup", &dbv)) {
+ if (!db_get_ws(pai->hContact, "ContactPhoto", "Backup", &dbv)) {
if ((mir_wstrlen(dbv.ptszVal)>0) && db_get_b(pai->hContact, "ContactPhoto", "Locked", 0)){
debugLogA("getavatarinfo(): Incoming request for avatar information. Contact has assigned Locked ContactPhoto. return GAIR_SUCCESS");
wcscpy_s(pai->filename, _countof(pai->filename) ,dbv.ptszVal);
@@ -235,12 +235,12 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam) }
requestAvatarTransfer(pai->hContact, AvatarURL);
- debugLog(L"getavatarinfo(): Incoming request for avatar information. uin=%d. Avatar hash unchanged but file %s does not exist. errno=%d: %s. requestAvatarTransfer() fired. return GAIR_WAITFOR", uin, pai->filename, errno, ws_strerror(errno));
+ debugLogW(L"getavatarinfo(): Incoming request for avatar information. uin=%d. Avatar hash unchanged but file %s does not exist. errno=%d: %s. requestAvatarTransfer() fired. return GAIR_WAITFOR", uin, pai->filename, errno, ws_strerror(errno));
return GAIR_WAITFOR;
}
if ((wParam & GAIF_FORCE) != 0) {
if (_wremove(pai->filename) != 0){
- debugLog(L"getavatarinfo(): refresh. _wremove 1 file %s error. errno=%d: %s", pai->filename, errno, _tcserror(errno));
+ debugLogW(L"getavatarinfo(): refresh. _wremove 1 file %s error. errno=%d: %s", pai->filename, errno, _tcserror(errno));
wchar_t error[512];
mir_snwprintf(error, TranslateT("Cannot remove old avatar file before refresh. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pai->filename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
@@ -255,7 +255,7 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam) if (AvatarHash == NULL && AvatarSavedHash != NULL) {
getAvatarFilename(pai->hContact, pai->filename, _countof(pai->filename));
if (_wremove(pai->filename) != 0){
- debugLog(L"getavatarinfo(): delete. _wremove file %s error. errno=%d: %s", pai->filename, errno, _tcserror(errno));
+ debugLogW(L"getavatarinfo(): delete. _wremove file %s error. errno=%d: %s", pai->filename, errno, _tcserror(errno));
wchar_t error[512];
mir_snwprintf(error, TranslateT("Cannot remove old avatar file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pai->filename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
@@ -302,7 +302,7 @@ INT_PTR GGPROTO::getmyavatar(WPARAM wParam, LPARAM lParam) debugLogA("getmyavatar(): Incoming request for self avatar information. returned ok.");
return 0;
} else {
- debugLog(L"getmyavatar(): Incoming request for self avatar information. saved avatar file %s does not exist. return -1 (error)", szFilename);
+ debugLogW(L"getmyavatar(): Incoming request for self avatar information. saved avatar file %s does not exist. return -1 (error)", szFilename);
return -1;
}
diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp index cd2225ddad..cdf748a66d 100644 --- a/protocols/Gadu-Gadu/src/sessions.cpp +++ b/protocols/Gadu-Gadu/src/sessions.cpp @@ -417,7 +417,7 @@ BOOL GGPROTO::sessions_closedlg() void GGPROTO::sessions_menus_init(HGENMENU hRoot)
{
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.root = hRoot;
mi.pszService = GGS_CONCUR_SESS;
diff --git a/protocols/Gadu-Gadu/src/userutils.cpp b/protocols/Gadu-Gadu/src/userutils.cpp index 2b8be7fb7a..6fea4ce96e 100644 --- a/protocols/Gadu-Gadu/src/userutils.cpp +++ b/protocols/Gadu-Gadu/src/userutils.cpp @@ -44,7 +44,7 @@ void *gg_doregister(GGPROTO *gg, char *newPass, char *newEmail) (h && !s) ? http_error_string(h->error) :
(s ? TranslateT("Registration rejected") : ws_strerror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
- gg->debugLog(L"gg_doregister(): Cannot register. errno=%d: %s", errno, ws_strerror(errno));
+ gg->debugLogW(L"gg_doregister(): Cannot register. errno=%d: %s", errno, ws_strerror(errno));
}
else {
gg->setDword(GG_KEY_UIN, s->uin);
@@ -90,7 +90,7 @@ void *gg_dounregister(GGPROTO *gg, uin_t uin, char *password) (h && !s) ? http_error_string(h->error) :
(s ? TranslateT("Bad number or password") : ws_strerror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
- gg->debugLog(L"gg_dounregister(): Cannot remove account. errno=%d: %s", errno, ws_strerror(errno));
+ gg->debugLogW(L"gg_dounregister(): Cannot remove account. errno=%d: %s", errno, ws_strerror(errno));
}
else
{
@@ -142,7 +142,7 @@ void *gg_dochpass(GGPROTO *gg, uin_t uin, char *password, char *newPass) (h && !s) ? http_error_string(h->error) :
(s ? TranslateT("Invalid data entered") : ws_strerror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
- gg->debugLog(L"gg_dochpass(): Cannot change password. errno=%d: %s", errno, ws_strerror(errno));
+ gg->debugLogW(L"gg_dochpass(): Cannot change password. errno=%d: %s", errno, ws_strerror(errno));
}
else
{
@@ -183,7 +183,7 @@ void *gg_dochemail(GGPROTO *gg, uin_t uin, char *password, char *email, char *ne mir_snwprintf(error, TranslateT("Your e-mail cannot be changed because of error:\n\t%s"),
(h && !s) ? http_error_string(h->error) : (s ? TranslateT("Bad old e-mail or password") : ws_strerror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
- gg->debugLog(L"gg_dochemail(): Cannot change e-mail. errno=%d: %s", errno, ws_strerror(errno));
+ gg->debugLogW(L"gg_dochemail(): Cannot change e-mail. errno=%d: %s", errno, ws_strerror(errno));
}
else
{
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index c4f076d1c7..8ef7cab404 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask, unsigned long adr, int port)
+BOOL CIrcProto::CList_AddDCCChat(const CMStringW& name, const CMStringW& hostmask, unsigned long adr, int port)
{
MCONTACT hContact;
wchar_t szNick[256];
@@ -34,7 +34,7 @@ BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask, if (hc && db_get_b(hc, "CList", "NotOnList", 0) == 0 && db_get_b(hc, "CList", "Hidden", 0) == 0)
bFlag = true;
- CMString contactname = name; contactname += DCCSTRING;
+ CMStringW contactname = name; contactname += DCCSTRING;
CONTACT user = { (wchar_t*)contactname.c_str(), NULL, NULL, false, false, true };
hContact = CList_AddContact(&user, false, false);
@@ -89,7 +89,7 @@ MCONTACT CIrcProto::CList_AddContact(CONTACT *user, bool InList, bool SetOnline) if (hContact) {
if (InList)
db_unset(hContact, "CList", "NotOnList");
- setTString(hContact, "Nick", user->name);
+ setWString(hContact, "Nick", user->name);
db_unset(hContact, "CList", "Hidden");
if (SetOnline && getWord(hContact, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
setWord(hContact, "Status", ID_STATUS_ONLINE);
@@ -106,8 +106,8 @@ MCONTACT CIrcProto::CList_AddContact(CONTACT *user, bool InList, bool SetOnline) else
db_set_b(hContact, "CList", "NotOnList", 1);
db_unset(hContact, "CList", "Hidden");
- setTString(hContact, "Nick", user->name);
- setTString(hContact, "Default", user->name);
+ setWString(hContact, "Nick", user->name);
+ setWString(hContact, "Default", user->name);
setWord(hContact, "Status", SetOnline ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE);
if (!InList && getByte("MirVerAutoRequestTemp", 0))
PostIrcMessage(L"/PRIVMSG %s \001VERSION\001", user->name);
@@ -121,10 +121,10 @@ MCONTACT CIrcProto::CList_SetOffline(CONTACT *user) MCONTACT hContact = CList_FindContact(user);
if (hContact) {
DBVARIANT dbv;
- if (!getTString(hContact, "Default", &dbv)) {
+ if (!getWString(hContact, "Default", &dbv)) {
setString(hContact, "User", "");
setString(hContact, "Host", "");
- setTString(hContact, "Nick", dbv.ptszVal);
+ setWString(hContact, "Nick", dbv.ptszVal);
setWord(hContact, "Status", ID_STATUS_OFFLINE);
db_free(&dbv);
return hContact;
@@ -148,8 +148,8 @@ bool CIrcProto::CList_SetAllOffline(BYTE ChatsToo) if (ChatsToo)
setWord(hContact, "Status", ID_STATUS_OFFLINE);
}
- else if (!getTString(hContact, "Default", &dbv)) {
- setTString(hContact, "Nick", dbv.ptszVal);
+ else if (!getWString(hContact, "Default", &dbv)) {
+ setWString(hContact, "Nick", dbv.ptszVal);
setWord(hContact, "Status", ID_STATUS_OFFLINE);
db_free(&dbv);
}
@@ -173,11 +173,11 @@ MCONTACT CIrcProto::CList_FindContact(CONTACT *user) continue;
MCONTACT hContact_temp = NULL;
- ptrW DBNick(getTStringA(hContact, "Nick"));
- ptrW DBUser(getTStringA(hContact, "UUser"));
- ptrW DBHost(getTStringA(hContact, "UHost"));
- ptrW DBDefault(getTStringA(hContact, "Default"));
- ptrW DBWildcard(getTStringA(hContact, "UWildcard"));
+ ptrW DBNick(getWStringA(hContact, "Nick"));
+ ptrW DBUser(getWStringA(hContact, "UUser"));
+ ptrW DBHost(getWStringA(hContact, "UHost"));
+ ptrW DBDefault(getWStringA(hContact, "Default"));
+ ptrW DBWildcard(getWStringA(hContact, "UWildcard"));
if (DBWildcard)
CharLower(DBWildcard);
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index ab36e0d46e..cfd91e12b1 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -93,7 +93,7 @@ VOID CALLBACK OnlineNotifTimerProc3(HWND, UINT, UINT_PTR idEvent, DWORD) return;
}
- CMString name = GetWord(ppro->m_channelsToWho.c_str(), 0);
+ CMStringW name = GetWord(ppro->m_channelsToWho.c_str(), 0);
if (name.IsEmpty()) {
ppro->m_channelsToWho = L"";
int count = (int)CallServiceSync(MS_GC_GETSESSIONCOUNT, 0, (LPARAM)ppro->m_szModuleName);
@@ -104,7 +104,7 @@ VOID CALLBACK OnlineNotifTimerProc3(HWND, UINT, UINT_PTR idEvent, DWORD) gci.pszModule = ppro->m_szModuleName;
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci) && gci.iType == GCW_CHATROOM)
if (gci.iCount <= ppro->m_onlineNotificationLimit)
- ppro->m_channelsToWho += CMString(gci.pszName) + L" ";
+ ppro->m_channelsToWho += CMStringW(gci.pszName) + L" ";
}
}
@@ -115,7 +115,7 @@ VOID CALLBACK OnlineNotifTimerProc3(HWND, UINT, UINT_PTR idEvent, DWORD) name = GetWord(ppro->m_channelsToWho.c_str(), 0);
ppro->DoUserhostWithReason(2, L"S" + name, true, L"%s", name.c_str());
- CMString temp = GetWordAddress(ppro->m_channelsToWho.c_str(), 1);
+ CMStringW temp = GetWordAddress(ppro->m_channelsToWho.c_str(), 1);
ppro->m_channelsToWho = temp;
if (ppro->m_iTempCheckTime)
ppro->SetChatTimer(ppro->OnlineNotifTimer3, ppro->m_iTempCheckTime * 1000, OnlineNotifTimerProc3);
@@ -136,8 +136,8 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) return;
}
- CMString name = GetWord(ppro->m_namesToWho.c_str(), 0);
- CMString name2 = GetWord(ppro->m_namesToUserhost.c_str(), 0);
+ CMStringW name = GetWord(ppro->m_namesToWho.c_str(), 0);
+ CMStringW name2 = GetWord(ppro->m_namesToUserhost.c_str(), 0);
if (name.IsEmpty() && name2.IsEmpty()) {
DBVARIANT dbv;
@@ -149,14 +149,14 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) BYTE bHidden = db_get_b(hContact, "CList", "Hidden", 0);
if (bDCC || bHidden)
continue;
- if (ppro->getTString(hContact, "Default", &dbv))
+ if (ppro->getWString(hContact, "Default", &dbv))
continue;
BYTE bAdvanced = ppro->getByte(hContact, "AdvancedMode", 0);
if (!bAdvanced) {
db_free(&dbv);
- if (!ppro->getTString(hContact, "Nick", &dbv)) {
- ppro->m_namesToUserhost += CMString(dbv.ptszVal) + L" ";
+ if (!ppro->getWString(hContact, "Nick", &dbv)) {
+ ppro->m_namesToUserhost += CMStringW(dbv.ptszVal) + L" ";
db_free(&dbv);
}
}
@@ -166,15 +166,15 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) wchar_t* DBNick = NULL;
wchar_t* DBWildcard = NULL;
- if (!ppro->getTString(hContact, "Nick", &dbv))
+ if (!ppro->getWString(hContact, "Nick", &dbv))
DBNick = dbv.ptszVal;
- if (!ppro->getTString(hContact, "UWildcard", &dbv2))
+ if (!ppro->getWString(hContact, "UWildcard", &dbv2))
DBWildcard = dbv2.ptszVal;
if (DBNick && (!DBWildcard || !WCCmp(CharLower(DBWildcard), CharLower(DBNick))))
- ppro->m_namesToWho += CMString(DBNick) + L" ";
+ ppro->m_namesToWho += CMStringW(DBNick) + L" ";
else if (DBWildcard)
- ppro->m_namesToWho += CMString(DBWildcard) + L" ";
+ ppro->m_namesToWho += CMStringW(DBWildcard) + L" ";
if (DBNick) db_free(&dbv);
if (DBWildcard) db_free(&dbv2);
@@ -189,7 +189,7 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) name = GetWord(ppro->m_namesToWho.c_str(), 0);
name2 = GetWord(ppro->m_namesToUserhost.c_str(), 0);
- CMString temp;
+ CMStringW temp;
if (!name.IsEmpty()) {
ppro->DoUserhostWithReason(2, L"S" + name, true, L"%s", name.c_str());
temp = GetWordAddress(ppro->m_namesToWho.c_str(), 1);
@@ -197,14 +197,14 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) }
if (!name2.IsEmpty()) {
- CMString params;
+ CMStringW params;
for (int i = 0; i < 3; i++) {
params = L"";
for (int j = 0; j < 5; j++)
params += GetWord(ppro->m_namesToUserhost, i * 5 + j) + L" ";
if (params[0] != ' ')
- ppro->DoUserhostWithReason(1, CMString(L"S") + params, true, params);
+ ppro->DoUserhostWithReason(1, CMStringW(L"S") + params, true, params);
}
temp = GetWordAddress(ppro->m_namesToUserhost.c_str(), 15);
ppro->m_namesToUserhost = temp;
@@ -221,7 +221,7 @@ int CIrcProto::AddOutgoingMessageToDB(MCONTACT hContact, wchar_t* msg) if (m_iStatus == ID_STATUS_OFFLINE || m_iStatus == ID_STATUS_CONNECTING)
return 0;
- CMString S = DoColorCodes(msg, TRUE, FALSE);
+ CMStringW S = DoColorCodes(msg, TRUE, FALSE);
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = m_szModuleName;
@@ -274,7 +274,7 @@ bool CIrcProto::OnIrc_WELCOME(const CIrcMessage* pmsg) if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1) {
static wchar_t host[1024];
int i = 0;
- CMString word = GetWord(pmsg->parameters[1].c_str(), i);
+ CMStringW word = GetWord(pmsg->parameters[1].c_str(), i);
while (!word.IsEmpty()) {
if (wcschr(word.c_str(), '!') && wcschr(word.c_str(), '@')) {
mir_wstrncpy(host, word.c_str(), _countof(host));
@@ -293,7 +293,7 @@ bool CIrcProto::OnIrc_WELCOME(const CIrcMessage* pmsg) bool CIrcProto::OnIrc_WHOTOOLONG(const CIrcMessage* pmsg)
{
- CMString command = GetNextUserhostReason(2);
+ CMStringW command = GetNextUserhostReason(2);
if (command[0] == 'U')
ShowMessage(pmsg);
@@ -357,7 +357,7 @@ bool CIrcProto::OnIrc_SETAWAY(const CIrcMessage* pmsg) bool CIrcProto::OnIrc_JOIN(const CIrcMessage* pmsg)
{
if (pmsg->parameters.getCount() > 0 && pmsg->m_bIncoming && pmsg->prefix.sNick != m_info.sNick) {
- CMString host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
+ CMStringW host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
DoEvent(GC_EVENT_JOIN, pmsg->parameters[0].c_str(), pmsg->prefix.sNick.c_str(), NULL, L"Normal", host.c_str(), NULL, true, false);
DoEvent(GC_EVENT_SETCONTACTSTATUS, pmsg->parameters[0].c_str(), pmsg->prefix.sNick.c_str(), NULL, NULL, NULL, ID_STATUS_ONLINE, FALSE, FALSE);
}
@@ -369,7 +369,7 @@ bool CIrcProto::OnIrc_JOIN(const CIrcMessage* pmsg) bool CIrcProto::OnIrc_QUIT(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming) {
- CMString host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
+ CMStringW host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
DoEvent(GC_EVENT_QUIT, NULL, pmsg->prefix.sNick.c_str(), pmsg->parameters.getCount() > 0 ? pmsg->parameters[0].c_str() : NULL, NULL, host.c_str(), NULL, true, false);
struct CONTACT user = { (LPTSTR)pmsg->prefix.sNick.c_str(), (LPTSTR)pmsg->prefix.sUser.c_str(), (LPTSTR)pmsg->prefix.sHost.c_str(), false, false, false };
CList_SetOffline(&user);
@@ -387,10 +387,10 @@ bool CIrcProto::OnIrc_QUIT(const CIrcMessage* pmsg) bool CIrcProto::OnIrc_PART(const CIrcMessage* pmsg)
{
if (pmsg->parameters.getCount() > 0 && pmsg->m_bIncoming) {
- CMString host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
+ CMStringW host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
DoEvent(GC_EVENT_PART, pmsg->parameters[0].c_str(), pmsg->prefix.sNick.c_str(), pmsg->parameters.getCount() > 1 ? pmsg->parameters[1].c_str() : NULL, NULL, host.c_str(), NULL, true, false);
if (pmsg->prefix.sNick == m_info.sNick) {
- CMString S = MakeWndID(pmsg->parameters[0].c_str());
+ CMStringW S = MakeWndID(pmsg->parameters[0].c_str());
GCDEST gcd = { m_szModuleName, S.c_str(), GC_EVENT_CONTROL };
GCEVENT gce = { sizeof(gce), &gcd };
CallChatEvent(SESSION_OFFLINE, (LPARAM)&gce);
@@ -409,7 +409,7 @@ bool CIrcProto::OnIrc_KICK(const CIrcMessage* pmsg) ShowMessage(pmsg);
if (pmsg->parameters[1] == m_info.sNick) {
- CMString S = MakeWndID(pmsg->parameters[0].c_str());
+ CMStringW S = MakeWndID(pmsg->parameters[0].c_str());
GCDEST gcd = { m_szModuleName, S.c_str(), GC_EVENT_CONTROL };
GCEVENT gce = { sizeof(gce), &gcd };
CallChatEvent(SESSION_OFFLINE, (LPARAM)&gce);
@@ -429,8 +429,8 @@ bool CIrcProto::OnIrc_KICK(const CIrcMessage* pmsg) bool CIrcProto::OnIrc_MODEQUERY(const CIrcMessage* pmsg)
{
if (pmsg->parameters.getCount() > 2 && pmsg->m_bIncoming && IsChannel(pmsg->parameters[1])) {
- CMString sPassword = L"";
- CMString sLimit = L"";
+ CMStringW sPassword = L"";
+ CMStringW sLimit = L"";
bool bAdd = false;
int iParametercount = 3;
@@ -464,8 +464,8 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg) {
bool flag = false;
bool bContainsValidModes = false;
- CMString sModes = L"";
- CMString sParams = L"";
+ CMStringW sModes = L"";
+ CMStringW sParams = L"";
if (pmsg->parameters.getCount() > 1 && pmsg->m_bIncoming) {
if (IsChannel(pmsg->parameters[0])) {
@@ -495,7 +495,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg) iParametercount++;
}
if (strchr(sUserModes.c_str(), (char)*p1)) {
- CMString sStatus = ModeToStatus(*p1);
+ CMStringW sStatus = ModeToStatus(*p1);
if ((int)pmsg->parameters.getCount() > iParametercount) {
if (!mir_wstrcmp(pmsg->parameters[2].c_str(), m_info.sNick.c_str())) {
char cModeBit = -1;
@@ -535,7 +535,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg) mir_snwprintf(temp, TranslateT("%s sets mode %s"),
pmsg->prefix.sNick.c_str(), pmsg->parameters[1].c_str());
- CMString sMessage = temp;
+ CMStringW sMessage = temp;
for (int i = 2; i < (int)pmsg->parameters.getCount(); i++)
sMessage += L" " + pmsg->parameters[i];
@@ -557,7 +557,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg) wchar_t temp[256];
mir_snwprintf(temp, TranslateT("%s sets mode %s"), pmsg->prefix.sNick.c_str(), pmsg->parameters[1].c_str());
- CMString sMessage = temp;
+ CMStringW sMessage = temp;
for (int i = 2; i < (int)pmsg->parameters.getCount(); i++)
sMessage += L" " + pmsg->parameters[i];
@@ -576,10 +576,10 @@ bool CIrcProto::OnIrc_NICK(const CIrcMessage* pmsg) if (m_info.sNick == pmsg->prefix.sNick && pmsg->parameters.getCount() > 0) {
m_info.sNick = pmsg->parameters[0];
- setTString("Nick", m_info.sNick.c_str());
+ setWString("Nick", m_info.sNick.c_str());
}
- CMString host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
+ CMStringW host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
DoEvent(GC_EVENT_NICK, NULL, pmsg->prefix.sNick.c_str(), pmsg->parameters[0].c_str(), NULL, host.c_str(), NULL, true, bIsMe);
DoEvent(GC_EVENT_CHUID, NULL, pmsg->prefix.sNick.c_str(), pmsg->parameters[0].c_str(), NULL, NULL, NULL, true, false);
@@ -588,9 +588,9 @@ bool CIrcProto::OnIrc_NICK(const CIrcMessage* pmsg) if (hContact) {
if (getWord(hContact, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
setWord(hContact, "Status", ID_STATUS_ONLINE);
- setTString(hContact, "Nick", pmsg->parameters[0].c_str());
- setTString(hContact, "User", pmsg->prefix.sUser.c_str());
- setTString(hContact, "Host", pmsg->prefix.sHost.c_str());
+ setWString(hContact, "Nick", pmsg->parameters[0].c_str());
+ setWString(hContact, "User", pmsg->prefix.sUser.c_str());
+ setWString(hContact, "Host", pmsg->prefix.sHost.c_str());
}
}
else ShowMessage(pmsg);
@@ -605,9 +605,9 @@ bool CIrcProto::OnIrc_NOTICE(const CIrcMessage* pmsg) return true;
if (!m_ignore || !IsIgnored(pmsg->prefix.sNick, pmsg->prefix.sUser, pmsg->prefix.sHost, 'n')) {
- CMString S;
- CMString S2;
- CMString S3;
+ CMStringW S;
+ CMStringW S2;
+ CMStringW S3;
if (pmsg->prefix.sNick.GetLength() > 0)
S = pmsg->prefix.sNick;
else
@@ -620,11 +620,11 @@ bool CIrcProto::OnIrc_NOTICE(const CIrcMessage* pmsg) gci.Flags = GCF_BYID | GCF_TYPE;
gci.pszModule = m_szModuleName;
- CMString str = GetWord(pmsg->parameters[1].c_str(), 0);
+ CMStringW str = GetWord(pmsg->parameters[1].c_str(), 0);
if (str[0] == '[' && str[1] == '#' && str[str.GetLength() - 1] == ']') {
str.Delete(str.GetLength() - 1, 1);
str.Delete(0, 1);
- CMString Wnd = MakeWndID(str.c_str());
+ CMStringW Wnd = MakeWndID(str.c_str());
gci.pszID = Wnd.c_str();
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci) && gci.iType == GCW_CHATROOM)
S2 = GetWord(gci.pszID, 0);
@@ -685,7 +685,7 @@ bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage* pmsg) if (IsCTCP(pmsg))
return true;
- CMString mess = pmsg->parameters[1];
+ CMStringW mess = pmsg->parameters[1];
bool bIsChannel = IsChannel(pmsg->parameters[0]);
if (pmsg->m_bIncoming && !bIsChannel) {
@@ -708,8 +708,8 @@ bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage* pmsg) PROTORECVEVENT pre = { 0 };
pre.timestamp = (DWORD)time(NULL);
pre.szMessage = mir_utf8encodeW(mess.c_str());
- setTString(hContact, "User", pmsg->prefix.sUser.c_str());
- setTString(hContact, "Host", pmsg->prefix.sHost.c_str());
+ setWString(hContact, "User", pmsg->prefix.sUser.c_str());
+ setWString(hContact, "Host", pmsg->prefix.sHost.c_str());
ProtoChainRecvMsg(hContact, &pre);
mir_free(pre.szMessage);
return true;
@@ -732,7 +732,7 @@ bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage* pmsg) bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
{
// is it a ctcp command, i e is the first and last characer of a PRIVMSG or NOTICE text ASCII 1
- CMString mess = pmsg->parameters[1];
+ CMStringW mess = pmsg->parameters[1];
if (!(mess.GetLength() > 3 && mess[0] == 1 && mess[mess.GetLength() - 1] == 1))
return false;
@@ -749,8 +749,8 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) }
// extract the type of ctcp command
- CMString ocommand = GetWord(mess.c_str(), 0);
- CMString command = GetWord(mess.c_str(), 0);
+ CMStringW ocommand = GetWord(mess.c_str(), 0);
+ CMStringW command = GetWord(mess.c_str(), 0);
command.MakeLower();
// should it be ignored?
@@ -854,15 +854,15 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) // incoming DCC request... lots of stuff happening here...
else if (pmsg->m_bIncoming && command == L"dcc") {
- CMString type = GetWord(mess.c_str(), 1);
+ CMStringW type = GetWord(mess.c_str(), 1);
type.MakeLower();
// components of a dcc message
- CMString sFile = L"";
+ CMStringW sFile = L"";
DWORD dwAdr = 0;
int iPort = 0;
unsigned __int64 dwSize = 0;
- CMString sToken = L"";
+ CMStringW sToken = L"";
bool bIsChat = (type == L"chat");
// 1. separate the dcc command into the correct pieces
@@ -878,7 +878,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) begin = mess.Find(' ', end);
if (begin >= 0) {
- CMString rest = mess.Mid(begin);
+ CMStringW rest = mess.Mid(begin);
dwAdr = wcstoul(GetWord(rest.c_str(), 0).c_str(), NULL, 10);
iPort = _wtoi(GetWord(rest.c_str(), 1).c_str());
dwSize = _wtoi64(GetWord(rest.c_str(), 2).c_str());
@@ -894,7 +894,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) // look for the part of the ctcp command that contains adress, port and size
while (!bFlag && !GetWord(mess.c_str(), index).IsEmpty()) {
- CMString sTemp;
+ CMStringW sTemp;
if (type == L"chat")
sTemp = GetWord(mess.c_str(), index - 1) + GetWord(mess.c_str(), index);
@@ -951,7 +951,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) begin = mess.Find(' ', end);
if (begin >= 0) {
- CMString rest = mess.Mid(begin);
+ CMStringW rest = mess.Mid(begin);
iPort = _wtoi(GetWord(rest.c_str(), 0).c_str());
dwSize = _wtoi(GetWord(rest.c_str(), 1).c_str());
sToken = GetWord(rest.c_str(), 2);
@@ -966,7 +966,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) // look for the part of the ctcp command that contains adress, port and size
while (!bFlag && !GetWord(mess.c_str(), index).IsEmpty()) {
- CMString sTemp = GetWord(mess.c_str(), index - 1) + GetWord(mess.c_str(), index);
+ CMStringW sTemp = GetWord(mess.c_str(), index - 1) + GetWord(mess.c_str(), index);
// if all characters are number it indicates we have found the adress, port and size parameters
int ind = 0;
@@ -1033,7 +1033,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) }
// remove path from the filename if the remote client (stupidly) sent it
- CMString sFileCorrected = sFile;
+ CMStringW sFileCorrected = sFile;
int i = sFile.ReverseFind('\\');
if (i != -1)
sFileCorrected = sFile.Mid(i + 1);
@@ -1055,7 +1055,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) }
// remove path from the filename if the remote client (stupidly) sent it
- CMString sFileCorrected = sFile;
+ CMStringW sFileCorrected = sFile;
int i = sFile.ReverseFind('\\');
if (i != -1)
sFileCorrected = sFile.Mid(i + 1);
@@ -1074,7 +1074,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) m_DCCChatIgnore == 2 && hContact &&
db_get_b(hContact, "CList", "NotOnList", 0) == 0 &&
db_get_b(hContact, "CList", "Hidden", 0) == 0) {
- CMString host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
+ CMStringW host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
CList_AddDCCChat(pmsg->prefix.sNick, host, dwAdr, iPort); // add a CHAT event to the clist
}
else {
@@ -1115,7 +1115,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) }
if (type == L"send") {
- CMString sTokenBackup = sToken;
+ CMStringW sTokenBackup = sToken;
bool bTurbo = false; // TDCC indicator
if (!sToken.IsEmpty() && sToken[sToken.GetLength() - 1] == 'T') {
@@ -1157,13 +1157,13 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) if (di->bReverse)
di->sToken = sTokenBackup;
- setTString(hContact, "User", pmsg->prefix.sUser.c_str());
- setTString(hContact, "Host", pmsg->prefix.sHost.c_str());
+ setWString(hContact, "User", pmsg->prefix.sUser.c_str());
+ setWString(hContact, "Host", pmsg->prefix.sHost.c_str());
wchar_t* tszTemp = (wchar_t*)sFile.c_str();
PROTORECVFILET pre = { 0 };
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.timestamp = (DWORD)time(NULL);
pre.fileCount = 1;
pre.files.w = &tszTemp;
@@ -1191,7 +1191,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) struct CONTACT user = { (wchar_t*)pmsg->prefix.sNick.c_str(), (wchar_t*)pmsg->prefix.sUser.c_str(), (wchar_t*)pmsg->prefix.sHost.c_str(), false, false, false };
MCONTACT hContact = CList_FindContact(&user);
if (hContact)
- setTString(hContact, "MirVer", DoColorCodes(GetWordAddress(mess.c_str(), 1), TRUE, FALSE));
+ setWString(hContact, "MirVer", DoColorCodes(GetWordAddress(mess.c_str(), 1), TRUE, FALSE));
}
// if the whois window is visible and the ctcp reply belongs to the user in it, then show the reply in the whois window
@@ -1244,7 +1244,7 @@ bool CIrcProto::OnIrc_NAMES(const CIrcMessage* pmsg) bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1) {
- CMString name = L"a";
+ CMStringW name = L"a";
int i = 0;
BOOL bFlag = false;
@@ -1270,7 +1270,7 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg) sChanName++;
// Add a new chat window
- CMString sID = MakeWndID(sChanName);
+ CMStringW sID = MakeWndID(sChanName);
BYTE btOwnMode = 0;
GCSESSION gcw = { sizeof(gcw) };
@@ -1300,12 +1300,12 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg) CallChatEvent(0, (LPARAM)&gce);
{
int k = 0;
- CMString sTemp = GetWord(sNamesList.c_str(), k);
+ CMStringW sTemp = GetWord(sNamesList.c_str(), k);
// Fill the nicklist
while (!sTemp.IsEmpty()) {
- CMString sStat;
- CMString sTemp2 = sTemp;
+ CMStringW sStat;
+ CMStringW sTemp2 = sTemp;
sStat = PrefixToStatus(sTemp[0]);
// fix for networks like freshirc where they allow more than one prefix
@@ -1386,16 +1386,16 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg) gce.time = time(0);
gce.pDest = &gcd;
- if (!getTString("JTemp", &dbv)) {
- CMString command = L"a";
- CMString save = L"";
+ if (!getWString("JTemp", &dbv)) {
+ CMStringW command = L"a";
+ CMStringW save = L"";
int k = 0;
while (!command.IsEmpty()) {
command = GetWord(dbv.ptszVal, k);
k++;
if (!command.IsEmpty()) {
- CMString S = command.Mid(1);
+ CMStringW S = command.Mid(1);
if (!mir_wstrcmpi(sChanName, S))
break;
@@ -1422,7 +1422,7 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg) if (save.IsEmpty())
db_unset(NULL, m_szModuleName, "JTemp");
else
- setTString("JTemp", save.c_str());
+ setWString("JTemp", save.c_str());
db_free(&dbv);
}
else CallChatEvent(SESSION_INITDONE, (LPARAM)&gce);
@@ -1533,7 +1533,7 @@ bool CIrcProto::OnIrc_LIST(const CIrcMessage* pmsg) }
lvItem.iSubItem = 3;
- CMString S = DoColorCodes(temp, TRUE, FALSE);
+ CMStringW S = DoColorCodes(temp, TRUE, FALSE);
lvItem.pszText = (wchar_t*)S.c_str();
ListView_SetItem(hListView, &lvItem);
temp = save;
@@ -1587,7 +1587,7 @@ bool CIrcProto::OnIrc_BANLIST(const CIrcMessage* pmsg) m_managerDlg->m_radio2.GetState() && pmsg->sCommand == L"346" ||
m_managerDlg->m_radio3.GetState() && pmsg->sCommand == L"348") &&
!m_managerDlg->m_radio1.Enabled() && !m_managerDlg->m_radio2.Enabled() && !m_managerDlg->m_radio3.Enabled()) {
- CMString S = pmsg->parameters[2];
+ CMStringW S = pmsg->parameters[2];
if (pmsg->parameters.getCount() > 3) {
S += L" - ";
S += pmsg->parameters[3];
@@ -1767,21 +1767,21 @@ bool CIrcProto::OnIrc_WHOIS_NO_USER(const CIrcMessage* pmsg) CONTACT user = { (wchar_t*)pmsg->parameters[1].c_str(), NULL, NULL, false, false, false };
MCONTACT hContact = CList_FindContact(&user);
if (hContact) {
- AddOutgoingMessageToDB(hContact, (wchar_t*)((CMString)L"> " + pmsg->parameters[2] + (CMString)L": " + pmsg->parameters[1]).c_str());
+ AddOutgoingMessageToDB(hContact, (wchar_t*)((CMStringW)L"> " + pmsg->parameters[2] + (CMStringW)L": " + pmsg->parameters[1]).c_str());
DBVARIANT dbv;
- if (!getTString(hContact, "Default", &dbv)) {
- setTString(hContact, "Nick", dbv.ptszVal);
+ if (!getWString(hContact, "Default", &dbv)) {
+ setWString(hContact, "Nick", dbv.ptszVal);
DBVARIANT dbv2;
if (getByte(hContact, "AdvancedMode", 0) == 0)
- DoUserhostWithReason(1, ((CMString)L"S" + dbv.ptszVal).c_str(), true, dbv.ptszVal);
+ DoUserhostWithReason(1, ((CMStringW)L"S" + dbv.ptszVal).c_str(), true, dbv.ptszVal);
else {
- if (!getTString(hContact, "UWildcard", &dbv2)) {
- DoUserhostWithReason(2, ((CMString)L"S" + dbv2.ptszVal).c_str(), true, dbv2.ptszVal);
+ if (!getWString(hContact, "UWildcard", &dbv2)) {
+ DoUserhostWithReason(2, ((CMStringW)L"S" + dbv2.ptszVal).c_str(), true, dbv2.ptszVal);
db_free(&dbv2);
}
- else DoUserhostWithReason(2, ((CMString)L"S" + dbv.ptszVal).c_str(), true, dbv.ptszVal);
+ else DoUserhostWithReason(2, ((CMStringW)L"S" + dbv.ptszVal).c_str(), true, dbv.ptszVal);
}
setString(hContact, "User", "");
setString(hContact, "Host", "");
@@ -1833,9 +1833,9 @@ bool CIrcProto::OnIrc_JOINERROR(const CIrcMessage* pmsg) {
if (pmsg->m_bIncoming) {
DBVARIANT dbv;
- if (!getTString("JTemp", &dbv)) {
- CMString command = L"a";
- CMString save = L"";
+ if (!getWString("JTemp", &dbv)) {
+ CMStringW command = L"a";
+ CMStringW save = L"";
int i = 0;
while (!command.IsEmpty()) {
@@ -1851,7 +1851,7 @@ bool CIrcProto::OnIrc_JOINERROR(const CIrcMessage* pmsg) if (save.IsEmpty())
db_unset(NULL, m_szModuleName, "JTemp");
else
- setTString("JTemp", save.c_str());
+ setWString("JTemp", save.c_str());
}
}
@@ -1899,7 +1899,7 @@ bool CIrcProto::OnIrc_ERROR(const CIrcMessage* pmsg) msn.szProto = m_szModuleName;
msn.tszInfoTitle = TranslateT("IRC error");
- CMString S;
+ CMStringW S;
if (pmsg->parameters.getCount() > 0)
S = DoColorCodes(pmsg->parameters[0].c_str(), TRUE, FALSE);
else
@@ -1916,13 +1916,13 @@ bool CIrcProto::OnIrc_ERROR(const CIrcMessage* pmsg) bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg)
{
- CMString command = GetNextUserhostReason(2);
+ CMStringW command = GetNextUserhostReason(2);
if (command[0] == 'S') {
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1) {
// is it a channel?
if (IsChannel(pmsg->parameters[1])) {
- CMString S;
- CMString User = GetWord(m_whoReply.c_str(), 0);
+ CMStringW S;
+ CMStringW User = GetWord(m_whoReply.c_str(), 0);
while (!User.IsEmpty()) {
if (GetWord(m_whoReply.c_str(), 3)[0] == 'G') {
S += User;
@@ -1931,7 +1931,7 @@ bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg) }
else DoEvent(GC_EVENT_SETCONTACTSTATUS, pmsg->parameters[1].c_str(), User.c_str(), NULL, NULL, NULL, ID_STATUS_ONLINE, FALSE, FALSE);
- CMString SS = GetWordAddress(m_whoReply.c_str(), 4);
+ CMStringW SS = GetWordAddress(m_whoReply.c_str(), 4);
if (SS.IsEmpty())
break;
m_whoReply = SS;
@@ -1950,20 +1950,20 @@ bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg) MCONTACT hContact = CList_FindContact(&ccUser);
if (hContact && getByte(hContact, "AdvancedMode", 0) == 1) {
- ptrW DBHost(getTStringA(hContact, "UHost"));
- ptrW DBNick(getTStringA(hContact, "Nick"));
- ptrW DBUser(getTStringA(hContact, "UUser"));
- ptrW DBDefault(getTStringA(hContact, "Default"));
- ptrW DBManUser(getTStringA(hContact, "User"));
- ptrW DBManHost(getTStringA(hContact, "Host"));
- ptrW DBWildcard(getTStringA(hContact, "UWildcard"));
+ ptrW DBHost(getWStringA(hContact, "UHost"));
+ ptrW DBNick(getWStringA(hContact, "Nick"));
+ ptrW DBUser(getWStringA(hContact, "UUser"));
+ ptrW DBDefault(getWStringA(hContact, "Default"));
+ ptrW DBManUser(getWStringA(hContact, "User"));
+ ptrW DBManHost(getWStringA(hContact, "Host"));
+ ptrW DBWildcard(getWStringA(hContact, "UWildcard"));
if (DBWildcard)
CharLower(DBWildcard);
- CMString nick;
- CMString user;
- CMString host;
- CMString away = GetWord(p1, 3);
+ CMStringW nick;
+ CMStringW user;
+ CMStringW host;
+ CMStringW away = GetWord(p1, 3);
while (!away.IsEmpty()) {
nick = GetWord(p1, 0);
@@ -1977,11 +1977,11 @@ bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg) setWord(hContact, "Status", ID_STATUS_ONLINE);
if ((DBNick && mir_wstrcmpi(nick.c_str(), DBNick)) || !DBNick)
- setTString(hContact, "Nick", nick.c_str());
+ setWString(hContact, "Nick", nick.c_str());
if ((DBManUser && mir_wstrcmpi(user.c_str(), DBManUser)) || !DBManUser)
- setTString(hContact, "User", user.c_str());
+ setWString(hContact, "User", user.c_str());
if ((DBManHost && mir_wstrcmpi(host.c_str(), DBManHost)) || !DBManHost)
- setTString(hContact, "Host", host.c_str());
+ setWString(hContact, "Host", host.c_str());
return true;
}
p1 = GetWordAddress(p1, 4);
@@ -1989,9 +1989,9 @@ bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg) }
if (DBWildcard && DBNick && !WCCmp(CharLower(DBWildcard), CharLower(DBNick))) {
- setTString(hContact, "Nick", DBDefault);
+ setWString(hContact, "Nick", DBDefault);
- DoUserhostWithReason(2, ((CMString)L"S" + DBWildcard).c_str(), true, (wchar_t*)DBWildcard);
+ DoUserhostWithReason(2, ((CMStringW)L"S" + DBWildcard).c_str(), true, (wchar_t*)DBWildcard);
setString(hContact, "User", "");
setString(hContact, "Host", "");
@@ -2000,7 +2000,7 @@ bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg) if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) {
setWord(hContact, "Status", ID_STATUS_OFFLINE);
- setTString(hContact, "Nick", DBDefault);
+ setWString(hContact, "Nick", DBDefault);
setString(hContact, "User", "");
setString(hContact, "Host", "");
}
@@ -2013,7 +2013,7 @@ bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg) bool CIrcProto::OnIrc_WHO_REPLY(const CIrcMessage* pmsg)
{
- CMString command = PeekAtReasons(2);
+ CMStringW command = PeekAtReasons(2);
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 6 && command[0] == 'S') {
m_whoReply.AppendFormat(L"%s %s %s %s ", pmsg->parameters[5].c_str(), pmsg->parameters[2].c_str(), pmsg->parameters[3].c_str(), pmsg->parameters[6].c_str());
if (mir_wstrcmpi(pmsg->parameters[5].c_str(), m_info.sNick.c_str()) == 0) {
@@ -2030,7 +2030,7 @@ bool CIrcProto::OnIrc_WHO_REPLY(const CIrcMessage* pmsg) bool CIrcProto::OnIrc_TRYAGAIN(const CIrcMessage* pmsg)
{
- CMString command = L"";
+ CMStringW command = L"";
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1) {
if (pmsg->parameters[1] == L"WHO")
command = GetNextUserhostReason(2);
@@ -2045,27 +2045,27 @@ bool CIrcProto::OnIrc_TRYAGAIN(const CIrcMessage* pmsg) bool CIrcProto::OnIrc_USERHOST_REPLY(const CIrcMessage* pmsg)
{
- CMString command;
+ CMStringW command;
if (pmsg->m_bIncoming) {
command = GetNextUserhostReason(1);
if (!command.IsEmpty() && command != L"U" && pmsg->parameters.getCount() > 1) {
CONTACT finduser = { NULL, NULL, NULL, false, false, false };
int awaystatus = 0;
- CMString sTemp;
- CMString host;
- CMString user;
- CMString nick;
- CMString mask;
- CMString mess;
- CMString channel;
+ CMStringW sTemp;
+ CMStringW host;
+ CMStringW user;
+ CMStringW nick;
+ CMStringW mask;
+ CMStringW mess;
+ CMStringW channel;
// Status-check pre-processing: Setup check-list
- OBJLIST<CMString> checklist(10);
+ OBJLIST<CMStringW> checklist(10);
if (command[0] == 'S') {
sTemp = GetWord(command.c_str(), 0);
sTemp.Delete(0, 1);
for (int j = 1; !sTemp.IsEmpty(); j++) {
- checklist.insert(new CMString(sTemp));
+ checklist.insert(new CMStringW(sTemp));
sTemp = GetWord(command.c_str(), j);
}
}
@@ -2113,9 +2113,9 @@ bool CIrcProto::OnIrc_USERHOST_REPLY(const CIrcMessage* pmsg) MCONTACT hContact = CList_FindContact(&finduser);
if (hContact && getByte(hContact, "AdvancedMode", 0) == 0) {
setWord(hContact, "Status", awaystatus == '-' ? ID_STATUS_AWAY : ID_STATUS_ONLINE);
- setTString(hContact, "User", user.c_str());
- setTString(hContact, "Host", host.c_str());
- setTString(hContact, "Nick", nick.c_str());
+ setWString(hContact, "User", user.c_str());
+ setWString(hContact, "Host", host.c_str());
+ setWString(hContact, "Nick", nick.c_str());
// If user found, remove from checklist
for (int i = 0; i < checklist.getCount(); i++)
@@ -2128,7 +2128,7 @@ bool CIrcProto::OnIrc_USERHOST_REPLY(const CIrcMessage* pmsg) case 'I': // m_ignore
mess = L"/IGNORE %question=\"";
mess += TranslateT("Please enter the hostmask (nick!user@host)\nNOTE! Contacts on your contact list are never ignored");
- mess += (CMString)L"\",\"" + TranslateT("Ignore") + L"\",\"*!*@" + host + L"\"";
+ mess += (CMStringW)L"\",\"" + TranslateT("Ignore") + L"\",\"*!*@" + host + L"\"";
if (m_ignoreChannelDefault)
mess += L" +qnidcm";
else
@@ -2201,7 +2201,7 @@ bool CIrcProto::OnIrc_SUPPORT(const CIrcMessage* pmsg) DoOnConnect(pmsg);
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 0) {
- CMString S;
+ CMStringW S;
for (int i = 0; i < pmsg->parameters.getCount(); i++) {
wchar_t* temp = mir_wstrdup(pmsg->parameters[i].c_str());
if (wcsstr(temp, L"CHANTYPES=")) {
@@ -2286,7 +2286,7 @@ void CIrcProto::OnIrcDisconnected() m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)Temp, ID_STATUS_OFFLINE);
- CMString sDisconn = L"\035\002";
+ CMStringW sDisconn = L"\035\002";
sDisconn += TranslateT("*Disconnected*");
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, sDisconn.c_str(), NULL, NULL, NULL, true, false);
@@ -2299,7 +2299,7 @@ void CIrcProto::OnIrcDisconnected() // restore the original nick, cause it might be changed
memcpy(m_nick, m_pNick, sizeof(m_nick));
- setTString("Nick", m_pNick);
+ setWString("Nick", m_pNick);
Menu_EnableItem(hMenuJoin, false);
Menu_EnableItem(hMenuList, false);
@@ -2393,7 +2393,7 @@ int CIrcProto::DoPerform(const char* event) sSetting.MakeUpper();
DBVARIANT dbv;
- if (!getTString(sSetting.c_str(), &dbv)) {
+ if (!getWString(sSetting.c_str(), &dbv)) {
if (!my_strstri(dbv.ptszVal, L"/away"))
PostIrcMessageWnd(NULL, NULL, dbv.ptszVal);
else
@@ -2404,12 +2404,12 @@ int CIrcProto::DoPerform(const char* event) return 0;
}
-int CIrcProto::IsIgnored(const CMString& nick, const CMString& address, const CMString& host, char type)
+int CIrcProto::IsIgnored(const CMStringW& nick, const CMStringW& address, const CMStringW& host, char type)
{
return IsIgnored(nick + L"!" + address + L"@" + host, type);
}
-int CIrcProto::IsIgnored(CMString user, char type)
+int CIrcProto::IsIgnored(CMStringW user, char type)
{
for (int i = 0; i < m_ignoreItems.getCount(); i++) {
const CIrcIgnoreItem& C = m_ignoreItems[i];
@@ -2440,7 +2440,7 @@ int CIrcProto::IsIgnored(CMString user, char type) bool CIrcProto::AddIgnore(const wchar_t* mask, const wchar_t* flags, const wchar_t* network)
{
RemoveIgnore(mask);
- m_ignoreItems.insert(new CIrcIgnoreItem(mask, (L"+" + CMString(flags)).c_str(), network));
+ m_ignoreItems.insert(new CIrcIgnoreItem(mask, (L"+" + CMStringW(flags)).c_str(), network));
RewriteIgnoreSettings();
if (m_ignoreDlg)
diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp index c8deea034a..cbe0852a7c 100644 --- a/protocols/IRCG/src/input.cpp +++ b/protocols/IRCG/src/input.cpp @@ -24,19 +24,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define NICKSUBSTITUTE L"!_nick_!"
-void CIrcProto::FormatMsg(CMString& text)
+void CIrcProto::FormatMsg(CMStringW& text)
{
wchar_t temp[30];
mir_wstrncpy(temp, GetWord(text.c_str(), 0).c_str(), 29);
CharLower(temp);
- CMString command = temp;
- CMString S = L"";
+ CMStringW command = temp;
+ CMStringW S = L"";
if (command == L"/quit" || command == L"/away")
S = GetWord(text.c_str(), 0) + L" :" + GetWordAddress(text.c_str(), 1);
else if (command == L"/privmsg" || command == L"/part" || command == L"/topic" || command == L"/notice") {
S = GetWord(text.c_str(), 0) + L" " + GetWord(text.c_str(), 1) + L" :";
if (!GetWord(text.c_str(), 2).IsEmpty())
- S += CMString(GetWordAddress(text.c_str(), 2));
+ S += CMStringW(GetWordAddress(text.c_str(), 2));
}
else if (command == L"/kick") {
S = GetWord(text.c_str(), 0) + L" " + GetWord(text.c_str(), 1) + L" " + GetWord(text.c_str(), 2) + L" :" + GetWordAddress(text.c_str(), 3);
@@ -47,10 +47,10 @@ void CIrcProto::FormatMsg(CMString& text) S = GetWordAddress(text.c_str(), 0);
}
else {
- CMString sNewNick = GetWord(text.c_str(), 1);
+ CMStringW sNewNick = GetWord(text.c_str(), 1);
if (sNick4Perform == L"") {
DBVARIANT dbv;
- if (!getTString("PNick", &dbv)) {
+ if (!getWString("PNick", &dbv)) {
sNick4Perform = dbv.ptszVal;
db_free(&dbv);
}
@@ -66,15 +66,15 @@ void CIrcProto::FormatMsg(CMString& text) text = S;
}
-static void AddCR(CMString& text)
+static void AddCR(CMStringW& text)
{
text.Replace(L"\n", L"\r\n");
text.Replace(L"\r\r", L"\r");
}
-CMString CIrcProto::DoAlias(const wchar_t *text, wchar_t *window)
+CMStringW CIrcProto::DoAlias(const wchar_t *text, wchar_t *window)
{
- CMString Messageout = L"";
+ CMStringW Messageout = L"";
const wchar_t* p1 = text;
const wchar_t* p2 = text;
bool LinebreakFlag = false, hasAlias = false;
@@ -82,7 +82,7 @@ CMString CIrcProto::DoAlias(const wchar_t *text, wchar_t *window) if (!p2)
p2 = wcschr(p1, '\0');
if (p1 == p2)
- return (CMString)text;
+ return (CMStringW)text;
do {
if (LinebreakFlag)
@@ -95,14 +95,14 @@ CMString CIrcProto::DoAlias(const wchar_t *text, wchar_t *window) test++;
if (*test == '/') {
mir_wstrncpy(line, GetWordAddress(line, 0), p2 - p1 + 1);
- CMString S = line;
+ CMStringW S = line;
delete[] line;
line = new wchar_t[S.GetLength() + 2];
mir_wstrncpy(line, S.c_str(), S.GetLength() + 1);
- CMString alias(m_alias);
+ CMStringW alias(m_alias);
const wchar_t* p3 = wcsstr(alias.c_str(), (GetWord(line, 0) + L" ").c_str());
if (p3 != alias.c_str()) {
- CMString str = L"\r\n";
+ CMStringW str = L"\r\n";
str += GetWord(line, 0) + L" ";
p3 = wcsstr(alias.c_str(), str.c_str());
if (p3)
@@ -115,7 +115,7 @@ CMString CIrcProto::DoAlias(const wchar_t *text, wchar_t *window) p4 = wcschr(p3, '\0');
*(wchar_t*)p4 = 0;
- CMString str = p3;
+ CMStringW str = p3;
str.Replace(L"##", window);
str.Replace(L"$?", L"%question");
@@ -125,7 +125,7 @@ CMString CIrcProto::DoAlias(const wchar_t *text, wchar_t *window) if (!GetWord(line, index).IsEmpty() && IsChannel(GetWord(line, index)))
str.Replace(buf, GetWord(line, index).c_str());
else {
- CMString S1 = L"#";
+ CMStringW S1 = L"#";
S1 += GetWord(line, index);
str.Replace(buf, S1.c_str());
}
@@ -158,7 +158,7 @@ CMString CIrcProto::DoAlias(const wchar_t *text, wchar_t *window) return hasAlias ? DoIdentifiers(Messageout, window) : Messageout;
}
-CMString CIrcProto::DoIdentifiers(CMString text, const wchar_t*)
+CMStringW CIrcProto::DoIdentifiers(CMStringW text, const wchar_t*)
{
SYSTEMTIME time;
wchar_t str[2];
@@ -209,13 +209,13 @@ static void __stdcall sttSetTimerOff(void* _pro) ppro->KillChatTimer(ppro->OnlineNotifTimer3);
}
-BOOL CIrcProto::DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hContact)
+BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hContact)
{
- CMString command(GetWord(text, 0)); command.MakeLower();
- CMString one = GetWord(text, 1);
- CMString two = GetWord(text, 2);
- CMString three = GetWord(text, 3);
- CMString therest = GetWordAddress(text, 4);
+ CMStringW command(GetWord(text, 0)); command.MakeLower();
+ CMStringW one = GetWord(text, 1);
+ CMStringW two = GetWord(text, 2);
+ CMStringW three = GetWord(text, 3);
+ CMStringW therest = GetWordAddress(text, 4);
if (command == L"/servershow" || command == L"/serverhide") {
if (m_useServer) {
@@ -238,7 +238,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hCon }
if (command == L"/clear") {
- CMString S;
+ CMStringW S;
if (!one.IsEmpty()) {
if (one == L"server")
S = SERVERWINDOW;
@@ -258,7 +258,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hCon if (command == L"/ignore") {
if (IsConnected()) {
- CMString IgnoreFlags;
+ CMStringW IgnoreFlags;
wchar_t temp[500];
if (one.IsEmpty()) {
if (m_ignore)
@@ -296,7 +296,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hCon }
else IgnoreFlags = L"qnidc";
- CMString szNetwork;
+ CMStringW szNetwork;
if (three.IsEmpty())
szNetwork = m_info.sNetwork;
else
@@ -334,7 +334,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hCon if (command == L"/joinx") {
if (!one.IsEmpty()) {
for (int i = 1;; i++) {
- CMString tmp = GetWord(text, i);
+ CMStringW tmp = GetWord(text, i);
if (tmp.IsEmpty())
break;
@@ -349,7 +349,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hCon if (command == L"/joinm") {
if (!one.IsEmpty()) {
for (int i = 1;; i++) {
- CMString tmp = GetWord(text, i);
+ CMStringW tmp = GetWord(text, i);
if (tmp.IsEmpty())
break;
@@ -363,7 +363,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hCon if (command == L"/nusers") {
wchar_t szTemp[40];
- CMString S = MakeWndID(window);
+ CMStringW S = MakeWndID(window);
GC_INFO gci = { 0 };
gci.Flags = GCF_BYID | GCF_NAME | GCF_COUNT;
gci.pszModule = m_szModuleName;
@@ -474,7 +474,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hCon return true;
}
- CMString S = MakeWndID(window);
+ CMStringW S = MakeWndID(window);
GCDEST gcd = { m_szModuleName, S.c_str(), GC_EVENT_CONTROL };
GCEVENT gce = { sizeof(gce), &gcd };
CallChatEvent(SESSION_TERMINATE, (LPARAM)&gce);
@@ -492,7 +492,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hCon int minutes = (int)m_noOfChannels / 4000;
int minutes2 = (int)m_noOfChannels / 9000;
- CMString szMsg(FORMAT, TranslateT("This command is not recommended on a network of this size!\r\nIt will probably cause high CPU usage and/or high bandwidth\r\nusage for around %u to %u minute(s).\r\n\r\nDo you want to continue?"), minutes2, minutes);
+ CMStringW szMsg(FORMAT, TranslateT("This command is not recommended on a network of this size!\r\nIt will probably cause high CPU usage and/or high bandwidth\r\nusage for around %u to %u minute(s).\r\n\r\nDo you want to continue?"), minutes2, minutes);
if (m_noOfChannels < 4000 || (m_noOfChannels >= 4000 && MessageBox(NULL, szMsg, TranslateT("IRC warning"), MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2) == IDYES)) {
ListView_DeleteAllItems(GetDlgItem(m_listDlg->GetHwnd(), IDC_INFO_LISTVIEW));
PostIrcMessage(L"/lusers");
@@ -516,7 +516,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hCon if (one.IsEmpty())
return true;
- CMString S = L"/ME " + DoIdentifiers(GetWordAddress(text.c_str(), 1), window);
+ CMStringW S = L"/ME " + DoIdentifiers(GetWordAddress(text.c_str(), 1), window);
S.Replace(L"%", L"%%");
DoEvent(GC_EVENT_SENDMESSAGE, NULL, NULL, S.c_str(), NULL, NULL, NULL, FALSE, FALSE);
return true;
@@ -526,7 +526,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hCon if (one.IsEmpty())
return true;
- CMString S = DoIdentifiers(GetWordAddress(text.c_str(), 1), window);
+ CMStringW S = DoIdentifiers(GetWordAddress(text.c_str(), 1), window);
S.Replace(L"%", L"%%");
DoEvent(GC_EVENT_SENDMESSAGE, NULL, NULL, S.c_str(), NULL, NULL, NULL, FALSE, FALSE);
return true;
@@ -554,14 +554,14 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hCon DoUserhostWithReason(1, (L"S" + one).c_str(), true, one.c_str());
else {
DBVARIANT dbv1;
- if (!getTString(hContact, "UWildcard", &dbv1)) {
- CMString S = L"S";
+ if (!getWString(hContact, "UWildcard", &dbv1)) {
+ CMStringW S = L"S";
S += dbv1.ptszVal;
DoUserhostWithReason(2, S.c_str(), true, dbv1.ptszVal);
db_free(&dbv1);
}
else {
- CMString S = L"S";
+ CMStringW S = L"S";
S += one;
DoUserhostWithReason(2, S.c_str(), true, one.c_str());
}
@@ -623,14 +623,14 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hCon CONTACT user = { (wchar_t*)two.c_str(), NULL, NULL, false, false, true };
MCONTACT ccNew = CList_AddContact(&user, false, false);
if (ccNew) {
- CMString s;
+ CMStringW s;
if (getByte(ccNew, "AdvancedMode", 0) == 0)
DoUserhostWithReason(1, (L"S" + two).c_str(), true, two.c_str());
else {
DBVARIANT dbv1;
- CMString S = L"S";
- if (!getTString(ccNew, "UWildcard", &dbv1)) {
+ CMStringW S = L"S";
+ if (!getWString(ccNew, "UWildcard", &dbv1)) {
S += dbv1.ptszVal;
DoUserhostWithReason(2, S.c_str(), true, dbv1.ptszVal);
db_free(&dbv1);
@@ -644,7 +644,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hCon if (three.IsEmpty())
CallService(MS_FILE_SENDFILE, ccNew, 0);
else {
- CMString temp = GetWordAddress(text.c_str(), 3);
+ CMStringW temp = GetWordAddress(text.c_str(), 3);
wchar_t* pp[2];
wchar_t* p = (wchar_t*)temp.c_str();
pp[0] = p;
@@ -670,7 +670,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hCon ulAdr = ConvertIPToInteger(m_IPFromServer ? m_myHost : m_myLocalHost);
if (ulAdr) {
- CMString contact = two; contact += DCCSTRING;
+ CMStringW contact = two; contact += DCCSTRING;
CONTACT user = { (wchar_t*)contact.c_str(), NULL, NULL, false, false, true };
MCONTACT ccNew = CList_AddContact(&user, false, false);
setByte(ccNew, "DCC", 1);
@@ -733,7 +733,7 @@ static void __stdcall DoInputRequestAliasApcStub(void* _par) wchar_t* infotext = NULL;
wchar_t* title = NULL;
wchar_t* defaulttext = NULL;
- CMString command = (wchar_t*)str;
+ CMStringW command = (wchar_t*)str;
wchar_t* p = wcsstr((wchar_t*)str, L"%question");
if (p[9] == '=' && p[10] == '\"') {
infotext = &p[11];
@@ -810,7 +810,7 @@ bool CIrcProto::PostIrcMessageWnd(wchar_t *window, MCONTACT hContact, const wcha if (!IsConnected() && !bDCC || !szBuf || mir_wstrlen(szBuf) < 1)
return 0;
- if (hContact && !getTString(hContact, "Nick", &dbv)) {
+ if (hContact && !getWString(hContact, "Nick", &dbv)) {
mir_wstrncpy(windowname, dbv.ptszVal, 255);
db_free(&dbv);
}
@@ -826,7 +826,7 @@ bool CIrcProto::PostIrcMessageWnd(wchar_t *window, MCONTACT hContact, const wcha }
// remove unecessary linebreaks, and do the aliases
- CMString Message = szBuf;
+ CMStringW Message = szBuf;
AddCR(Message);
RemoveLinebreaks(Message);
if (!hContact && IsConnected()) {
@@ -851,7 +851,7 @@ bool CIrcProto::PostIrcMessageWnd(wchar_t *window, MCONTACT hContact, const wcha while (!Message.IsEmpty()) {
// split the text into lines, and do an automatic textsplit on long lies as well
bool flag = false;
- CMString DoThis = L"";
+ CMStringW DoThis = L"";
int index = Message.Find(L"\r\n", 0);
if (index == -1)
index = Message.GetLength();
@@ -868,7 +868,7 @@ bool CIrcProto::PostIrcMessageWnd(wchar_t *window, MCONTACT hContact, const wcha if (GetWord(DoThis.c_str(), 1).IsEmpty())
continue;
- CMString S = GetWordAddress(DoThis.c_str(), 1);
+ CMStringW S = GetWordAddress(DoThis.c_str(), 1);
SendIrcMessage(S.c_str(), true, cp);
continue;
}
@@ -877,11 +877,11 @@ bool CIrcProto::PostIrcMessageWnd(wchar_t *window, MCONTACT hContact, const wcha if ((GetWord(DoThis.c_str(), 0)[0] != '/') || // not a command
((GetWord(DoThis.c_str(), 0)[0] == '/') && (GetWord(DoThis.c_str(), 0)[1] == '/')) || // or double backslash at the beginning
hContact) {
- CMString S = L"/PRIVMSG ";
+ CMStringW S = L"/PRIVMSG ";
if (mir_wstrcmpi(window, SERVERWINDOW) == 0 && !m_info.sServerName.IsEmpty())
S += m_info.sServerName + L" " + DoThis;
else
- S += CMString(windowname) + L" " + DoThis;
+ S += CMStringW(windowname) + L" " + DoThis;
DoThis = S;
flag = true;
@@ -902,7 +902,7 @@ bool CIrcProto::PostIrcMessageWnd(wchar_t *window, MCONTACT hContact, const wcha CDccSession* dcc = FindDCCSession(hContact);
if (dcc) {
FormatMsg(DoThis);
- CMString mess = GetWordAddress(DoThis.c_str(), 2);
+ CMStringW mess = GetWordAddress(DoThis.c_str(), 2);
if (mess[0] == ':')
mess.Delete(0, 1);
mess += '\n';
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index ab4430ad42..d734c12ee4 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -59,7 +59,7 @@ CIrcMessage::CIrcMessage(const CIrcMessage& m) : prefix.sHost = m.prefix.sHost; for (int i = 0; i < m.parameters.getCount(); i++) - parameters.insert(new CMString(m.parameters[i])); + parameters.insert(new CMStringW(m.parameters[i])); } CIrcMessage::~CIrcMessage() @@ -145,14 +145,14 @@ end_of_prefix: // seek end-of-message while (*p2) ++p2; - parameters.insert(new CMString(p1, p2 - p1)); + parameters.insert(new CMStringW(p1, p2 - p1)); break; } else { // seek end of parameter while (*p2 && *p2 != ' ') ++p2; - parameters.insert(new CMString(p1, p2 - p1)); + parameters.insert(new CMStringW(p1, p2 - p1)); // see next parameter while (*p2 && *p2 == ' ') ++p2; @@ -232,11 +232,11 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info) NLSend("PASS %s\r\n", info.sPassword.c_str()); NLSend(L"NICK %s\r\n", info.sNick.c_str()); - CMString userID = GetWord(info.sUserID.c_str(), 0); + CMStringW userID = GetWord(info.sUserID.c_str(), 0); wchar_t szHostName[MAX_PATH]; DWORD cbHostName = _countof(szHostName); GetComputerName(szHostName, &cbHostName); - CMString HostName = GetWord(szHostName, 0); + CMStringW HostName = GetWord(szHostName, 0); if (userID.IsEmpty()) userID = L"Miranda"; if (HostName.IsEmpty()) @@ -525,7 +525,7 @@ CDccSession* CIrcProto::FindDCCRecvByPortAndName(int iPort, const wchar_t* szNam for (int i = 0; i < m_dcc_xfers.getCount(); i++) { CDccSession* p = m_dcc_xfers[i]; DBVARIANT dbv; - if (!getTString(p->di->hContact, "Nick", &dbv)) { + if (!getWString(p->di->hContact, "Nick", &dbv)) { if (p->di->iType == DCC_SEND && !p->di->bSender && !mir_wstrcmpi(szName, dbv.ptszVal) && iPort == p->di->iPort) { db_free(&dbv); return p; @@ -548,7 +548,7 @@ CDccSession* CIrcProto::FindPassiveDCCSend(int iToken) return 0; } -CDccSession* CIrcProto::FindPassiveDCCRecv(CMString sName, CMString sToken) +CDccSession* CIrcProto::FindPassiveDCCRecv(CMStringW sName, CMStringW sToken) { mir_cslock lck(m_dcc); @@ -867,7 +867,7 @@ int CDccSession::SetupConnection() pfts.tszCurrentFile = (wchar_t*)di->sFileAndPath.c_str(); pfts.tszWorkingDir = (wchar_t*)di->sPath.c_str(); pfts.hContact = di->hContact; - pfts.flags = PFTS_TCHAR + ((di->bSender) ? PFTS_SENDING : PFTS_RECEIVING); + pfts.flags = PFTS_UNICODE + ((di->bSender) ? PFTS_SENDING : PFTS_RECEIVING); pfts.totalFiles = 1; pfts.currentFileNumber = 0; pfts.totalBytes = di->dwSize; @@ -974,7 +974,7 @@ int CDccSession::SetupConnection() di->iPort = nb.wPort; // store the port internally so it is possible to search for it (for resuming of filetransfers purposes) - CMString sFileWithQuotes = di->sFile; + CMStringW sFileWithQuotes = di->sFile; // if spaces in the filename surround with quotes if (sFileWithQuotes.Find(' ', 0) != -1) { diff --git a/protocols/IRCG/src/irclib.h b/protocols/IRCG/src/irclib.h index 069c545a12..4e46810551 100644 --- a/protocols/IRCG/src/irclib.h +++ b/protocols/IRCG/src/irclib.h @@ -38,18 +38,18 @@ struct DCCINFO : public MZeroedObject DWORD dwAdr;
unsigned __int64 dwSize;
DWORD iType;
- CMString sToken;
+ CMStringW sToken;
int iPort;
BOOL bTurbo;
BOOL bSSL;
BOOL bSender;
BOOL bReverse;
- CMString sPath;
- CMString sFile;
- CMString sFileAndPath;
- CMString sHostmask;
+ CMStringW sPath;
+ CMStringW sFile;
+ CMStringW sFileAndPath;
+ CMStringW sHostmask;
MCONTACT hContact;
- CMString sContactName;
+ CMStringW sContactName;
};
class CIrcMessage
@@ -57,13 +57,13 @@ class CIrcMessage public :
struct Prefix
{
- CMString sNick, sUser, sHost;
+ CMStringW sNick, sUser, sHost;
}
prefix;
CIrcProto* m_proto;
- CMString sCommand;
- OBJLIST<CMString> parameters;
+ CMStringW sCommand;
+ OBJLIST<CMStringW> parameters;
bool m_bIncoming;
bool m_bNotify;
int m_codePage;
@@ -87,13 +87,13 @@ private : struct CIrcSessionInfo
{
CMStringA sServer;
- CMString sServerName;
- CMString sNick;
- CMString sUserID;
- CMString sFullName;
+ CMStringW sServerName;
+ CMStringW sNick;
+ CMStringW sUserID;
+ CMStringW sFullName;
CMStringA sPassword;
- CMString sIdentServerType;
- CMString sNetwork;
+ CMStringW sIdentServerType;
+ CMStringW sNetwork;
bool bIdentServer;
bool bNickFlag;
int m_iSSL;
@@ -114,7 +114,7 @@ struct CIrcIgnoreItem CIrcIgnoreItem( int codepage, const char*, const char*, const char* );
~CIrcIgnoreItem();
- CMString mask, flags, network;
+ CMStringW mask, flags, network;
};
////////////////////////////////////////////////////////////////////
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index 2d3b16f50f..222691d3d7 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -179,13 +179,13 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM) db_unset(NULL, m_szModuleName, "JTemp");
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
mir_snwprintf(name, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = name;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
- nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE;
char szTemp2[256];
mir_snprintf(szTemp2, "%s DCC", m_szModuleName);
nlu.szSettingsModule = szTemp2;
@@ -255,10 +255,10 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM) for (int i = 0; i < performToConvert.getCount(); i++) {
CMStringA s = performToConvert[i];
DBVARIANT dbv;
- if (!getTString(s, &dbv)) {
+ if (!getWString(s, &dbv)) {
db_unset(NULL, m_szModuleName, s);
s.MakeUpper();
- setTString(s, dbv.ptszVal);
+ setWString(s, dbv.ptszVal);
db_free(&dbv);
}
}
@@ -275,13 +275,13 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM) wchar_t szBuf[40];
if (mir_wstrlen(m_alternativeNick) == 0) {
mir_snwprintf(szBuf, L"%s%u", m_nick, rand() % 9999);
- setTString("AlernativeNick", szBuf);
+ setWString("AlernativeNick", szBuf);
mir_wstrncpy(m_alternativeNick, szBuf, 30);
}
if (mir_wstrlen(m_name) == 0) {
mir_snwprintf(szBuf, L"Miranda%u", rand() % 9999);
- setTString("Name", szBuf);
+ setWString("Name", szBuf);
mir_wstrncpy(m_name, szBuf, 200);
}
}
@@ -305,14 +305,14 @@ MCONTACT __cdecl CIrcProto::AddToList(int, PROTOSEARCHRESULT* psr) if (hContact) {
DBVARIANT dbv1;
- CMString S = L"S";
+ CMStringW S = L"S";
if (getByte(hContact, "AdvancedMode", 0) == 0) {
S += user.name;
DoUserhostWithReason(1, S, true, user.name);
}
else {
- if (!getTString(hContact, "UWildcard", &dbv1)) {
+ if (!getWString(hContact, "UWildcard", &dbv1)) {
S += dbv1.ptszVal;
DoUserhostWithReason(2, S, true, dbv1.ptszVal);
db_free(&dbv1);
@@ -417,7 +417,7 @@ int __cdecl CIrcProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** if (_wstat64(di->sFileAndPath.c_str(), &statbuf) == 0 && (statbuf.st_mode & _S_IFDIR) == 0)
dwPos = statbuf.st_size;
- CMString sFileWithQuotes = di->sFile;
+ CMStringW sFileWithQuotes = di->sFile;
// if spaces in the filename surround witrh quotes
if (sFileWithQuotes.Find(' ', 0) != -1) {
@@ -484,7 +484,7 @@ void __cdecl CIrcProto::AckBasicSearch(void *arg) AckBasicSearchParam *param = (AckBasicSearchParam*)arg;
PROTOSEARCHRESULT psr = { sizeof(psr) };
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.id.w = psr.nick.w = param->buf;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)& psr);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)1, 0);
@@ -550,7 +550,7 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t** }
DBVARIANT dbv;
- if (!getTString(hContact, "Nick", &dbv)) {
+ if (!getWString(hContact, "Nick", &dbv)) {
// set up a basic DCCINFO struct and pass it to a DCC object
dci = new DCCINFO;
dci->sFileAndPath = ppszFiles[index];
@@ -561,7 +561,7 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t** dci->sFile = dci->sFileAndPath.Mid(i + 1);
}
- CMString sFileWithQuotes = dci->sFile;
+ CMStringW sFileWithQuotes = dci->sFile;
// if spaces in the filename surround witrh quotes
if (sFileWithQuotes.Find(' ', 0) != -1) {
@@ -583,7 +583,7 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t** AddDCCSession(dci, dcc);
// need to make sure that %'s are doubled to avoid having chat interpret as color codes
- CMString sFileCorrect = dci->sFile;
+ CMStringW sFileCorrect = dci->sFile;
sFileCorrect.Replace(L"%", L"%%");
// is it an reverse filetransfer (receiver acts as server)
@@ -786,13 +786,13 @@ HANDLE __cdecl CIrcProto::GetAwayMsg(MCONTACT hContact) // bypass chat contacts.
if (!isChatRoom(hContact)) {
- if (hContact && !getTString(hContact, "Nick", &dbv)) {
+ if (hContact && !getWString(hContact, "Nick", &dbv)) {
int i = getWord(hContact, "Status", ID_STATUS_OFFLINE);
if (i != ID_STATUS_AWAY) {
db_free(&dbv);
return 0;
}
- CMString S = L"WHOIS ";
+ CMStringW S = L"WHOIS ";
S += dbv.ptszVal;
if (IsConnected())
SendIrcMessage(S.c_str(), false);
@@ -814,7 +814,7 @@ int __cdecl CIrcProto::SetAwayMsg(int status, const wchar_t* msg) break;
default:
- CMString newStatus = msg;
+ CMStringW newStatus = msg;
newStatus.Replace(L"\r\n", L" ");
if (m_statusMessage.IsEmpty() || msg == NULL || m_statusMessage != newStatus) {
if (msg == NULL || *msg == 0)
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index 9102b14c3a..940251a7ca 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -59,8 +59,8 @@ void CIrcProto::ReadSettings(TDbSetting* sets, int count) *(char**)ptr = NULL;
}
break;
- case DBVT_TCHAR:
- if (!getTString(p->name, &dbv)) {
+ case DBVT_WCHAR:
+ if (!getWString(p->name, &dbv)) {
if (p->size != -1) {
size_t len = min(p->size - 1, mir_wstrlen(dbv.ptszVal));
memcpy(ptr, dbv.pszVal, len*sizeof(wchar_t));
@@ -100,11 +100,11 @@ void CIrcProto::WriteSettings( TDbSetting* sets, int count ) setString(p->name, (char*)ptr);
break;
- case DBVT_TCHAR:
+ case DBVT_WCHAR:
if (p->size == -1)
- setTString(p->name, *(wchar_t**)ptr);
+ setWString(p->name, *(wchar_t**)ptr);
else
- setTString(p->name, (wchar_t*)ptr);
+ setWString(p->name, (wchar_t*)ptr);
break;
} } }
@@ -398,9 +398,9 @@ struct CServerDlg : public CProtoDlgBase<CIrcProto> static TDbSetting ConnectSettings[] =
{
- { FIELD_OFFSET(CIrcProto, m_userID), "UserID", DBVT_TCHAR, _countof(pZero->m_userID) },
- { FIELD_OFFSET(CIrcProto, m_identSystem), "IdentSystem", DBVT_TCHAR, _countof(pZero->m_identSystem) },
- { FIELD_OFFSET(CIrcProto, m_identPort), "IdentPort", DBVT_TCHAR, _countof(pZero->m_identPort) },
+ { FIELD_OFFSET(CIrcProto, m_userID), "UserID", DBVT_WCHAR, _countof(pZero->m_userID) },
+ { FIELD_OFFSET(CIrcProto, m_identSystem), "IdentSystem", DBVT_WCHAR, _countof(pZero->m_identSystem) },
+ { FIELD_OFFSET(CIrcProto, m_identPort), "IdentPort", DBVT_WCHAR, _countof(pZero->m_identPort) },
{ FIELD_OFFSET(CIrcProto, m_serverName ), "ServerName", DBVT_ASCIIZ, _countof(pZero->m_serverName) },
{ FIELD_OFFSET(CIrcProto, m_portStart ), "PortStart", DBVT_ASCIIZ, _countof(pZero->m_portStart) },
@@ -412,10 +412,10 @@ static TDbSetting ConnectSettings[] = { FIELD_OFFSET(CIrcProto, m_onlineNotificationTime) , "OnlineNotificationTime", DBVT_WORD, 0, 30 },
{ FIELD_OFFSET(CIrcProto, m_onlineNotificationLimit) , "OnlineNotificationLimit", DBVT_WORD, 0, 50 },
{ FIELD_OFFSET(CIrcProto, m_channelAwayNotification), "ChannelAwayNotification", DBVT_BYTE, 0, 1 },
- { FIELD_OFFSET(CIrcProto, m_nick), "Nick", DBVT_TCHAR, _countof(pZero->m_nick) },
- { FIELD_OFFSET(CIrcProto, m_pNick), "PNick", DBVT_TCHAR, _countof(pZero->m_pNick) },
- { FIELD_OFFSET(CIrcProto, m_alternativeNick), "AlernativeNick", DBVT_TCHAR, _countof(pZero->m_alternativeNick) },
- { FIELD_OFFSET(CIrcProto, m_name), "Name", DBVT_TCHAR, _countof(pZero->m_name) },
+ { FIELD_OFFSET(CIrcProto, m_nick), "Nick", DBVT_WCHAR, _countof(pZero->m_nick) },
+ { FIELD_OFFSET(CIrcProto, m_pNick), "PNick", DBVT_WCHAR, _countof(pZero->m_pNick) },
+ { FIELD_OFFSET(CIrcProto, m_alternativeNick), "AlernativeNick", DBVT_WCHAR, _countof(pZero->m_alternativeNick) },
+ { FIELD_OFFSET(CIrcProto, m_name), "Name", DBVT_WCHAR, _countof(pZero->m_name) },
{ FIELD_OFFSET(CIrcProto, m_disableDefaultServer), "DisableDefaultServer", DBVT_BYTE },
{ FIELD_OFFSET(CIrcProto, m_ident), "Ident", DBVT_BYTE },
{ FIELD_OFFSET(CIrcProto, m_identTimer), "IdentTimer", DBVT_BYTE },
@@ -778,7 +778,7 @@ void CConnectPrefsDlg::OnApply() static TDbSetting CtcpSettings[] =
{
- { FIELD_OFFSET(CIrcProto, m_userInfo), "UserInfo", DBVT_TCHAR, _countof(pZero->m_userInfo) },
+ { FIELD_OFFSET(CIrcProto, m_userInfo), "UserInfo", DBVT_WCHAR, _countof(pZero->m_userInfo) },
{ FIELD_OFFSET(CIrcProto, m_DCCPacketSize), "DccPacketSize", DBVT_WORD, 0, 4096 },
{ FIELD_OFFSET(CIrcProto, m_DCCPassive), "DccPassive", DBVT_BYTE },
{ FIELD_OFFSET(CIrcProto, m_DCCMode), "DCCMode", DBVT_BYTE },
@@ -849,14 +849,14 @@ void CCtcpPrefsDlg::OnInitDialog() else {
if (m_proto->m_IPFromServer) {
if (m_proto->m_myHost[0]) {
- CMString s = (CMString)TranslateT("<Resolved IP: ") + (wchar_t*)_A2T(m_proto->m_myHost) + L">";
+ CMStringW s = (CMStringW)TranslateT("<Resolved IP: ") + (wchar_t*)_A2T(m_proto->m_myHost) + L">";
m_ip.SetText(s.c_str());
}
else m_ip.SetText(TranslateT("<Automatic>"));
}
else {
if (m_proto->m_myLocalHost[0]) {
- CMString s = (CMString)TranslateT("<Local IP: ") + (wchar_t*)_A2T(m_proto->m_myLocalHost) + L">";
+ CMStringW s = (CMStringW)TranslateT("<Local IP: ") + (wchar_t*)_A2T(m_proto->m_myLocalHost) + L">";
m_ip.SetText(s.c_str());
}
else m_ip.SetText(TranslateT("<Automatic>"));
@@ -874,14 +874,14 @@ void CCtcpPrefsDlg::OnClicked(CCtrlData*) else {
if (m_fromServer.GetState()) {
if (m_proto->m_myHost[0]) {
- CMString s = (CMString)TranslateT("<Resolved IP: ") + (wchar_t*)_A2T(m_proto->m_myHost) + L">";
+ CMStringW s = (CMStringW)TranslateT("<Resolved IP: ") + (wchar_t*)_A2T(m_proto->m_myHost) + L">";
m_ip.SetText(s.c_str());
}
else m_ip.SetText(TranslateT("<Automatic>"));
}
else {
if (m_proto->m_myLocalHost[0]) {
- CMString s = (CMString)TranslateT("<Local IP: ") + (wchar_t*)_A2T(m_proto->m_myLocalHost) + L">";
+ CMStringW s = (CMStringW)TranslateT("<Local IP: ") + (wchar_t*)_A2T(m_proto->m_myLocalHost) + L">";
m_ip.SetText(s.c_str());
}
else m_ip.SetText(TranslateT("<Automatic>"));
@@ -925,8 +925,8 @@ void CCtcpPrefsDlg::OnApply() static TDbSetting OtherSettings[] =
{
- { FIELD_OFFSET(CIrcProto, m_quitMessage), "QuitMessage", DBVT_TCHAR, _countof(pZero->m_quitMessage) },
- { FIELD_OFFSET(CIrcProto, m_alias), "Alias", DBVT_TCHAR, -1 },
+ { FIELD_OFFSET(CIrcProto, m_quitMessage), "QuitMessage", DBVT_WCHAR, _countof(pZero->m_quitMessage) },
+ { FIELD_OFFSET(CIrcProto, m_alias), "Alias", DBVT_WCHAR, -1 },
{ FIELD_OFFSET(CIrcProto, m_codepage), "Codepage", DBVT_DWORD, 0, CP_ACP },
{ FIELD_OFFSET(CIrcProto, m_utfAutodetect), "UtfAutodetect", DBVT_BYTE },
{ FIELD_OFFSET(CIrcProto, m_perform), "Perform", DBVT_BYTE },
@@ -1160,7 +1160,7 @@ void COtherPrefsDlg::OnApply() continue;
if (!pPerf->mText.IsEmpty())
- m_proto->setTString(pPerf->mSetting.c_str(), pPerf->mText.c_str());
+ m_proto->setWString(pPerf->mSetting.c_str(), pPerf->mText.c_str());
else
db_unset(NULL, m_proto->m_szModuleName, pPerf->mSetting.c_str());
}
@@ -1175,7 +1175,7 @@ void COtherPrefsDlg::addPerformComboValue(int idx, const char* szValueName) PERFORM_INFO* pPref;
DBVARIANT dbv;
- if (!m_proto->getTString(sSetting.c_str(), &dbv)) {
+ if (!m_proto->getWString(sSetting.c_str(), &dbv)) {
pPref = new PERFORM_INFO(sSetting.c_str(), dbv.ptszVal);
db_free(&dbv);
}
@@ -1218,7 +1218,7 @@ void CAddIgnoreDlg::OnOk(CCtrlButton*) {
wchar_t szMask[500];
wchar_t szNetwork[500];
- CMString flags;
+ CMStringW flags;
if (IsDlgButtonChecked(m_hwnd, IDC_Q) == BST_CHECKED) flags += 'q';
if (IsDlgButtonChecked(m_hwnd, IDC_N) == BST_CHECKED) flags += 'n';
if (IsDlgButtonChecked(m_hwnd, IDC_I) == BST_CHECKED) flags += 'i';
@@ -1229,7 +1229,7 @@ void CAddIgnoreDlg::OnOk(CCtrlButton*) GetDlgItemText(m_hwnd, IDC_MASK, szMask, _countof(szMask));
GetDlgItemText(m_hwnd, IDC_NETWORK, szNetwork, _countof(szNetwork));
- CMString Mask = GetWord(szMask, 0);
+ CMStringW Mask = GetWord(szMask, 0);
if (Mask.GetLength() != 0) {
if (!wcschr(Mask.c_str(), '!') && !wcschr(Mask.c_str(), '@'))
Mask += L"!*@*";
@@ -1357,12 +1357,12 @@ void CIrcProto::InitIgnore(void) mir_snprintf(settingName, "IGNORE:%d", idx++);
DBVARIANT dbv;
- if (getTString(settingName, &dbv))
+ if (getWString(settingName, &dbv))
break;
- CMString mask = GetWord(dbv.ptszVal, 0);
- CMString flags = GetWord(dbv.ptszVal, 1);
- CMString network = GetWord(dbv.ptszVal, 2);
+ CMStringW mask = GetWord(dbv.ptszVal, 0);
+ CMStringW flags = GetWord(dbv.ptszVal, 1);
+ CMStringW network = GetWord(dbv.ptszVal, 2);
m_ignoreItems.insert(new CIrcIgnoreItem(mask.c_str(), flags.c_str(), network.c_str()));
db_free(&dbv);
}
@@ -1383,7 +1383,7 @@ void CIrcProto::RewriteIgnoreSettings(void) mir_snprintf(settingName, "IGNORE:%d", i);
CIrcIgnoreItem& C = m_ignoreItems[i];
- setTString(settingName, (C.mask + L" " + C.flags + L" " + C.network).c_str());
+ setWString(settingName, (C.mask + L" " + C.flags + L" " + C.network).c_str());
}
}
@@ -1638,7 +1638,7 @@ int CIrcProto::OnInitOptionsPages(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.pwszTitle = m_tszUserName;
odp.pwszGroup = LPGENW("Network");
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.pwszTab = LPGENW("Account");
odp.pDialog = new CConnectPrefsDlg(this);
@@ -1690,12 +1690,12 @@ void CIrcProto::InitPrefs(void) if (m_pNick[0] == 0) {
if (m_nick[0] != 0) {
memcpy(m_pNick, m_nick, sizeof(m_pNick));
- setTString("PNick", m_nick);
+ setWString("PNick", m_nick);
}
}
else {
memcpy(m_nick, m_pNick, sizeof(m_nick));
- setTString("Nick", m_nick);
+ setWString("Nick", m_nick);
}
m_mySpecifiedHostIP[0] = 0;
diff --git a/protocols/IRCG/src/output.cpp b/protocols/IRCG/src/output.cpp index eacf4c785b..9eb5181e91 100644 --- a/protocols/IRCG/src/output.cpp +++ b/protocols/IRCG/src/output.cpp @@ -21,9 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-static CMString FormatOutput(const CIrcMessage* pmsg)
+static CMStringW FormatOutput(const CIrcMessage* pmsg)
{
- CMString sMessage;
+ CMStringW sMessage;
if (pmsg->m_bIncoming) { // Is it an incoming message?
if (pmsg->sCommand == L"WALLOPS" && pmsg->parameters.getCount() > 0) {
@@ -85,10 +85,10 @@ static CMString FormatOutput(const CIrcMessage* pmsg) int l = pmsg->parameters[1].GetLength();
if (l > 3 && pmsg->parameters[1][0] == 1 && pmsg->parameters[1][l - 1] == 1) {
// CTCP reply
- CMString tempstr = pmsg->parameters[1];
+ CMStringW tempstr = pmsg->parameters[1];
tempstr.Delete(0, 1);
tempstr.Delete(tempstr.GetLength() - 1, 1);
- CMString type = GetWord(tempstr.c_str(), 0);
+ CMStringW type = GetWord(tempstr.c_str(), 0);
if (mir_wstrcmpi(type.c_str(), L"ping") == 0)
mir_snwprintf(temp, TranslateT("CTCP %s reply sent to %s"), type.c_str(), pmsg->parameters[0].c_str());
else
@@ -131,7 +131,7 @@ THE_END: BOOL CIrcProto::ShowMessage(const CIrcMessage* pmsg)
{
- CMString mess = FormatOutput(pmsg);
+ CMStringW mess = FormatOutput(pmsg);
if (!pmsg->m_bIncoming)
mess.Replace(L"%%", L"%");
diff --git a/protocols/IRCG/src/scripting.cpp b/protocols/IRCG/src/scripting.cpp index 9813630002..a2586f1258 100644 --- a/protocols/IRCG/src/scripting.cpp +++ b/protocols/IRCG/src/scripting.cpp @@ -92,7 +92,7 @@ INT_PTR __cdecl CIrcProto::Scripting_InsertGuiOut(WPARAM, LPARAM lParam) gchook->ptszUID = NULL;
if (gch->pDest->ptszID) {
- CMString S = MakeWndID(gch->pDest->ptszID);
+ CMStringW S = MakeWndID(gch->pDest->ptszID);
gchook->pDest->ptszID = wcsdup(S.c_str());
}
else gchook->pDest->ptszID = NULL;
@@ -112,7 +112,7 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam) {
if (m_scriptingEnabled && lparam) {
CMStringA sString = (char*)lparam, sRequest;
- CMString sOutput, sChannel;
+ CMStringW sOutput, sChannel;
int i = sString.Find("|");
if (i != -1) {
@@ -142,7 +142,7 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam) (m_IPFromServer) ? m_myHost : m_myLocalHost);
else if (sRequest == "usercount" && !sChannel.IsEmpty()) {
- CMString S = MakeWndID(sChannel.c_str());
+ CMStringW S = MakeWndID(sChannel.c_str());
GC_INFO gci = { 0 };
gci.Flags = GCF_BYID | GCF_COUNT;
gci.pszModule = m_szModuleName;
@@ -154,7 +154,7 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam) }
}
else if (sRequest == "userlist" && !sChannel.IsEmpty()) {
- CMString S = MakeWndID(sChannel.c_str());
+ CMStringW S = MakeWndID(sChannel.c_str());
GC_INFO gci = { 0 };
gci.Flags = GCF_BYID | GCF_USERS;
gci.pszModule = m_szModuleName;
@@ -163,7 +163,7 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam) return (INT_PTR)mir_strdup(gci.pszUsers);
}
else if (sRequest == "channellist") {
- CMString S = L"";
+ CMStringW S = L"";
int n = CallServiceSync(MS_GC_GETSESSIONCOUNT, 0, (LPARAM)m_szModuleName);
if (n >= 0) {
int j = 0;
@@ -174,7 +174,7 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam) gci.iItem = j;
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci)) {
if (mir_wstrcmpi(gci.pszID, SERVERWINDOW)) {
- CMString S1 = gci.pszID;
+ CMStringW S1 = gci.pszID;
int k = S1.Find(L" ");
if (k != -1)
S1 = S1.Mid(0, k);
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index a05b6d0b17..e97a5abae5 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -198,10 +198,10 @@ int __cdecl CIrcProto::OnContactDeleted(WPARAM wp, LPARAM) return 0;
DBVARIANT dbv;
- if (!getTString(hContact, "Nick", &dbv)) {
+ if (!getWString(hContact, "Nick", &dbv)) {
int type = getByte(hContact, "ChatRoom", 0);
if (type != 0) {
- CMString S = L"";
+ CMStringW S = L"";
if (type == GCW_CHATROOM)
S = MakeWndID(dbv.ptszVal);
if (type == GCW_SERVER)
@@ -232,7 +232,7 @@ INT_PTR __cdecl CIrcProto::OnJoinChat(WPARAM wp, LPARAM) return 0;
DBVARIANT dbv;
- if (!getTString((MCONTACT)wp, "Nick", &dbv)) {
+ if (!getWString((MCONTACT)wp, "Nick", &dbv)) {
if (getByte((MCONTACT)wp, "ChatRoom", 0) == GCW_CHATROOM)
PostIrcMessage(L"/JOIN %s", dbv.ptszVal);
db_free(&dbv);
@@ -246,11 +246,11 @@ INT_PTR __cdecl CIrcProto::OnLeaveChat(WPARAM wp, LPARAM) return 0;
DBVARIANT dbv;
- if (!getTString((MCONTACT)wp, "Nick", &dbv)) {
+ if (!getWString((MCONTACT)wp, "Nick", &dbv)) {
if (getByte((MCONTACT)wp, "ChatRoom", 0) == GCW_CHATROOM) {
PostIrcMessage(L"/PART %s %s", dbv.ptszVal, m_userInfo);
- CMString S = MakeWndID(dbv.ptszVal);
+ CMStringW S = MakeWndID(dbv.ptszVal);
GCDEST gcd = { m_szModuleName, S.c_str(), GC_EVENT_CONTROL };
GCEVENT gce = { sizeof(gce), &gcd };
CallChatEvent(SESSION_TERMINATE, (LPARAM)&gce);
@@ -267,7 +267,7 @@ INT_PTR __cdecl CIrcProto::OnMenuChanSettings(WPARAM wp, LPARAM) MCONTACT hContact = (MCONTACT)wp;
DBVARIANT dbv;
- if (!getTString(hContact, "Nick", &dbv)) {
+ if (!getWString(hContact, "Nick", &dbv)) {
PostIrcMessageWnd(dbv.ptszVal, NULL, L"/CHANNELMANAGER");
db_free(&dbv);
}
@@ -281,7 +281,7 @@ INT_PTR __cdecl CIrcProto::OnMenuWhois(WPARAM wp, LPARAM) DBVARIANT dbv;
- if (!getTString((MCONTACT)wp, "Nick", &dbv)) {
+ if (!getWString((MCONTACT)wp, "Nick", &dbv)) {
PostIrcMessage(L"/WHOIS %s %s", dbv.ptszVal, dbv.ptszVal);
db_free(&dbv);
}
@@ -303,7 +303,7 @@ INT_PTR __cdecl CIrcProto::OnMenuIgnore(WPARAM wp, LPARAM) MCONTACT hContact = (MCONTACT)wp;
DBVARIANT dbv;
- if (!getTString(hContact, "Nick", &dbv)) {
+ if (!getWString(hContact, "Nick", &dbv)) {
if (!isChatRoom(hContact)) {
char* host = NULL;
DBVARIANT dbv1;
@@ -481,7 +481,7 @@ static void DoChatFormatting(wchar_t* pszText) int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
{
GCHOOK *gch = (GCHOOK*)lParam;
- CMString S = L"";
+ CMStringW S = L"";
mir_cslock lock(m_gchook);
@@ -574,7 +574,7 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam) case 9: // nickserv remind password
{
DBVARIANT dbv;
- if (!getTString("Nick", &dbv)) {
+ if (!getWString("Nick", &dbv)) {
PostIrcMessage(L"/nickserv SENDPASS %s", dbv.ptszVal);
db_free(&dbv);
}
@@ -670,13 +670,13 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam) p1, gch->ptszUID, TranslateT("Please enter the reason"), TranslateT("Kick"), TranslateT("Jerk"));
break;
case 7:
- DoUserhostWithReason(1, L"B" + (CMString)p1, true, L"%s", gch->ptszUID);
+ DoUserhostWithReason(1, L"B" + (CMStringW)p1, true, L"%s", gch->ptszUID);
break;
case 8:
- DoUserhostWithReason(1, L"K" + (CMString)p1, true, L"%s", gch->ptszUID);
+ DoUserhostWithReason(1, L"K" + (CMStringW)p1, true, L"%s", gch->ptszUID);
break;
case 9:
- DoUserhostWithReason(1, L"L" + (CMString)p1, true, L"%s", gch->ptszUID);
+ DoUserhostWithReason(1, L"L" + (CMStringW)p1, true, L"%s", gch->ptszUID);
break;
case 10:
PostIrcMessage(L"/WHOIS %s %s", gch->ptszUID, gch->ptszUID);
@@ -723,28 +723,28 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam) gch->ptszUID, TranslateT("Please enter the channel name to invite to"), TranslateT("Invite to channel"));
break;
case 30:
- {
- PROTOSEARCHRESULT psr = { 0 };
- psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
- psr.id.w = gch->ptszUID;
- psr.nick.w = gch->ptszUID;
-
- ADDCONTACTSTRUCT acs = { 0 };
- acs.handleType = HANDLE_SEARCHRESULT;
- acs.szProto = m_szModuleName;
- acs.psr = &psr;
- CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
- }
+ {
+ PROTOSEARCHRESULT psr = { 0 };
+ psr.cbSize = sizeof(psr);
+ psr.flags = PSR_UNICODE;
+ psr.id.w = gch->ptszUID;
+ psr.nick.w = gch->ptszUID;
+
+ ADDCONTACTSTRUCT acs = { 0 };
+ acs.handleType = HANDLE_SEARCHRESULT;
+ acs.szProto = m_szModuleName;
+ acs.psr = &psr;
+ CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
+ }
break;
case 31: //slap
- PostIrcMessageWnd(p1, NULL, CMString(FORMAT, L"/slap %s", gch->ptszUID));
+ PostIrcMessageWnd(p1, NULL, CMStringW(FORMAT, L"/slap %s", gch->ptszUID));
break;
case 32: //nickserv info
- PostIrcMessageWnd(p1, NULL, CMString(FORMAT, L"/nickserv INFO %s ALL", gch->ptszUID));
+ PostIrcMessageWnd(p1, NULL, CMStringW(FORMAT, L"/nickserv INFO %s ALL", gch->ptszUID));
break;
case 33: //nickserv ghost
- PostIrcMessageWnd(p1, NULL, CMString(FORMAT, L"/nickserv GHOST %s", gch->ptszUID));
+ PostIrcMessageWnd(p1, NULL, CMStringW(FORMAT, L"/nickserv GHOST %s", gch->ptszUID));
break;
}
break;
@@ -923,7 +923,7 @@ int __cdecl CIrcProto::OnMenuPreBuild(WPARAM hContact, LPARAM) Menu_ShowItem(hUMenuChanSettings, true);
// context menu for contact
- else if (!getTString(hContact, "Default", &dbv)) {
+ else if (!getWString(hContact, "Default", &dbv)) {
Menu_ShowItem(hUMenuChanSettings, false);
// for DCC contact
@@ -966,7 +966,7 @@ int __cdecl CIrcProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam) if (!strcmp(cws->szSetting, "NotOnList")) {
DBVARIANT dbv;
- if (!getTString(hContact, "Nick", &dbv)) {
+ if (!getWString(hContact, "Nick", &dbv)) {
if (getByte("MirVerAutoRequest", 1))
PostIrcMessage(L"/PRIVMSG %s \001VERSION\001", dbv.ptszVal);
db_free(&dbv);
diff --git a/protocols/IRCG/src/stdafx.h b/protocols/IRCG/src/stdafx.h index 460b5a54f2..4e8670af7f 100644 --- a/protocols/IRCG/src/stdafx.h +++ b/protocols/IRCG/src/stdafx.h @@ -152,7 +152,7 @@ struct PERFORM_INFO // Contains 'm_perform buffer' for different networks {}
CMStringA mSetting;
- CMString mText;
+ CMStringW mText;
};
struct CONTACT // Contains info about users
@@ -319,15 +319,15 @@ struct CIrcProto : public PROTO<CIrcProto> COLORREF colors[16];
HICON hIcon[13];
- OBJLIST<CMString> vUserhostReasons;
- OBJLIST<CMString> vWhoInProgress;
+ OBJLIST<CMStringW> vUserhostReasons;
+ OBJLIST<CMStringW> vWhoInProgress;
mir_cs cs;
mir_cs m_gchook;
mir_cs m_resolve;
HANDLE m_evWndCreate;
- CMString m_statusMessage;
+ CMStringW m_statusMessage;
int m_iTempCheckTime;
CIrcSessionInfo si;
@@ -354,7 +354,7 @@ struct CIrcProto : public PROTO<CIrcProto> int m_noOfChannels, m_manualWhoisCount;
CMStringA sChannelModes, sUserModes;
- CMString sChannelPrefixes, sUserModePrefixes, WhoisAwayReply;
+ CMStringW sChannelPrefixes, sUserModePrefixes, WhoisAwayReply;
//clist.cpp
MCONTACT CList_AddContact(CONTACT *user, bool InList, bool SetOnline);
@@ -363,7 +363,7 @@ struct CIrcProto : public PROTO<CIrcProto> bool CList_AddEvent(CONTACT *user, HICON Icon, HANDLE event, const char *tooltip, int type ) ;
MCONTACT CList_FindContact(CONTACT *user);
- BOOL CList_AddDCCChat(const CMString &name, const CMString &hostmask, unsigned long adr, int port) ;
+ BOOL CList_AddDCCChat(const CMStringW &name, const CMStringW &hostmask, unsigned long adr, int port) ;
//commandmonitor.cpp
UINT_PTR IdentTimer, InitTimer, KeepAliveTimer, OnlineNotifTimer, OnlineNotifTimer3;
@@ -374,15 +374,15 @@ struct CIrcProto : public PROTO<CIrcProto> void __cdecl ResolveIPThread(void *di);
bool AddIgnore(const wchar_t *mask, const wchar_t *mode, const wchar_t *network) ;
- int IsIgnored(const CMString &nick, const CMString &address, const CMString &host, char type) ;
- int IsIgnored(CMString user, char type);
+ int IsIgnored(const CMStringW &nick, const CMStringW &address, const CMStringW &host, char type) ;
+ int IsIgnored(CMStringW user, char type);
bool RemoveIgnore(const wchar_t *mask) ;
//input.cpp
- CMString DoAlias( const wchar_t *text, wchar_t *window);
- BOOL DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hContact);
- CMString DoIdentifiers(CMString text, const wchar_t *window);
- void FormatMsg(CMString &text);
+ CMStringW DoAlias( const wchar_t *text, wchar_t *window);
+ BOOL DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hContact);
+ CMStringW DoIdentifiers(CMStringW text, const wchar_t *window);
+ void FormatMsg(CMStringW &text);
bool PostIrcMessageWnd(wchar_t *pszWindow, MCONTACT hContact, const wchar_t *szBuf);
bool PostIrcMessage(const wchar_t *fmt, ...);
@@ -404,14 +404,14 @@ struct CIrcProto : public PROTO<CIrcProto> OBJLIST<CIrcIgnoreItem> m_ignoreItems;
int m_channelNumber;
- CMString m_whoReply;
- CMString sNamesList;
- CMString sTopic;
- CMString sTopicName;
- CMString sTopicTime;
- CMString m_namesToWho;
- CMString m_channelsToWho;
- CMString m_namesToUserhost;
+ CMStringW m_whoReply;
+ CMStringW sNamesList;
+ CMStringW sTopic;
+ CMStringW sTopicName;
+ CMStringW sTopicTime;
+ CMStringW m_namesToWho;
+ CMStringW m_channelsToWho;
+ CMStringW m_namesToUserhost;
void InitPrefs(void);
void InitIgnore(void);
@@ -439,25 +439,25 @@ struct CIrcProto : public PROTO<CIrcProto> void __cdecl DisconnectServerThread( void* );
//tools.cpp
- void AddToJTemp(wchar_t op, CMString& sCommand);
- bool AddWindowItemData(CMString window, const wchar_t* pszLimit, const wchar_t* pszMode, const wchar_t* pszPassword, const wchar_t* pszTopic);
+ void AddToJTemp(wchar_t op, CMStringW& sCommand);
+ bool AddWindowItemData(CMStringW window, const wchar_t* pszLimit, const wchar_t* pszMode, const wchar_t* pszPassword, const wchar_t* pszTopic);
INT_PTR CallChatEvent(WPARAM wParam, LPARAM lParam);
INT_PTR DoEvent(int iEvent, const wchar_t* pszWindow, const wchar_t* pszNick, const wchar_t* pszText, const wchar_t* pszStatus, const wchar_t* pszUserInfo, DWORD_PTR dwItemData, bool bAddToLog, bool bIsMe,time_t timestamp = 1);
void FindLocalIP(HANDLE con);
- bool FreeWindowItemData(CMString window, CHANNELINFO* wis);
+ bool FreeWindowItemData(CMStringW window, CHANNELINFO* wis);
bool IsChannel(const char* sName);
bool IsChannel(const wchar_t* sName);
void KillChatTimer(UINT_PTR &nIDEvent);
- CMString MakeWndID(const wchar_t* sWindow);
- CMString ModeToStatus(int sMode);
- CMString PrefixToStatus(int cPrefix);
- int SetChannelSBText(CMString sWindow, CHANNELINFO * wi);
+ CMStringW MakeWndID(const wchar_t* sWindow);
+ CMStringW ModeToStatus(int sMode);
+ CMStringW PrefixToStatus(int cPrefix);
+ int SetChannelSBText(CMStringW sWindow, CHANNELINFO * wi);
void SetChatTimer(UINT_PTR &nIDEvent,UINT uElapse, TIMERPROC lpTimerFunc);
void ClearUserhostReasons(int type);
- void DoUserhostWithReason(int type, CMString reason, bool bSendCommand, CMString userhostparams, ...);
- CMString GetNextUserhostReason(int type);
- CMString PeekAtReasons(int type);
+ void DoUserhostWithReason(int type, CMStringW reason, bool bSendCommand, CMStringW userhostparams, ...);
+ CMStringW GetNextUserhostReason(int type);
+ CMStringW PeekAtReasons(int type);
// userinfo.cpp
void __cdecl AckUserInfoSearch( void* hContact );
@@ -475,7 +475,7 @@ struct CIrcProto : public PROTO<CIrcProto> CDccSession* FindDCCSendByPort(int iPort);
CDccSession* FindDCCRecvByPortAndName(int iPort, const wchar_t* szName);
CDccSession* FindPassiveDCCSend(int iToken);
- CDccSession* FindPassiveDCCRecv(CMString sName, CMString sToken);
+ CDccSession* FindPassiveDCCRecv(CMStringW sName, CMStringW sToken);
void DisconnectAllDCCSessions(bool Shutdown);
void CheckDCCTimeout(void);
@@ -575,7 +575,7 @@ private : PfnIrcMessageHandler FindMethod(const wchar_t* lpszName);
void OnIrcMessage(const CIrcMessage* pmsg);
- CMString sNick4Perform;
+ CMStringW sNick4Perform;
};
// map actual member functions to their associated IRC command.
@@ -619,9 +619,9 @@ HANDLE GetIconHandle(int iconId); //tools.cpp
int __stdcall WCCmp(const wchar_t* wild, const wchar_t* string);
char* __stdcall IrcLoadFile(wchar_t * szPath);
-CMString __stdcall GetWord(const wchar_t* text, int index);
+CMStringW __stdcall GetWord(const wchar_t* text, int index);
const wchar_t* __stdcall GetWordAddress(const wchar_t* text, int index);
-void __stdcall RemoveLinebreaks( CMString& Message );
+void __stdcall RemoveLinebreaks( CMStringW& Message );
wchar_t* __stdcall my_strstri(const wchar_t *s1, const wchar_t *s2) ;
wchar_t* __stdcall DoColorCodes (const wchar_t* text, bool bStrip, bool bReplacePercent);
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp index 4869720b3f..eb3068d7de 100644 --- a/protocols/IRCG/src/tools.cpp +++ b/protocols/IRCG/src/tools.cpp @@ -23,13 +23,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////////////////
-void CIrcProto::AddToJTemp(wchar_t op, CMString& sCommand)
+void CIrcProto::AddToJTemp(wchar_t op, CMStringW& sCommand)
{
- CMString res;
+ CMStringW res;
int pos = 0;
for (;;) {
- CMString tmp = sCommand.Tokenize(L",", pos);
+ CMStringW tmp = sCommand.Tokenize(L",", pos);
if (pos == -1)
break;
@@ -41,15 +41,15 @@ void CIrcProto::AddToJTemp(wchar_t op, CMString& sCommand) }
DBVARIANT dbv;
- if (!getTString("JTemp", &dbv)) {
- res = CMString(dbv.ptszVal) + L" " + res;
+ if (!getWString("JTemp", &dbv)) {
+ res = CMStringW(dbv.ptszVal) + L" " + res;
db_free(&dbv);
}
- setTString("JTemp", res.c_str());
+ setWString("JTemp", res.c_str());
}
-CMString __stdcall GetWord(const wchar_t* text, int index)
+CMStringW __stdcall GetWord(const wchar_t* text, int index)
{
if (text && *text) {
wchar_t* p1 = (wchar_t*)text;
@@ -75,11 +75,11 @@ CMString __stdcall GetWord(const wchar_t* text, int index) p2 = wcschr(p1, '\0');
if (p1 != p2)
- return CMString(p1, p2 - p1);
+ return CMStringW(p1, p2 - p1);
}
}
- return CMString();
+ return CMStringW();
}
const wchar_t* __stdcall GetWordAddress(const wchar_t* text, int index)
@@ -108,7 +108,7 @@ const wchar_t* __stdcall GetWordAddress(const wchar_t* text, int index) return temp;
}
-void __stdcall RemoveLinebreaks(CMString &Message)
+void __stdcall RemoveLinebreaks(CMStringW &Message)
{
while (Message.Find(L"\r\n\r\n", 0) != -1)
Message.Replace(L"\r\n\r\n", L"\r\n");
@@ -386,8 +386,8 @@ INT_PTR CIrcProto::DoEvent(int iEvent, const wchar_t* pszWindow, const wchar_t* DWORD_PTR dwItemData, bool bAddToLog, bool bIsMe, time_t timestamp)
{
GCDEST gcd = { m_szModuleName, NULL, iEvent };
- CMString sID;
- CMString sText = L"";
+ CMStringW sID;
+ CMStringW sText = L"";
if (iEvent == GC_EVENT_INFORMATION && bIsMe && !bEcho)
return false;
@@ -401,7 +401,7 @@ INT_PTR CIrcProto::DoEvent(int iEvent, const wchar_t* pszWindow, const wchar_t* if (pszWindow) {
if (mir_wstrcmpi(pszWindow, SERVERWINDOW))
- sID = pszWindow + (CMString)L" - " + m_info.sNetwork;
+ sID = pszWindow + (CMStringW)L" - " + m_info.sNetwork;
else
sID = pszWindow;
gcd.ptszID = (wchar_t*)sID.c_str();
@@ -430,29 +430,29 @@ INT_PTR CIrcProto::DoEvent(int iEvent, const wchar_t* pszWindow, const wchar_t* return CallChatEvent(0, (LPARAM)&gce);
}
-CMString CIrcProto::ModeToStatus(int sMode)
+CMStringW CIrcProto::ModeToStatus(int sMode)
{
if (sUserModes.Find(sMode) != -1) {
switch (sMode) {
case 'q':
- return (CMString)L"Owner";
+ return (CMStringW)L"Owner";
case 'o':
- return (CMString)L"Op";
+ return (CMStringW)L"Op";
case 'v':
- return (CMString)L"Voice";
+ return (CMStringW)L"Voice";
case 'h':
- return (CMString)L"Halfop";
+ return (CMStringW)L"Halfop";
case 'a':
- return (CMString)L"Admin";
+ return (CMStringW)L"Admin";
default:
- return (CMString)L"Unknown";
+ return (CMStringW)L"Unknown";
}
}
- return (CMString)L"Normal";
+ return (CMStringW)L"Normal";
}
-CMString CIrcProto::PrefixToStatus(int cPrefix)
+CMStringW CIrcProto::PrefixToStatus(int cPrefix)
{
const wchar_t* p = wcschr(sUserModePrefixes.c_str(), cPrefix);
if (p) {
@@ -460,7 +460,7 @@ CMString CIrcProto::PrefixToStatus(int cPrefix) return ModeToStatus(sUserModes[index]);
}
- return (CMString)L"Normal";
+ return (CMStringW)L"Normal";
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -531,9 +531,9 @@ void CIrcProto::KillChatTimer(UINT_PTR &nIDEvent) /////////////////////////////////////////////////////////////////////////////////////////
-int CIrcProto::SetChannelSBText(CMString sWindow, CHANNELINFO * wi)
+int CIrcProto::SetChannelSBText(CMStringW sWindow, CHANNELINFO * wi)
{
- CMString sTemp = L"";
+ CMStringW sTemp = L"";
if (wi->pszMode) {
sTemp += L"[";
sTemp += wi->pszMode;
@@ -545,14 +545,14 @@ int CIrcProto::SetChannelSBText(CMString sWindow, CHANNELINFO * wi) return DoEvent(GC_EVENT_SETSBTEXT, sWindow.c_str(), NULL, sTemp.c_str(), NULL, NULL, NULL, FALSE, FALSE, 0);
}
-CMString CIrcProto::MakeWndID(const wchar_t* sWindow)
+CMStringW CIrcProto::MakeWndID(const wchar_t* sWindow)
{
wchar_t buf[200];
mir_snwprintf(buf, L"%s - %s", sWindow, (IsConnected()) ? m_info.sNetwork.c_str() : TranslateT("Offline"));
- return CMString(buf);
+ return CMStringW(buf);
}
-bool CIrcProto::FreeWindowItemData(CMString window, CHANNELINFO* wis)
+bool CIrcProto::FreeWindowItemData(CMStringW window, CHANNELINFO* wis)
{
CHANNELINFO *wi;
if (!wis)
@@ -570,7 +570,7 @@ bool CIrcProto::FreeWindowItemData(CMString window, CHANNELINFO* wis) return false;
}
-bool CIrcProto::AddWindowItemData(CMString window, const wchar_t* pszLimit, const wchar_t* pszMode, const wchar_t* pszPassword, const wchar_t* pszTopic)
+bool CIrcProto::AddWindowItemData(CMStringW window, const wchar_t* pszLimit, const wchar_t* pszMode, const wchar_t* pszPassword, const wchar_t* pszTopic)
{
CHANNELINFO *wi = (CHANNELINFO *)DoEvent(GC_EVENT_GETITEMDATA, window.c_str(), NULL, NULL, NULL, NULL, NULL, FALSE, FALSE, 0);
if (wi) {
@@ -610,10 +610,10 @@ void CIrcProto::FindLocalIP(HANDLE hConn) // inspiration from jabber }
}
-void CIrcProto::DoUserhostWithReason(int type, CMString reason, bool bSendCommand, CMString userhostparams, ...)
+void CIrcProto::DoUserhostWithReason(int type, CMStringW reason, bool bSendCommand, CMStringW userhostparams, ...)
{
wchar_t temp[4096];
- CMString S = L"";
+ CMStringW S = L"";
switch (type) {
case 1:
S = L"USERHOST";
@@ -633,22 +633,22 @@ void CIrcProto::DoUserhostWithReason(int type, CMString reason, bool bSendComman // Add reason
if (type == 1)
- vUserhostReasons.insert(new CMString(reason));
+ vUserhostReasons.insert(new CMStringW(reason));
else if (type == 2)
- vWhoInProgress.insert(new CMString(reason));
+ vWhoInProgress.insert(new CMStringW(reason));
// Do command
if (IsConnected() && bSendCommand)
SendIrcMessage(temp, false);
}
-CMString CIrcProto::GetNextUserhostReason(int type)
+CMStringW CIrcProto::GetNextUserhostReason(int type)
{
- CMString reason = L"";
+ CMStringW reason = L"";
switch (type) {
case 1:
if (!vUserhostReasons.getCount())
- return CMString();
+ return CMStringW();
// Get reason
reason = vUserhostReasons[0];
@@ -656,7 +656,7 @@ CMString CIrcProto::GetNextUserhostReason(int type) break;
case 2:
if (!vWhoInProgress.getCount())
- return CMString();
+ return CMStringW();
// Get reason
reason = vWhoInProgress[0];
@@ -667,21 +667,21 @@ CMString CIrcProto::GetNextUserhostReason(int type) return reason;
}
-CMString CIrcProto::PeekAtReasons(int type)
+CMStringW CIrcProto::PeekAtReasons(int type)
{
switch (type) {
case 1:
if (!vUserhostReasons.getCount())
- return CMString();
+ return CMStringW();
return vUserhostReasons[0];
case 2:
if (!vWhoInProgress.getCount())
- return CMString();
+ return CMStringW();
return vWhoInProgress[0];
}
- return CMString();
+ return CMStringW();
}
void CIrcProto::ClearUserhostReasons(int type)
diff --git a/protocols/IRCG/src/userinfo.cpp b/protocols/IRCG/src/userinfo.cpp index 0079e410e0..68b3705a5f 100644 --- a/protocols/IRCG/src/userinfo.cpp +++ b/protocols/IRCG/src/userinfo.cpp @@ -63,26 +63,26 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(m_hwnd, IDC_WILDCARD), bAdvanced);
if (!bAdvanced) {
- SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateTS(STR_BASIC));
- if (!p->ppro->getTString(p->hContact, "Default", &dbv)) {
+ SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateW(STR_BASIC));
+ if (!p->ppro->getWString(p->hContact, "Default", &dbv)) {
SetDlgItemText(m_hwnd, IDC_WILDCARD, dbv.ptszVal);
db_free(&dbv);
}
}
else {
- SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateTS(STR_ADVANCED));
- if (!p->ppro->getTString(p->hContact, "UWildcard", &dbv)) {
+ SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateW(STR_ADVANCED));
+ if (!p->ppro->getWString(p->hContact, "UWildcard", &dbv)) {
SetDlgItemText(m_hwnd, IDC_WILDCARD, dbv.ptszVal);
db_free(&dbv);
}
}
- if (!p->ppro->getTString(p->hContact, "UUser", &dbv)) {
+ if (!p->ppro->getWString(p->hContact, "UUser", &dbv)) {
SetDlgItemText(m_hwnd, IDC_USER, dbv.ptszVal);
db_free(&dbv);
}
- if (!p->ppro->getTString(p->hContact, "UHost", &dbv)) {
+ if (!p->ppro->getWString(p->hContact, "UHost", &dbv)) {
SetDlgItemText(m_hwnd, IDC_HOST, dbv.ptszVal);
db_free(&dbv);
}
@@ -107,18 +107,18 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM if (GetWindowTextLength(GetDlgItem(m_hwnd, IDC_WILDCARD)) == 0 ||
GetWindowTextLength(GetDlgItem(m_hwnd, IDC_USER)) == 0 ||
GetWindowTextLength(GetDlgItem(m_hwnd, IDC_HOST)) == 0) {
- MessageBox(NULL, TranslateTS(STR_ERROR2), TranslateT("IRC error"), MB_OK | MB_ICONERROR);
+ MessageBox(NULL, TranslateW(STR_ERROR2), TranslateT("IRC error"), MB_OK | MB_ICONERROR);
return FALSE;
}
DBVARIANT dbv;
- if (!p->ppro->getTString(p->hContact, "Default", &dbv)) {
- CMString S = STR_ERROR;
+ if (!p->ppro->getWString(p->hContact, "Default", &dbv)) {
+ CMStringW S = STR_ERROR;
S += L" (";
S += dbv.ptszVal;
S += L")";
if ((mir_wstrlen(temp) < 4 && mir_wstrlen(temp)) || !WCCmp(CharLower(temp), CharLower(dbv.ptszVal))) {
- MessageBox(NULL, TranslateTS(S.c_str()), TranslateT("IRC error"), MB_OK | MB_ICONERROR);
+ MessageBox(NULL, TranslateW(S.c_str()), TranslateT("IRC error"), MB_OK | MB_ICONERROR);
db_free(&dbv);
return FALSE;
}
@@ -127,7 +127,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM GetDlgItemText(m_hwnd, IDC_WILDCARD, temp, _countof(temp));
if (mir_wstrlen(GetWord(temp, 0).c_str()))
- p->ppro->setTString(p->hContact, "UWildcard", GetWord(temp, 0).c_str());
+ p->ppro->setWString(p->hContact, "UWildcard", GetWord(temp, 0).c_str());
else
db_unset(p->hContact, p->ppro->m_szModuleName, "UWildcard");
}
@@ -136,13 +136,13 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM GetDlgItemText(m_hwnd, IDC_USER, temp, _countof(temp));
if (mir_wstrlen(GetWord(temp, 0).c_str()))
- p->ppro->setTString(p->hContact, "UUser", GetWord(temp, 0).c_str());
+ p->ppro->setWString(p->hContact, "UUser", GetWord(temp, 0).c_str());
else
db_unset(p->hContact, p->ppro->m_szModuleName, "UUser");
GetDlgItemText(m_hwnd, IDC_HOST, temp, _countof(temp));
if (mir_wstrlen(GetWord(temp, 0).c_str()))
- p->ppro->setTString(p->hContact, "UHost", GetWord(temp, 0).c_str());
+ p->ppro->setWString(p->hContact, "UHost", GetWord(temp, 0).c_str());
else
db_unset(p->hContact, p->ppro->m_szModuleName, "UHost");
@@ -162,10 +162,10 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM }
if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RADIO1) {
- SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateTS(STR_BASIC));
+ SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateW(STR_BASIC));
DBVARIANT dbv;
- if (!p->ppro->getTString(p->hContact, "Default", &dbv)) {
+ if (!p->ppro->getWString(p->hContact, "Default", &dbv)) {
SetDlgItemText(m_hwnd, IDC_WILDCARD, dbv.ptszVal);
db_free(&dbv);
}
@@ -174,8 +174,8 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RADIO2) {
DBVARIANT dbv;
- SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateTS(STR_ADVANCED));
- if (!p->ppro->getTString(p->hContact, "UWildcard", &dbv)) {
+ SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateW(STR_ADVANCED));
+ if (!p->ppro->getWString(p->hContact, "UWildcard", &dbv)) {
SetDlgItemText(m_hwnd, IDC_WILDCARD, dbv.ptszVal);
db_free(&dbv);
}
@@ -200,7 +200,7 @@ int __cdecl CIrcProto::OnInitUserInfo(WPARAM wParam, LPARAM lParam) return 0;
DBVARIANT dbv;
- if (!getTString(hContact, "Default", &dbv)) {
+ if (!getWString(hContact, "Default", &dbv)) {
if (IsChannel(dbv.ptszVal)) {
db_free(&dbv);
return 0;
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp index 494000553c..40c30af560 100644 --- a/protocols/IRCG/src/windows.cpp +++ b/protocols/IRCG/src/windows.cpp @@ -211,7 +211,7 @@ void CNickDlg::OnInitDialog() Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_RENAME));
DBVARIANT dbv;
- if (!m_proto->getTString("RecentNicks", &dbv)) {
+ if (!m_proto->getWString("RecentNicks", &dbv)) {
for (int i = 0; i < 10; i++)
if (!GetWord(dbv.ptszVal, i).IsEmpty())
SendDlgItemMessage(m_hwnd, IDC_ENICK, CB_ADDSTRING, 0, (LPARAM)GetWord(dbv.ptszVal, i).c_str());
@@ -232,17 +232,17 @@ void CNickDlg::OnOk(CCtrlButton*) m_Enick.GetText(szTemp, _countof(szTemp));
m_proto->PostIrcMessage(L"/NICK %s", szTemp);
- CMString S = szTemp;
+ CMStringW S = szTemp;
DBVARIANT dbv;
- if (!m_proto->getTString("RecentNicks", &dbv)) {
+ if (!m_proto->getWString("RecentNicks", &dbv)) {
for (int i = 0; i < 10; i++) {
- CMString s = GetWord(dbv.ptszVal, i);
+ CMStringW s = GetWord(dbv.ptszVal, i);
if (!s.IsEmpty() && s != szTemp)
S += L" " + s;
}
db_free(&dbv);
}
- m_proto->setTString("RecentNicks", S.c_str());
+ m_proto->setWString("RecentNicks", S.c_str());
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -503,10 +503,10 @@ void CJoinDlg::OnInitDialog() CCoolIrcDlg::OnInitDialog();
DBVARIANT dbv;
- if (!m_proto->getTString("RecentChannels", &dbv)) {
+ if (!m_proto->getWString("RecentChannels", &dbv)) {
for (int i = 0; i < 20; i++) {
if (!GetWord(dbv.ptszVal, i).IsEmpty()) {
- CMString S = GetWord(dbv.ptszVal, i);
+ CMStringW S = GetWord(dbv.ptszVal, i);
S.Replace(L"%newl", L" ");
SendDlgItemMessage(m_hwnd, IDC_ENICK, CB_ADDSTRING, 0, (LPARAM)S.c_str());
}
@@ -530,20 +530,20 @@ void CJoinDlg::OnOk(CCtrlButton*) else
m_proto->PostIrcMessage(L"/JOIN #%s", szTemp);
- CMString S = szTemp;
+ CMStringW S = szTemp;
S.Replace(L" ", L"%newl");
- CMString SL = S;
+ CMStringW SL = S;
DBVARIANT dbv;
- if (!m_proto->getTString("RecentChannels", &dbv)) {
+ if (!m_proto->getWString("RecentChannels", &dbv)) {
for (int i = 0; i < 20; i++) {
- CMString W = GetWord(dbv.ptszVal, i);
+ CMStringW W = GetWord(dbv.ptszVal, i);
if (!W.IsEmpty() && W != SL)
S += L" " + W;
}
db_free(&dbv);
}
- m_proto->setTString("RecentChannels", S.c_str());
+ m_proto->setWString("RecentChannels", S.c_str());
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -756,7 +756,7 @@ void CQuestionDlg::OnOk(CCtrlButton*) else *p1 = '\0';
}
- CMString S('\0', j + 2);
+ CMStringW S('\0', j + 2);
GetDlgItemText(m_hwnd, IDC_HIDDENEDIT, S.GetBuffer(), j + 1);
S.Replace(text, l);
m_proto->PostIrcMessageWnd(NULL, NULL, S);
@@ -909,11 +909,11 @@ void CManagerDlg::OnClose() wchar_t window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
- CMString S = L"";
+ CMStringW S = L"";
wchar_t temp[1000];
for (int i = 0; i < 5; i++) {
if (m_topic.SendMsg(CB_GETLBTEXT, i, (LPARAM)temp) != LB_ERR) {
- CMString S1 = temp;
+ CMStringW S1 = temp;
/* FIXME: What the hell does it mean!? GCC won't compile this on UNICODE */
#if !defined(__GNUC__) || !defined(UNICODE)
S1.Replace(L" ", L"%¤");
@@ -925,7 +925,7 @@ void CManagerDlg::OnClose() if (!S.IsEmpty() && m_proto->IsConnected()) {
mir_snwprintf(temp, L"Topic%s%s", window, m_proto->m_info.sNetwork.c_str());
char* p = mir_u2a(temp);
- m_proto->setTString(p, S.c_str());
+ m_proto->setWString(p, S.c_str());
mir_free(p);
}
DestroyWindow(m_hwnd);
@@ -978,7 +978,7 @@ void CManagerDlg::OnEdit(CCtrlButton*) int i = m_list.GetCurSel();
if (i != LB_ERR) {
wchar_t* m = m_list.GetItemText(i);
- CMString user = GetWord(m, 0);
+ CMStringW user = GetWord(m, 0);
mir_free(m);
wchar_t temp[100];
@@ -1027,7 +1027,7 @@ void CManagerDlg::OnRemove(CCtrlButton*) wchar_t temp[100], mode[3];
wchar_t* m = m_list.GetItemText(i, temp, _countof(temp));
- CMString user = GetWord(m, 0);
+ CMStringW user = GetWord(m, 0);
if (m_radio1.GetState()) {
mir_wstrcpy(mode, L"-b");
@@ -1083,8 +1083,8 @@ void CManagerDlg::OnApplyModes(CCtrlButton*) if (wi) {
wchar_t toadd[10]; *toadd = '\0';
wchar_t toremove[10]; *toremove = '\0';
- CMString appendixadd = L"";
- CMString appendixremove = L"";
+ CMStringW appendixadd = L"";
+ CMStringW appendixremove = L"";
if (wi->pszMode && wcschr(wi->pszMode, 't')) {
if (!m_check1.GetState())
mir_wstrcat(toremove, L"t");
@@ -1134,12 +1134,12 @@ void CManagerDlg::OnApplyModes(CCtrlButton*) else if (m_check9.GetState())
mir_wstrcat(toadd, L"c");
- CMString Key = L"";
- CMString Limit = L"";
+ CMStringW Key = L"";
+ CMStringW Limit = L"";
if (wi->pszMode && wi->pszPassword && wcschr(wi->pszMode, 'k')) {
if (!m_check5.GetState()) {
mir_wstrcat(toremove, L"k");
- appendixremove += L" " + CMString(wi->pszPassword);
+ appendixremove += L" " + CMStringW(wi->pszPassword);
}
else if (GetWindowTextLength(m_key.GetHwnd())) {
wchar_t temp[400];
@@ -1148,8 +1148,8 @@ void CManagerDlg::OnApplyModes(CCtrlButton*) if (Key != temp) {
mir_wstrcat(toremove, L"k");
mir_wstrcat(toadd, L"k");
- appendixadd += L" " + CMString(temp);
- appendixremove += L" " + CMString(wi->pszPassword);
+ appendixadd += L" " + CMStringW(temp);
+ appendixremove += L" " + CMStringW(wi->pszPassword);
}
}
}
@@ -1170,7 +1170,7 @@ void CManagerDlg::OnApplyModes(CCtrlButton*) GetDlgItemText(m_hwnd, IDC_LIMIT, temp, _countof(temp));
if (wi->pszLimit && mir_wstrcmpi(wi->pszLimit, temp)) {
mir_wstrcat(toadd, L"l");
- appendixadd += L" " + CMString(temp);
+ appendixadd += L" " + CMStringW(temp);
}
}
}
@@ -1283,9 +1283,9 @@ void CManagerDlg::InitManager(int mode, const wchar_t* window) char* p = mir_u2a(temp);
DBVARIANT dbv;
- if (!m_proto->getTString(p, &dbv)) {
+ if (!m_proto->getWString(p, &dbv)) {
for (int i = 0; i < 5; i++) {
- CMString S = GetWord(dbv.ptszVal, i);
+ CMStringW S = GetWord(dbv.ptszVal, i);
if (!S.IsEmpty()) {
/* FIXME: What the hell does it mean!? GCC won't compile this on UNICODE */
#if !defined(__GNUC__) || !defined(UNICODE)
diff --git a/protocols/IcqOscarJ/src/fam_04message.cpp b/protocols/IcqOscarJ/src/fam_04message.cpp index 104c7c8652..1d2b182bd9 100644 --- a/protocols/IcqOscarJ/src/fam_04message.cpp +++ b/protocols/IcqOscarJ/src/fam_04message.cpp @@ -947,7 +947,7 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, size_t wLen, DWORD dwUin, c }
contacts[iContact] = (ICQSEARCHRESULT*)SAFE_MALLOC(sizeof(ICQSEARCHRESULT));
contacts[iContact]->hdr.cbSize = sizeof(ICQSEARCHRESULT);
- contacts[iContact]->hdr.flags = PSR_TCHAR;
+ contacts[iContact]->hdr.flags = PSR_UNICODE;
contacts[iContact]->hdr.nick.w = null_strdup(L"");
contacts[iContact]->hdr.id.w = ansi_to_tchar(szUid);
@@ -1682,7 +1682,7 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp, for (int i = 0; i < nContacts; i++) {
isrList[i] = (ICQSEARCHRESULT*)SAFE_MALLOC(sizeof(ICQSEARCHRESULT));
isrList[i]->hdr.cbSize = sizeof(ICQSEARCHRESULT);
- isrList[i]->hdr.flags = PSR_TCHAR;
+ isrList[i]->hdr.flags = PSR_UNICODE;
if (IsStringUIN(pszMsgField[1 + i * 2])) { // icq contact
isrList[i]->uin = atoi(pszMsgField[1 + i * 2]);
if (isrList[i]->uin == 0)
diff --git a/protocols/IcqOscarJ/src/fam_0alookup.cpp b/protocols/IcqOscarJ/src/fam_0alookup.cpp index bb37764957..909ae75838 100644 --- a/protocols/IcqOscarJ/src/fam_0alookup.cpp +++ b/protocols/IcqOscarJ/src/fam_0alookup.cpp @@ -92,7 +92,7 @@ void CIcqProto::handleLookupEmailReply(BYTE* buf, size_t wLen, DWORD dwCookie) debugLogA("SNAC(0x0A,0x3): Lookup reply");
sr.hdr.cbSize = sizeof(sr);
- sr.hdr.flags = PSR_TCHAR;
+ sr.hdr.flags = PSR_UNICODE;
sr.hdr.email.w = ansi_to_tchar(pCookie->szObject);
// Syntax check, read chain
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp index c2cc01818e..bfd2b1ee14 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.cpp +++ b/protocols/IcqOscarJ/src/icq_avatar.cpp @@ -57,11 +57,11 @@ avatars_request::~avatars_request() wchar_t* CIcqProto::GetOwnAvatarFileName()
{
DBVARIANT dbvFile = {DBVT_DELETED};
- if (getTString(NULL, "AvatarFile", &dbvFile))
+ if (getWString(NULL, "AvatarFile", &dbvFile))
return NULL;
wchar_t tmp[MAX_PATH * 2];
- PathToAbsoluteT(dbvFile.ptszVal, tmp);
+ PathToAbsoluteW(dbvFile.ptszVal, tmp);
db_free(&dbvFile);
return null_strdup(tmp);
@@ -76,7 +76,7 @@ void CIcqProto::GetFullAvatarFileName(int dwUin, const char *szUid, int dwFormat void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, wchar_t *pszDest, size_t cbLen)
{
wchar_t szPath[MAX_PATH * 2];
- mir_snwprintf(szPath, L"%s\\%S\\", VARST(L"%miranda_avatarcache%"), m_szModuleName);
+ mir_snwprintf(szPath, L"%s\\%S\\", VARSW(L"%miranda_avatarcache%"), m_szModuleName);
FOLDERSGETDATA fgd = { sizeof(fgd) };
fgd.nMaxPathSize = _countof(szPath);
@@ -88,7 +88,7 @@ void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, wchar_t *pszDest size_t tPathLen = mir_wstrlen(pszDest);
// make sure the avatar cache directory exists
- CreateDirectoryTreeT(szPath);
+ CreateDirectoryTreeW(szPath);
if (dwUin != 0)
_ltow(dwUin, pszDest + tPathLen, 10);
@@ -99,7 +99,7 @@ void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, wchar_t *pszDest }
else {
wchar_t szBuf[MAX_PATH];
- if (CallService(MS_DB_GETPROFILENAMET, MAX_PATH, (LPARAM)szBuf))
+ if (CallService(MS_DB_GETPROFILENAMEW, MAX_PATH, (LPARAM)szBuf))
mir_wstrcpy(pszDest + tPathLen, L"avatar");
else {
wchar_t *szLastDot = wcsrchr(szBuf, '.');
@@ -1226,7 +1226,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, size_t wBufferLen if (!pCookieData->hContact) { // our avatar, set filename
wchar_t tmp[MAX_PATH * 2];
PathToRelativeT(tszImageFile, tmp);
- ppro->setTString(NULL, "AvatarFile", tmp);
+ ppro->setWString(NULL, "AvatarFile", tmp);
}
else { // contact's avatar set hash
DBVARIANT dbv = { DBVT_DELETED };
diff --git a/protocols/IcqOscarJ/src/icq_db.cpp b/protocols/IcqOscarJ/src/icq_db.cpp index bafbfb8dda..938a486e08 100644 --- a/protocols/IcqOscarJ/src/icq_db.cpp +++ b/protocols/IcqOscarJ/src/icq_db.cpp @@ -169,7 +169,7 @@ void CIcqProto::setStatusMsgVar(MCONTACT hContact, char* szStatusMsg, bool isAns char *oldStatusMsg = NULL;
DBVARIANT dbv;
- if (!db_get_ts(hContact, "CList", "StatusMsg", &dbv)) {
+ if (!db_get_ws(hContact, "CList", "StatusMsg", &dbv)) {
oldStatusMsg = make_utf8_string(dbv.ptszVal);
db_free(&dbv);
}
diff --git a/protocols/IcqOscarJ/src/icq_filerequests.cpp b/protocols/IcqOscarJ/src/icq_filerequests.cpp index 93382f6b04..f1855ce4b4 100644 --- a/protocols/IcqOscarJ/src/icq_filerequests.cpp +++ b/protocols/IcqOscarJ/src/icq_filerequests.cpp @@ -155,7 +155,7 @@ void CIcqProto::handleFileRequest(PBYTE buf, DWORD dwUin, DWORD dwCookie, DWORD wchar_t* ptszFileName = mir_utf8decodeW(pszFileName);
PROTORECVFILET pre = { 0 };
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(NULL);
pre.descr.w = mir_utf8decodeW(pszDescription);
diff --git a/protocols/IcqOscarJ/src/icq_opts.cpp b/protocols/IcqOscarJ/src/icq_opts.cpp index a767d5987a..94633b1d97 100644 --- a/protocols/IcqOscarJ/src/icq_opts.cpp +++ b/protocols/IcqOscarJ/src/icq_opts.cpp @@ -93,14 +93,14 @@ static INT_PTR CALLBACK DlgProcIcqOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP LoadDBCheckState(ppro, hwndDlg, IDC_KEEPALIVE, "KeepAlive", DEFAULT_KEEPALIVE_ENABLED);
SendDlgItemMessage(hwndDlg, IDC_LOGLEVEL, TBM_SETRANGE, FALSE, MAKELONG(0, 4));
SendDlgItemMessage(hwndDlg, IDC_LOGLEVEL, TBM_SETPOS, TRUE, 4 - ppro->getByte("ShowLogLevel", LOG_WARNING));
- SetDlgItemText(hwndDlg, IDC_LEVELDESCR, TranslateTS(szLogLevelDescr[4 - SendDlgItemMessage(hwndDlg, IDC_LOGLEVEL, TBM_GETPOS, 0, 0)]));
+ SetDlgItemText(hwndDlg, IDC_LEVELDESCR, TranslateW(szLogLevelDescr[4 - SendDlgItemMessage(hwndDlg, IDC_LOGLEVEL, TBM_GETPOS, 0, 0)]));
ShowDlgItem(hwndDlg, IDC_RECONNECTREQD, SW_HIDE);
LoadDBCheckState(ppro, hwndDlg, IDC_NOERRMULTI, "IgnoreMultiErrorBox", 0);
}
return TRUE;
case WM_HSCROLL:
- SetDlgItemText(hwndDlg, IDC_LEVELDESCR, TranslateTS(szLogLevelDescr[4 - SendDlgItemMessage(hwndDlg, IDC_LOGLEVEL, TBM_GETPOS, 0, 0)]));
+ SetDlgItemText(hwndDlg, IDC_LEVELDESCR, TranslateW(szLogLevelDescr[4 - SendDlgItemMessage(hwndDlg, IDC_LOGLEVEL, TBM_GETPOS, 0, 0)]));
OptDlgChanged(hwndDlg);
break;
@@ -514,7 +514,7 @@ int CIcqProto::OnOptionsInit(WPARAM wParam, LPARAM) odp.pwszGroup = LPGENW("Network");
odp.dwInitParam = LPARAM(this);
odp.pwszTitle = m_tszUserName;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.pwszTab = LPGENW("Account");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ICQ);
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index 0c755f0d79..fe362f382a 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -160,7 +160,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const wchar_t* aUserName) : wchar_t szBuffer[MAX_PATH + 64];
mir_snwprintf(szBuffer, TranslateT("%s server connection"), m_tszUserName);
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.ptszDescriptiveName = szBuffer;
nlu.szSettingsModule = m_szModuleName;
nlu.szHttpGatewayHello = "http://http.proxy.icq.com/hello";
@@ -174,7 +174,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const wchar_t* aUserName) : char szP2PModuleName[MAX_PATH];
mir_snprintf(szP2PModuleName, "%sP2P", m_szModuleName);
mir_snwprintf(szBuffer, TranslateT("%s client-to-client connections"), m_tszUserName);
- nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_UNICODE;
nlu.ptszDescriptiveName = szBuffer;
nlu.szSettingsModule = szP2PModuleName;
nlu.minIncomingPorts = 1;
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index 52f532436f..417541d349 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -893,7 +893,7 @@ void InitXStatusIcons() SKINICONDESC sid = { 0 };
sid.section.a = "Protocols/" ICQ_PROTOCOL_NAME "/" LPGEN("Custom Status");
- sid.flags = SIDF_PATH_TCHAR;
+ sid.flags = SIDF_PATH_UNICODE;
sid.defaultFile.w = InitXStatusIconLibrary(lib, _countof(lib));
for (int i = 0; i < XSTATUS_COUNT; i++) {
@@ -945,13 +945,13 @@ INT_PTR CIcqProto::SetXStatusEx(WPARAM, LPARAM lParam) if (m_bXStatusEnabled && (pData->flags & CSSF_MASK_NAME)) { // set custom status name
if (pData->flags & CSSF_UNICODE)
- setTString(DBSETTING_XSTATUS_NAME, pData->pwszName);
+ setWString(DBSETTING_XSTATUS_NAME, pData->pwszName);
else
setString(DBSETTING_XSTATUS_NAME, pData->pszName);
}
if (pData->flags & CSSF_MASK_MESSAGE) { // set custom status message
if (pData->flags & CSSF_UNICODE)
- setTString(DBSETTING_XSTATUS_MSG, pData->pwszMessage);
+ setWString(DBSETTING_XSTATUS_MSG, pData->pwszMessage);
else
setString(DBSETTING_XSTATUS_MSG, pData->pszMessage);
diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp index d8e50a1837..b1ec3e8330 100644 --- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp +++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp @@ -66,7 +66,7 @@ static int LookupDatabaseSetting(const FieldNamesItem* table, int code, DBVARIAN }
else if (type == DBVT_WCHAR) {
WCHAR* wtext = make_unicode_string(text);
- dbv->pwszVal = mir_wstrdup(TranslateTS(wtext));
+ dbv->pwszVal = mir_wstrdup(TranslateW(wtext));
dbv->type = DBVT_WCHAR;
SAFE_FREE((void**)&wtext);
}
@@ -524,7 +524,7 @@ INT_PTR CIcqProto::SetMyAvatar(WPARAM, LPARAM lParam) wchar_t tmp[MAX_PATH];
PathToRelativeT(tszMyFile, tmp);
- setTString(NULL, "AvatarFile", tmp);
+ setWString(NULL, "AvatarFile", tmp);
SAFE_FREE((void**)&hash);
}
else {
@@ -542,7 +542,7 @@ INT_PTR CIcqProto::SetNickName(WPARAM wParam, LPARAM lParam) return 0; // failure
if (wParam & SMNN_UNICODE)
- setTString("Nick", (WCHAR*)lParam);
+ setWString("Nick", (WCHAR*)lParam);
else
setString("Nick", (char*)lParam);
@@ -668,7 +668,7 @@ INT_PTR icq_getEventTextMissedMessage(WPARAM, LPARAM lParam) MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, pszText, (int)mir_strlen(pszText), pwszText, wchars);
- nRetVal = (INT_PTR)mir_wstrdup(TranslateTS(pwszText));
+ nRetVal = (INT_PTR)mir_wstrdup(TranslateW(pwszText));
}
else if (pEvent->datatype == DBVT_ASCIIZ)
nRetVal = (INT_PTR)mir_strdup(Translate(pszText));
diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp index fdfa9da536..5d5d480194 100644 --- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp +++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp @@ -500,7 +500,7 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, size_t wLen, DWORD dwUin, char * wchar_t* ptszFileName = mir_utf8decodeW(pszFileName);
PROTORECVFILET pre = { 0 };
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(NULL);
pre.descr.w = mir_utf8decodeW(pszDescription);
diff --git a/protocols/IcqOscarJ/src/userinfotab.cpp b/protocols/IcqOscarJ/src/userinfotab.cpp index 25ba1d7e98..f58065619b 100644 --- a/protocols/IcqOscarJ/src/userinfotab.cpp +++ b/protocols/IcqOscarJ/src/userinfotab.cpp @@ -268,7 +268,7 @@ int CIcqProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) return 0;
OPTIONSDIALOGPAGE odp = { 0 };
- odp.flags = ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.hInstance = hInst;
odp.dwInitParam = LPARAM(this);
odp.pfnDlgProc = IcqDlgProc;
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index 3e13e9efe1..c1f05aacbb 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -1443,7 +1443,7 @@ char* __fastcall ICQTranslateUtf(const char *src) { // we can use unicode translate (0.5+)
WCHAR* usrc = make_unicode_string(src);
- szRes = make_utf8_string(TranslateTS(usrc));
+ szRes = make_utf8_string(TranslateW(usrc));
SAFE_FREE((void**)&usrc);
}
@@ -1455,7 +1455,7 @@ char* __fastcall ICQTranslateUtfStatic(const char *src, char *buf, size_t bufsiz if (mir_strlen(src)) { // we can use unicode translate (0.5+)
WCHAR *usrc = make_unicode_string(src);
- make_utf8_string_static(TranslateTS(usrc), buf, bufsize);
+ make_utf8_string_static(TranslateW(usrc), buf, bufsize);
SAFE_FREE((void**)&usrc);
}
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index c074e502ef..18008f7313 100644 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -124,7 +124,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) }
// init fontservice for info frame
- FontIDT fontid = { 0 };
+ FontIDW fontid = { 0 };
fontid.cbSize = sizeof(fontid);
wcsncpy_s(fontid.group, LPGENW("Jabber"), _TRUNCATE);
strncpy_s(fontid.dbSettingsGroup, GLOBAL_SETTING_MODULE, _TRUNCATE);
@@ -141,14 +141,14 @@ static int OnModulesLoaded(WPARAM, LPARAM) wcsncpy_s(fontid.name, LPGENW("Frame title"), _TRUNCATE);
strncpy_s(fontid.prefix, "fntFrameTitle", _TRUNCATE);
fontid.deffontsettings.style = DBFONTF_BOLD;
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
wcsncpy_s(fontid.name, LPGENW("Frame text"), _TRUNCATE);
strncpy_s(fontid.prefix, "fntFrameClock", _TRUNCATE);
fontid.deffontsettings.style = 0;
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
- ColourIDT colourid = {0};
+ ColourIDW colourid = {0};
colourid.cbSize = sizeof(colourid);
wcsncpy_s(colourid.group, L"Jabber", _TRUNCATE);
strncpy_s(colourid.dbSettingsGroup, GLOBAL_SETTING_MODULE, _TRUNCATE);
@@ -156,7 +156,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) wcsncpy_s(colourid.name, L"Background", _TRUNCATE);
strncpy_s(colourid.setting, "clFrameBack", _TRUNCATE);
colourid.defcolour = GetSysColor(COLOR_WINDOW);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
return 0;
}
diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp index e29f3fde4e..b643adf547 100644 --- a/protocols/JabberG/src/jabber_adhoc.cpp +++ b/protocols/JabberG/src/jabber_adhoc.cpp @@ -181,7 +181,7 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, Jabbe const wchar_t *name = XmlGetAttrValue(itemNode, L"name");
if (!name) name = XmlGetAttrValue(itemNode, L"node");
- ypos = AdHoc_AddCommandRadio(GetDlgItem(hwndDlg, IDC_FRAME), TranslateTS(name), nodeIdx, ypos, (nodeIdx == 1) ? 1 : 0);
+ ypos = AdHoc_AddCommandRadio(GetDlgItem(hwndDlg, IDC_FRAME), TranslateW(name), nodeIdx, ypos, (nodeIdx == 1) ? 1 : 0);
dat->CurrentHeight = ypos;
}
}
@@ -232,7 +232,7 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA else if (LPCTSTR ptszTitle = XmlGetText(XmlGetChild(xNode, "title")))
JabberFormSetInstruction(hwndDlg, ptszTitle);
else
- JabberFormSetInstruction(hwndDlg, TranslateTS(status));
+ JabberFormSetInstruction(hwndDlg, TranslateW(status));
JabberFormCreateUI(hFrame, xNode, &dat->CurrentHeight);
ShowDlgItem(hwndDlg, IDC_FRAME, SW_SHOW);
}
@@ -242,7 +242,7 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA sttShowControls(hwndDlg, FALSE, toHide);
LPCTSTR noteText = XmlGetText(XmlGetChild(commandNode, "note"));
- JabberFormSetInstruction(hwndDlg, noteText ? noteText : TranslateTS(status));
+ JabberFormSetInstruction(hwndDlg, noteText ? noteText : TranslateW(status));
}
// check actions
@@ -513,7 +513,7 @@ int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM hContact, LPARAM lParam) int res = -1;
if ((hContact != NULL || lParam != 0) && m_bJabberOnline) {
- ptrW szJid(getTStringA(hContact, "jid"));
+ ptrW szJid(getWStringA(hContact, "jid"));
if (hContact && szJid != NULL) {
JABBER_LIST_ITEM *item = NULL;
int selected = 0;
diff --git a/protocols/JabberG/src/jabber_api.cpp b/protocols/JabberG/src/jabber_api.cpp index 167c518bdc..45fcc27744 100644 --- a/protocols/JabberG/src/jabber_api.cpp +++ b/protocols/JabberG/src/jabber_api.cpp @@ -57,7 +57,7 @@ MCONTACT CJabberProto::ContactFromJID(LPCTSTR jid) LPTSTR CJabberProto::ContactToJID(MCONTACT hContact)
{
- return getTStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : "jid");
+ return getWStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : "jid");
}
LPTSTR CJabberProto::GetBestResourceName(LPCTSTR jid)
@@ -87,7 +87,7 @@ LPTSTR CJabberProto::GetResourceList(LPCTSTR jid) if (!item->arResources.getCount())
return NULL;
- CMString res;
+ CMStringW res;
for (int i=0; i < item->arResources.getCount(); i++) {
res.Append(item->arResources[i]->m_tszResourceName);
res.AppendChar(0);
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index a940fee985..c6cd6c33d2 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -153,7 +153,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt) BOOL bDirect = m_options.BsDirect;
if (m_options.BsProxyManual) {
- ptrW proxyJid( getTStringA("BsProxyServer"));
+ ptrW proxyJid( getWStringA("BsProxyServer"));
if (proxyJid) {
jbt->bProxyDiscovered = FALSE;
jbt->szProxyHost = NULL;
@@ -626,7 +626,7 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt) port = (WORD)_wtoi(szPort);
replaceStrW(jbt->streamhostJID, str);
- debugLog(L"bytestream_recv connecting to %s:%d", szHost, port);
+ debugLogW(L"bytestream_recv connecting to %s:%d", szHost, port);
NETLIBOPENCONNECTION nloc = { 0 };
nloc.cbSize = sizeof(nloc);
nloc.szHost = mir_u2a(szHost);
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp index f4457137c8..0a4e6b25a6 100644 --- a/protocols/JabberG/src/jabber_caps.cpp +++ b/protocols/JabberG/src/jabber_caps.cpp @@ -268,7 +268,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const wchar_t *jid, BOOL app m_clientCapsManager.SetClientCaps(r->m_tszCapsNode, token, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId());
m_ThreadInfo->send(
- XmlNodeIq(pInfo) << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(L"node", CMString(FORMAT, L"%s#%s", r->m_tszCapsNode, token)));
+ XmlNodeIq(pInfo) << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(L"node", CMStringW(FORMAT, L"%s#%s", r->m_tszCapsNode, token)));
bRequestSent = TRUE;
}
@@ -558,12 +558,12 @@ JabberCapsBits CJabberClientCapsManager::GetClientCaps(wchar_t *szNode, wchar_t CJabberClientCaps *pClient = FindClient(szNode);
if (!pClient) {
lck.unlock();
- ppro->debugLog(L"CAPS: get no caps for: %s, %s", szNode, szVer);
+ ppro->debugLogW(L"CAPS: get no caps for: %s, %s", szNode, szVer);
return JABBER_RESOURCE_CAPS_UNINIT;
}
JabberCapsBits jcbCaps = pClient->GetPartialCaps(szVer);
lck.unlock();
- ppro->debugLog(L"CAPS: get caps %I64x for: %s, %s", jcbCaps, szNode, szVer);
+ ppro->debugLogW(L"CAPS: get caps %I64x for: %s, %s", jcbCaps, szNode, szVer);
return jcbCaps;
}
@@ -581,7 +581,7 @@ BOOL CJabberClientCapsManager::SetClientCaps(const wchar_t *szNode, const wchar_ }
BOOL bOk = pClient->SetPartialCaps(szVer, jcbCaps, nIqId);
lck.unlock();
- ppro->debugLog(L"CAPS: set caps %I64x for: %s, %s", jcbCaps, szNode, szVer);
+ ppro->debugLogW(L"CAPS: set caps %I64x for: %s, %s", jcbCaps, szNode, szVer);
return bOk;
}
diff --git a/protocols/JabberG/src/jabber_captcha.cpp b/protocols/JabberG/src/jabber_captcha.cpp index 0de9eda1bb..e775f43923 100644 --- a/protocols/JabberG/src/jabber_captcha.cpp +++ b/protocols/JabberG/src/jabber_captcha.cpp @@ -50,7 +50,7 @@ INT_PTR CALLBACK JabberCaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPCTSTR hint = params->hint;
if (hint == NULL)
hint = TranslateT("Enter the text you see");
- SetDlgItemText(hwndDlg, IDC_INSTRUCTION, TranslateTS(hint));
+ SetDlgItemText(hwndDlg, IDC_INSTRUCTION, TranslateW(hint));
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)params);
return TRUE;
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 4f3cf9534c..d5599c001b 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -74,7 +74,7 @@ struct TRoleOrAffiliationInfo }
void translate()
{
- this->title = TranslateTS(this->title_en);
+ this->title = TranslateW(this->title_en);
}
};
@@ -141,27 +141,27 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM *item) if (JABBER_LIST_ITEM *bookmark = ListGetItemPtr(LIST_BOOKMARK, item->jid)) {
if (bookmark->name) {
- ptrW myHandle(db_get_tsa(si->hContact, "CList", "MyHandle"));
+ ptrW myHandle(db_get_wsa(si->hContact, "CList", "MyHandle"));
if (myHandle == NULL)
- db_set_ts(si->hContact, "CList", "MyHandle", bookmark->name);
+ db_set_ws(si->hContact, "CList", "MyHandle", bookmark->name);
}
}
- ptrW tszNick(getTStringA(si->hContact, "MyNick"));
+ ptrW tszNick(getWStringA(si->hContact, "MyNick"));
if (tszNick != NULL) {
if (!mir_wstrcmp(tszNick, szNick))
delSetting(si->hContact, "MyNick");
else
- setTString(si->hContact, "MyNick", item->nick);
+ setWString(si->hContact, "MyNick", item->nick);
}
- else setTString(si->hContact, "MyNick", item->nick);
+ else setWString(si->hContact, "MyNick", item->nick);
- ptrW passw(getTStringA(si->hContact, "Password"));
+ ptrW passw(getWStringA(si->hContact, "Password"));
if (lstrcmp_null(passw, item->password)) {
if (!item->password || !item->password[0])
delSetting(si->hContact, "Password");
else
- setTString(si->hContact, "Password", item->password);
+ setWString(si->hContact, "Password", item->password);
}
}
@@ -170,7 +170,7 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM *item) GCDEST gcd = { m_szModuleName, item->jid, GC_EVENT_ADDGROUP };
GCEVENT gce = { sizeof(gce), &gcd };
for (int i = _countof(sttStatuses) - 1; i >= 0; i--) {
- gce.ptszStatus = TranslateTS(sttStatuses[i]);
+ gce.ptszStatus = TranslateW(sttStatuses[i]);
CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
}
@@ -184,7 +184,7 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus {
if (!item || !user || (item->bChatActive != 2)) return;
- CMString buf;
+ CMStringW buf;
switch (type) {
case INFO_BAN:
@@ -300,7 +300,7 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const wchar_t }
gce.ptszText = TranslateT("Moderator");
}
- gce.ptszStatus = TranslateTS(sttStatuses[JabberGcGetStatus(JS)]);
+ gce.ptszStatus = TranslateW(sttStatuses[JabberGcGetStatus(JS)]);
gce.bIsMe = (mir_wstrcmp(nick, myNick) == 0);
statusToSet = JS->m_iStatus;
break;
@@ -331,11 +331,11 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, HXML reason) wchar_t *szMessage = NULL;
if (code != 307 && code != 301) {
- ptrW tszMessage(getTStringA("GcMsgQuit"));
+ ptrW tszMessage(getWStringA("GcMsgQuit"));
if (tszMessage != NULL)
szMessage = NEWWSTR_ALLOCA(tszMessage);
else
- szMessage = TranslateTS(JABBER_GC_MSG_QUIT);
+ szMessage = TranslateW(JABBER_GC_MSG_QUIT);
}
else {
ptrW myNick(JabberNickFromJID(m_szJabberJID));
@@ -729,7 +729,7 @@ public: {
CSuper::OnInitDialog();
- SetDlgItemText(m_hwnd, IDC_HEADERBAR, CMString(FORMAT, TranslateT("Invite Users to\n%s"), m_room));
+ SetDlgItemText(m_hwnd, IDC_HEADERBAR, CMStringW(FORMAT, TranslateT("Invite Users to\n%s"), m_room));
Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_GROUP));
SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_CLIST), GWL_STYLE,
@@ -786,7 +786,7 @@ public: if (int hItem = SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0)) {
if (SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) {
- ptrW jid(m_proto->getTStringA(hContact, "jid"));
+ ptrW jid(m_proto->getWStringA(hContact, "jid"));
if (jid != NULL)
InviteUser(jid, text);
}
@@ -998,7 +998,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* enum { BAN_KICK_INTERVAL = 1000 };
static DWORD dwLastBanKickTime = 0;
- CMString szBuffer, szTitle;
+ CMStringW szBuffer, szTitle;
if ((gch->dwData >= CLISTMENUIDMIN) && (gch->dwData <= CLISTMENUIDMAX)) {
if (him->m_tszRealJid && *him->m_tszRealJid)
@@ -1010,9 +1010,9 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* switch (gch->dwData) {
case IDM_SLAP:
if (ppro->m_bJabberOnline) {
- ptrW szMessage(ppro->getTStringA("GcMsgSlap"));
+ ptrW szMessage(ppro->getWStringA("GcMsgSlap"));
if (szMessage == NULL)
- szMessage = mir_wstrdup(TranslateTS(JABBER_GC_MSG_SLAP));
+ szMessage = mir_wstrdup(TranslateW(JABBER_GC_MSG_SLAP));
wchar_t buf[256];
// do not use snprintf to avoid possible problems with % symbol
@@ -1031,10 +1031,10 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* case IDM_VCARD:
{
- CMString jid(FORMAT, L"%s/%s", item->jid, him->m_tszResourceName);
+ CMStringW jid(FORMAT, L"%s/%s", item->jid, him->m_tszResourceName);
MCONTACT hContact = ppro->AddToListByJID(jid, PALF_TEMPORARY);
- ppro->setTString(hContact, "Nick", him->m_tszResourceName);
+ ppro->setWString(hContact, "Nick", him->m_tszResourceName);
ppro->ListAdd(LIST_VCARD_TEMP, jid, hContact);
ppro->ListAddResource(LIST_VCARD_TEMP, jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority);
@@ -1217,7 +1217,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* if (him->m_tszRealJid && *him->m_tszRealJid) {
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.id.w = NEWWSTR_ALLOCA(him->m_tszRealJid);
if (wchar_t *tmp = wcschr(psr.id.w, '/'))
*tmp = 0;
@@ -1235,7 +1235,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* gch)
{
- CMString szBuffer, szTitle;
+ CMStringW szBuffer, szTitle;
switch (gch->dwData) {
case IDM_LST_PARTICIPANT:
@@ -1372,7 +1372,7 @@ static void sttSendPrivateMessage(CJabberProto *ppro, JABBER_LIST_ITEM *item, co ppro->setWord(hContact, "Status", r->m_iStatus);
db_set_b(hContact, "CList", "Hidden", 1);
- ppro->setTString(hContact, "Nick", nick);
+ ppro->setWString(hContact, "Nick", nick);
db_set_dw(hContact, "Ignore", "Mask1", 0);
CallService(MS_MSG_SENDMESSAGE, hContact, 0);
}
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp index 28af8638a0..1a330e2ae7 100644 --- a/protocols/JabberG/src/jabber_console.cpp +++ b/protocols/JabberG/src/jabber_console.cpp @@ -346,7 +346,7 @@ void CJabberDlgConsole::OnInitDialog() m_proto->m_filterInfo.type = (TFilterInfo::Type)m_proto->getByte("consoleWnd_ftype", TFilterInfo::T_OFF);
*m_proto->m_filterInfo.pattern = 0;
- ptrW tszPattern( m_proto->getTStringA("consoleWnd_fpattern"));
+ ptrW tszPattern( m_proto->getWStringA("consoleWnd_fpattern"));
if (tszPattern != NULL)
mir_wstrncpy(m_proto->m_filterInfo.pattern, tszPattern, _countof(m_proto->m_filterInfo.pattern));
@@ -397,7 +397,7 @@ void CJabberDlgConsole::OnClose() m_proto->setByte("consoleWnd_presence", m_proto->m_filterInfo.presence);
m_proto->setByte("consoleWnd_iq", m_proto->m_filterInfo.iq);
m_proto->setByte("consoleWnd_ftype", m_proto->m_filterInfo.type);
- m_proto->setTString("consoleWnd_fpattern", m_proto->m_filterInfo.pattern);
+ m_proto->setWString("consoleWnd_fpattern", m_proto->m_filterInfo.pattern);
Utils_SaveWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "consoleWnd_");
DestroyWindow(m_hwnd);
@@ -568,7 +568,7 @@ INT_PTR CJabberDlgConsole::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) for (i = 0; i < _countof(filter_modes); i++)
AppendMenu(hMenu,
MF_STRING | ((filter_modes[i].type == m_proto->m_filterInfo.type) ? MF_CHECKED : 0),
- filter_modes[i].type + 1, TranslateTS(filter_modes[i].title));
+ filter_modes[i].type + 1, TranslateW(filter_modes[i].title));
RECT rc; GetWindowRect(GetDlgItem(m_hwnd, IDC_BTN_FILTER), &rc);
CheckDlgButton(m_hwnd, IDC_BTN_FILTER, BST_CHECKED);
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index 9f2d52f03e..6fefdf6ca2 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -450,14 +450,14 @@ void CJabberProto::PerformBrowse(HWND hwndDlg) for (int i = 0; i < count; i++) {
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "discoWnd_favName_%d", i);
- ptrW tszName(getTStringA(setting));
+ ptrW tszName(getWStringA(setting));
if (tszName == NULL)
continue;
mir_snprintf(setting, "discoWnd_favJID_%d", i);
- ptrW dbvJid(getTStringA(setting));
+ ptrW dbvJid(getWStringA(setting));
mir_snprintf(setting, "discoWnd_favNode_%d", i);
- ptrW dbvNode(getTStringA(setting));
+ ptrW dbvNode(getWStringA(setting));
CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(dbvJid, dbvNode, tszName);
SendBothRequests(pNode, NULL);
}
@@ -802,7 +802,7 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *) for (int i = 0; i < count; i++) {
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "discoWnd_favName_%d", i);
- ptrW tszName(m_proto->getTStringA(setting));
+ ptrW tszName(m_proto->getWStringA(setting));
if (tszName != NULL) {
HMENU hSubMenu = CreatePopupMenu();
AppendMenu(hSubMenu, MF_STRING, 100 + i * 10 + 0, TranslateT("Navigate"));
@@ -851,11 +851,11 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *) char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "discoWnd_favJID_%d", res);
- ptrW dbv(m_proto->getTStringA(setting));
+ ptrW dbv(m_proto->getWStringA(setting));
if (dbv) SetDlgItemText(m_hwnd, IDC_COMBO_JID, dbv);
mir_snprintf(setting, "discoWnd_favNode_%d", res);
- dbv = m_proto->getTStringA(setting);
+ dbv = m_proto->getWStringA(setting);
if (dbv) SetDlgItemText(m_hwnd, IDC_COMBO_NODE, dbv);
PostMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_BUTTON_BROWSE, 0), 0);
@@ -1235,9 +1235,9 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM MCONTACT hContact;
if ((items[i].action == SD_ACT_USERMENU) && (hContact = HContactFromJID(pNode->GetJid()))) {
HMENU hContactMenu = Menu_BuildContactMenu(hContact);
- AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT_PTR)hContactMenu, TranslateTS(items[i].title));
+ AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT_PTR)hContactMenu, TranslateW(items[i].title));
}
- else AppendMenu(hMenu, MF_STRING, items[i].action, TranslateTS(items[i].title));
+ else AppendMenu(hMenu, MF_STRING, items[i].action, TranslateW(items[i].title));
lastSeparator = FALSE;
}
else if (!lastSeparator) {
@@ -1257,7 +1257,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM if (bFeatureOk) {
if (items[i].title) {
- AppendMenu(hMenu, MF_STRING, items[i].action, TranslateTS(items[i].title));
+ AppendMenu(hMenu, MF_STRING, items[i].action, TranslateW(items[i].title));
lastSeparator = FALSE;
}
else if (!lastSeparator) {
@@ -1341,11 +1341,11 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM char setting[MAXMODULELABELLENGTH];
int count = getDword("discoWnd_favCount", 0);
mir_snprintf(setting, "discoWnd_favName_%d", count);
- setTString(setting, pNode->GetName() ? pNode->GetName() : pNode->GetJid());
+ setWString(setting, pNode->GetName() ? pNode->GetName() : pNode->GetJid());
mir_snprintf(setting, "discoWnd_favJID_%d", count);
- setTString(setting, pNode->GetJid());
+ setWString(setting, pNode->GetJid());
mir_snprintf(setting, "discoWnd_favNode_%d", count);
- setTString(setting, pNode->GetNode() ? pNode->GetNode() : L"");
+ setWString(setting, pNode->GetNode() ? pNode->GetNode() : L"");
setDword("discoWnd_favCount", ++count);
}
break;
@@ -1365,7 +1365,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM case SD_ACT_PROXY:
m_options.BsDirect = FALSE;
m_options.BsProxyManual = TRUE;
- setTString("BsProxyServer", pNode->GetJid());
+ setWString("BsProxyServer", pNode->GetJid());
break;
case SD_ACT_JOIN:
diff --git a/protocols/JabberG/src/jabber_disco.h b/protocols/JabberG/src/jabber_disco.h index ecc55393e6..dbef9300f7 100644 --- a/protocols/JabberG/src/jabber_disco.h +++ b/protocols/JabberG/src/jabber_disco.h @@ -347,7 +347,7 @@ public: BOOL GetTooltipText(wchar_t *szText, int nMaxLength)
{
- CMString tszTmp;
+ CMStringW tszTmp;
tszTmp.AppendFormat(L"Jid: %s\r\n", m_szJid);
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp index 61aecd3a6b..c02aed14c2 100644 --- a/protocols/JabberG/src/jabber_events.cpp +++ b/protocols/JabberG/src/jabber_events.cpp @@ -36,7 +36,7 @@ int CJabberProto::OnContactDeleted(WPARAM hContact, LPARAM) if (!m_bJabberOnline) // should never happen
return 0;
- ptrW jid(getTStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : "jid"));
+ ptrW jid(getWStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : "jid"));
if (jid == NULL)
return 0;
@@ -76,13 +76,13 @@ static wchar_t* sttSettingToTchar(DBCONTACTWRITESETTING *cws) void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, MCONTACT hContact)
{
- JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrW(getTStringA(hContact, "jid")));
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrW(getWStringA(hContact, "jid")));
if (item == NULL)
return;
- ptrW tszNick(db_get_tsa(hContact, "CList", "MyHandle"));
+ ptrW tszNick(db_get_wsa(hContact, "CList", "MyHandle"));
if (tszNick == NULL)
- tszNick = getTStringA(hContact, "Nick");
+ tszNick = getWStringA(hContact, "Nick");
if (tszNick == NULL)
tszNick = JabberNickFromJID(item->jid);
if (tszNick == NULL)
@@ -97,7 +97,7 @@ void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, MCONTACT hC else {
wchar_t *p = sttSettingToTchar(cws);
if (cws->value.pszVal != NULL && mir_wstrcmp(p, item->group)) {
- debugLog(L"Group set to %s", p);
+ debugLogW(L"Group set to %s", p);
if (p)
AddContactToRoster(item->jid, tszNick, p);
}
@@ -107,7 +107,7 @@ void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, MCONTACT hC void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING *cws, MCONTACT hContact)
{
- JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrW( getTStringA(hContact, "jid")));
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrW( getWStringA(hContact, "jid")));
if (item == NULL)
return;
@@ -120,7 +120,7 @@ void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING *cws, MCONTACT ptrW newNick( sttSettingToTchar(cws));
if (newNick && mir_wstrcmp(item->nick, newNick)) {
- debugLog(L"Renaming contact %s: %s -> %s", item->jid, item->nick, newNick);
+ debugLogW(L"Renaming contact %s: %s -> %s", item->jid, item->nick, newNick);
AddContactToRoster(item->jid, newNick, item->group);
}
}
@@ -130,23 +130,23 @@ void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING *cws, MCONT if (cws->value.type != DBVT_DELETED && !(cws->value.type == DBVT_BYTE && cws->value.bVal == 0))
return;
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid == NULL)
return;
- debugLog(L"Add %s permanently to list", jid);
- ptrW nick(db_get_tsa(hContact, "CList", "MyHandle"));
+ debugLogW(L"Add %s permanently to list", jid);
+ ptrW nick(db_get_wsa(hContact, "CList", "MyHandle"));
if (nick == NULL)
- nick = getTStringA(hContact, "Nick");
+ nick = getWStringA(hContact, "Nick");
if (nick == NULL)
nick = JabberNickFromJID(jid);
if (nick == NULL)
return;
- AddContactToRoster(jid, nick, ptrW(db_get_tsa(hContact, "CList", "Group")));
+ AddContactToRoster(jid, nick, ptrW(db_get_wsa(hContact, "CList", "Group")));
XmlNode xPresence(L"presence"); xPresence << XATTR(L"to", LPCTSTR(jid)) << XATTR(L"type", L"subscribe");
- ptrW myNick(getTStringA(NULL, "Nick"));
+ ptrW myNick(getWStringA(NULL, "Nick"));
if (myNick != NULL)
xPresence << XCHILD(L"nick", LPCTSTR(myNick)) << XATTR(L"xmlns", JABBER_FEAT_NICK);
m_ThreadInfo->send(xPresence);
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp index 27eda280b2..efb423bb95 100644 --- a/protocols/JabberG/src/jabber_file.cpp +++ b/protocols/JabberG/src/jabber_file.cpp @@ -390,11 +390,11 @@ int CJabberProto::FileSendParse(JABBER_SOCKET s, filetransfer *ft, char* buffer, if (ft->httpPath == NULL)
debugLogA("Requested file name does not matched (httpPath == NULL)");
else
- debugLog(L"Requested file name does not matched ('%s' vs. '%s')", ft->httpPath, t);
+ debugLogW(L"Requested file name does not matched ('%s' vs. '%s')", ft->httpPath, t);
ft->state = FT_ERROR;
break;
}
- debugLog(L"Sending [%s]", ft->std.ptszFiles[currentFile]);
+ debugLogW(L"Sending [%s]", ft->std.ptszFiles[currentFile]);
_wstat64(ft->std.ptszFiles[currentFile], &statbuf); // file size in statbuf.st_size
if ((fileId = _wopen(ft->std.ptszFiles[currentFile], _O_BINARY | _O_RDONLY)) < 0) {
debugLogA("File cannot be opened");
@@ -448,7 +448,7 @@ filetransfer::filetransfer(CJabberProto *proto) ppro = proto;
fileId = -1;
std.cbSize = sizeof(std);
- std.flags = PFTS_TCHAR;
+ std.flags = PFTS_UNICODE;
}
filetransfer::~filetransfer()
@@ -512,12 +512,12 @@ int filetransfer::create() WaitForSingleObject(hWaitEvent, INFINITE);
if (fileId == -1) {
- ppro->debugLog(L"Saving to [%s]", std.tszCurrentFile);
+ ppro->debugLogW(L"Saving to [%s]", std.tszCurrentFile);
fileId = _wopen(std.tszCurrentFile, _O_BINARY | _O_CREAT | _O_TRUNC | _O_WRONLY, _S_IREAD | _S_IWRITE);
}
if (fileId == -1)
- ppro->debugLog(L"Cannot create file '%s' during a file transfer", filefull);
+ ppro->debugLogW(L"Cannot create file '%s' during a file transfer", filefull);
else if (std.currentFileSize != 0)
_chsize(fileId, std.currentFileSize);
diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp index ceabe55ba9..e1ee55f08a 100644 --- a/protocols/JabberG/src/jabber_form.cpp +++ b/protocols/JabberG/src/jabber_form.cpp @@ -727,7 +727,7 @@ static INT_PTR CALLBACK JabberFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, L"title")) != NULL && XmlGetText(n) != NULL)
SetWindowText(hwndDlg, XmlGetText(n));
else
- SetWindowText(hwndDlg, TranslateTS(jfi->defTitle));
+ SetWindowText(hwndDlg, TranslateW(jfi->defTitle));
// Set instruction field
if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, L"instructions")) != NULL && XmlGetText(n) != NULL)
@@ -736,7 +736,7 @@ static INT_PTR CALLBACK JabberFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, L"title")) != NULL && XmlGetText(n) != NULL)
JabberFormSetInstruction(hwndDlg, XmlGetText(n));
else
- JabberFormSetInstruction(hwndDlg, TranslateTS(jfi->defTitle));
+ JabberFormSetInstruction(hwndDlg, TranslateW(jfi->defTitle));
}
// Create form
diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp index e1da41f62c..d9e880c771 100644 --- a/protocols/JabberG/src/jabber_frame.cpp +++ b/protocols/JabberG/src/jabber_frame.cpp @@ -82,7 +82,7 @@ CJabberInfoFrame::CJabberInfoFrame(CJabberProto *proto): frame.hWnd = CreateWindowEx(0, L"JabberInfoFrameClass", NULL, WS_CHILD|WS_VISIBLE, 0, 0, 100, 100, hwndClist, NULL, hInst, this);
frame.align = alBottom;
frame.height = 2 * SZ_FRAMEPADDING + GetSystemMetrics(SM_CYSMICON) + SZ_LINEPADDING; // compact height by default
- frame.Flags = F_VISIBLE|F_LOCKED|F_NOBORDER|F_TCHAR;
+ frame.Flags = F_VISIBLE|F_LOCKED|F_NOBORDER|F_UNICODE;
frame.tname = mir_a2u(proto->m_szModuleName);
frame.TBtname = proto->m_tszUserName;
m_frameId = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0);
@@ -240,24 +240,24 @@ void CJabberInfoFrame::ReloadFonts() {
LOGFONT lfFont;
- FontIDT fontid = {0};
+ FontIDW fontid = {0};
fontid.cbSize = sizeof(fontid);
wcsncpy_s(fontid.group, L"Jabber", _TRUNCATE);
wcsncpy_s(fontid.name, L"Frame title", _TRUNCATE);
- m_clTitle = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lfFont);
+ m_clTitle = CallService(MS_FONT_GETW, (WPARAM)&fontid, (LPARAM)&lfFont);
DeleteObject(m_hfntTitle);
m_hfntTitle = CreateFontIndirect(&lfFont);
wcsncpy_s(fontid.name, L"Frame text", _TRUNCATE);
- m_clText = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lfFont);
+ m_clText = CallService(MS_FONT_GETW, (WPARAM)&fontid, (LPARAM)&lfFont);
DeleteObject(m_hfntText);
m_hfntText = CreateFontIndirect(&lfFont);
- ColourIDT colourid = {0};
+ ColourIDW colourid = {0};
colourid.cbSize = sizeof(colourid);
wcsncpy_s(colourid.group, L"Jabber", _TRUNCATE);
wcsncpy_s(colourid.name, L"Background", _TRUNCATE);
- m_clBack = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, 0);
+ m_clBack = CallService(MS_COLOUR_GETW, (WPARAM)&colourid, 0);
UpdateSize();
}
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp index 01ef6ac638..e68ce31eac 100644 --- a/protocols/JabberG/src/jabber_ft.cpp +++ b/protocols/JabberG/src/jabber_ft.cpp @@ -187,10 +187,10 @@ BOOL CJabberProto::FtSend(HANDLE hConn, filetransfer *ft) char* buffer;
int numRead;
- debugLog(L"Sending [%s]", ft->std.ptszFiles[ft->std.currentFileNumber]);
+ debugLogW(L"Sending [%s]", ft->std.ptszFiles[ft->std.currentFileNumber]);
_wstat64(ft->std.ptszFiles[ft->std.currentFileNumber], &statbuf); // file size in statbuf.st_size
if ((fd = _wopen(ft->std.ptszFiles[ft->std.currentFileNumber], _O_BINARY | _O_RDONLY)) < 0) {
- debugLog(L"File cannot be opened");
+ debugLogW(L"File cannot be opened");
return FALSE;
}
@@ -217,7 +217,7 @@ BOOL CJabberProto::FtSend(HANDLE hConn, filetransfer *ft) BOOL CJabberProto::FtIbbSend(int blocksize, filetransfer *ft)
{
- debugLog(L"Sending [%s]", ft->std.ptszFiles[ft->std.currentFileNumber]);
+ debugLogW(L"Sending [%s]", ft->std.ptszFiles[ft->std.currentFileNumber]);
struct _stati64 statbuf;
_wstat64(ft->std.ptszFiles[ft->std.currentFileNumber], &statbuf); // file size in statbuf.st_size
@@ -375,7 +375,7 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode) ft->std.totalBytes = ft->std.currentFileSize = filesize;
PROTORECVFILET pre = { 0 };
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(NULL);
pre.files.w = (wchar_t**)&filename;
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index 52bef54a38..433414bb59 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -120,16 +120,16 @@ struct JabberGcRecentInfo {
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "rcMuc_%d_server", iRecent);
- m_server = ppro->getTStringA(setting);
+ m_server = ppro->getWStringA(setting);
mir_snprintf(setting, "rcMuc_%d_room", iRecent);
- m_room = ppro->getTStringA(setting);
+ m_room = ppro->getWStringA(setting);
mir_snprintf(setting, "rcMuc_%d_nick", iRecent);
- m_nick = ppro->getTStringA(setting);
+ m_nick = ppro->getWStringA(setting);
mir_snprintf(setting, "password_rcMuc_%d", iRecent);
- m_password = ppro->getTStringA(NULL, setting);
+ m_password = ppro->getWStringA(NULL, setting);
return m_room || m_server || m_nick || m_password;
}
@@ -140,25 +140,25 @@ struct JabberGcRecentInfo mir_snprintf(setting, "rcMuc_%d_server", iRecent);
if (m_server)
- ppro->setTString(setting, m_server);
+ ppro->setWString(setting, m_server);
else
ppro->delSetting(setting);
mir_snprintf(setting, "rcMuc_%d_room", iRecent);
if (m_room)
- ppro->setTString(setting, m_room);
+ ppro->setWString(setting, m_room);
else
ppro->delSetting(setting);
mir_snprintf(setting, "rcMuc_%d_nick", iRecent);
if (m_nick)
- ppro->setTString(setting, m_nick);
+ ppro->setWString(setting, m_nick);
else
ppro->delSetting(setting);
mir_snprintf(setting, "password_rcMuc_%d", iRecent);
if (m_password)
- ppro->setTString(setting, m_password);
+ ppro->setWString(setting, m_password);
else
ppro->delSetting(setting);
}
@@ -185,16 +185,16 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleJoinGroupchat(WPARAM, LPARAM) INT_PTR __cdecl CJabberProto::OnJoinChat(WPARAM hContact, LPARAM)
{
- ptrW jid(getTStringA(hContact, "ChatRoomID"));
+ ptrW jid(getWStringA(hContact, "ChatRoomID"));
if (jid == NULL)
return 0;
- ptrW nick(getTStringA(hContact, "MyNick"));
+ ptrW nick(getWStringA(hContact, "MyNick"));
if (nick == NULL)
- if ((nick = getTStringA("Nick")) == NULL)
+ if ((nick = getWStringA("Nick")) == NULL)
return 0;
- ptrW password(getTStringA(hContact, "Password"));
+ ptrW password(getWStringA(hContact, "Password"));
if (getWord(hContact, "Status", 0) != ID_STATUS_ONLINE) {
wchar_t *p = wcschr(jid, '@');
@@ -209,7 +209,7 @@ INT_PTR __cdecl CJabberProto::OnJoinChat(WPARAM hContact, LPARAM) INT_PTR __cdecl CJabberProto::OnLeaveChat(WPARAM hContact, LPARAM)
{
- ptrW jid(getTStringA(hContact, "ChatRoomID"));
+ ptrW jid(getWStringA(hContact, "ChatRoomID"));
if (jid != NULL) {
if (getWord(hContact, "Status", 0) != ID_STATUS_OFFLINE) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, jid);
@@ -439,7 +439,7 @@ void CJabberDlgGcJoin::OnInitDialog() delete pInfo;
}
- ptrW tszNick(m_proto->getTStringA("Nick"));
+ ptrW tszNick(m_proto->getWStringA("Nick"));
if (tszNick == NULL)
tszNick = JabberNickFromJID(m_proto->m_szJabberJID);
SetDlgItemText(m_hwnd, IDC_NICK, tszNick);
@@ -747,14 +747,14 @@ static VOID CALLBACK JabberGroupchatChangeNickname(void* arg) JABBER_LIST_ITEM *item = param->ppro->ListGetItemPtr(LIST_CHATROOM, param->jid);
if (item != NULL) {
- CMString szBuffer, szTitle;
+ CMStringW szBuffer, szTitle;
szTitle.Format(TranslateT("Change nickname in <%s>"), item->name ? item->name : item->jid);
if (item->nick)
szBuffer = item->nick;
if (param->ppro->EnterString(szBuffer, szTitle, ESF_COMBO, "gcNick_")) {
replaceStrW(item->nick, szBuffer);
- param->ppro->SendPresenceTo(param->ppro->m_iStatus, CMString(FORMAT, L"%s/%s", item->jid, szBuffer), NULL);
+ param->ppro->SendPresenceTo(param->ppro->m_iStatus, CMStringW(FORMAT, L"%s/%s", item->jid, szBuffer), NULL);
}
}
@@ -792,7 +792,7 @@ void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const wchar_t * MCONTACT hContact = HContactFromJID(item->jid);
if (hContact != NULL)
- setTString(hContact, "MyNick", newNick);
+ setWString(hContact, "MyNick", newNick);
}
GCDEST gcd = { m_szModuleName, item->jid, GC_EVENT_CHUID };
@@ -1000,7 +1000,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node) ptrW str(JabberErrorMsg(errorNode, &errorCode));
if (errorCode == JABBER_ERROR_CONFLICT) {
- ptrW newNick(getTStringA("GcAltNick"));
+ ptrW newNick(getWStringA("GcAltNick"));
if (++item->iChatState == 1 && newNick != NULL && newNick[0] != 0) {
replaceStrW(item->nick, newNick);
wchar_t text[1024] = { 0 };
@@ -1026,7 +1026,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node) HXML n, m;
const wchar_t *from, *type, *p, *nick, *resource;
JABBER_LIST_ITEM *item;
- CMString imgLink;
+ CMStringW imgLink;
if (!XmlGetName(node) || mir_wstrcmp(XmlGetName(node), L"message")) return;
if ((from = XmlGetAttrValue(node, L"from")) == NULL) return;
@@ -1106,7 +1106,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node) }
else nick = NULL;
- CMString tszText(msgText);
+ CMStringW tszText(msgText);
tszText.Replace(L"%", L"%%");
tszText += imgLink;
@@ -1141,7 +1141,7 @@ class CGroupchatInviteAcceptDlg : public CJabberDlgBase {
typedef CJabberDlgBase CSuper;
CCtrlButton m_accept;
- CMString m_roomJid, m_from, m_reason, m_password;
+ CMStringW m_roomJid, m_from, m_reason, m_password;
public:
CGroupchatInviteAcceptDlg(CJabberProto *ppro, const wchar_t *roomJid, const wchar_t *from, const wchar_t *reason, const wchar_t *password) :
@@ -1193,9 +1193,9 @@ void CJabberProto::GroupchatProcessInvite(const wchar_t *roomJid, const wchar_t return;
if (m_options.AutoAcceptMUC) {
- ptrW nick(getTStringA(HContactFromJID(m_szJabberJID), "MyNick"));
+ ptrW nick(getWStringA(HContactFromJID(m_szJabberJID), "MyNick"));
if (nick == NULL)
- nick = getTStringA("Nick");
+ nick = getWStringA("Nick");
if (nick == NULL)
nick = JabberNickFromJID(m_szJabberJID);
AcceptGroupchatInvite(roomJid, nick, password);
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index 64aae7a25b..1a83ffad04 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -124,7 +124,7 @@ void CIconPool::RegisterIcon(const char *name, wchar_t *filename, int iconid, wc sid.pszName = szSettingName;
sid.section.w = szSection;
sid.description.w = szDescription;
- sid.flags = SIDF_ALL_TCHAR;
+ sid.flags = SIDF_ALL_UNICODE;
sid.iDefaultIndex = iconid;
item->m_hIcolibItem = IcoLib_AddIcon(&sid);
@@ -292,7 +292,7 @@ static HICON LoadTransportIcon(char *filename, int i, char *IconName, wchar_t *S sid.description.w = Description;
sid.defaultFile.a = szMyPath;
sid.iDefaultIndex = i;
- sid.flags = SIDF_TCHAR;
+ sid.flags = SIDF_UNICODE;
IcoLib_AddIcon(&sid);
}
return IcoLib_GetIcon(IconName);
@@ -389,7 +389,7 @@ INT_PTR __cdecl CJabberProto::JGetAdvancedStatusIcon(WPARAM hContact, LPARAM) if (!getByte(hContact, "IsTransported", 0))
return -1;
- int iID = GetTransportProtoID(ptrW(getTStringA(hContact, "Transport")));
+ int iID = GetTransportProtoID(ptrW(getWStringA(hContact, "Transport")));
if (iID < 0)
return -1;
@@ -436,7 +436,7 @@ BOOL CJabberProto::DBCheckIsTransportedContact(const wchar_t *jid, MCONTACT hCon }
if (isTransported) {
- setTString(hContact, "Transport", domain);
+ setWString(hContact, "Transport", domain);
setByte(hContact, "IsTransported", 1);
}
return isTransported;
@@ -445,7 +445,7 @@ BOOL CJabberProto::DBCheckIsTransportedContact(const wchar_t *jid, MCONTACT hCon void CJabberProto::CheckAllContactsAreTransported()
{
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid)
DBCheckIsTransportedContact(jid, hContact);
}
diff --git a/protocols/JabberG/src/jabber_iq.cpp b/protocols/JabberG/src/jabber_iq.cpp index 79db2a2232..a34fa92b9f 100644 --- a/protocols/JabberG/src/jabber_iq.cpp +++ b/protocols/JabberG/src/jabber_iq.cpp @@ -171,7 +171,7 @@ void CJabberIqManager::ExpireInfo(CJabberIqInfo *pInfo) if ((pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_HCONTACT) && (pInfo->m_szFrom))
pInfo->m_hContact = ppro->HContactFromJID(pInfo->m_szFrom);
- ppro->debugLog(L"Expiring iq id %d, sent to %s", pInfo->m_nIqId, pInfo->m_szReceiver ? pInfo->m_szReceiver : L"server");
+ ppro->debugLogW(L"Expiring iq id %d, sent to %s", pInfo->m_nIqId, pInfo->m_szReceiver ? pInfo->m_szReceiver : L"server");
pInfo->m_nIqType = JABBER_IQ_TYPE_FAIL;
(ppro->*(pInfo->m_pHandler))(NULL, pInfo);
@@ -336,7 +336,7 @@ bool CJabberIqManager::HandleIqPermanent(HXML pNode) if ((pInfo.m_dwParamsToParse & JABBER_IQ_PARSE_HCONTACT) && (iqInfo.m_szFrom))
iqInfo.m_hContact = ppro->HContactFromJID(iqInfo.m_szFrom);
- ppro->debugLog(L"Handling iq id %s, type %s, from %s", iqInfo.m_szId, szType, iqInfo.m_szFrom);
+ ppro->debugLogW(L"Handling iq id %s, type %s, from %s", iqInfo.m_szId, szType, iqInfo.m_szFrom);
if ((ppro->*(pInfo.m_pHandler))(pNode, &iqInfo))
return true;
}
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index 84e5c93ef8..301b24e15b 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -227,7 +227,7 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo) // invalid JID
if (!bRetVal) {
- debugLog(L"<iq/> attempt to hack via roster push from %s", pInfo->GetFrom());
+ debugLogW(L"<iq/> attempt to hack via roster push from %s", pInfo->GetFrom());
return TRUE;
}
}
@@ -256,7 +256,7 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo) if (hContact == NULL)
hContact = DBCreateContact(jid, nick, false, false);
else
- setTString(hContact, "jid", jid);
+ setWString(hContact, "jid", jid);
JABBER_LIST_ITEM *item = ListAdd(LIST_ROSTER, jid, hContact);
replaceStrW(item->nick, nick);
@@ -265,21 +265,21 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo) replaceStrW(item->group, XmlGetText(groupNode));
if (name != NULL) {
- ptrW tszNick(getTStringA(hContact, "Nick"));
+ ptrW tszNick(getWStringA(hContact, "Nick"));
if (tszNick != NULL) {
if (mir_wstrcmp(nick, tszNick) != 0)
- db_set_ts(hContact, "CList", "MyHandle", nick);
+ db_set_ws(hContact, "CList", "MyHandle", nick);
else
db_unset(hContact, "CList", "MyHandle");
}
- else db_set_ts(hContact, "CList", "MyHandle", nick);
+ else db_set_ws(hContact, "CList", "MyHandle", nick);
}
else db_unset(hContact, "CList", "MyHandle");
if (!m_options.IgnoreRosterGroups) {
if (item->group != NULL) {
Clist_GroupCreate(0, item->group);
- db_set_ts(hContact, "CList", "Group", item->group);
+ db_set_ws(hContact, "CList", "Group", item->group);
}
else db_unset(hContact, "CList", "Group");
}
@@ -291,7 +291,7 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo) else if (!mir_wstrcmp(str, L"to")) item->subscription = SUB_TO;
else if (!mir_wstrcmp(str, L"from")) item->subscription = SUB_FROM;
else item->subscription = SUB_NONE;
- debugLog(L"Roster push for jid=%s, set subscription to %s", jid, str);
+ debugLogW(L"Roster push for jid=%s, set subscription to %s", jid, str);
MCONTACT hContact = HContactFromJID(jid);
@@ -371,7 +371,7 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo) desc = (wchar_t*)XmlGetText(n);
wchar_t *str2;
- debugLog(L"description = %s", desc);
+ debugLogW(L"description = %s", desc);
if ((str2 = wcsrchr(ft->httpPath, '/')) != NULL)
str2++;
else
@@ -380,7 +380,7 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo) JabberHttpUrlDecode(str2);
PROTORECVFILET pre;
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.timestamp = time(NULL);
pre.descr.w = desc;
pre.files.w = &str2;
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index caa0532da6..1f94d96dc7 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -149,9 +149,9 @@ void CJabberProto::OnProcessLoginRq(ThreadData *info, DWORD rq) if (item->nick && item->nick[0])
GroupchatJoinRoom(server, p, item->nick, item->password, true);
else {
- ptrW nick(getTStringA(HContactFromJID(m_szJabberJID), "MyNick"));
+ ptrW nick(getWStringA(HContactFromJID(m_szJabberJID), "MyNick"));
if (nick == NULL)
- nick = getTStringA("Nick");
+ nick = getWStringA("Nick");
if (nick == NULL)
nick = JabberNickFromJID(m_szJabberJID);
@@ -264,9 +264,9 @@ void CJabberProto::OnIqResultSetAuth(HXML iqNode, CJabberIqInfo*) if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
if (!mir_wstrcmp(type, L"result")) {
- ptrW tszNick(getTStringA("Nick"));
+ ptrW tszNick(getWStringA("Nick"));
if (tszNick == NULL)
- setTString("Nick", m_ThreadInfo->conn.username);
+ setWString("Nick", m_ThreadInfo->conn.username);
OnLoggedIn();
}
@@ -290,9 +290,9 @@ void CJabberProto::OnIqResultBind(HXML iqNode, CJabberIqInfo *pInfo) LPCTSTR szJid = XPathT(iqNode, "bind[@xmlns='urn:ietf:params:xml:ns:xmpp-bind']/jid");
if (szJid) {
if (!wcsncmp(m_ThreadInfo->fullJID, szJid, _countof(m_ThreadInfo->fullJID)))
- debugLog(L"Result Bind: %s confirmed ", m_ThreadInfo->fullJID);
+ debugLogW(L"Result Bind: %s confirmed ", m_ThreadInfo->fullJID);
else {
- debugLog(L"Result Bind: %s changed to %s", m_ThreadInfo->fullJID, szJid);
+ debugLogW(L"Result Bind: %s changed to %s", m_ThreadInfo->fullJID, szJid);
wcsncpy_s(m_ThreadInfo->fullJID, szJid, _TRUNCATE);
}
}
@@ -318,7 +318,7 @@ void CJabberProto::OnIqResultSession(HXML, CJabberIqInfo *pInfo) void CJabberProto::GroupchatJoinByHContact(MCONTACT hContact, bool autojoin)
{
- ptrW roomjid(getTStringA(hContact, "ChatRoomID"));
+ ptrW roomjid(getWStringA(hContact, "ChatRoomID"));
if (roomjid == NULL)
return;
@@ -329,14 +329,14 @@ void CJabberProto::GroupchatJoinByHContact(MCONTACT hContact, bool autojoin) server[0] = 0; server++;
- ptrW nick(getTStringA(hContact, "MyNick"));
+ ptrW nick(getWStringA(hContact, "MyNick"));
if (nick == NULL) {
nick = JabberNickFromJID(m_szJabberJID);
if (nick == NULL)
return;
}
- GroupchatJoinRoom(server, room, nick, ptrW(getTStringA(hContact, "Password")), autojoin);
+ GroupchatJoinRoom(server, room, nick, ptrW(getWStringA(hContact, "Password")), autojoin);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -427,14 +427,14 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo) }
if (name != NULL) {
- ptrW tszNick(getTStringA(hContact, "Nick"));
+ ptrW tszNick(getWStringA(hContact, "Nick"));
if (tszNick != NULL) {
if (mir_wstrcmp(nick, tszNick) != 0)
- db_set_ts(hContact, "CList", "MyHandle", nick);
+ db_set_ws(hContact, "CList", "MyHandle", nick);
else
db_unset(hContact, "CList", "MyHandle");
}
- else db_set_ts(hContact, "CList", "MyHandle", nick);
+ else db_set_ws(hContact, "CList", "MyHandle", nick);
}
else db_unset(hContact, "CList", "MyHandle");
@@ -461,12 +461,12 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo) Clist_GroupCreate(0, item->group);
// Don't set group again if already correct, or Miranda may show wrong group count in some case
- ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_wsa(hContact, "CList", "Group"));
if (tszGroup != NULL) {
if (mir_wstrcmp(tszGroup, item->group))
- db_set_ts(hContact, "CList", "Group", item->group);
+ db_set_ws(hContact, "CList", "Group", item->group);
}
- else db_set_ts(hContact, "CList", "Group", item->group);
+ else db_set_ws(hContact, "CList", "Group", item->group);
}
else db_unset(hContact, "CList", "Group");
}
@@ -492,9 +492,9 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo) if (m_options.RosterSync == TRUE) {
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact;) {
MCONTACT hNext = db_find_next(hContact, m_szModuleName);
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid != NULL && !ListGetItemPtr(LIST_ROSTER, jid)) {
- debugLog(L"Syncing roster: preparing to delete %s (hContact=0x%x)", jid, hContact);
+ debugLogW(L"Syncing roster: preparing to delete %s (hContact=0x%x)", jid, hContact);
CallService(MS_DB_CONTACT_DELETE, hContact, 0);
}
hContact = hNext;
@@ -601,7 +601,7 @@ void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasP wchar_t szAvatarFileName[MAX_PATH];
GetAvatarFileName(hContact, szAvatarFileName, _countof(szAvatarFileName));
- debugLog(L"Picture file name set to %s", szAvatarFileName);
+ debugLogW(L"Picture file name set to %s", szAvatarFileName);
HANDLE hFile = CreateFile(szAvatarFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
return;
@@ -618,10 +618,10 @@ void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasP hasPhoto = true;
CallService(MS_AV_SETMYAVATART, (WPARAM)m_szModuleName, (LPARAM)szAvatarFileName);
- debugLog(L"My picture saved to %s", szAvatarFileName);
+ debugLogW(L"My picture saved to %s", szAvatarFileName);
}
else {
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid != NULL) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid);
if (item == NULL) {
@@ -634,7 +634,7 @@ void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasP if (item->photoFileName && mir_wstrcmp(item->photoFileName, szAvatarFileName))
DeleteFile(item->photoFileName);
replaceStrW(item->photoFileName, szAvatarFileName);
- debugLog(L"Contact's picture saved to %s", szAvatarFileName);
+ debugLogW(L"Contact's picture saved to %s", szAvatarFileName);
OnIqResultGotAvatar(hContact, o, szPicType);
}
}
@@ -672,7 +672,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) if (!mir_wstrcmp(type, L"result")) {
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.nick.w = sttGetText(vCardNode, "NICKNAME");
psr.firstName.w = sttGetText(vCardNode, "FN");
psr.lastName.w = L"";
@@ -726,13 +726,13 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) if (!mir_wstrcmp(XmlGetName(n), L"FN")) {
if (XmlGetText(n) != NULL) {
hasFn = true;
- setTString(hContact, "FullName", XmlGetText(n));
+ setWString(hContact, "FullName", XmlGetText(n));
}
}
else if (!mir_wstrcmp(XmlGetName(n), L"NICKNAME")) {
if (XmlGetText(n) != NULL) {
hasNick = true;
- setTString(hContact, "Nick", XmlGetText(n));
+ setWString(hContact, "Nick", XmlGetText(n));
}
}
else if (!mir_wstrcmp(XmlGetName(n), L"N")) {
@@ -740,15 +740,15 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) if (!hasGiven && !hasFamily && !hasMiddle) {
if ((m = XmlGetChild(n, "GIVEN")) != NULL && XmlGetText(m) != NULL) {
hasGiven = true;
- setTString(hContact, "FirstName", XmlGetText(m));
+ setWString(hContact, "FirstName", XmlGetText(m));
}
if ((m = XmlGetChild(n, "FAMILY")) != NULL && XmlGetText(m) != NULL) {
hasFamily = true;
- setTString(hContact, "LastName", XmlGetText(m));
+ setWString(hContact, "LastName", XmlGetText(m));
}
if ((m = XmlGetChild(n, "MIDDLE")) != NULL && XmlGetText(m) != NULL) {
hasMiddle = true;
- setTString(hContact, "MiddleName", XmlGetText(m));
+ setWString(hContact, "MiddleName", XmlGetText(m));
}
}
}
@@ -765,7 +765,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) mir_snprintf(text, "e-mail%d", nEmail - 1);
}
else mir_snprintf(text, "e-mail%d", nEmail);
- setTString(hContact, text, XmlGetText(m));
+ setWString(hContact, text, XmlGetText(m));
if (hContact == NULL) {
mir_snprintf(text, "e-mailFlag%d", nEmail);
@@ -800,7 +800,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) }
else {
hasBday = true;
- setTString("BirthDate", XmlGetText(n));
+ setWString("BirthDate", XmlGetText(n));
}
}
}
@@ -815,7 +815,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) }
else {
hasGender = true;
- setTString("GenderString", XmlGetText(n));
+ setWString("GenderString", XmlGetText(n));
}
}
}
@@ -834,36 +834,36 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) else
wcsncpy_s(text, XmlGetText(m), _TRUNCATE);
text[_countof(text) - 1] = '\0';
- setTString(hContact, "Street", text);
+ setWString(hContact, "Street", text);
}
else {
- setTString(hContact, "Street", XmlGetText(m));
+ setWString(hContact, "Street", XmlGetText(m));
if ((m = XmlGetChild(n, "EXTADR")) == NULL)
m = XmlGetChild(n, "EXTADD");
if (m != NULL && XmlGetText(m) != NULL) {
hasHomeStreet2 = true;
- setTString(hContact, "Street2", XmlGetText(m));
+ setWString(hContact, "Street2", XmlGetText(m));
}
}
}
if ((m = XmlGetChild(n, "LOCALITY")) != NULL && XmlGetText(m) != NULL) {
hasHomeLocality = true;
- setTString(hContact, "City", XmlGetText(m));
+ setWString(hContact, "City", XmlGetText(m));
}
if ((m = XmlGetChild(n, "REGION")) != NULL && XmlGetText(m) != NULL) {
hasHomeRegion = true;
- setTString(hContact, "State", XmlGetText(m));
+ setWString(hContact, "State", XmlGetText(m));
}
if ((m = XmlGetChild(n, "PCODE")) != NULL && XmlGetText(m) != NULL) {
hasHomePcode = true;
- setTString(hContact, "ZIP", XmlGetText(m));
+ setWString(hContact, "ZIP", XmlGetText(m));
}
if ((m = XmlGetChild(n, "CTRY")) == NULL || XmlGetText(m) == NULL) // Some bad client use <COUNTRY/> instead of <CTRY/>
m = XmlGetChild(n, "COUNTRY");
if (m != NULL && XmlGetText(m) != NULL) {
hasHomeCtry = true;
- setTString(hContact, "Country", XmlGetText(m));
+ setWString(hContact, "Country", XmlGetText(m));
}
}
@@ -881,36 +881,36 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) else
wcsncpy_s(text, XmlGetText(m), _TRUNCATE);
text[_countof(text) - 1] = '\0';
- setTString(hContact, "CompanyStreet", text);
+ setWString(hContact, "CompanyStreet", text);
}
else {
- setTString(hContact, "CompanyStreet", XmlGetText(m));
+ setWString(hContact, "CompanyStreet", XmlGetText(m));
if ((m = XmlGetChild(n, "EXTADR")) == NULL)
m = XmlGetChild(n, "EXTADD");
if (m != NULL && XmlGetText(m) != NULL) {
hasWorkStreet2 = true;
- setTString(hContact, "CompanyStreet2", XmlGetText(m));
+ setWString(hContact, "CompanyStreet2", XmlGetText(m));
}
}
}
if ((m = XmlGetChild(n, "LOCALITY")) != NULL && XmlGetText(m) != NULL) {
hasWorkLocality = true;
- setTString(hContact, "CompanyCity", XmlGetText(m));
+ setWString(hContact, "CompanyCity", XmlGetText(m));
}
if ((m = XmlGetChild(n, "REGION")) != NULL && XmlGetText(m) != NULL) {
hasWorkRegion = true;
- setTString(hContact, "CompanyState", XmlGetText(m));
+ setWString(hContact, "CompanyState", XmlGetText(m));
}
if ((m = XmlGetChild(n, "PCODE")) != NULL && XmlGetText(m) != NULL) {
hasWorkPcode = true;
- setTString(hContact, "CompanyZIP", XmlGetText(m));
+ setWString(hContact, "CompanyZIP", XmlGetText(m));
}
if ((m = XmlGetChild(n, "CTRY")) == NULL || XmlGetText(m) == NULL) // Some bad client use <COUNTRY/> instead of <CTRY/>
m = XmlGetChild(n, "COUNTRY");
if (m != NULL && XmlGetText(m) != NULL) {
hasWorkCtry = true;
- setTString(hContact, "CompanyCountry", XmlGetText(m));
+ setWString(hContact, "CompanyCountry", XmlGetText(m));
}
}
}
@@ -920,11 +920,11 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) if (hContact != NULL) {
if (!hasFax && XmlGetChild(n, "FAX") != NULL) {
hasFax = true;
- setTString(hContact, "Fax", XmlGetText(m));
+ setWString(hContact, "Fax", XmlGetText(m));
}
else if (!hasCell && XmlGetChild(n, "CELL") != NULL) {
hasCell = true;
- setTString(hContact, "Cellular", XmlGetText(m));
+ setWString(hContact, "Cellular", XmlGetText(m));
}
else if (!hasPhone &&
(XmlGetChild(n, "HOME") != NULL || XmlGetChild(n, "WORK") != NULL || XmlGetChild(n, "VOICE") != NULL ||
@@ -939,13 +939,13 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) XmlGetChild(n, "PCS") == NULL)))
{
hasPhone = true;
- setTString(hContact, "Phone", XmlGetText(m));
+ setWString(hContact, "Phone", XmlGetText(m));
}
}
else {
char text[100];
mir_snprintf(text, "Phone%d", nPhone);
- setTString(text, XmlGetText(m));
+ setWString(text, XmlGetText(m));
mir_snprintf(text, "PhoneFlag%d", nPhone);
int nFlag = 0;
@@ -970,39 +970,39 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) // Homepage
if (!hasUrl && XmlGetText(n) != NULL) {
hasUrl = true;
- setTString(hContact, "Homepage", XmlGetText(n));
+ setWString(hContact, "Homepage", XmlGetText(n));
}
}
else if (!mir_wstrcmp(XmlGetName(n), L"ORG")) {
if (!hasOrgname && !hasOrgunit) {
if ((m = XmlGetChild(n, "ORGNAME")) != NULL && XmlGetText(m) != NULL) {
hasOrgname = true;
- setTString(hContact, "Company", XmlGetText(m));
+ setWString(hContact, "Company", XmlGetText(m));
}
if ((m = XmlGetChild(n, "ORGUNIT")) != NULL && XmlGetText(m) != NULL) { // The real vCard can have multiple <ORGUNIT/> but we will only display the first one
hasOrgunit = true;
- setTString(hContact, "CompanyDepartment", XmlGetText(m));
+ setWString(hContact, "CompanyDepartment", XmlGetText(m));
}
}
}
else if (!mir_wstrcmp(XmlGetName(n), L"ROLE")) {
if (!hasRole && XmlGetText(n) != NULL) {
hasRole = true;
- setTString(hContact, "Role", XmlGetText(n));
+ setWString(hContact, "Role", XmlGetText(n));
}
}
else if (!mir_wstrcmp(XmlGetName(n), L"TITLE")) {
if (!hasTitle && XmlGetText(n) != NULL) {
hasTitle = true;
- setTString(hContact, "CompanyPosition", XmlGetText(n));
+ setWString(hContact, "CompanyPosition", XmlGetText(n));
}
}
else if (!mir_wstrcmp(XmlGetName(n), L"DESC")) {
if (!hasDesc && XmlGetText(n) != NULL) {
hasDesc = true;
- CMString tszMemo(XmlGetText(n));
+ CMStringW tszMemo(XmlGetText(n));
tszMemo.Replace(L"\n", L"\r\n");
- setTString(hContact, "About", tszMemo);
+ setWString(hContact, "About", tszMemo);
}
}
else if (!mir_wstrcmp(XmlGetName(n), L"PHOTO"))
@@ -1011,10 +1011,10 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) }
if (hasFn && !hasNick) {
- ptrW nick(getTStringA(hContact, "Nick"));
+ ptrW nick(getWStringA(hContact, "Nick"));
ptrW jidNick(JabberNickFromJID(jid));
if (!nick || (jidNick && !mir_wstrcmpi(nick, jidNick)))
- setTString(hContact, "Nick", ptrW(getTStringA(hContact, "FullName")));
+ setWString(hContact, "Nick", ptrW(getWStringA(hContact, "FullName")));
}
if (!hasFn)
delSetting(hContact, "FullName");
@@ -1125,7 +1125,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) debugLogA("Has no avatar");
delSetting(hContact, "AvatarHash");
- if (ptrW(getTStringA(hContact, "AvatarSaved")) != NULL) {
+ if (ptrW(getWStringA(hContact, "AvatarSaved")) != NULL) {
delSetting(hContact, "AvatarSaved");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL);
}
@@ -1173,7 +1173,7 @@ void CJabberProto::OnIqResultSetSearch(HXML iqNode, CJabberIqInfo*) if (!mir_wstrcmp(XmlGetName(itemNode), L"item")) {
if ((jid = XmlGetAttrValue(itemNode, L"jid")) != NULL) {
psr.id.w = (wchar_t*)jid;
- debugLog(L"Result jid = %s", jid);
+ debugLogW(L"Result jid = %s", jid);
if ((n = XmlGetChild(itemNode, "nick")) != NULL && XmlGetText(n) != NULL)
psr.nick.w = (wchar_t*)XmlGetText(n);
else
@@ -1190,7 +1190,7 @@ void CJabberProto::OnIqResultSetSearch(HXML iqNode, CJabberIqInfo*) psr.email.w = (wchar_t*)XmlGetText(n);
else
psr.email.w = L"";
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&psr);
}
}
@@ -1227,7 +1227,7 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*) PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
for (int j = 0;; j++) {
HXML fieldNode = XmlGetChild(itemNode, j);
@@ -1247,7 +1247,7 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*) if (!mir_wstrcmp(fieldName, L"jid")) {
psr.id.w = (wchar_t*)XmlGetText(n);
- debugLog(L"Result jid = %s", psr.id.w);
+ debugLogW(L"Result jid = %s", psr.id.w);
}
else if (!mir_wstrcmp(fieldName, L"nickname"))
psr.nick.w = (XmlGetText(n) != NULL) ? (wchar_t*)XmlGetText(n) : L"";
@@ -1309,7 +1309,7 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*) if (XmlGetChildCount(vCard) == 0) {
delSetting(hContact, "AvatarHash");
- if (ptrW(getTStringA(hContact, "AvatarSaved")) != NULL) {
+ if (ptrW(getWStringA(hContact, "AvatarSaved")) != NULL) {
delSetting(hContact, "AvatarSaved");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL);
}
@@ -1420,7 +1420,7 @@ void CJabberProto::OnIqResultGotAvatar(MCONTACT hContact, HXML n, const wchar_t else if (!mir_wstrcmp(mimeType, L"image/bmp")) pictureType = PA_FORMAT_BMP;
else {
LBL_ErrFormat:
- debugLog(L"Invalid mime type specified for picture: %s", mimeType);
+ debugLogW(L"Invalid mime type specified for picture: %s", mimeType);
return;
}
}
@@ -1456,7 +1456,7 @@ LBL_ErrFormat: char buffer[41];
setString(hContact, "AvatarSaved", bin2hex(digest, sizeof(digest), buffer));
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, HANDLE(&ai), NULL);
- debugLog(L"Broadcast new avatar: %s", ai.filename);
+ debugLogW(L"Broadcast new avatar: %s", ai.filename);
}
else ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, HANDLE(&ai), NULL);
}
@@ -1622,7 +1622,7 @@ void CJabberProto::OnIqResultEntityTime(HXML pIqNode, CJabberIqInfo *pInfo) LPCTSTR szTz = XPathFmt(pIqNode, L"time[@xmlns='%s']/tz", JABBER_FEAT_ENTITY_TIME);
if (szTz)
- setTString(pInfo->m_hContact, "TzName", szTz);
+ setWString(pInfo->m_hContact, "TzName", szTz);
else
delSetting(pInfo->m_hContact, "TzName");
return;
diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp index 1904cb0cf7..afbdfe383b 100644 --- a/protocols/JabberG/src/jabber_iqid_muc.cpp +++ b/protocols/JabberG/src/jabber_iqid_muc.cpp @@ -322,7 +322,7 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w lvi.cchTextMax = _countof(text);
ListView_GetItem(nm->hdr.hwndFrom, &lvi);
if (lvi.lParam == -1) {
- CMString szBuffer(dat->type2str());
+ CMStringW szBuffer(dat->type2str());
if (!dat->ppro->EnterString(szBuffer, NULL, ESF_COMBO, "gcAddNick_"))
break;
@@ -331,7 +331,7 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w if (szBuffer.IsEmpty())
break;
- CMString rsn(dat->type2str());
+ CMStringW rsn(dat->type2str());
if (dat->type == MUC_BANLIST) {
dat->ppro->EnterString(rsn, TranslateT("Reason to ban"), ESF_COMBO, "gcAddReason_");
if (szBuffer)
diff --git a/protocols/JabberG/src/jabber_list.cpp b/protocols/JabberG/src/jabber_list.cpp index 1e4c95f77f..1df982ec43 100644 --- a/protocols/JabberG/src/jabber_list.cpp +++ b/protocols/JabberG/src/jabber_list.cpp @@ -91,12 +91,12 @@ void CJabberProto::ListInit(void) {
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (isChatRoom(hContact)) {
- ptrW jid(getTStringA(hContact, "ChatRoomID"));
+ ptrW jid(getWStringA(hContact, "ChatRoomID"));
if (jid != NULL)
ListAdd(LIST_CHATROOM, jid, hContact);
}
else {
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid != NULL)
ListAdd(LIST_ROSTER, jid, hContact);
}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 512ec95593..7a91ec5498 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -303,7 +303,7 @@ void g_MenuInit(void) g_hMenuDirectPresence[0] = Menu_AddContactMenuItem(&mi);
UNSET_UID(mi);
- mi.flags |= CMIF_TCHAR | CMIF_SYSTEM;
+ mi.flags |= CMIF_UNICODE | CMIF_SYSTEM;
mi.root = g_hMenuDirectPresence[0];
for (int i = 0; i < _countof(PresenceModeArray); i++) {
char buf[] = "Jabber/DirectPresenceX";
@@ -374,7 +374,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) bool bIsTransport = getBool(hContact, "IsTransport", false);
if ((bIsChatRoom == GCW_CHATROOM) || bIsChatRoom == 0) {
- if (ptrW(getTStringA(hContact, bIsChatRoom ? (char*)"ChatRoomID" : (char*)"jid")) != NULL) {
+ if (ptrW(getWStringA(hContact, bIsChatRoom ? (char*)"ChatRoomID" : (char*)"jid")) != NULL) {
Menu_ShowItem(g_hMenuConvert, TRUE);
Menu_ModifyItem(g_hMenuConvert, bIsChatRoom ? LPGENW("&Convert to Contact") : LPGENW("&Convert to Chat Room"));
}
@@ -388,7 +388,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) Menu_ModifyItem(g_hMenuDirectPresence[i + 1], NULL, Skin_LoadProtoIcon(m_szModuleName, PresenceModeArray[i].mode));
if (bIsChatRoom) {
- ptrW roomid(getTStringA(hContact, "ChatRoomID"));
+ ptrW roomid(getWStringA(hContact, "ChatRoomID"));
if (roomid != NULL) {
Menu_ShowItem(g_hMenuRosterAdd, FALSE);
@@ -406,7 +406,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) Menu_ShowItem(g_hMenuRefresh, TRUE);
}
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid == NULL)
return 0;
@@ -441,7 +441,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) mi.flags = CMIF_SYSTEM;
mi.pszService = text;
- CMString szTmp;
+ CMStringW szTmp;
for (int i = 0; i < nMenuResourceItemsNew; i++) {
mir_snprintf(text, "/UseResource_%d", i);
if (i >= m_nMenuResourceItems) {
@@ -477,10 +477,10 @@ INT_PTR __cdecl CJabberProto::OnMenuConvertChatContact(WPARAM hContact, LPARAM) BYTE bIsChatRoom = isChatRoom(hContact);
const char *szSetting = (bIsChatRoom) ? "ChatRoomID" : "jid";
- ptrW jid(getTStringA(hContact, szSetting));
+ ptrW jid(getWStringA(hContact, szSetting));
if (jid != NULL) {
delSetting(hContact, szSetting);
- setTString(hContact, szSetting, jid);
+ setWString(hContact, szSetting, jid);
setByte(hContact, "ChatRoom", !bIsChatRoom);
}
return 0;
@@ -491,13 +491,13 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM hContact, LPARAM) if (!hContact)
return 0; // we do not add ourself to the roster. (buggy situation - should not happen)
- ptrW roomID(getTStringA(hContact, "ChatRoomID"));
+ ptrW roomID(getWStringA(hContact, "ChatRoomID"));
if (roomID == NULL)
return 0;
if (ListGetItemPtr(LIST_ROSTER, roomID) == NULL) {
- ptrW group(db_get_tsa(hContact, "CList", "Group"));
- ptrW nick(getTStringA(hContact, "Nick"));
+ ptrW group(db_get_wsa(hContact, "CList", "Group"));
+ ptrW nick(getWStringA(hContact, "Nick"));
AddContactToRoster(roomID, nick, group);
if (m_options.AddRoster2Bookmarks == TRUE) {
@@ -506,7 +506,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM hContact, LPARAM) item = new JABBER_LIST_ITEM();
item->jid = mir_wstrdup(roomID);
item->name = mir_wstrdup(nick);
- item->nick = getTStringA(hContact, "MyNick");
+ item->nick = getWStringA(hContact, "MyNick");
AddEditBookmark(item);
delete item;
}
@@ -518,7 +518,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM hContact, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuHandleRequestAuth(WPARAM hContact, LPARAM)
{
if (hContact != NULL && m_bJabberOnline) {
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid != NULL)
m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", jid) << XATTR(L"type", L"subscribe"));
}
@@ -528,7 +528,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleRequestAuth(WPARAM hContact, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuHandleGrantAuth(WPARAM hContact, LPARAM)
{
if (hContact != NULL && m_bJabberOnline) {
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid != NULL)
m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", jid) << XATTR(L"type", L"subscribed"));
}
@@ -538,7 +538,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleGrantAuth(WPARAM hContact, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuRevokeAuth(WPARAM hContact, LPARAM)
{
if (hContact != NULL && m_bJabberOnline) {
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid != NULL)
m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", jid) << XATTR(L"type", L"unsubscribed"));
}
@@ -550,7 +550,7 @@ INT_PTR __cdecl CJabberProto::OnMenuTransportLogin(WPARAM hContact, LPARAM) if (!getByte(hContact, "IsTransport", 0))
return 0;
- JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrW(getTStringA(hContact, "jid")));
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrW(getWStringA(hContact, "jid")));
if (item != NULL) {
XmlNode p(L"presence"); XmlAddAttr(p, L"to", item->jid);
if (item->getTemp()->m_iStatus == ID_STATUS_ONLINE)
@@ -565,7 +565,7 @@ INT_PTR __cdecl CJabberProto::OnMenuTransportResolve(WPARAM hContact, LPARAM) if (!getByte(hContact, "IsTransport", 0))
return 0;
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid != NULL)
ResolveTransportNicks(jid);
return 0;
@@ -576,7 +576,7 @@ INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd(WPARAM hContact, LPARAM) if (!hContact)
return 0; // we do not add ourself to the roster. (buggy situation - should not happen)
- ptrW roomID(getTStringA(hContact, "ChatRoomID"));
+ ptrW roomID(getWStringA(hContact, "ChatRoomID"));
if (roomID == NULL)
return 0;
@@ -585,7 +585,7 @@ INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd(WPARAM hContact, LPARAM) item->jid = mir_wstrdup(roomID);
item->name = pcli->pfnGetContactDisplayName(hContact, 0);
item->type = L"conference";
- item->nick = getTStringA(hContact, "MyNick");
+ item->nick = getWStringA(hContact, "MyNick");
AddEditBookmark(item);
delete item;
}
@@ -706,7 +706,7 @@ void CJabberProto::MenuInit() mi.pszService = srvFce;
mi.name.w = szName;
mi.position = 2000040000;
- mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_UNMOVABLE | CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.root = m_hMenuPriorityRoot;
mir_snprintf(srvFce, "/menuSetPriority/%d", 0);
@@ -786,7 +786,7 @@ void CJabberProto::GlobalMenuInit() // Account chooser menu
CMenuItem mi;
- mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_UNMOVABLE | CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.position = iChooserMenuPos++;
mi.name.w = m_tszUserName;
m_hChooseMenuItem = Menu_AddItem(hChooserMenu, &mi, this);
@@ -801,23 +801,23 @@ void CJabberProto::GlobalMenuInit() HOTKEYDESC hkd = { sizeof(hkd) };
hkd.pszName = text;
hkd.pszService = text;
- hkd.ptszSection = m_tszUserName;
- hkd.dwFlags = HKD_TCHAR;
+ hkd.pwszSection = m_tszUserName;
+ hkd.dwFlags = HKD_UNICODE;
mir_strcpy(tDest, "/Groupchat");
- hkd.ptszDescription = LPGENW("Join conference");
+ hkd.pwszDescription = LPGENW("Join conference");
Hotkey_Register(&hkd);
mir_strcpy(tDest, "/Bookmarks");
- hkd.ptszDescription = LPGENW("Open bookmarks");
+ hkd.pwszDescription = LPGENW("Open bookmarks");
Hotkey_Register(&hkd);
mir_strcpy(tDest, "/PrivacyLists");
- hkd.ptszDescription = LPGENW("Privacy lists");
+ hkd.pwszDescription = LPGENW("Privacy lists");
Hotkey_Register(&hkd);
mir_strcpy(tDest, "/ServiceDiscovery");
- hkd.ptszDescription = LPGENW("Service discovery");
+ hkd.pwszDescription = LPGENW("Service discovery");
Hotkey_Register(&hkd);
}
@@ -941,7 +941,7 @@ int CJabberProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam) hDialogsList = WindowList_Create();
WindowList_Add(hDialogsList, event->hwndWindow, event->hContact);
- ptrW jid(getTStringA(event->hContact, "jid"));
+ ptrW jid(getWStringA(event->hContact, "jid"));
if (jid != NULL) {
JABBER_LIST_ITEM *pItem = ListGetItemPtr(LIST_ROSTER, jid);
if (pItem && m_ThreadInfo && (m_ThreadInfo->jabberServerCaps & JABBER_CAPS_ARCHIVE_AUTO) && m_options.EnableMsgArchive)
@@ -991,7 +991,7 @@ int CJabberProto::OnProcessSrmmIconClick(WPARAM hContact, LPARAM lParam) if (!hContact)
return 0;
- JABBER_LIST_ITEM *LI = ListGetItemPtr(LIST_ROSTER, ptrW(getTStringA(hContact, "jid")));
+ JABBER_LIST_ITEM *LI = ListGetItemPtr(LIST_ROSTER, ptrW(getWStringA(hContact, "jid")));
if (LI == NULL)
return 0;
@@ -1041,7 +1041,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleResource(WPARAM hContact, LPARAM, LPAR if (!m_bJabberOnline || !hContact)
return 0;
- ptrW tszJid(getTStringA(hContact, "jid"));
+ ptrW tszJid(getWStringA(hContact, "jid"));
if (tszJid == NULL)
return 0;
@@ -1073,9 +1073,9 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleDirectPresence(WPARAM hContact, LPARAM return 0;
wchar_t *jid, text[1024];
- ptrW tszJid(getTStringA(hContact, "jid"));
+ ptrW tszJid(getWStringA(hContact, "jid"));
if (tszJid == NULL) {
- ptrW roomid(getTStringA(hContact, "ChatRoomID"));
+ ptrW roomid(getWStringA(hContact, "ChatRoomID"));
if (roomid == NULL)
return 0;
@@ -1088,7 +1088,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleDirectPresence(WPARAM hContact, LPARAM }
else jid = tszJid;
- CMString szValue;
+ CMStringW szValue;
if (EnterString(szValue, TranslateT("Status Message"), ESF_MULTILINE))
SendPresenceTo(res, jid, NULL, szValue);
return 0;
diff --git a/protocols/JabberG/src/jabber_message_manager.cpp b/protocols/JabberG/src/jabber_message_manager.cpp index 99b853bca9..e443c6ce73 100644 --- a/protocols/JabberG/src/jabber_message_manager.cpp +++ b/protocols/JabberG/src/jabber_message_manager.cpp @@ -100,7 +100,7 @@ bool CJabberMessageManager::HandleMessagePermanent(HXML node, ThreadData *pThrea messageInfo.m_hContact = ppro->HContactFromJID(messageInfo.m_szFrom);
if (messageInfo.m_szFrom)
- ppro->debugLog(L"Handling message from %s", messageInfo.m_szFrom);
+ ppro->debugLogW(L"Handling message from %s", messageInfo.m_szFrom);
if ((ppro->*(pInfo.m_pHandler))(node, pThreadData, &messageInfo))
return true;
}
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index ac90da7561..0a4600cecb 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -103,9 +103,9 @@ MCONTACT CJabberProto::DBCreateContact(const wchar_t *jid, const wchar_t *nick, MCONTACT hNewContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
Proto_AddToContact(hNewContact, m_szModuleName);
- setTString(hNewContact, "jid", szJid);
+ setWString(hNewContact, "jid", szJid);
if (nick != NULL && *nick != '\0')
- setTString(hNewContact, "Nick", nick);
+ setWString(hNewContact, "Nick", nick);
if (temporary)
db_set_b(hNewContact, "CList", "NotOnList", 1);
else
@@ -114,7 +114,7 @@ MCONTACT CJabberProto::DBCreateContact(const wchar_t *jid, const wchar_t *nick, if (JABBER_LIST_ITEM *pItem = ListAdd(LIST_ROSTER, jid, hNewContact))
pItem->bUseResource = wcschr(szJid, '/') != 0;
- debugLog(L"Create Jabber contact jid=%s, nick=%s", szJid, nick);
+ debugLogW(L"Create Jabber contact jid=%s, nick=%s", szJid, nick);
DBCheckIsTransportedContact(szJid, hNewContact);
return hNewContact;
}
@@ -156,11 +156,11 @@ BOOL CJabberProto::AddDbPresenceEvent(MCONTACT hContact, BYTE btEventType) void CJabberProto::GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen)
{
- int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
+ int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARSW(L"%miranda_avatarcache%"), m_szModuleName);
DWORD dwAttributes = GetFileAttributes(pszDest);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
- CreateDirectoryTreeT(pszDest);
+ CreateDirectoryTreeW(pszDest);
pszDest[tPathLen++] = '\\';
@@ -203,8 +203,8 @@ void CJabberProto::ResolveTransportNicks(const wchar_t *jid) if (!getByte(hContact, "IsTransported", 0))
continue;
- ptrW dbJid(getTStringA(hContact, "jid")); if (dbJid == NULL) continue;
- ptrW dbNick(getTStringA(hContact, "Nick")); if (dbNick == NULL) continue;
+ ptrW dbJid(getWStringA(hContact, "jid")); if (dbJid == NULL) continue;
+ ptrW dbNick(getWStringA(hContact, "Nick")); if (dbNick == NULL) continue;
wchar_t *p = wcschr(dbJid, '@');
if (p == NULL)
@@ -300,7 +300,7 @@ void CJabberProto::UpdateMirVer(JABBER_LIST_ITEM *item) if (!hContact)
return;
- debugLog(L"JabberUpdateMirVer: for jid %s", item->jid);
+ debugLogW(L"JabberUpdateMirVer: for jid %s", item->jid);
pResourceStatus p(NULL);
if (item->resourceMode == RSMODE_LASTSEEN)
@@ -312,7 +312,7 @@ void CJabberProto::UpdateMirVer(JABBER_LIST_ITEM *item) UpdateMirVer(hContact, p);
}
-void CJabberProto::FormatMirVer(pResourceStatus &resource, CMString &res)
+void CJabberProto::FormatMirVer(pResourceStatus &resource, CMStringW &res)
{
res.Empty();
if (resource == NULL)
@@ -320,7 +320,7 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, CMString &res) // jabber:iq:version info requested and exists?
if (resource->m_dwVersionRequestTime && resource->m_tszSoftware) {
- debugLog(L"JabberUpdateMirVer: for iq:version rc %s: %s", resource->m_tszResourceName, resource->m_tszSoftware);
+ debugLogW(L"JabberUpdateMirVer: for iq:version rc %s: %s", resource->m_tszResourceName, resource->m_tszSoftware);
if (!resource->m_tszSoftwareVersion || wcsstr(resource->m_tszSoftware, resource->m_tszSoftwareVersion))
res = resource->m_tszSoftware;
else
@@ -328,13 +328,13 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, CMString &res) }
// no version info and no caps info? set MirVer = resource name
else if (!resource->m_tszCapsNode || !resource->m_tszCapsVer) {
- debugLog(L"JabberUpdateMirVer: for rc %s: %s", resource->m_tszResourceName, resource->m_tszResourceName);
+ debugLogW(L"JabberUpdateMirVer: for rc %s: %s", resource->m_tszResourceName, resource->m_tszResourceName);
if (resource->m_tszResourceName)
res = resource->m_tszResourceName;
}
// XEP-0115 caps mode
else {
- debugLog(L"JabberUpdateMirVer: for rc %s: %s#%s", resource->m_tszResourceName, resource->m_tszCapsNode, resource->m_tszCapsVer);
+ debugLogW(L"JabberUpdateMirVer: for rc %s: %s#%s", resource->m_tszResourceName, resource->m_tszCapsNode, resource->m_tszCapsVer);
int i;
@@ -374,12 +374,12 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, CMString &res) void CJabberProto::UpdateMirVer(MCONTACT hContact, pResourceStatus &resource)
{
- CMString tszMirVer;
+ CMStringW tszMirVer;
FormatMirVer(resource, tszMirVer);
if (!tszMirVer.IsEmpty())
- setTString(hContact, "MirVer", tszMirVer);
+ setWString(hContact, "MirVer", tszMirVer);
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid == NULL)
return;
@@ -388,32 +388,32 @@ void CJabberProto::UpdateMirVer(MCONTACT hContact, pResourceStatus &resource) mir_snwprintf(szFullJid, L"%s/%s", jid, resource->m_tszResourceName);
else
mir_wstrncpy(szFullJid, jid, _countof(szFullJid));
- setTString(hContact, DBSETTING_DISPLAY_UID, szFullJid);
+ setWString(hContact, DBSETTING_DISPLAY_UID, szFullJid);
}
void CJabberProto::UpdateSubscriptionInfo(MCONTACT hContact, JABBER_LIST_ITEM *item)
{
switch (item->subscription) {
case SUB_TO:
- setTString(hContact, "SubscriptionText", TranslateT("To"));
+ setWString(hContact, "SubscriptionText", TranslateT("To"));
setString(hContact, "Subscription", "to");
setByte(hContact, "Auth", 0);
setByte(hContact, "Grant", 1);
break;
case SUB_FROM:
- setTString(hContact, "SubscriptionText", TranslateT("From"));
+ setWString(hContact, "SubscriptionText", TranslateT("From"));
setString(hContact, "Subscription", "from");
setByte(hContact, "Auth", 1);
setByte(hContact, "Grant", 0);
break;
case SUB_BOTH:
- setTString(hContact, "SubscriptionText", TranslateT("Both"));
+ setWString(hContact, "SubscriptionText", TranslateT("Both"));
setString(hContact, "Subscription", "both");
setByte(hContact, "Auth", 0);
setByte(hContact, "Grant", 0);
break;
case SUB_NONE:
- setTString(hContact, "SubscriptionText", TranslateT("None"));
+ setWString(hContact, "SubscriptionText", TranslateT("None"));
setString(hContact, "Subscription", "none");
setByte(hContact, "Auth", 1);
setByte(hContact, "Grant", 1);
@@ -445,7 +445,7 @@ void CJabberProto::InitPopups(void) POPUPCLASS ppc = { sizeof(ppc) };
ppc.flags = PCF_TCHAR;
- ppc.ptszDescription = desc;
+ ppc.pwszDescription = desc;
ppc.pszName = name;
ppc.hIcon = LoadIconEx("main");
ppc.colorBack = RGB(191, 0, 0); //Red
@@ -476,25 +476,25 @@ void CJabberProto::MsgPopup(MCONTACT hContact, const wchar_t *szMsg, const wchar }
}
-CMString CJabberProto::ExtractImage(HXML node)
+CMStringW CJabberProto::ExtractImage(HXML node)
{
HXML nHtml, nBody, nImg;
LPCTSTR src;
- CMString link;
+ CMStringW link;
if ((nHtml = XmlGetChild(node, "html")) != NULL &&
(nBody = XmlGetChild(nHtml, "body")) != NULL &&
(nImg = XmlGetChild(nBody, "img")) != NULL &&
(src = XmlGetAttrValue(nImg, L"src")) != NULL) {
- CMString strSrc(src);
+ CMStringW strSrc(src);
if (strSrc.Left(11).Compare(L"data:image/") == 0) {
int end = strSrc.Find(L';');
if (end != -1) {
- CMString ext(strSrc.c_str() + 11, end - 11);
+ CMStringW ext(strSrc.c_str() + 11, end - 11);
int comma = strSrc.Find(L',', end);
if (comma != -1) {
- CMString image(strSrc.c_str() + comma + 1, strSrc.GetLength() - comma - 1);
+ CMStringW image(strSrc.c_str() + comma + 1, strSrc.GetLength() - comma - 1);
image.Replace(L"%2B", L"+");
image.Replace(L"%2F", L"/");
image.Replace(L"%3D", L"=");
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index 66f16d6f1a..36f780f87e 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -240,7 +240,7 @@ void CJabberDlgNoteItem::OnInitDialog() Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_NOTES));
if (m_fnProcess) {
- CMString buf;
+ CMStringW buf;
if (m_fnProcess == &CJabberProto::ProcessIncomingNote)
buf.Format(TranslateT("Incoming note from %s"), m_pNote->GetFrom());
else
@@ -815,7 +815,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleNotes(WPARAM, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuSendNote(WPARAM wParam, LPARAM)
{
if (wParam) {
- CNoteItem *pItem = new CNoteItem(NULL, ptrW(getTStringA(wParam, "jid")));
+ CNoteItem *pItem = new CNoteItem(NULL, ptrW(getWStringA(wParam, "jid")));
CJabberDlgBase *pDlg = new CJabberDlgNoteItem(this, pItem, &CJabberProto::ProcessOutgoingNote);
pDlg->Show();
}
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 66fb8e5e49..c1a9ab062b 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -331,7 +331,7 @@ CCtrlEditJid::CCtrlEditJid(CDlgBase* dlg, int ctrlId): static void sttStoreJidFromUI(CJabberProto *ppro, CCtrlEdit &txtUsername, CCtrlCombo &cbServer)
{
- ppro->setTString("jid", CMString(FORMAT, L"%s@%s", ptrW(txtUsername.GetText()), ptrW(cbServer.GetText())));
+ ppro->setWString("jid", CMStringW(FORMAT, L"%s@%s", ptrW(txtUsername.GetText()), ptrW(cbServer.GetText())));
}
class CDlgOptAccount : public CJabberDlgBase
@@ -425,7 +425,7 @@ protected: SendDlgItemMessage(m_hwnd, IDC_PRIORITY_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(127, -128));
- wchar_t *passw = m_proto->getTStringA(NULL, "Password");
+ wchar_t *passw = m_proto->getWStringA(NULL, "Password");
if (passw) {
m_txtPassword.SetText(passw);
mir_free(passw);
@@ -444,7 +444,7 @@ protected: if (GetComputerName(szCompName, &dwCompNameLength))
m_cbResource.AddString(szCompName);
- ptrW tszResource(m_proto->getTStringA("Resource"));
+ ptrW tszResource(m_proto->getWStringA("Resource"));
if (tszResource != NULL) {
if (CB_ERR == m_cbResource.FindString(tszResource, -1, true))
m_cbResource.AddString(tszResource);
@@ -453,7 +453,7 @@ protected: else m_cbResource.SetText(L"Miranda");
for (int i = 0; g_LanguageCodes[i].szCode; i++) {
- int iItem = m_cbLocale.AddString(TranslateTS(g_LanguageCodes[i].szDescription), (LPARAM)g_LanguageCodes[i].szCode);
+ int iItem = m_cbLocale.AddString(TranslateW(g_LanguageCodes[i].szDescription), (LPARAM)g_LanguageCodes[i].szCode);
if (!mir_wstrcmp(m_proto->m_tszSelectedLang, g_LanguageCodes[i].szCode))
m_cbLocale.SetCurSel(iItem);
}
@@ -483,7 +483,7 @@ protected: m_proto->m_savedPassword = NULL;
if (m_chkSavePassword.GetState() == BST_CHECKED)
- m_proto->setTString("Password", ptrW(m_txtPassword.GetText()));
+ m_proto->setWString("Password", ptrW(m_txtPassword.GetText()));
else
m_proto->delSetting("Password");
@@ -491,7 +491,7 @@ protected: if (index >= 0) {
wchar_t *szLanguageCode = (wchar_t *)m_cbLocale.GetItemData(index);
if (szLanguageCode) {
- m_proto->setTString("XmlLang", szLanguageCode);
+ m_proto->setWString("XmlLang", szLanguageCode);
mir_free(m_proto->m_tszSelectedLang);
m_proto->m_tszSelectedLang = mir_wstrdup(szLanguageCode);
@@ -897,8 +897,8 @@ public: m_otvOptions(this, IDC_OPTTREE)
{
CreateLink(m_txtAltNick, "GcAltNick", L"");
- CreateLink(m_txtSlap, "GcMsgSlap", TranslateTS(JABBER_GC_MSG_SLAP));
- CreateLink(m_txtQuit, "GcMsgQuit", TranslateTS(JABBER_GC_MSG_QUIT));
+ CreateLink(m_txtSlap, "GcMsgSlap", TranslateW(JABBER_GC_MSG_SLAP));
+ CreateLink(m_txtQuit, "GcMsgQuit", TranslateW(JABBER_GC_MSG_QUIT));
m_otvOptions.AddOption(LPGENW("General") L"/" LPGENW("Autoaccept multiuser chat invitations"), m_proto->m_options.AutoAcceptMUC);
m_otvOptions.AddOption(LPGENW("General") L"/" LPGENW("Automatically join bookmarks on login"), m_proto->m_options.AutoJoinBookmarks);
@@ -952,7 +952,7 @@ static int _RosterInsertListItem(HWND hList, const wchar_t * jid, const wchar_t ListView_SetItemText(hList, index, 0, (wchar_t*)jid);
ListView_SetItemText(hList, index, 1, (wchar_t*)nick);
ListView_SetItemText(hList, index, 2, (wchar_t*)group);
- ListView_SetItemText(hList, index, 3, TranslateTS(subscr));
+ ListView_SetItemText(hList, index, 3, TranslateW(subscr));
return index;
}
@@ -1016,7 +1016,7 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*) // now it is require to process whole contact list to add not in roster contacts
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- ptrW tszJid(getTStringA(hContact, "jid"));
+ ptrW tszJid(getWStringA(hContact, "jid"));
if (tszJid == NULL)
continue;
@@ -1029,8 +1029,8 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*) if (p) *p = 0;
}
if (ListView_FindItem(hList, -1, &lvfi) == -1) {
- ptrW tszName(db_get_tsa(hContact, "CList", "MyHandle"));
- ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszName(db_get_wsa(hContact, "CList", "MyHandle"));
+ ptrW tszGroup(db_get_wsa(hContact, "CList", "Group"));
_RosterInsertListItem(hList, tszJid, tszName, tszGroup, NULL, FALSE);
}
}
@@ -1492,7 +1492,7 @@ int CJabberProto::OnOptionsInit(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.pwszGroup = LPGENW("Network");
odp.pwszTitle = m_tszUserName;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.pwszTab = LPGENW("Account");
odp.pDialog = new CDlgOptAccount(this);
@@ -1569,7 +1569,7 @@ protected: m_gotservers = false;
- wchar_t *passw = m_proto->getTStringA(NULL, "Password");
+ wchar_t *passw = m_proto->getWStringA(NULL, "Password");
if (passw) {
m_txtPassword.SetText(passw);
mir_free(passw);
@@ -1588,7 +1588,7 @@ protected: if (GetComputerName(szCompName, &dwCompNameLength))
m_cbResource.AddString(szCompName);
- ptrW tszResource(m_proto->getTStringA("Resource"));
+ ptrW tszResource(m_proto->getWStringA("Resource"));
if (tszResource != NULL) {
if (CB_ERR == m_cbResource.FindString(tszResource, -1, true))
m_cbResource.AddString(tszResource);
@@ -1666,7 +1666,7 @@ protected: m_txtManualHost.Enable();
m_txtPort.Enable();
- ptrW dbManualHost(m_proto->getTStringA("ManualHost"));
+ ptrW dbManualHost(m_proto->getWStringA("ManualHost"));
if (dbManualHost != NULL)
m_txtManualHost.SetText(dbManualHost);
@@ -1715,7 +1715,7 @@ protected: if (m_chkSavePassword.GetState() == BST_CHECKED) {
wchar_t *text = m_txtPassword.GetText();
- m_proto->setTString("Password", text);
+ m_proto->setWString("Password", text);
mir_free(text);
}
else m_proto->delSetting("Password");
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 8e9e009d1d..545c1cc81a 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -183,7 +183,7 @@ void CJabberProto::OnIqResultPrivacyListActive(HXML iqNode, CJabberIqInfo *pInfo if (type == NULL)
return;
- CMString szText;
+ CMStringW szText;
if (!mir_wstrcmp(type, L"result")) {
mir_cslock lck(m_privacyListManager.m_cs);
@@ -370,7 +370,7 @@ public: wchar_t *szTypes[] = { L"JID", L"Group", L"Subscription", L"Any" };
int i, nTypes[] = { Jid, Group, Subscription, Else };
for (i=0; i < _countof(szTypes); i++) {
- LRESULT nItem = SendDlgItemMessage(m_hwnd, IDC_COMBO_TYPE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szTypes[i]));
+ LRESULT nItem = SendDlgItemMessage(m_hwnd, IDC_COMBO_TYPE, CB_ADDSTRING, 0, (LPARAM)TranslateW(szTypes[i]));
SendDlgItemMessage(m_hwnd, IDC_COMBO_TYPE, CB_SETITEMDATA, nItem, nTypes[i]);
if (m_pRule->GetType() == nTypes[i])
SendDlgItemMessage(m_hwnd, IDC_COMBO_TYPE, CB_SETCURSEL, nItem, 0);
@@ -379,7 +379,7 @@ public: SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_RESETCONTENT, 0, 0);
wchar_t *szSubscriptions[] = { L"none", L"from", L"to", L"both" };
for (i=0; i < _countof(szSubscriptions); i++) {
- LRESULT nItem = SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szSubscriptions[i]));
+ LRESULT nItem = SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_ADDSTRING, 0, (LPARAM)TranslateW(szSubscriptions[i]));
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_SETITEMDATA, nItem, (LPARAM)szSubscriptions[i]);
}
@@ -423,7 +423,7 @@ public: SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUES, CB_RESETCONTENT, 0, 0);
{
for (MCONTACT hContact = db_find_first(m_proto->m_szModuleName); hContact; hContact = db_find_next(hContact, m_proto->m_szModuleName)) {
- ptrW jid( m_proto->getTStringA(hContact, "jid"));
+ ptrW jid( m_proto->getWStringA(hContact, "jid"));
if (jid != NULL)
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUES, CB_ADDSTRING, 0, jid);
}
@@ -471,7 +471,7 @@ public: ShowWindow(GetDlgItem(m_hwnd, IDC_COMBO_VALUE), SW_SHOW);
if (m_pRule->GetValue()) {
- LRESULT nSelected = SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_SELECTSTRING, -1, (LPARAM)TranslateTS(m_pRule->GetValue()));
+ LRESULT nSelected = SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_SELECTSTRING, -1, (LPARAM)TranslateW(m_pRule->GetValue()));
if (nSelected == CB_ERR)
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_SETCURSEL, 0, 0);
}
@@ -948,7 +948,7 @@ BOOL CJabberDlgPrivacyLists::OnWmDrawItem(UINT, WPARAM, LPARAM lParam) int i, totalWidth = -5; // spacing for last item
for (i=0; i < _countof(drawItems); i++) {
SIZE sz = {0};
- drawItems[i].text = TranslateTS(drawItems[i].textEng);
+ drawItems[i].text = TranslateW(drawItems[i].textEng);
GetTextExtentPoint32(lpdis->hDC, drawItems[i].text, (int)mir_wstrlen(drawItems[i].text), &sz);
totalWidth += sz.cx + 18 + 5; // 18 pixels for icon, 5 pixel spacing
}
@@ -1462,9 +1462,9 @@ void CJabberDlgPrivacyLists::CListBuildList(HWND hwndList, CPrivacyList *pList) for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
hItem = m_clcClist.FindContact(hContact);
- ptrW jid( m_proto->getTStringA(hContact, "jid"));
+ ptrW jid( m_proto->getWStringA(hContact, "jid"));
if (jid == NULL)
- if ((jid = m_proto->getTStringA(hContact, "ChatRoomID")) == NULL)
+ if ((jid = m_proto->getWStringA(hContact, "ChatRoomID")) == NULL)
continue;
if (dwPackets = CListGetPackets(hwndList, hItem, true))
@@ -1663,7 +1663,7 @@ void CJabberDlgPrivacyLists::btnActivate_OnClick(CCtrlButton *) active << XATTR(L"name", pList->GetListName());
lck.unlock();
- SetStatusText(TranslateTS(JABBER_PL_BUSY_MSG));
+ SetStatusText(TranslateW(JABBER_PL_BUSY_MSG));
m_proto->m_ThreadInfo->send(iq);
}
@@ -1690,7 +1690,7 @@ void CJabberDlgPrivacyLists::btnSetDefault_OnClick(CCtrlButton *) XmlAddAttr(defaultTag, L"name", pList->GetListName());
lck.unlock();
- SetStatusText(TranslateTS(JABBER_PL_BUSY_MSG));
+ SetStatusText(TranslateW(JABBER_PL_BUSY_MSG));
m_proto->m_ThreadInfo->send(iq);
}
@@ -1958,7 +1958,7 @@ void CJabberDlgPrivacyLists::btnApply_OnClick(CCtrlButton *) pList = pList->GetNext();
} }
- SetStatusText(TranslateTS(JABBER_PL_BUSY_MSG));
+ SetStatusText(TranslateW(JABBER_PL_BUSY_MSG));
PostMessage(m_hwnd, WM_JABBER_REFRESH, 0, 0);
}
@@ -2101,7 +2101,7 @@ void CJabberProto::BuildPrivacyMenu() mi.pszService = "/PrivacyLists";
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandlePrivacyLists);
mi.position = 3000040000;
- mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR;
+ mi.flags = CMIF_UNMOVABLE | CMIF_UNICODE;
mi.hIcolibItem = GetIconHandle(IDI_PRIVACY_LISTS);
mi.name.w = LPGENW("List Editor...");
mi.root = m_hPrivacyMenuRoot;
@@ -2122,7 +2122,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld) CMenuItem mi;
mi.position = 2000040000;
- mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR;
+ mi.flags = CMIF_UNMOVABLE | CMIF_UNICODE;
mi.root = m_hPrivacyMenuRoot;
mi.pszService = srvFce;
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 198a8231d0..f66f63f151 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -146,7 +146,7 @@ CJabberProto::CJabberProto(const char *aProtoName, const wchar_t *aUserName) : db_set_resident(m_szModuleName, "Auth");
db_set_resident(m_szModuleName, "Grant");
- if ((m_tszSelectedLang = getTStringA("XmlLang")) == NULL)
+ if ((m_tszSelectedLang = getWStringA("XmlLang")) == NULL)
m_tszSelectedLang = mir_wstrdup(L"en");
}
@@ -242,7 +242,7 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) SetContactOfflineStatus(hContact);
if (getByte(hContact, "IsTransport", 0)) {
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid == NULL)
continue;
@@ -297,7 +297,7 @@ int __cdecl CJabberProto::OnPreShutdown(WPARAM, LPARAM) MCONTACT CJabberProto::AddToListByJID(const wchar_t *newJid, DWORD flags)
{
- debugLog(L"AddToListByJID jid = %s", newJid);
+ debugLogW(L"AddToListByJID jid = %s", newJid);
MCONTACT hContact = DBCreateContact(newJid, NULL, true, false);
if (flags & PALF_TEMPORARY)
@@ -371,7 +371,7 @@ int CJabberProto::Authorize(MEVENT hDbEvent) char *lastName = firstName + mir_strlen(firstName) + 1;
char *jid = lastName + mir_strlen(lastName) + 1;
- debugLog(L"Send 'authorization allowed' to %s", jid);
+ debugLogW(L"Send 'authorization allowed' to %s", jid);
wchar_t *newJid = (dbei.flags & DBEF_UTF) ? mir_utf8decodeW(jid) : mir_a2u(jid);
@@ -382,7 +382,7 @@ int CJabberProto::Authorize(MEVENT hDbEvent) JABBER_LIST_ITEM *item;
if ((item = ListGetItemPtr(LIST_ROSTER, newJid)) == NULL || (item->subscription != SUB_BOTH && item->subscription != SUB_TO)) {
- debugLog(L"Try adding contact automatically jid = %s", jid);
+ debugLogW(L"Try adding contact automatically jid = %s", jid);
if (MCONTACT hContact = AddToListByJID(newJid, 0)) {
// Trigger actual add by removing the "NotOnList" added by AddToListByJID()
// See AddToListByJID() and JabberDbSettingChanged().
@@ -659,7 +659,7 @@ void __cdecl CJabberProto::BasicSearchThread(JABBER_SEARCH_BASIC *jsb) PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.nick.w = jsb->jid;
psr.firstName.w = L"";
psr.lastName.w = L"";
@@ -672,7 +672,7 @@ void __cdecl CJabberProto::BasicSearchThread(JABBER_SEARCH_BASIC *jsb) HANDLE __cdecl CJabberProto::SearchBasic(const wchar_t *szJid)
{
- debugLog(L"JabberBasicSearch called with lParam = '%s'", szJid);
+ debugLogW(L"JabberBasicSearch called with lParam = '%s'", szJid);
JABBER_SEARCH_BASIC *jsb;
if (!m_bJabberOnline || (jsb = (JABBER_SEARCH_BASIC*)mir_alloc(sizeof(JABBER_SEARCH_BASIC))) == NULL)
@@ -687,7 +687,7 @@ HANDLE __cdecl CJabberProto::SearchBasic(const wchar_t *szJid) numericjid = (*i >= '0') && (*i <= '9');
mir_free(szServer);
- szServer = getTStringA(NULL, "LoginServer");
+ szServer = getWStringA(NULL, "LoginServer");
if (szServer == NULL)
szServer = mir_wstrdup(L"jabber.org");
else if (numericjid && !mir_wstrcmpi(szServer, L"S.ms")) {
@@ -701,7 +701,7 @@ HANDLE __cdecl CJabberProto::SearchBasic(const wchar_t *szJid) }
else wcsncpy_s(jsb->jid, szJid, _TRUNCATE);
- debugLog(L"Adding '%s' without validation", jsb->jid);
+ debugLogW(L"Adding '%s' without validation", jsb->jid);
jsb->hSearch = SerialNext();
ForkThread((MyThreadFunc)&CJabberProto::BasicSearchThread, jsb);
return (HANDLE)jsb->hSearch;
@@ -802,7 +802,7 @@ int __cdecl CJabberProto::SendContacts(MCONTACT hContact, int, int nContacts, MC HXML x = m << XCHILDNS(L"x", JABBER_FEAT_ROSTER_EXCHANGE);
for (int i = 0; i < nContacts; i++) {
- ptrW jid(getTStringA(hContactsList[i], "jid"));
+ ptrW jid(getWStringA(hContactsList[i], "jid"));
if (jid != NULL)
x << XCHILD(L"item") << XATTR(L"action", L"add") << XATTR(L"jid", jid);
}
@@ -822,7 +822,7 @@ HANDLE __cdecl CJabberProto::SendFile(MCONTACT hContact, const wchar_t *szDescri if (getWord(hContact, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
return 0;
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid == NULL)
return 0;
@@ -873,7 +873,7 @@ HANDLE __cdecl CJabberProto::SendFile(MCONTACT hContact, const wchar_t *szDescri int i, j;
for (i = j = 0; i < ft->std.totalFiles; i++) {
if (_wstat64(ppszFiles[i], &statbuf))
- debugLog(L"'%s' is an invalid filename", ppszFiles[i]);
+ debugLogW(L"'%s' is an invalid filename", ppszFiles[i]);
else {
ft->std.ptszFiles[j] = mir_wstrdup(ppszFiles[i]);
ft->fileSize[j] = statbuf.st_size;
@@ -1031,7 +1031,7 @@ int __cdecl CJabberProto::SetApparentMode(MCONTACT hContact, int mode) if (!m_bJabberOnline)
return 0;
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid == NULL)
return 0;
@@ -1103,7 +1103,7 @@ void __cdecl CJabberProto::GetAwayMsgThread(void *param) MCONTACT hContact = (DWORD_PTR)param;
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid != NULL) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid);
if (item != NULL) {
@@ -1162,7 +1162,7 @@ HANDLE __cdecl CJabberProto::GetAwayMsg(MCONTACT hContact) int __cdecl CJabberProto::SetAwayMsg(int status, const wchar_t *msg)
{
- debugLog(L"SetAwayMsg called, wParam=%d lParam=%s", status, msg);
+ debugLogW(L"SetAwayMsg called, wParam=%d lParam=%s", status, msg);
wchar_t **szMsg;
mir_cslockfull lck(m_csModeMsgMutex);
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index f0e36b64ff..dbdc84bab3 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -582,14 +582,14 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface void GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen);
void ResolveTransportNicks(const wchar_t *jid);
void SetServerStatus(int iNewStatus);
- void FormatMirVer(pResourceStatus &resource, CMString&);
+ void FormatMirVer(pResourceStatus &resource, CMStringW&);
void UpdateMirVer(JABBER_LIST_ITEM *item);
void UpdateMirVer(MCONTACT hContact, pResourceStatus &resource);
void UpdateSubscriptionInfo(MCONTACT hContact, JABBER_LIST_ITEM *item);
void SetContactOfflineStatus(MCONTACT hContact);
void InitPopups(void);
void MsgPopup(MCONTACT hContact, const wchar_t *szMsg, const wchar_t *szTitle);
- CMString ExtractImage(HXML node);
+ CMStringW ExtractImage(HXML node);
//---- jabber_opt.cpp ----------------------------------------------------------------
INT_PTR __cdecl OnMenuHandleRosterControl(WPARAM wParam, LPARAM lParam);
@@ -746,7 +746,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface void ComboLoadRecentStrings(HWND hwndDlg, UINT idcCombo, char *param, int recentCount=JABBER_DEFAULT_RECENT_COUNT);
void ComboAddRecentString(HWND hwndDlg, UINT idcCombo, char *param, const wchar_t *string, int recentCount=JABBER_DEFAULT_RECENT_COUNT);
- BOOL EnterString(CMString &result, LPCTSTR caption, int type, char *windowName=NULL, int recentCount=JABBER_DEFAULT_RECENT_COUNT, int timeout=0);
+ BOOL EnterString(CMStringW &result, LPCTSTR caption, int type, char *windowName=NULL, int recentCount=JABBER_DEFAULT_RECENT_COUNT, int timeout=0);
bool IsMyOwnJID(LPCTSTR szJID);
void __cdecl LoadHttpAvatars(void* param);
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp index 6cfb672dd0..7255b5cc63 100644 --- a/protocols/JabberG/src/jabber_rc.cpp +++ b/protocols/JabberG/src/jabber_rc.cpp @@ -322,7 +322,7 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc fieldNode = xNode << XCHILD(L"field") << XATTR(L"label", TranslateT("Change global status"))
<< XATTR(L"type", L"boolean") << XATTR(L"var", L"status-global");
- ptrW tszStatusMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, status, 0));
+ ptrW tszStatusMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGW, status, 0));
if (tszStatusMsg)
fieldNode << XCHILD(L"value", tszStatusMsg);
@@ -375,7 +375,7 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc int nNoDlg = db_get_b(NULL, "SRAway", StatusModeToDbSetting(status, "NoDlg"), 0);
db_set_b(NULL, "SRAway", StatusModeToDbSetting(status, "NoDlg"), 1);
- db_set_ts(NULL, "SRAway", StatusModeToDbSetting(status, "Msg"), szStatusMessage ? szStatusMessage : L"");
+ db_set_ws(NULL, "SRAway", StatusModeToDbSetting(status, "Msg"), szStatusMessage ? szStatusMessage : L"");
fieldNode = XmlGetChildByTag(xNode, "field", "var", L"status-global");
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value"))) {
@@ -465,7 +465,7 @@ int CJabberProto::RcGetUnreadEventsCount() {
int nEventsSent = 0;
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- ptrW jid( getTStringA(hContact, "jid"));
+ ptrW jid( getWStringA(hContact, "jid"));
if (jid == NULL) continue;
for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
@@ -477,7 +477,7 @@ int CJabberProto::RcGetUnreadEventsCount() dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob + 1);
int nGetTextResult = db_event_get(hDbEvent, &dbei);
if (!nGetTextResult && dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_READ) && !(dbei.flags & DBEF_SENT)) {
- wchar_t *szEventText = DbGetEventTextT(&dbei, CP_ACP);
+ wchar_t *szEventText = DbGetEventTextW(&dbei, CP_ACP);
if (szEventText) {
nEventsSent++;
mir_free(szEventText);
@@ -551,7 +551,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe int nEventsSent = 0;
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- ptrW tszJid( getTStringA(hContact, "jid"));
+ ptrW tszJid( getWStringA(hContact, "jid"));
if (tszJid == NULL)
continue;
@@ -569,7 +569,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe if (dbei.eventType != EVENTTYPE_MESSAGE || (dbei.flags & (DBEF_READ | DBEF_SENT)))
continue;
- ptrW szEventText( DbGetEventTextT(&dbei, CP_ACP));
+ ptrW szEventText( DbGetEventTextW(&dbei, CP_ACP));
if (szEventText == NULL)
continue;
diff --git a/protocols/JabberG/src/jabber_rc.h b/protocols/JabberG/src/jabber_rc.h index fd4a6664d9..cd85c98039 100644 --- a/protocols/JabberG/src/jabber_rc.h +++ b/protocols/JabberG/src/jabber_rc.h @@ -42,7 +42,7 @@ typedef int (CJabberProto::*JABBER_ADHOC_HANDLER)(HXML iqNode, CJabberIqInfo *pI class CJabberAdhocSession
{
protected:
- CMString m_szSessionId;
+ CMStringW m_szSessionId;
CJabberAdhocSession* m_pNext;
DWORD m_dwStartTime;
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index 69f3c6f3ee..2e950a0b26 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -105,7 +105,7 @@ static int JabberSearchAddField(HWND hwndDlg, Data* FieldDat) int Order = (FieldDat->bHidden) ? -1 : FieldDat->Order; - HWND hwndLabel = CreateWindowEx(0, L"STATIC", (LPCTSTR)TranslateTS(FieldDat->Label), WS_CHILD, CornerX, CornerY + Order * 40, width, 13, hwndParent, NULL, hInst, 0); + HWND hwndLabel = CreateWindowEx(0, L"STATIC", (LPCTSTR)TranslateW(FieldDat->Label), WS_CHILD, CornerX, CornerY + Order * 40, width, 13, hwndParent, NULL, hInst, 0); HWND hwndVar = CreateWindowEx(0 | WS_EX_CLIENTEDGE, L"EDIT", (LPCTSTR)FieldDat->defValue, WS_CHILD | WS_TABSTOP, CornerX + 5, CornerY + Order * 40 + 14, width, 20, hwndParent, NULL, hInst, 0); SendMessage(hwndLabel, WM_SETFONT, (WPARAM)hFont, 0); SendMessage(hwndVar, WM_SETFONT, (WPARAM)hFont, 0); @@ -161,7 +161,7 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*) break; if (!mir_wstrcmpi(XmlGetName(chNode), L"instructions") && XmlGetText(chNode)) - SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, TranslateTS(XmlGetText(chNode))); + SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, TranslateW(XmlGetText(chNode))); else if (XmlGetName(chNode)) { Data *MyData = (Data*)malloc(sizeof(Data)); memset(MyData, 0, sizeof(Data)); @@ -278,7 +278,7 @@ void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_M nick = buff; } Results.psr.nick.w = nick; - Results.psr.flags = PSR_TCHAR; + Results.psr.flags = PSR_UNICODE; ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SEARCHRESULT, id, (LPARAM)&Results); Results.psr.nick.w = NULL; @@ -494,16 +494,16 @@ void CJabberProto::SearchDeleteFromRecent(const wchar_t *szAddr, bool deleteLast for (int i = 0; i < 10; i++) { char key[30]; mir_snprintf(key, "RecentlySearched_%d", i); - ptrW szValue(getTStringA(key)); + ptrW szValue(getWStringA(key)); if (szValue == NULL || mir_wstrcmpi(szAddr, szValue)) continue; for (int j = i; j < 10; j++) { mir_snprintf(key, "RecentlySearched_%d", j + 1); - szValue = getTStringA(key); + szValue = getWStringA(key); if (szValue != NULL) { mir_snprintf(key, "RecentlySearched_%d", j); - setTString(NULL, key, szValue); + setWString(NULL, key, szValue); } else { if (deleteLastFromDB) { @@ -524,15 +524,15 @@ void CJabberProto::SearchAddToRecent(const wchar_t *szAddr, HWND hwndDialog) for (int j = 9; j > 0; j--) { mir_snprintf(key, "RecentlySearched_%d", j - 1); - ptrW szValue(getTStringA(key)); + ptrW szValue(getWStringA(key)); if (szValue != NULL) { mir_snprintf(key, "RecentlySearched_%d", j); - setTString(NULL, key, szValue); + setWString(NULL, key, szValue); } } mir_snprintf(key, "RecentlySearched_%d", 0); - setTString(key, szAddr); + setWString(key, szAddr); if (hwndDialog) JabberSearchAddUrlToRecentCombo(hwndDialog, szAddr); } @@ -564,7 +564,7 @@ static INT_PTR CALLBACK JabberSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPAR for (i = 0; i < 10; i++) { char key[30]; mir_snprintf(key, "RecentlySearched_%d", i); - ptrW szValue(dat->ppro->getTStringA(key)); + ptrW szValue(dat->ppro->getWStringA(key)); if (szValue != NULL) JabberSearchAddUrlToRecentCombo(hwndDlg, szValue); } @@ -714,7 +714,7 @@ static INT_PTR CALLBACK JabberSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPAR HWND __cdecl CJabberProto::CreateExtendedSearchUI(HWND parent) { if (parent && hInst) { - ptrW szServer(getTStringA("LoginServer")); + ptrW szServer(getWStringA("LoginServer")); if (szServer == NULL || mir_wstrcmpi(szServer, L"S.ms")) return CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SEARCHUSER), parent, JabberSearchAdvancedDlgProc, (LPARAM)this); } diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index 9d5553db8f..29b2cef6b5 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -144,7 +144,7 @@ INT_PTR __cdecl CJabberProto::JabberGetAvatarInfo(WPARAM wParam, LPARAM lParam) }
if ((wParam & GAIF_FORCE) != 0 && pai->hContact != NULL && m_bJabberOnline) {
- ptrW tszJid( getTStringA(pai->hContact, "jid"));
+ ptrW tszJid( getWStringA(pai->hContact, "jid"));
if (tszJid != NULL) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, tszJid);
if (item != NULL) {
@@ -158,7 +158,7 @@ INT_PTR __cdecl CJabberProto::JabberGetAvatarInfo(WPARAM wParam, LPARAM lParam) if (szJid[0] == 0)
wcsncpy_s(szJid, tszJid, _TRUNCATE);
- debugLog(L"Rereading %s for %s", isXVcard ? JABBER_FEAT_VCARD_TEMP : JABBER_FEAT_AVATAR, szJid);
+ debugLogW(L"Rereading %s for %s", isXVcard ? JABBER_FEAT_VCARD_TEMP : JABBER_FEAT_AVATAR, szJid);
m_ThreadInfo->send((isXVcard) ?
XmlNodeIq( AddIQ(&CJabberProto::OnIqResultGetVCardAvatar, JABBER_IQ_TYPE_GET, szJid)) << XCHILDNS(L"vCard", JABBER_FEAT_VCARD_TEMP) :
@@ -319,7 +319,7 @@ INT_PTR __cdecl CJabberProto::JabberSetNickname(WPARAM wParam, LPARAM lParam) {
wchar_t *nickname = (wParam & SMNN_UNICODE) ? mir_wstrdup((WCHAR*)lParam) : mir_a2u((char*)lParam);
- setTString("Nick", nickname);
+ setWString("Nick", nickname);
SetServerVcard(FALSE, L"");
return 0;
}
@@ -338,15 +338,15 @@ INT_PTR __cdecl CJabberProto::ServiceSendXML(WPARAM, LPARAM lParam) static const wchar_t *JabberEnum2AffilationStr[] = { LPGENW("None"), LPGENW("Outcast"), LPGENW("Member"), LPGENW("Admin"), LPGENW("Owner") },
*JabberEnum2RoleStr[] = { LPGENW("None"), LPGENW("Visitor"), LPGENW("Participant"), LPGENW("Moderator") };
-static void appendString(bool bIsTipper, const wchar_t *tszTitle, const wchar_t *tszValue, CMString &out)
+static void appendString(bool bIsTipper, const wchar_t *tszTitle, const wchar_t *tszValue, CMStringW &out)
{
if (!out.IsEmpty())
out.Append(bIsTipper ? L"\n" : L"\r\n");
if (bIsTipper)
- out.AppendFormat(L"<b>%s</b>\t%s", TranslateTS(tszTitle), tszValue);
+ out.AppendFormat(L"<b>%s</b>\t%s", TranslateW(tszTitle), tszValue);
else {
- wchar_t *p = TranslateTS(tszTitle);
+ wchar_t *p = TranslateW(tszTitle);
out.AppendFormat(L"%s%s\t%s", p, mir_wstrlen(p) <= 7 ? L"\t" : L"", tszValue);
}
}
@@ -374,7 +374,7 @@ INT_PTR __cdecl CJabberProto::JabberGCGetToolTipText(WPARAM wParam, LPARAM lPara bool bIsTipper = db_get_b(NULL, "Tab_SRMsg", "adv_TipperTooltip", 0) && ServiceExists("mToolTip/HideTip");
//JID:
- CMString outBuf;
+ CMStringW outBuf;
if (wcschr(info->m_tszResourceName, '@') != NULL)
appendString(bIsTipper, LPGENW("JID:"), info->m_tszResourceName, outBuf);
else if (lParam) //or simple nick
@@ -389,10 +389,10 @@ INT_PTR __cdecl CJabberProto::JabberGCGetToolTipText(WPARAM wParam, LPARAM lPara appendString(bIsTipper, LPGENW("Status message:"), info->m_tszStatusMessage, outBuf);
// Role
- appendString(bIsTipper, LPGENW("Role:"), TranslateTS(JabberEnum2RoleStr[info->m_role]), outBuf);
+ appendString(bIsTipper, LPGENW("Role:"), TranslateW(JabberEnum2RoleStr[info->m_role]), outBuf);
// Affiliation
- appendString(bIsTipper, LPGENW("Affiliation:"), TranslateTS(JabberEnum2AffilationStr[info->m_affiliation]), outBuf);
+ appendString(bIsTipper, LPGENW("Affiliation:"), TranslateW(JabberEnum2AffilationStr[info->m_affiliation]), outBuf);
// real jid
if (info->m_tszRealJid)
@@ -465,7 +465,7 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam) if (!HContactFromJID(szJid)) {
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.nick.w = szJid;
psr.id.w = szJid;
@@ -525,7 +525,7 @@ INT_PTR __cdecl CJabberProto::JabberSendNudge(WPARAM hContact, LPARAM) if (!m_bJabberOnline)
return 0;
- ptrW jid( getTStringA(hContact, "jid"));
+ ptrW jid( getWStringA(hContact, "jid"));
if (jid == NULL)
return 0;
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index bc3486fdf5..407def3d3d 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -97,7 +97,7 @@ static INT_PTR CALLBACK JabberPasswordDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa BOOL savePassword = IsDlgButtonChecked(hwndDlg, IDC_SAVE_PERM);
param->pro->setByte("SavePassword", savePassword);
if (savePassword) {
- param->pro->setTString("Password", param->onlinePassword);
+ param->pro->setWString("Password", param->onlinePassword);
param->saveOnlinePassword = TRUE;
}
}
@@ -245,13 +245,13 @@ void CJabberProto::ServerThread(JABBER_CONN_DATA *pParam) m_ThreadInfo = &info;
- if ((tszValue = getTStringA("LoginName")) != NULL)
+ if ((tszValue = getWStringA("LoginName")) != NULL)
wcsncpy_s(info.conn.username, tszValue, _TRUNCATE);
if (*rtrimw(info.conn.username) == '\0') {
DWORD dwSize = _countof(info.conn.username);
if (GetUserName(info.conn.username, &dwSize))
- setTString("LoginName", info.conn.username);
+ setWString("LoginName", info.conn.username);
else
info.conn.username[0] = 0;
}
@@ -282,7 +282,7 @@ LBL_FatalError: mir_wstrcpy(info.resource, L"Miranda");
}
else {
- if ((tszValue = getTStringA("Resource")) != NULL)
+ if ((tszValue = getWStringA("Resource")) != NULL)
wcsncpy_s(info.resource, tszValue, _TRUNCATE);
else
mir_wstrcpy(info.resource, L"Miranda");
@@ -319,7 +319,7 @@ LBL_FatalError: }
}
else {
- ptrW tszPassw(getTStringA(NULL, "Password"));
+ ptrW tszPassw(getWStringA(NULL, "Password"));
if (tszPassw == NULL) {
JLoginFailed(LOGINERR_BADUSERID);
debugLogA("Thread ended, password is not configured");
@@ -394,7 +394,7 @@ LBL_FatalError: m_szJabberJID = (wchar_t*)mir_alloc(sizeof(wchar_t)*(len + 1));
mir_snwprintf(m_szJabberJID, len + 1, L"%s@%S", info.conn.username, info.conn.server);
m_bSendKeepAlive = m_options.KeepAlive != 0;
- setTString("jid", m_szJabberJID); // store jid in database
+ setWString("jid", m_szJabberJID); // store jid in database
ListInit();
}
@@ -830,13 +830,13 @@ void CJabberProto::OnProcessSuccess(HXML node, ThreadData *info) }
debugLogA("Success: Logged-in.");
- ptrW tszNick(getTStringA("Nick"));
+ ptrW tszNick(getWStringA("Nick"));
if (tszNick == NULL)
- setTString("Nick", info->conn.username);
+ setWString("Nick", info->conn.username);
xmlStreamInitialize("after successful sasl");
}
- else debugLog(L"Success: unknown action %s.", type);
+ else debugLogW(L"Success: unknown action %s.", type);
}
void CJabberProto::OnProcessChallenge(HXML node, ThreadData *info)
@@ -1321,7 +1321,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) if (!mir_wstrcmp(action, L"add")) {
MCONTACT cc = DBCreateContact(jid, nick, false, false);
if (group)
- db_set_ts(cc, "CList", "Group", group);
+ db_set_ws(cc, "CList", "Group", group);
}
else if (!mir_wstrcmp(action, L"delete")) {
MCONTACT cc = HContactFromJID(jid);
@@ -1365,7 +1365,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) if (szMessage == NULL)
return;
- CMString tmp(szMessage);
+ CMStringW tmp(szMessage);
tmp += ExtractImage(node);
tmp.Replace(L"\n", L"\r\n");
ptrA buf(mir_utf8encodeW(tmp));
@@ -1407,7 +1407,7 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node) if (from == NULL)
return;
- debugLog(L"presence: for jid %s", from);
+ debugLogW(L"presence: for jid %s", from);
pResourceStatus r(ResourceInfoFromJID(from));
if (r == NULL)
@@ -1449,7 +1449,7 @@ void CJabberProto::UpdateJidDbSettings(const wchar_t *jid) if (wcschr(jid, '/') == NULL)
status = item->getTemp()->m_iStatus;
if (item->getTemp()->m_tszStatusMessage)
- db_set_ts(hContact, "CList", "StatusMsg", item->getTemp()->m_tszStatusMessage);
+ db_set_ws(hContact, "CList", "StatusMsg", item->getTemp()->m_tszStatusMessage);
else
db_unset(hContact, "CList", "StatusMsg");
}
@@ -1472,9 +1472,9 @@ void CJabberProto::UpdateJidDbSettings(const wchar_t *jid) item->getTemp()->m_iStatus = status;
if (nSelectedResource != -1) {
pResourceStatus r(item->arResources[nSelectedResource]);
- debugLog(L"JabberUpdateJidDbSettings: updating jid %s to rc %s", item->jid, r->m_tszResourceName);
+ debugLogW(L"JabberUpdateJidDbSettings: updating jid %s to rc %s", item->jid, r->m_tszResourceName);
if (r->m_tszStatusMessage)
- db_set_ts(hContact, "CList", "StatusMsg", r->m_tszStatusMessage);
+ db_set_ws(hContact, "CList", "StatusMsg", r->m_tszStatusMessage);
else
db_unset(hContact, "CList", "StatusMsg");
UpdateMirVer(hContact, r);
@@ -1530,13 +1530,13 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) if ((hContact = HContactFromJID(from)) == NULL) {
if (!mir_wstrcmpi(info->fullJID, from) || (!bSelfPresence && !ListGetItemPtr(LIST_ROSTER, from))) {
- debugLog(L"SKIP Receive presence online from %s (who is not in my roster and not in list - skiping)", from);
+ debugLogW(L"SKIP Receive presence online from %s (who is not in my roster and not in list - skiping)", from);
return;
}
hContact = DBCreateContact(from, nick, true, true);
}
if (!ListGetItemPtr(LIST_ROSTER, from)) {
- debugLog(L"Receive presence online from %s (who is not in my roster)", from);
+ debugLogW(L"Receive presence online from %s (who is not in my roster)", from);
ListAdd(LIST_ROSTER, from, hContact);
}
DBCheckIsTransportedContact(from, hContact);
@@ -1564,7 +1564,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) if (wcschr(from, '@') == NULL) {
UI_SAFE_NOTIFY(m_pDlgServiceDiscovery, WM_JABBER_TRANSPORT_REFRESH);
}
- debugLog(L"%s (%s) online, set contact status to %s", nick, from, pcli->pfnGetStatusModeDescription(status, 0));
+ debugLogW(L"%s (%s) online, set contact status to %s", nick, from, pcli->pfnGetStatusModeDescription(status, 0));
HXML xNode;
if (m_options.EnableAvatars) {
@@ -1577,9 +1577,9 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) if (ptszHash != NULL) {
delSetting(hContact, "AvatarXVcard");
debugLogA("AvatarXVcard deleted");
- setTString(hContact, "AvatarHash", ptszHash);
+ setWString(hContact, "AvatarHash", ptszHash);
bHasAvatar = true;
- ptrW saved(getTStringA(hContact, "AvatarSaved"));
+ ptrW saved(getWStringA(hContact, "AvatarSaved"));
if (saved == NULL || mir_wstrcmp(saved, ptszHash)) {
debugLogA("Avatar was changed");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, NULL);
@@ -1597,9 +1597,9 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) if (txt != NULL && txt[0] != 0) {
setByte(hContact, "AvatarXVcard", 1);
debugLogA("AvatarXVcard set");
- setTString(hContact, "AvatarHash", txt);
+ setWString(hContact, "AvatarHash", txt);
bHasAvatar = true;
- ptrW saved(getTStringA(hContact, "AvatarSaved"));
+ ptrW saved(getWStringA(hContact, "AvatarSaved"));
if (saved == NULL || mir_wstrcmp(saved, txt)) {
debugLogA("Avatar was changed. Using vcard-temp:x:update");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, NULL);
@@ -1612,7 +1612,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) debugLogA("Has no avatar");
delSetting(hContact, "AvatarHash");
- if (ptrW(getTStringA(hContact, "AvatarSaved")) != NULL) {
+ if (ptrW(getWStringA(hContact, "AvatarSaved")) != NULL) {
delSetting(hContact, "AvatarSaved");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL);
} } }
@@ -1639,7 +1639,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) item->getTemp()->m_tszStatusMessage = mir_wstrdup(XmlGetText(XmlGetChild(node, "status")));
}
}
- else debugLog(L"SKIP Receive presence offline from %s (who is not in my roster)", from);
+ else debugLogW(L"SKIP Receive presence offline from %s (who is not in my roster)", from);
UpdateJidDbSettings(from);
@@ -1659,7 +1659,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) if (xNick != NULL) {
LPCTSTR xszNick = XmlGetText(xNick);
if (xszNick != NULL && *xszNick) {
- debugLog(L"Grabbed nick from presence: %s", xszNick);
+ debugLogW(L"Grabbed nick from presence: %s", xszNick);
tszNick = mir_wstrdup(xszNick);
}
}
@@ -1672,11 +1672,11 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) if (m_options.AutoAdd == TRUE) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, from);
if (item == NULL || (item->subscription != SUB_BOTH && item->subscription != SUB_TO)) {
- debugLog(L"Try adding contact automatically jid = %s", from);
+ debugLogW(L"Try adding contact automatically jid = %s", from);
if ((hContact = AddToListByJID(from, 0)) != NULL) {
if (item)
item->hContact = hContact;
- setTString(hContact, "Nick", tszNick);
+ setWString(hContact, "Nick", tszNick);
db_unset(hContact, "CList", "NotOnList");
}
}
@@ -1684,7 +1684,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) RebuildInfoFrame();
}
else {
- debugLog(L"%s (%s) requests authorization", tszNick, from);
+ debugLogW(L"%s (%s) requests authorization", tszNick, from);
DBAddAuthRequest(from, tszNick);
}
return;
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index 4a0f6e0046..bd464df117 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -279,7 +279,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti if (jcb & g_JabberFeatCapPairs[i].jcbCap) { wchar_t szDescription[ 1024 ]; if (g_JabberFeatCapPairs[i].tszDescription) - mir_snwprintf(szDescription, L"%s (%s)", TranslateTS(g_JabberFeatCapPairs[i].tszDescription), g_JabberFeatCapPairs[i].szFeature); + mir_snwprintf(szDescription, L"%s (%s)", TranslateW(g_JabberFeatCapPairs[i].tszDescription), g_JabberFeatCapPairs[i].szFeature); else wcsncpy_s(szDescription, g_JabberFeatCapPairs[i].szFeature, _TRUNCATE); sttFillInfoLine(hwndTree, htiCaps, NULL, NULL, szDescription, sttInfoLineId(resource, INFOLINE_CAPS, i)); @@ -289,7 +289,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti if (jcb & ppro->m_lstJabberFeatCapPairsDynamic[j]->jcbCap) { wchar_t szDescription[ 1024 ]; if (ppro->m_lstJabberFeatCapPairsDynamic[j]->szDescription) - mir_snwprintf(szDescription, L"%s (%s)", TranslateTS(ppro->m_lstJabberFeatCapPairsDynamic[j]->szDescription), ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature); + mir_snwprintf(szDescription, L"%s (%s)", TranslateW(ppro->m_lstJabberFeatCapPairsDynamic[j]->szDescription), ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature); else wcsncpy_s(szDescription, ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature, _TRUNCATE); sttFillInfoLine(hwndTree, htiCaps, NULL, NULL, szDescription, sttInfoLineId(resource, INFOLINE_CAPS, i)); @@ -320,9 +320,9 @@ static void sttFillAdvStatusInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM ht if (szAdvStatusIcon && szAdvStatusTitle && *szAdvStatusTitle) { wchar_t szText[2048]; if (szAdvStatusText && *szAdvStatusText) - mir_snwprintf(szText, L"%s (%s)", TranslateTS(szAdvStatusTitle), szAdvStatusText); + mir_snwprintf(szText, L"%s (%s)", TranslateW(szAdvStatusTitle), szAdvStatusText); else - wcsncpy_s(szText, TranslateTS(szAdvStatusTitle), _TRUNCATE); + wcsncpy_s(szText, TranslateW(szAdvStatusTitle), _TRUNCATE); sttFillInfoLine(hwndTree, htiRoot, IcoLib_GetIcon(szAdvStatusIcon), szTitle, szText, dwInfoLine); } @@ -470,7 +470,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa if (dat == NULL) break; if (dat->item == NULL) { - ptrW jid(dat->ppro->getTStringA(dat->hContact, "jid")); + ptrW jid(dat->ppro->getWStringA(dat->hContact, "jid")); if (jid == NULL) break; @@ -560,7 +560,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa case PSN_PARAMCHANGED: dat->ppro = (CJabberProto*)((PSHNOTIFY*)lParam)->lParam; if (dat->hContact != NULL) { - ptrW jid(dat->ppro->getTStringA(dat->hContact, "jid")); + ptrW jid(dat->ppro->getWStringA(dat->hContact, "jid")); if (jid != NULL) if (!(dat->item = dat->ppro->ListGetItemPtr(LIST_VCARD_TEMP, jid))) dat->item = dat->ppro->ListGetItemPtr(LIST_ROSTER, jid); @@ -642,14 +642,14 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP } ShowWindow(GetDlgItem(hwndDlg, IDC_SAVE), SW_HIDE); { - ptrW jid(photoInfo->ppro->getTStringA(photoInfo->hContact, "jid")); + ptrW jid(photoInfo->ppro->getWStringA(photoInfo->hContact, "jid")); if (jid != NULL) { JABBER_LIST_ITEM *item = photoInfo->ppro->ListGetItemPtr(LIST_VCARD_TEMP, jid); if (item == NULL) item = photoInfo->ppro->ListGetItemPtr(LIST_ROSTER, jid); if (item != NULL) { if (item->photoFileName) { - photoInfo->ppro->debugLog(L"Showing picture from %s", item->photoFileName); + photoInfo->ppro->debugLogW(L"Showing picture from %s", item->photoFileName); photoInfo->hBitmap = Bitmap_Load(item->photoFileName); FIP->FI_Premultiply(photoInfo->hBitmap); ShowWindow(GetDlgItem(hwndDlg, IDC_SAVE), SW_SHOW); @@ -666,7 +666,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP case IDC_SAVE: static wchar_t szFilter[512]; - ptrW jid(photoInfo->ppro->getTStringA(photoInfo->hContact, "jid")); + ptrW jid(photoInfo->ppro->getWStringA(photoInfo->hContact, "jid")); if (jid == NULL) break; @@ -701,7 +701,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP ofn.nMaxFile = _MAX_PATH; ofn.Flags = OFN_OVERWRITEPROMPT; if (GetSaveFileName(&ofn)) { - photoInfo->ppro->debugLog(L"File selected is %s", szFileName); + photoInfo->ppro->debugLogW(L"File selected is %s", szFileName); CopyFile(item->photoFileName, szFileName, FALSE); } } diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index c607e10c26..c2083fb050 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -283,9 +283,9 @@ wchar_t* __stdcall JabberErrorMsg(HXML errorNode, int* pErrorCode) }
if (str != NULL)
- mir_snwprintf(errorStr, 256, L"%s %d: %s\r\n%s", TranslateT("Error"), errorCode, TranslateTS(JabberErrorStr(errorCode)), str);
+ mir_snwprintf(errorStr, 256, L"%s %d: %s\r\n%s", TranslateT("Error"), errorCode, TranslateW(JabberErrorStr(errorCode)), str);
else
- mir_snwprintf(errorStr, 256, L"%s %d: %s", TranslateT("Error"), errorCode, TranslateTS(JabberErrorStr(errorCode)));
+ mir_snwprintf(errorStr, 256, L"%s %d: %s", TranslateT("Error"), errorCode, TranslateW(JabberErrorStr(errorCode)));
if (pErrorCode)
*pErrorCode = errorCode;
@@ -425,7 +425,7 @@ void CJabberProto::SendPresenceTo(int status, const wchar_t* to, HXML extra, con arrExtCaps.insert(m_lstJabberFeatCapPairsDynamic[i]->szExt);
if (arrExtCaps.getCount()) {
- CMString szExtCaps = arrExtCaps[0];
+ CMStringW szExtCaps = arrExtCaps[0];
for (int i = 1; i < arrExtCaps.getCount(); i++) {
szExtCaps.AppendChar(' ');
szExtCaps += arrExtCaps[i];
@@ -528,7 +528,7 @@ wchar_t* CJabberProto::GetClientJID(MCONTACT hContact, wchar_t *dest, size_t des if (hContact == NULL)
return NULL;
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
return GetClientJID(jid, dest, destLen);
}
@@ -658,7 +658,7 @@ void CJabberProto::ComboLoadRecentStrings(HWND hwndDlg, UINT idcCombo, char *par for (int i = 0; i < recentCount; i++) {
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "%s%d", param, i);
- ptrW tszRecent(getTStringA(setting));
+ ptrW tszRecent(getWStringA(setting));
if (tszRecent != NULL)
SendDlgItemMessage(hwndDlg, idcCombo, CB_ADDSTRING, 0, tszRecent);
}
@@ -682,7 +682,7 @@ void CJabberProto::ComboAddRecentString(HWND hwndDlg, UINT idcCombo, char *param id = getByte(param, 0);
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "%s%d", param, id);
- setTString(setting, string);
+ setWString(setting, string);
setByte(param, (id + 1) % recentCount);
}
@@ -809,7 +809,7 @@ void JabberCopyText(HWND hwnd, const wchar_t *text) }
}
-BOOL CJabberProto::EnterString(CMString &result, LPCTSTR caption, int type, char *windowName, int recentCount, int timeout)
+BOOL CJabberProto::EnterString(CMStringW &result, LPCTSTR caption, int type, char *windowName, int recentCount, int timeout)
{
if (caption == NULL) {
caption = NEWWSTR_ALLOCA(result.GetString());
@@ -933,7 +933,7 @@ void __cdecl CJabberProto::LoadHttpAvatars(void* param) fclose(out);
setString(ai.hContact, "AvatarSaved", buffer);
ProtoBroadcastAck(ai.hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &ai, 0);
- debugLog(L"Broadcast new avatar: %s", ai.filename);
+ debugLogW(L"Broadcast new avatar: %s", ai.filename);
}
else ProtoBroadcastAck(ai.hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, &ai, 0);
}
diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index f48503739d..e4a6b04931 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -46,9 +46,9 @@ int CJabberProto::SendGetVcard(const wchar_t *jid) static void SetDialogField(CJabberProto *ppro, HWND hwndDlg, int nDlgItem, char* key, bool bTranslate = false)
{
- ptrW tszValue(ppro->getTStringA(key));
+ ptrW tszValue(ppro->getWStringA(key));
if (tszValue != NULL)
- SetDlgItemText(hwndDlg, nDlgItem, (bTranslate) ? TranslateTS(tszValue) : tszValue);
+ SetDlgItemText(hwndDlg, nDlgItem, (bTranslate) ? TranslateW(tszValue) : tszValue);
else
SetDlgItemTextA(hwndDlg, nDlgItem, "");
}
@@ -127,7 +127,7 @@ static INT_PTR CALLBACK HomeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA for (int i = 0; i < g_cbCountries; i++) {
if (g_countries[i].id != 0xFFFF && g_countries[i].id != 0) {
wchar_t *country = mir_a2u(g_countries[i].szName);
- SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_ADDSTRING, 0, (LPARAM)TranslateTS(country));
+ SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_ADDSTRING, 0, (LPARAM)TranslateW(country));
mir_free(country);
}
}
@@ -191,7 +191,7 @@ static INT_PTR CALLBACK WorkDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA for (int i = 0; i < g_cbCountries; i++) {
if (g_countries[i].id != 0xFFFF && g_countries[i].id != 0) {
wchar_t *country = mir_a2u(g_countries[i].szName);
- SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_ADDSTRING, 0, (LPARAM)TranslateTS(country));
+ SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_ADDSTRING, 0, (LPARAM)TranslateW(country));
mir_free(country);
}
}
@@ -293,7 +293,7 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (GetTempPath(_countof(szTempPath), szTempPath) <= 0)
mir_wstrcpy(szTempPath, L".\\");
if (GetTempFileName(szTempPath, L"jab", 0, szTempFileName) > 0) {
- dat->ppro->debugLog(L"Temp file = %s", szTempFileName);
+ dat->ppro->debugLogW(L"Temp file = %s", szTempFileName);
if (CopyFile(szAvatarFileName, szTempFileName, FALSE) == TRUE) {
if ((dat->hBitmap = Bitmap_Load(szTempFileName)) != NULL) {
FIP->FI_Premultiply(dat->hBitmap);
@@ -349,7 +349,7 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR struct _stat st;
HBITMAP hNewBitmap;
- dat->ppro->debugLog(L"File selected is %s", szFileName);
+ dat->ppro->debugLogW(L"File selected is %s", szFileName);
if (_wstat(szFileName, &st) < 0 || st.st_size > 40 * 1024) {
MessageBox(hwndDlg, TranslateT("Only JPG, GIF, and BMP image files smaller than 40 KB are supported."), TranslateT("Jabber vCard"), MB_OK | MB_SETFOREGROUND);
break;
@@ -358,7 +358,7 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR mir_wstrcpy(szTempPath, L".\\");
if (GetTempFileName(szTempPath, L"jab", 0, szTempFileName) > 0) {
- dat->ppro->debugLog(L"Temp file = %s", szTempFileName);
+ dat->ppro->debugLogW(L"Temp file = %s", szTempFileName);
if (CopyFile(szFileName, szTempFileName, FALSE) == TRUE) {
if ((hNewBitmap = Bitmap_Load(szTempFileName)) != NULL) {
if (dat->hBitmap) {
@@ -581,7 +581,7 @@ static INT_PTR CALLBACK EditEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, wchar_t text[128];
GetDlgItemText(hwndDlg, IDC_EMAIL, text, _countof(text));
mir_snprintf(idstr, "e-mail%d", dat->id);
- dat->ppro->setTString(idstr, text);
+ dat->ppro->setWString(idstr, text);
{
WORD nFlag = 0;
if (IsDlgButtonChecked(hwndDlg, IDC_HOME)) nFlag |= JABBER_VCEMAIL_HOME;
@@ -730,7 +730,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP lvi.iItem = 0;
for (i=0;;i++) {
mir_snprintf(idstr, "e-mail%d", i);
- ptrW email( ppro->getTStringA(idstr));
+ ptrW email( ppro->getWStringA(idstr));
if (email == NULL) break;
mir_snwprintf(number, L"%d", i+1);
@@ -751,7 +751,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP lvi.iItem = 0;
for (i=0;;i++) {
mir_snprintf(idstr, "Phone%d", i);
- ptrW phone( ppro->getTStringA(idstr));
+ ptrW phone( ppro->getWStringA(idstr));
if (phone == NULL) break;
mir_snwprintf(number, L"%d", i+1);
@@ -922,44 +922,44 @@ void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage) switch (iPage) {
case 0:
GetDlgItemText(hwndPage, IDC_FULLNAME, text, _countof(text));
- setTString("FullName", text);
+ setWString("FullName", text);
GetDlgItemText(hwndPage, IDC_NICKNAME, text, _countof(text));
- setTString("Nick", text);
+ setWString("Nick", text);
GetDlgItemText(hwndPage, IDC_FIRSTNAME, text, _countof(text));
- setTString("FirstName", text);
+ setWString("FirstName", text);
GetDlgItemText(hwndPage, IDC_MIDDLE, text, _countof(text));
- setTString("MiddleName", text);
+ setWString("MiddleName", text);
GetDlgItemText(hwndPage, IDC_LASTNAME, text, _countof(text));
- setTString("LastName", text);
+ setWString("LastName", text);
GetDlgItemText(hwndPage, IDC_BIRTH, text, _countof(text));
- setTString("BirthDate", text);
+ setWString("BirthDate", text);
switch (SendDlgItemMessage(hwndPage, IDC_GENDER, CB_GETCURSEL, 0, 0)) {
case 0: setString("GenderString", "Male"); break;
case 1: setString("GenderString", "Female"); break;
default: setString("GenderString", ""); break;
}
GetDlgItemText(hwndPage, IDC_OCCUPATION, text, _countof(text));
- setTString("Role", text);
+ setWString("Role", text);
GetDlgItemText(hwndPage, IDC_HOMEPAGE, text, _countof(text));
- setTString("Homepage", text);
+ setWString("Homepage", text);
break;
// Page 1: Home
case 1:
GetDlgItemText(hwndPage, IDC_ADDRESS1, text, _countof(text));
- setTString("Street", text);
+ setWString("Street", text);
GetDlgItemText(hwndPage, IDC_ADDRESS2, text, _countof(text));
- setTString("Street2", text);
+ setWString("Street2", text);
GetDlgItemText(hwndPage, IDC_CITY, text, _countof(text));
- setTString("City", text);
+ setWString("City", text);
GetDlgItemText(hwndPage, IDC_STATE, text, _countof(text));
- setTString("State", text);
+ setWString("State", text);
GetDlgItemText(hwndPage, IDC_ZIP, text, _countof(text));
- setTString("ZIP", text);
+ setWString("ZIP", text);
{
int i = SendDlgItemMessage(hwndPage, IDC_COUNTRY, CB_GETCURSEL, 0, 0);
wchar_t *country = mir_a2u((i) ? g_countries[i + 2].szName : g_countries[1].szName);
- setTString("Country", country);
+ setWString("Country", country);
mir_free(country);
}
break;
@@ -967,25 +967,25 @@ void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage) // Page 2: Work
case 2:
GetDlgItemText(hwndPage, IDC_COMPANY, text, _countof(text));
- setTString("Company", text);
+ setWString("Company", text);
GetDlgItemText(hwndPage, IDC_DEPARTMENT, text, _countof(text));
- setTString("CompanyDepartment", text);
+ setWString("CompanyDepartment", text);
GetDlgItemText(hwndPage, IDC_TITLE, text, _countof(text));
- setTString("CompanyPosition", text);
+ setWString("CompanyPosition", text);
GetDlgItemText(hwndPage, IDC_ADDRESS1, text, _countof(text));
- setTString("CompanyStreet", text);
+ setWString("CompanyStreet", text);
GetDlgItemText(hwndPage, IDC_ADDRESS2, text, _countof(text));
- setTString("CompanyStreet2", text);
+ setWString("CompanyStreet2", text);
GetDlgItemText(hwndPage, IDC_CITY, text, _countof(text));
- setTString("CompanyCity", text);
+ setWString("CompanyCity", text);
GetDlgItemText(hwndPage, IDC_STATE, text, _countof(text));
- setTString("CompanyState", text);
+ setWString("CompanyState", text);
GetDlgItemText(hwndPage, IDC_ZIP, text, _countof(text));
- setTString("CompanyZIP", text);
+ setWString("CompanyZIP", text);
{
int i = SendDlgItemMessage(hwndPage, IDC_COUNTRY, CB_GETCURSEL, 0, 0);
wchar_t *country = mir_a2u((i) ? g_countries[i + 2].szName : g_countries[1].szName);
- setTString("CompanyCountry", country);
+ setWString("CompanyCountry", country);
mir_free(country);
}
break;
@@ -996,7 +996,7 @@ void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage) // Page 4: Note
case 4:
GetDlgItemText(hwndPage, IDC_DESC, text, _countof(text));
- setTString("About", text);
+ setWString("About", text);
break;
}
}
@@ -1006,7 +1006,7 @@ void CJabberProto::AppendVcardFromDB(HXML n, char *tag, char *key) if (n == NULL || tag == NULL || key == NULL)
return;
- ptrW tszValue(getTStringA(key));
+ ptrW tszValue(getWStringA(key));
n << XCHILD(_A2T(tag), tszValue);
}
@@ -1033,7 +1033,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t* szPhotoFileName) for (i = 0;; i++) {
mir_snprintf(idstr, "e-mail%d", i);
- ptrW email(getTStringA(idstr));
+ ptrW email(getWStringA(idstr));
if (email == NULL)
break;
@@ -1081,7 +1081,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t* szPhotoFileName) for (i = 0;; i++) {
mir_snprintf(idstr, "Phone%d", i);
- ptrW phone(getTStringA(idstr));
+ ptrW phone(getWStringA(idstr));
if (phone == NULL)
break;
@@ -1112,7 +1112,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t* szPhotoFileName) szFileName = szAvatarName;
// Set photo element, also update the global jabberVcardPhotoFileName to reflect the update
- debugLog(L"Before update, file name = %s", szFileName);
+ debugLogW(L"Before update, file name = %s", szFileName);
if (szFileName == NULL || szFileName[0] == 0) {
v << XCHILD(L"PHOTO");
DeleteFile(szAvatarName);
@@ -1120,7 +1120,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t* szPhotoFileName) delSetting("AvatarHash");
}
else {
- debugLog(L"Saving picture from %s", szFileName);
+ debugLogW(L"Saving picture from %s", szFileName);
struct _stat st;
if (_wstat(szFileName, &st) >= 0) {
@@ -1187,7 +1187,7 @@ void CJabberProto::OnUserInfoInit_VCard(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.dwInitParam = (LPARAM)this;
- odp.flags = ODPF_TCHAR | ODPF_USERINFOTAB | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_UNICODE | ODPF_USERINFOTAB | ODPF_DONTTRANSLATE;
odp.pwszTitle = m_tszUserName;
odp.pfnDlgProc = PersonalDlgProc;
diff --git a/protocols/JabberG/src/jabber_ws.cpp b/protocols/JabberG/src/jabber_ws.cpp index 739fd07362..b3db55eb4d 100644 --- a/protocols/JabberG/src/jabber_ws.cpp +++ b/protocols/JabberG/src/jabber_ws.cpp @@ -32,7 +32,7 @@ BOOL CJabberProto::WsInit(void) mir_snwprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { sizeof(nlu) };
- nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR; // | NUF_HTTPGATEWAY;
+ nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE; // | NUF_HTTPGATEWAY;
nlu.ptszDescriptiveName = name;
nlu.szSettingsModule = m_szModuleName;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 7a0c229662..8f88666661 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -277,7 +277,7 @@ void CJabberDlgPepSimple::cbModes_OnChange(CCtrlData *) if ((m_prevSelected >= 0) && (m_modes[m_cbModes.GetItemData(m_prevSelected)].m_id >= 0)) {
wchar_t *txt = m_txtDescription.GetText();
mir_snprintf(szSetting, "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name);
- m_proto->setTString(szSetting, txt);
+ m_proto->setWString(szSetting, txt);
mir_free(txt);
}
@@ -285,7 +285,7 @@ void CJabberDlgPepSimple::cbModes_OnChange(CCtrlData *) if ((m_prevSelected >= 0) && (m_modes[m_cbModes.GetItemData(m_prevSelected)].m_id >= 0)) {
mir_snprintf(szSetting, "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name);
- ptrW szDescr( m_proto->getTStringA(szSetting));
+ ptrW szDescr( m_proto->getWStringA(szSetting));
m_txtDescription.SetText((szDescr != NULL) ? szDescr : L"");
m_txtDescription.Enable(true);
}
@@ -469,7 +469,7 @@ void CPepGuiService::RebuildMenu() mi.root = hJabberRoot;
mi.pszService = szService;
mi.position = 200010;
- mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR | CMIF_HIDDEN;
+ mi.flags = CMIF_UNMOVABLE | CMIF_UNICODE | CMIF_HIDDEN;
mi.hIcolibItem = m_hIcolibItem;
mi.name.w = m_szText ? m_szText : LPGENW("<advanced status slot>");
m_hMenuItem = Menu_AddProtoMenuItem(&mi, m_proto->m_szModuleName);
@@ -693,7 +693,7 @@ void CPepMood::SetMood(MCONTACT hContact, const wchar_t *szMood, const wchar_t * HANDLE hIcon;
wchar_t title[128];
if (mood >= 0) {
- mir_snwprintf(title, TranslateT("Mood: %s"), TranslateTS(g_arrMoods[mood].szName));
+ mir_snwprintf(title, TranslateT("Mood: %s"), TranslateW(g_arrMoods[mood].szName));
hIcon = g_MoodIcons.GetIcolibHandle(g_arrMoods[mood].szTag);
}
else {
@@ -709,13 +709,13 @@ void CPepMood::SetMood(MCONTACT hContact, const wchar_t *szMood, const wchar_t * if (szMood) {
m_proto->setByte(hContact, DBSETTING_XSTATUSID, mood);
- m_proto->setTString(hContact, DBSETTING_XSTATUSNAME, TranslateTS(g_arrMoods[mood].szName));
+ m_proto->setWString(hContact, DBSETTING_XSTATUSNAME, TranslateW(g_arrMoods[mood].szName));
if (szText)
- m_proto->setTString(hContact, DBSETTING_XSTATUSMSG, szText);
+ m_proto->setWString(hContact, DBSETTING_XSTATUSMSG, szText);
else
m_proto->delSetting(hContact, DBSETTING_XSTATUSMSG);
- m_proto->WriteAdvStatus(hContact, ADVSTATUS_MOOD, szMood, g_MoodIcons.GetIcolibName(g_arrMoods[mood].szTag), TranslateTS(g_arrMoods[mood].szName), szText);
+ m_proto->WriteAdvStatus(hContact, ADVSTATUS_MOOD, szMood, g_MoodIcons.GetIcolibName(g_arrMoods[mood].szTag), TranslateW(g_arrMoods[mood].szName), szText);
}
else {
m_proto->delSetting(hContact, DBSETTING_XSTATUSID);
@@ -733,7 +733,7 @@ void CPepMood::ShowSetDialog(BYTE bQuiet) if (!bQuiet) {
CJabberDlgPepSimple dlg(m_proto, TranslateT("Set Mood"));
for (int i = 1; i < _countof(g_arrMoods); i++)
- dlg.AddStatusMode(i, g_arrMoods[i].szTag, g_MoodIcons.GetIcon(g_arrMoods[i].szTag), TranslateTS(g_arrMoods[i].szName));
+ dlg.AddStatusMode(i, g_arrMoods[i].szTag, g_MoodIcons.GetIcon(g_arrMoods[i].szTag), TranslateW(g_arrMoods[i].szName));
dlg.SetActiveStatus(m_mode, m_text);
dlg.DoModal();
@@ -748,7 +748,7 @@ void CPepMood::ShowSetDialog(BYTE bQuiet) wchar_t *ptszTitle;
if (m_mode >= 0) {
Publish();
- hIcon = g_MoodIcons.GetIcolibHandle(g_arrMoods[m_mode].szTag); ptszTitle = TranslateTS(g_arrMoods[m_mode].szName);
+ hIcon = g_MoodIcons.GetIcolibHandle(g_arrMoods[m_mode].szTag); ptszTitle = TranslateW(g_arrMoods[m_mode].szName);
}
else {
Retract();
@@ -971,9 +971,9 @@ void ActivityBuildTitle(int id, wchar_t *buf, int size) if (szFirst) {
if (szSecond)
- mir_snwprintf(buf, size, L"%s [%s]", TranslateTS(szFirst), TranslateTS(szSecond));
+ mir_snwprintf(buf, size, L"%s [%s]", TranslateW(szFirst), TranslateW(szSecond));
else
- mir_wstrncpy(buf, TranslateTS(szFirst), size);
+ mir_wstrncpy(buf, TranslateW(szFirst), size);
}
else *buf = 0;
}
@@ -1109,7 +1109,7 @@ void CPepActivity::ShowSetDialog(BYTE) CJabberDlgPepSimple dlg(m_proto, TranslateT("Set Activity"));
for (int i=0; i < _countof(g_arrActivities); i++)
if (g_arrActivities[i].szFirst || g_arrActivities[i].szSecond)
- dlg.AddStatusMode(i, ActivityGetId(i), g_ActivityIcons.GetIcon(returnActivity(i)), TranslateTS(g_arrActivities[i].szTitle), (g_arrActivities[i].szSecond != NULL));
+ dlg.AddStatusMode(i, ActivityGetId(i), g_ActivityIcons.GetIcon(returnActivity(i)), TranslateW(g_arrActivities[i].szTitle), (g_arrActivities[i].szSecond != NULL));
dlg.SetActiveStatus(m_mode, m_text);
dlg.DoModal();
@@ -1123,7 +1123,7 @@ void CPepActivity::ShowSetDialog(BYTE) UpdateMenuItem(g_ActivityIcons.GetIcolibHandle(returnActivity(m_mode)), g_arrActivities[m_mode].szTitle);
if (m_proto->m_pInfoFrame)
- m_proto->m_pInfoFrame->UpdateInfoItem("$/PEP/activity", g_ActivityIcons.GetIcolibHandle(returnActivity(m_mode)), TranslateTS(g_arrActivities[m_mode].szTitle));
+ m_proto->m_pInfoFrame->UpdateInfoItem("$/PEP/activity", g_ActivityIcons.GetIcolibHandle(returnActivity(m_mode)), TranslateW(g_arrActivities[m_mode].szTitle));
}
else {
Retract();
@@ -1218,7 +1218,7 @@ void CJabberProto::SetContactTune(MCONTACT hContact, LPCTSTR szArtist, LPCTSTR s mir_snwprintf(szListeningTo, 2047, L"%s - %s", szTitle ? szTitle : L"", szArtist ? szArtist : L"");
}
- setTString(hContact, "ListeningTo", szListeningTo);
+ setWString(hContact, "ListeningTo", szListeningTo);
char tuneIcon[128];
mir_snprintf(tuneIcon, "%s_%s", m_szModuleName, "main");
@@ -1468,17 +1468,17 @@ void CJabberProto::WriteAdvStatus(MCONTACT hContact, const char *pszSlot, const char szSetting[128];
mir_snprintf(szSetting, "%s/%s/id", m_szModuleName, pszSlot);
- db_set_ts(hContact, "AdvStatus", szSetting, pszMode);
+ db_set_ws(hContact, "AdvStatus", szSetting, pszMode);
mir_snprintf(szSetting, "%s/%s/icon", m_szModuleName, pszSlot);
db_set_s(hContact, "AdvStatus", szSetting, pszIcon);
mir_snprintf(szSetting, "%s/%s/title", m_szModuleName, pszSlot);
- db_set_ts(hContact, "AdvStatus", szSetting, pszTitle);
+ db_set_ws(hContact, "AdvStatus", szSetting, pszTitle);
mir_snprintf(szSetting, "%s/%s/text", m_szModuleName, pszSlot);
if (pszText)
- db_set_ts(hContact, "AdvStatus", szSetting, pszText);
+ db_set_ws(hContact, "AdvStatus", szSetting, pszText);
else
db_unset(hContact, "AdvStatus", szSetting);
}
@@ -1494,7 +1494,7 @@ wchar_t* CJabberProto::ReadAdvStatusT(MCONTACT hContact, const char *pszSlot, co {
char szSetting[128];
mir_snprintf(szSetting, "%s/%s/%s", m_szModuleName, pszSlot, pszValue);
- return db_get_tsa(hContact, "AdvStatus", szSetting);
+ return db_get_wsa(hContact, "AdvStatus", szSetting);
}
///////////////////////////////////////////////////////////////////////////////
@@ -1511,13 +1511,13 @@ void g_XstatusIconsInit() mir_wstrcpy(szSection, L"Protocols/Jabber/" LPGENW("Moods"));
for (int i = 1; i < _countof(g_arrMoods); i++)
- g_MoodIcons.RegisterIcon(g_arrMoods[i].szTag, szFile, -(200 + i), szSection, TranslateTS(g_arrMoods[i].szName));
+ g_MoodIcons.RegisterIcon(g_arrMoods[i].szTag, szFile, -(200 + i), szSection, TranslateW(g_arrMoods[i].szName));
mir_wstrcpy(szSection, L"Protocols/Jabber/" LPGENW("Activities"));
for (int k = 0; k < _countof(g_arrActivities); k++) {
if (g_arrActivities[k].szFirst)
- g_ActivityIcons.RegisterIcon(g_arrActivities[k].szFirst, szFile, g_arrActivities[k].iconid, szSection, TranslateTS(g_arrActivities[k].szTitle));
+ g_ActivityIcons.RegisterIcon(g_arrActivities[k].szFirst, szFile, g_arrActivities[k].iconid, szSection, TranslateW(g_arrActivities[k].szTitle));
if (g_arrActivities[k].szSecond)
- g_ActivityIcons.RegisterIcon(g_arrActivities[k].szSecond, szFile, g_arrActivities[k].iconid, szSection, TranslateTS(g_arrActivities[k].szTitle));
+ g_ActivityIcons.RegisterIcon(g_arrActivities[k].szSecond, szFile, g_arrActivities[k].iconid, szSection, TranslateW(g_arrActivities[k].szTitle));
}
}
diff --git a/protocols/MRA/src/MraAdvancedSearch.cpp b/protocols/MRA/src/MraAdvancedSearch.cpp index 5ea4500c69..cfcda90d31 100644 --- a/protocols/MRA/src/MraAdvancedSearch.cpp +++ b/protocols/MRA/src/MraAdvancedSearch.cpp @@ -65,7 +65,7 @@ void InitComboBox(HWND hWndCombo, FieldNames *lpNames) ResetComboBox(hWndCombo);
for (size_t i = 0; lpNames[i].lpszText; i++) {
- DWORD dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)TranslateTS(lpNames[i].lpszText));
+ DWORD dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)TranslateW(lpNames[i].lpszText));
SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, lpNames[i].dwCode);
}
}
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index ca412ee5dc..8986f6e781 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -59,7 +59,7 @@ DWORD CMraProto::MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle) mir_snwprintf(szBuffer, L"%s %s", m_tszUserName, TranslateT("Avatars' plugin connections"));
NETLIBUSER nlu = { sizeof(nlu) };
- nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = MRA_AVT_SECT_NAME;
nlu.ptszDescriptiveName = szBuffer;
pmraaqAvatarsQueue->hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
@@ -476,11 +476,11 @@ DWORD CMraProto::MraAvatarsGetFileName(HANDLE hQueue, MCONTACT hContact, DWORD d return ERROR_NOT_SUPPORTED;
wchar_t tszBase[MAX_PATH];
- mir_snwprintf(tszBase, L"%s\\%s\\", VARST(L"%miranda_avatarcache%"), m_tszUserName);
+ mir_snwprintf(tszBase, L"%s\\%s\\", VARSW(L"%miranda_avatarcache%"), m_tszUserName);
res = tszBase;
// some path in buff and free space for file name is avaible
- CreateDirectoryTreeT(res);
+ CreateDirectoryTreeW(res);
if (dwFormat != PA_FORMAT_DEFAULT) {
CMStringW szEmail;
@@ -633,7 +633,7 @@ INT_PTR CALLBACK MraAvatarsQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wPara wchar_t szServer[MAX_PATH];
GetDlgItemText(hWndDlg, IDC_SERVER, szServer, _countof(szServer));
- db_set_ts(NULL, MRA_AVT_SECT_NAME, "Server", szServer);
+ db_set_ws(NULL, MRA_AVT_SECT_NAME, "Server", szServer);
return TRUE;
}
break;
diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp index 58b17b39f8..9033968d25 100644 --- a/protocols/MRA/src/MraChat.cpp +++ b/protocols/MRA/src/MraChat.cpp @@ -45,7 +45,7 @@ INT_PTR CMraProto::MraChatSessionNew(MCONTACT hContact) GCDEST gcd = { m_szModuleName, wszEMail.c_str(), GC_EVENT_ADDGROUP };
GCEVENT gce = { sizeof(gce), &gcd };
for (int i = 0; i < _countof(lpwszStatuses); i++) {
- gce.ptszStatus = TranslateTS(lpwszStatuses[i]);
+ gce.ptszStatus = TranslateW(lpwszStatuses[i]);
CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
}
diff --git a/protocols/MRA/src/MraIcons.cpp b/protocols/MRA/src/MraIcons.cpp index 8b2c83a35d..ee5a2f35f5 100644 --- a/protocols/MRA/src/MraIcons.cpp +++ b/protocols/MRA/src/MraIcons.cpp @@ -103,7 +103,7 @@ void InitXStatusIcons() SKINICONDESC sid = { 0 };
sid.section.w = LPGENW("Protocols")L"/" LPGENW("MRA") L"/" LPGENW("Custom Status");
sid.defaultFile.w = szBuff;
- sid.flags = SIDF_ALL_TCHAR;
+ sid.flags = SIDF_ALL_UNICODE;
hXStatusAdvancedStatusIcons[0] = NULL;
for (DWORD i = 1; i < MRA_XSTATUS_COUNT+1; i++) {
diff --git a/protocols/MRA/src/MraPopUp.cpp b/protocols/MRA/src/MraPopUp.cpp index 2f5bc21800..14b780924c 100644 --- a/protocols/MRA/src/MraPopUp.cpp +++ b/protocols/MRA/src/MraPopUp.cpp @@ -28,7 +28,7 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR SendMessage(hWndCombo, CB_RESETCONTENT, 0, 0);
for (size_t i = 0; i < POPUPS_TYPES_COUNT; i++) {
- DWORD dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)TranslateTS(lpcwszPopupsTypes[i]));
+ DWORD dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)TranslateW(lpcwszPopupsTypes[i]));
SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, i);
}
SendMessage(hWndCombo, CB_SETCURSEL, 0, 0);
@@ -68,7 +68,7 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR case IDC_PREVIEW:
for (int i = 0; i < POPUPS_TYPES_COUNT; i++)
- ppro->MraPopupShowFromAgentW(i, 0, TranslateTS(lpcwszPopupsTypes[i]));
+ ppro->MraPopupShowFromAgentW(i, 0, TranslateW(lpcwszPopupsTypes[i]));
break;
case IDC_CHK_ENABLE:
@@ -134,7 +134,7 @@ int CMraProto::OnPopupOptInit(WPARAM wParam, LPARAM) odp.pwszTitle = m_tszUserName;
odp.pwszGroup = LPGENW("Popups");
odp.groupPosition = 900000000;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pfnDlgProc = MraPopupDlgProcOpts;
Options_AddPage(wParam, &odp);
}
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index 5ba003938d..a8daef4625 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -39,7 +39,7 @@ CMraProto::CMraProto(const char* _module, const wchar_t* _displayName) : mir_snwprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { sizeof(nlu) };
- nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
+ nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
nlu.ptszDescriptiveName = name;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
diff --git a/protocols/MRA/src/MraSendCommand.cpp b/protocols/MRA/src/MraSendCommand.cpp index 0cb54e6522..f5c9849e9f 100644 --- a/protocols/MRA/src/MraSendCommand.cpp +++ b/protocols/MRA/src/MraSendCommand.cpp @@ -184,7 +184,7 @@ DWORD CMraProto::MraMessageRecv(const CMStringA &szFrom, DWORD dwMsgID) }
// Adds new contact
-DWORD CMraProto::MraAddContact(MCONTACT hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones, const CMString* wszAuthMessage)
+DWORD CMraProto::MraAddContact(MCONTACT hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones, const CMStringW* wszAuthMessage)
{
if (szEmail.GetLength() <= 4 && !(dwContactFlag & CONTACT_FLAG_GROUP))
return 0;
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 60d4784a14..92a44be899 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -458,9 +458,9 @@ DWORD CMraProto::SetContactBasicInfoW(MCONTACT hContact, DWORD dwSetInfoFlags, D MraGroupItem *grp = m_groups.find((MraGroupItem*)&dwGroupID);
if (grp) {
- ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_wsa(hContact, "CList", "Group"));
if (mir_wstrcmp(tszGroup, grp->m_name))
- db_set_ts(hContact, "CList", "Group", grp->m_name);
+ db_set_ws(hContact, "CList", "Group", grp->m_name);
}
}
@@ -874,11 +874,11 @@ void CMraProto::ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode size_t dwErrDescriptionSize;
if (dwErrorCode == NO_ERROR)
- wcsncpy_s(szErrorText, TranslateTS(lpwszErrText), _TRUNCATE);
+ wcsncpy_s(szErrorText, TranslateW(lpwszErrText), _TRUNCATE);
else {
dwErrDescriptionSize = (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErrorCode, 0, szErrDescription, (_countof(szErrDescription) - sizeof(WCHAR)), NULL) - 2);
szErrDescription[dwErrDescriptionSize] = 0;
- mir_snwprintf(szErrorText, L"%s %lu: %s", TranslateTS(lpwszErrText), dwErrorCode, szErrDescription);
+ mir_snwprintf(szErrorText, L"%s %lu: %s", TranslateW(lpwszErrText), dwErrorCode, szErrDescription);
}
MraPopupShowFromAgentW(MRA_POPUP_TYPE_ERROR, 0, szErrorText);
}
@@ -997,13 +997,13 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP SendDlgItemMessage(hWndDlg, IDC_XTITLE, EM_LIMITTEXT, STATUS_TITLE_MAX, 0);
SendDlgItemMessage(hWndDlg, IDC_XMSG, EM_LIMITTEXT, STATUS_DESC_MAX, 0);
SendMessage(hWndDlg, WM_SETICON, ICON_BIG, (LPARAM)dat->hDlgIcon);
- SetWindowText(hWndDlg, TranslateTS(lpcszXStatusNameDef[dat->dwXStatus]));
+ SetWindowText(hWndDlg, TranslateW(lpcszXStatusNameDef[dat->dwXStatus]));
mir_snprintf(szValueName, "XStatus%ldName", dat->dwXStatus);
if (dat->ppro->mraGetStringW(NULL, szValueName, szBuff))
SetDlgItemText(hWndDlg, IDC_XTITLE, szBuff.c_str()); // custom xstatus name
else // default xstatus name
- SetDlgItemText(hWndDlg, IDC_XTITLE, TranslateTS(lpcszXStatusNameDef[dat->dwXStatus]));
+ SetDlgItemText(hWndDlg, IDC_XTITLE, TranslateW(lpcszXStatusNameDef[dat->dwXStatus]));
mir_snprintf(szValueName, "XStatus%ldMsg", dat->dwXStatus);
if (dat->ppro->mraGetStringW(NULL, szValueName, szBuff))
@@ -1056,7 +1056,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP dwBuffSize = GetDlgItemText(hWndDlg, IDC_XTITLE, szBuff, (STATUS_TITLE_MAX + 1));
if (dwBuffSize == 0) { // user delete all text
- mir_wstrncpy(szBuff, TranslateTS(lpcszXStatusNameDef[dat->dwXStatus]), STATUS_TITLE_MAX + 1);
+ mir_wstrncpy(szBuff, TranslateW(lpcszXStatusNameDef[dat->dwXStatus]), STATUS_TITLE_MAX + 1);
dwBuffSize = (DWORD)mir_wstrlen(szBuff);
}
mir_snprintf(szValueName, "XStatus%dName", dat->dwXStatus);
diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp index f54ecfb595..e31dc66345 100644 --- a/protocols/MRA/src/Mra_menus.cpp +++ b/protocols/MRA/src/Mra_menus.cpp @@ -341,7 +341,7 @@ HGENMENU CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bI hRootMenu = Menu_GetProtocolRoot(this);
if (hRootMenu == NULL) {
mi.name.w = m_tszUserName;
- mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.hIcolibItem = g_hMainIcon;
hRootMenu = Menu_AddProtoMenuItem(&mi);
}
diff --git a/protocols/MRA/src/Mra_options.cpp b/protocols/MRA/src/Mra_options.cpp index 1bd1a5694f..ac742a9f29 100644 --- a/protocols/MRA/src/Mra_options.cpp +++ b/protocols/MRA/src/Mra_options.cpp @@ -38,10 +38,10 @@ INT_PTR CALLBACK DlgProcOptsAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARA case PSN_APPLY:
wchar_t szBuff[MAX_EMAIL_LEN];
GetDlgItemText(hWndDlg, IDC_LOGIN, szBuff, _countof(szBuff));
- ppro->setTString(NULL, "e-mail", szBuff);
+ ppro->setWString(NULL, "e-mail", szBuff);
if (GetDlgItemText(hWndDlg, IDC_PASSWORD, szBuff, _countof(szBuff))) {
- ppro->setTString("Password", szBuff);
+ ppro->setWString("Password", szBuff);
SecureZeroMemory(szBuff, sizeof(szBuff));
}
return TRUE;
@@ -91,7 +91,7 @@ INT_PTR CALLBACK DlgProcAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lP ppro->mraSetStringW(NULL, "e-mail", szBuff);
if (GetDlgItemText(hWndDlg, IDC_PASSWORD, szBuff, _countof(szBuff))) {
- ppro->setTString("Password", szBuff);
+ ppro->setWString("Password", szBuff);
SecureZeroMemory(szBuff, sizeof(szBuff));
}
return TRUE;
@@ -218,7 +218,7 @@ int CMraProto::OnOptionsInit(WPARAM wParam, LPARAM lParam) odp.hInstance = g_hInstance;
odp.pwszTitle = m_tszUserName;
odp.pwszGroup = LPGENW("Network");
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pwszTab = LPGENW("Account");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ACCOUNT);
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index 19d568e54c..6dbe4220c4 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -357,7 +357,7 @@ bool CMraProto::CmdHelloAck(BinBuffer &buf) if (IsXStatusValid(dwXStatusMir)) {// xstatuses
mir_snprintf(szValueName, "XStatus%ldName", dwXStatusMir);
if (!mraGetStringW(NULL, szValueName, wszStatusTitle))
- wszStatusTitle = TranslateTS(lpcszXStatusNameDef[dwXStatusMir]);
+ wszStatusTitle = TranslateW(lpcszXStatusNameDef[dwXStatusMir]);
mir_snprintf(szValueName, "XStatus%ldMsg", dwXStatusMir);
mraGetStringW(NULL, szValueName, wszStatusDesc);
@@ -721,7 +721,7 @@ bool CMraProto::CmdContactAck(int cmd, int seq, BinBuffer &buf) case CONTACT_OPER_SUCCESS:// ## äîáàâëåíèå ïðîèçâåäåíî óñïåøíî
if (cmd == MRIM_CS_ADD_CONTACT_ACK) {
DWORD dwFlags = SCBIF_ID | SCBIF_SERVER_FLAG, dwGroupID = 0;
- ptrW grpName(db_get_tsa(hContact, "CList", "Group"));
+ ptrW grpName(db_get_wsa(hContact, "CList", "Group"));
if (grpName) {
dwFlags |= SCBIF_GROUP_ID;
dwGroupID = MraMoveContactToGroup(hContact, -1, grpName);
@@ -1259,7 +1259,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) }
else {
if (iGroupMode == 100) { // first start
- ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_wsa(hContact, "CList", "Group"));
if (tszGroup)
dwGroupID = MraMoveContactToGroup(hContact, dwGroupID, tszGroup);
}
@@ -1788,7 +1788,7 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, CMStringA & if (m_heNudgeReceived)
NotifyEventHooks(m_heNudgeReceived, hContact, NULL);
else {
- T2Utf szMsg(TranslateTS(MRA_ALARM_MESSAGE));
+ T2Utf szMsg(TranslateW(MRA_ALARM_MESSAGE));
pre.szMessage = szMsg;
ProtoChainRecvMsg(hContact, &pre);
}
diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp index c957ad89d5..67f0969a99 100644 --- a/protocols/MRA/src/Mra_svcs.cpp +++ b/protocols/MRA/src/Mra_svcs.cpp @@ -531,7 +531,7 @@ DWORD CMraProto::MraSendNewStatus(DWORD dwStatusMir, DWORD dwXStatusMir, const C mir_snprintf(szValueName, "XStatus%ldName", dwXStatusMir);
// custom xstatus name
if (!mraGetStringW(NULL, szValueName, wszStatusTitle))
- wszStatusTitle = TranslateTS(lpcszXStatusNameDef[dwXStatusMir]);
+ wszStatusTitle = TranslateW(lpcszXStatusNameDef[dwXStatusMir]);
}
else wszStatusTitle = pwszStatusTitle;
diff --git a/protocols/MSN/src/msn_chat.cpp b/protocols/MSN/src/msn_chat.cpp index 539280f125..0c87d43f5b 100644 --- a/protocols/MSN/src/msn_chat.cpp +++ b/protocols/MSN/src/msn_chat.cpp @@ -506,7 +506,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam) msnNsThread->sendMessage('N', thread->szEmail, thread->netId, UTF8(pszMsg), 0);
DBVARIANT dbv;
- int bError = getTString("Nick", &dbv);
+ int bError = getWString("Nick", &dbv);
GCDEST gcd = { m_szModuleName, gch->pDest->ptszID, GC_EVENT_MESSAGE };
GCEVENT gce = { sizeof(gce), &gcd };
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index 2a37ab21e1..190fb1e704 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -273,7 +273,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para case 'p':
psr[cnt] = (PROTOSEARCHRESULT*)mir_calloc(sizeof(PROTOSEARCHRESULT));
psr[cnt]->cbSize = sizeof(psr);
- psr[cnt]->flags = PSR_TCHAR;
+ psr[cnt]->flags = PSR_UNICODE;
psr[cnt]->id.w = psr[cnt]->nick.w = psr[cnt]->email.w = mir_a2u(wlid);
cnt++;
}
@@ -523,7 +523,7 @@ void CMsnProto::MSN_ProcessURIObject(MCONTACT hContact, ezxml_t xmli) mir_snwprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
PROTORECVFILET pre = { 0 };
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(NULL);
pre.descr.w = (desc = ezxml_child(xmli, "Description"))?mir_utf8decodeW(desc->txt):tComment;
@@ -573,7 +573,7 @@ void CMsnProto::MSN_ProcessYFind(char* buf, size_t len) PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.id.w = szEmailT;
psr.nick.w = szEmailT;
psr.email.w = szEmailT;
@@ -849,7 +849,7 @@ void CMsnProto::MSN_ProcessStatusMessage(ezxml_t xmli, const char* wlid) else lti.ptszType = mir_utf8decodeW(parts[1]);
wchar_t *cm = (wchar_t *)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%title% - %artist%", (LPARAM)<i);
- setTString(hContact, "ListeningTo", cm);
+ setWString(hContact, "ListeningTo", cm);
mir_free(cm);
@@ -1473,7 +1473,7 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email, mir_snwprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
PROTORECVFILET pre = { 0 };
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(NULL);
pre.descr.w = tComment;
diff --git a/protocols/MSN/src/msn_links.cpp b/protocols/MSN/src/msn_links.cpp index a46e26e1a6..35ab65cfa3 100644 --- a/protocols/MSN/src/msn_links.cpp +++ b/protocols/MSN/src/msn_links.cpp @@ -95,7 +95,7 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam) /* does not yet check if email is current user */
if (hContact == NULL) {
PROTOSEARCHRESULT psr = { sizeof(psr) };
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.nick.w = email;
psr.email.w = email;
diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp index 2016dfc9b9..9ca0aa8942 100644 --- a/protocols/MSN/src/msn_mail.cpp +++ b/protocols/MSN/src/msn_mail.cpp @@ -391,6 +391,6 @@ void CMsnProto::displayEmailCount(MCONTACT hContact) mir_snwprintf(szNick, getByte("DisableHotmailJunk", 0) ? L"%s [%d]" : L"%s [%d][%d]", name, mUnreadMessages, mUnreadJunkEmails);
nickChg = true;
- setTString(hContact, "Nick", szNick);
+ setWString(hContact, "Nick", szNick);
nickChg = false;
}
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp index ef12418621..5a7e2418a8 100644 --- a/protocols/MSN/src/msn_menu.cpp +++ b/protocols/MSN/src/msn_menu.cpp @@ -198,7 +198,7 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam SendDlgItemMessage(hwndDlg, IDC_NICKNAME, EM_LIMITTEXT, 129, 0);
DBVARIANT dbv;
- if (!proto->getTString("Nick", &dbv)) {
+ if (!proto->getWString("Nick", &dbv)) {
SetDlgItemText(hwndDlg, IDC_NICKNAME, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index 5b6b1b1ec7..7fa82d51e8 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -170,10 +170,10 @@ char* MSN_GetAvatarHash(char* szContext, char** pszUrl) // MSN_GetAvatarFileName - gets a file name for an contact's avatar
void CMsnProto::MSN_GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen, const wchar_t *ext)
{
- size_t tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
+ size_t tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARSW(L"%miranda_avatarcache%"), m_szModuleName);
if (_waccess(pszDest, 0))
- CreateDirectoryTreeT(pszDest);
+ CreateDirectoryTreeW(pszDest);
size_t tPathLen2 = tPathLen;
if (hContact != NULL) {
@@ -331,7 +331,7 @@ void CMsnProto::MSN_GetCustomSmileyFileName(MCONTACT hContact, wchar_t* pszDest, if (hContact != NULL) {
DBVARIANT dbv = { 0 };
- if (getTString(hContact, "e-mail", &dbv)) {
+ if (getWString(hContact, "e-mail", &dbv)) {
dbv.type = DBVT_ASCIIZ;
dbv.ptszVal = (wchar_t*)mir_alloc(11*sizeof(wchar_t));
_ui64tow((UINT_PTR)hContact, dbv.ptszVal, 10);
@@ -354,7 +354,7 @@ void CMsnProto::MSN_GetCustomSmileyFileName(MCONTACT hContact, wchar_t* pszDest, }
if (!exist)
- CreateDirectoryTreeT(pszDest);
+ CreateDirectoryTreeW(pszDest);
wchar_t *sztSmileyName = mir_a2u(SmileyName);
mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s.%s", sztSmileyName,
@@ -397,7 +397,7 @@ void CMsnProto::MSN_GoOffline(void) {
if (isChatRoom(hContact) != 0) {
DBVARIANT dbv;
- if (getTString(hContact, "ChatRoomID", &dbv) == 0) {
+ if (getWString(hContact, "ChatRoomID", &dbv) == 0) {
GCDEST gcd = { m_szModuleName, dbv.ptszVal, GC_EVENT_CONTROL };
GCEVENT gce = { sizeof(gce), &gcd };
CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, (LPARAM)&gce);
@@ -990,7 +990,7 @@ void CMsnProto::InitPopups(void) ppc.flags = PCF_TCHAR;
ppc.PluginWindowProc = NullWindowProc;
ppc.hIcon = LoadIconEx("main");
- ppc.ptszDescription = desc;
+ ppc.pwszDescription = desc;
ppc.pszName = name;
ppc.colorBack = RGB(173, 206, 247);
@@ -1087,7 +1087,7 @@ filetransfer::filetransfer(CMsnProto* prt) memset(this, 0, sizeof(filetransfer));
fileId = -1;
std.cbSize = sizeof(std);
- std.flags = PFTS_TCHAR;
+ std.flags = PFTS_UNICODE;
proto = prt;
hLockHandle = CreateMutex(NULL, FALSE, NULL);
diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp index 38b32891a8..be5634e4aa 100644 --- a/protocols/MSN/src/msn_opts.cpp +++ b/protocols/MSN/src/msn_opts.cpp @@ -98,7 +98,7 @@ static INT_PTR CALLBACK DlgProcMsnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP HWND wnd = GetDlgItem(hwndDlg, IDC_HANDLE2);
DBVARIANT dbv;
- if (!proto->getTString("Nick", &dbv)) {
+ if (!proto->getWString("Nick", &dbv)) {
SetWindowText(wnd, dbv.ptszVal);
db_free(&dbv);
}
@@ -249,7 +249,7 @@ LBL_Continue: #ifdef OBSOLETE
GetDlgItemText(hwndDlg, IDC_HANDLE2, screenStr, _countof(screenStr));
- if (!proto->getTString("Nick", &dbv)) {
+ if (!proto->getWString("Nick", &dbv)) {
if (mir_wstrcmp(dbv.ptszVal, screenStr))
proto->MSN_SendNickname(screenStr);
db_free(&dbv);
@@ -276,7 +276,7 @@ LBL_Continue: proto->setByte("ManageServer", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MANAGEGROUPS));
GetDlgItemText(hwndDlg, IDC_MAILER_APP, screenStr, _countof(screenStr));
- proto->setTString("MailerPath", screenStr);
+ proto->setWString("MailerPath", screenStr);
if (reconnectRequired && proto->msnLoggedIn)
MessageBox(hwndDlg,
@@ -522,7 +522,7 @@ static INT_PTR CALLBACK DlgProcAccMgrUI(HWND hwndDlg, UINT msg, WPARAM wParam, L SendDlgItemMessage(hwndDlg, IDC_PASSWORD, EM_SETLIMITTEXT, 16, 0);
DBVARIANT dbv;
- if (!proto->getTString("Place", &dbv)) {
+ if (!proto->getWString("Place", &dbv)) {
SetDlgItemText(hwndDlg, IDC_PLACE, dbv.ptszVal);
db_free(&dbv);
}
@@ -570,7 +570,7 @@ static INT_PTR CALLBACK DlgProcAccMgrUI(HWND hwndDlg, UINT msg, WPARAM wParam, L wchar_t szPlace[64];
GetDlgItemText(hwndDlg, IDC_PLACE, szPlace, _countof(szPlace));
if (szPlace[0])
- proto->setTString("Place", szPlace);
+ proto->setWString("Place", szPlace);
else
proto->delSetting("Place");
@@ -630,7 +630,7 @@ int CMsnProto::OnOptionsInit(WPARAM wParam, LPARAM) odp.pwszTitle = m_tszUserName;
odp.pwszGroup = LPGENW("Network");
odp.pwszTab = LPGENW("Account");
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.pfnDlgProc = DlgProcMsnOpts;
odp.dwInitParam = (LPARAM)this;
Options_AddPage(wParam, &odp);
diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp index 5bb5a9b610..c4698514ad 100644 --- a/protocols/MSN/src/msn_p2p.cpp +++ b/protocols/MSN/src/msn_p2p.cpp @@ -1227,7 +1227,7 @@ void CMsnProto::p2p_InitFileTransfer( mir_snwprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
PROTORECVFILET pre = { 0 };
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(NULL);
pre.descr.w = tComment;
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index e9e6950beb..41e853830d 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -125,11 +125,11 @@ CMsnProto::CMsnProto(const char* aProtoName, const wchar_t* aUserName) : mailsoundname = (char*)mir_alloc(64);
mir_snprintf(mailsoundname, 64, "%s:Hotmail", m_szModuleName);
- SkinAddNewSoundExT(mailsoundname, m_tszUserName, LPGENW("Live Mail"));
+ SkinAddNewSoundExW(mailsoundname, m_tszUserName, LPGENW("Live Mail"));
alertsoundname = (char*)mir_alloc(64);
mir_snprintf(alertsoundname, 64, "%s:Alerts", m_szModuleName);
- SkinAddNewSoundExT(alertsoundname, m_tszUserName, LPGENW("Live Alert"));
+ SkinAddNewSoundExW(alertsoundname, m_tszUserName, LPGENW("Live Alert"));
AvatarQueue_Init();
InitCustomFolders();
@@ -139,7 +139,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const wchar_t* aUserName) : NETLIBUSER nlu1 = { 0 };
nlu1.cbSize = sizeof(nlu1);
- nlu1.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
+ nlu1.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu1.szSettingsModule = szDbsettings;
nlu1.ptszDescriptiveName = szBuffer;
@@ -149,7 +149,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const wchar_t* aUserName) : NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
+ nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
nlu.ptszDescriptiveName = szBuffer;
@@ -417,7 +417,7 @@ void __cdecl CMsnProto::MsnSearchAckThread(void* arg) {
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.id.w = (wchar_t*)emailT;
psr.nick.w = (wchar_t*)emailT;
psr.email.w = (wchar_t*)emailT;
@@ -736,7 +736,7 @@ void __cdecl CMsnProto::MsnGetAwayMsgThread(void* arg) AwayMsgInfo *inf = (AwayMsgInfo*)arg;
DBVARIANT dbv;
- if (!db_get_ts(inf->hContact, "CList", "StatusMsg", &dbv)) {
+ if (!db_get_ws(inf->hContact, "CList", "StatusMsg", &dbv)) {
ProtoBroadcastAck(inf->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)inf->id, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
diff --git a/protocols/MSN/src/msn_skypeab.cpp b/protocols/MSN/src/msn_skypeab.cpp index a0cd9ca76d..e27727c1da 100644 --- a/protocols/MSN/src/msn_skypeab.cpp +++ b/protocols/MSN/src/msn_skypeab.cpp @@ -144,12 +144,12 @@ bool CMsnProto::MSN_SKYABGetProfiles(const char *pszPOST) MCONTACT hContact = MSN_HContactFromEmail(szWLId, skypename, false, false);
if (hContact) {
- if (value = get_json_str(item, "firstname")) setTString(hContact, "FirstName", value);
- if (value = get_json_str(item, "lastname")) setTString(hContact, "LastName", value);
- if (value = get_json_str(item, "displayname")) setTString(hContact, "Nick", value);
+ if (value = get_json_str(item, "firstname")) setWString(hContact, "FirstName", value);
+ if (value = get_json_str(item, "lastname")) setWString(hContact, "LastName", value);
+ if (value = get_json_str(item, "displayname")) setWString(hContact, "Nick", value);
if (value = get_json_str(item, "country")) setString(hContact, "Country", (char*)CallService(MS_UTILS_GETCOUNTRYBYISOCODE, (WPARAM)(char*)_T2A(value), 0));
- if (value = get_json_str(item, "city")) setTString(hContact, "City", value);
- if (value = get_json_str(item, "mood")) db_set_ts(hContact, "CList", "StatusMsg", value);
+ if (value = get_json_str(item, "city")) setWString(hContact, "City", value);
+ if (value = get_json_str(item, "mood")) db_set_ws(hContact, "CList", "StatusMsg", value);
}
}
json_delete(items);
@@ -191,9 +191,9 @@ bool CMsnProto::MSN_SKYABGetProfile(const char *wlid) MCONTACT hContact = MSN_HContactFromEmail(szWLId, skypename, false, false);
if (hContact) {
- if (value = get_json_str(item, "firstname")) setTString(hContact, "FirstName", value);
- if (value = get_json_str(item, "lastname")) setTString(hContact, "LastName", value);
- if (value = get_json_str(item, "displayname")) setTString(hContact, "Nick", value);
+ if (value = get_json_str(item, "firstname")) setWString(hContact, "FirstName", value);
+ if (value = get_json_str(item, "lastname")) setWString(hContact, "LastName", value);
+ if (value = get_json_str(item, "displayname")) setWString(hContact, "Nick", value);
if (value = get_json_str(item, "gender")) setByte(hContact, "Gender", (BYTE)(_wtoi(value) == 1 ? 'M' : 'F'));
if (value = get_json_str(item, "birthday")) {
int d, m, y;
@@ -203,10 +203,10 @@ bool CMsnProto::MSN_SKYABGetProfile(const char *wlid) setByte(hContact, "BirthMonth", m);
}
if (value = get_json_str(item, "country")) setString(hContact, "Country", (char*)CallService(MS_UTILS_GETCOUNTRYBYISOCODE, (WPARAM)(char*)_T2A(value), 0));
- if (value = get_json_str(item, "province")) setTString(hContact, "State", value);
- if (value = get_json_str(item, "city")) setTString(hContact, "City", value);
- if (value = get_json_str(item, "homepage")) setTString(hContact, "Homepage", value);
- if (value = get_json_str(item, "about")) setTString(hContact, "About", value);
+ if (value = get_json_str(item, "province")) setWString(hContact, "State", value);
+ if (value = get_json_str(item, "city")) setWString(hContact, "City", value);
+ if (value = get_json_str(item, "homepage")) setWString(hContact, "Homepage", value);
+ if (value = get_json_str(item, "about")) setWString(hContact, "About", value);
JSONNode *node = json_get(item, "emails");
if (node && !node->empty()) {
@@ -220,10 +220,10 @@ bool CMsnProto::MSN_SKYABGetProfile(const char *wlid) setStringUtf(hContact, szName, (*it).as_string().c_str());
}
}
- if (value = get_json_str(item, "phoneMobile")) setTString(hContact, "Cellular", value);
- if (value = get_json_str(item, "phone")) setTString(hContact, "Phone", value);
- if (value = get_json_str(item, "phoneOffice")) setTString(hContact, "CompanyPhone", value);
- if (value = get_json_str(item, "mood")) db_set_ts(hContact, "CList", "StatusMsg", value);
+ if (value = get_json_str(item, "phoneMobile")) setWString(hContact, "Cellular", value);
+ if (value = get_json_str(item, "phone")) setWString(hContact, "Phone", value);
+ if (value = get_json_str(item, "phoneOffice")) setWString(hContact, "CompanyPhone", value);
+ if (value = get_json_str(item, "mood")) db_set_ws(hContact, "CList", "StatusMsg", value);
}
bRet = true;
}
@@ -391,7 +391,7 @@ bool CMsnProto::MSN_SKYABSearch(const char *keyWord, HANDLE hSearch) wchar_t *sSkypeName = json_as_string(json_get(Skype, "SkypeName"));
PROTOSEARCHRESULT psr = { sizeof(psr) };
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.id.w = sSkypeName;
psr.nick.w = sDisplayName;
ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_DATA, hSearch, (LPARAM)&psr);
diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp index 4746906aca..0b466b67ba 100644 --- a/protocols/MSN/src/msn_svcs.cpp +++ b/protocols/MSN/src/msn_svcs.cpp @@ -363,7 +363,7 @@ INT_PTR CMsnProto::SetCurrentMedia(WPARAM, LPARAM lParam) mir_snwprintf(text, 128, L"%s - %s", (msnCurrentMedia.ptszTitle ? msnCurrentMedia.ptszTitle : L""),
(msnCurrentMedia.ptszArtist ? msnCurrentMedia.ptszArtist : L""));
}
- setTString("ListeningTo", text);
+ setWString("ListeningTo", text);
mir_free(text);
}
@@ -385,7 +385,7 @@ int CMsnProto::OnContactDeleted(WPARAM hContact, LPARAM) if (isChatRoom(hContact)) {
DBVARIANT dbv;
- if (!getTString(hContact, "ChatRoomID", &dbv)) {
+ if (!getWString(hContact, "ChatRoomID", &dbv)) {
MSN_KillChatSession(dbv.ptszVal);
db_free(&dbv);
}
@@ -595,7 +595,7 @@ INT_PTR CMsnProto::OnLeaveChat(WPARAM hContact, LPARAM) {
if (isChatRoom(hContact) != 0) {
DBVARIANT dbv;
- if (getTString(hContact, "ChatRoomID", &dbv) == 0) {
+ if (getWString(hContact, "ChatRoomID", &dbv) == 0) {
MSN_KillChatSession(dbv.ptszVal);
db_free(&dbv);
}
diff --git a/protocols/MinecraftDynmap/src/communication.cpp b/protocols/MinecraftDynmap/src/communication.cpp index 4e24ddafa4..612369dad7 100644 --- a/protocols/MinecraftDynmap/src/communication.cpp +++ b/protocols/MinecraftDynmap/src/communication.cpp @@ -281,7 +281,7 @@ bool MinecraftDynmapProto::doEvents() // TODO: there are also "channel" and "account" elements if (!time_ || !playerName_ || !message_) { - debugLog(L"Error: No player name, time or text for message"); + debugLogW(L"Error: No player name, time or text for message"); continue; } @@ -289,7 +289,7 @@ bool MinecraftDynmapProto::doEvents() std::string name = playerName_.as_string(); std::string message = message_.as_string(); - debugLog(L"Received message: [%d] %s -> %s", timestamp, name.c_str(), message.c_str()); + debugLogW(L"Received message: [%d] %s -> %s", timestamp, name.c_str(), message.c_str()); UpdateChat(name.c_str(), message.c_str(), timestamp); } } diff --git a/protocols/MinecraftDynmap/src/dialogs.cpp b/protocols/MinecraftDynmap/src/dialogs.cpp index 3f8c6fc4c9..3a32f77553 100644 --- a/protocols/MinecraftDynmap/src/dialogs.cpp +++ b/protocols/MinecraftDynmap/src/dialogs.cpp @@ -64,7 +64,7 @@ static BOOL StoreDBCheckState(MinecraftDynmapProto* ppro, HWND hwnd, int idCtrl, static void LoadDBText(MinecraftDynmapProto* ppro, HWND hwnd, int idCtrl, const char* szSetting) { - ptrW tstr(db_get_tsa(NULL, ppro->m_szModuleName, szSetting)); + ptrW tstr(db_get_wsa(NULL, ppro->m_szModuleName, szSetting)); if (tstr) SetDlgItemText(hwnd, idCtrl, tstr); } @@ -75,7 +75,7 @@ static void StoreDBText(MinecraftDynmapProto* ppro, HWND hwnd, int idCtrl, const GetDlgItemText(hwnd, idCtrl, tstr, _countof(tstr)); if (tstr[0] != '\0') { - db_set_ts(NULL, ppro->m_szModuleName, szSetting, tstr); + db_set_ws(NULL, ppro->m_szModuleName, szSetting, tstr); } else { db_unset(NULL, ppro->m_szModuleName, szSetting); } diff --git a/protocols/MinecraftDynmap/src/proto.cpp b/protocols/MinecraftDynmap/src/proto.cpp index 7d2c845e55..147d9924a0 100644 --- a/protocols/MinecraftDynmap/src/proto.cpp +++ b/protocols/MinecraftDynmap/src/proto.cpp @@ -44,7 +44,7 @@ MinecraftDynmapProto::MinecraftDynmapProto(const char* proto_name, const wchar_t // Create standard network connection wchar_t descr[512]; NETLIBUSER nlu = {sizeof(nlu)}; - nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR; + nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE; nlu.szSettingsModule = m_szModuleName; mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName); nlu.ptszDescriptiveName = descr; @@ -178,7 +178,7 @@ int MinecraftDynmapProto::OnModulesLoaded(WPARAM, LPARAM) odp.hInstance = g_hInstance; odp.pwszTitle = m_tszUserName; odp.dwInitParam = LPARAM(this); - odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE; + odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE; odp.position = 271828; odp.pwszGroup = LPGENW("Network"); diff --git a/protocols/Omegle/src/chat.cpp b/protocols/Omegle/src/chat.cpp index 73fc40ea11..3cc30faaaf 100644 --- a/protocols/Omegle/src/chat.cpp +++ b/protocols/Omegle/src/chat.cpp @@ -331,10 +331,10 @@ void OmegleProto::SetChatStatus(int status) if (status == ID_STATUS_ONLINE)
{
// Load actual name from database
- facy.nick_ = db_get_tsa(NULL, m_szModuleName, OMEGLE_KEY_NAME);
+ facy.nick_ = db_get_wsa(NULL, m_szModuleName, OMEGLE_KEY_NAME);
if (facy.nick_ == NULL) {
facy.nick_ = mir_wstrdup(TranslateT("You"));
- db_set_ts(NULL, m_szModuleName, OMEGLE_KEY_NAME, facy.nick_);
+ db_set_ws(NULL, m_szModuleName, OMEGLE_KEY_NAME, facy.nick_);
}
// Add self contact
diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp index 0e3abe9354..390de4c4cc 100644 --- a/protocols/Omegle/src/communication.cpp +++ b/protocols/Omegle/src/communication.cpp @@ -513,7 +513,7 @@ bool Omegle_client::events() } else if (name == "serverMessage") { ptrW message(json_as_string(json_at(item, 1))); - parent->UpdateChat(NULL, TranslateTS(message)); + parent->UpdateChat(NULL, TranslateW(message)); } else if (name == "connected") { // Stranger connected @@ -541,7 +541,7 @@ bool Omegle_client::events() likes += L", "; } - parent->debugLog(L"Got common likes: '%s'", likes.c_str()); + parent->debugLogW(L"Got common likes: '%s'", likes.c_str()); parent->SetTopic(likes.c_str()); } else if (name == "question") { @@ -557,7 +557,7 @@ bool Omegle_client::events() st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_on")); ptrW who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_wstrdup(L"Stranger")); - mir_snwprintf(st.tszText, TranslateT("%s is typing."), TranslateTS(who)); + mir_snwprintf(st.tszText, TranslateT("%s is typing."), TranslateW(who)); CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), (LPARAM)&st); } @@ -570,7 +570,7 @@ bool Omegle_client::events() st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_off")); ptrW who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_wstrdup(L"Stranger")); - mir_snwprintf(st.tszText, TranslateT("%s stopped typing."), TranslateTS(who)); + mir_snwprintf(st.tszText, TranslateT("%s stopped typing."), TranslateW(who)); CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), (LPARAM)&st); } @@ -615,7 +615,7 @@ bool Omegle_client::events() ptrW stranger(json_as_string(json_at(item, 1))); wchar_t strT[255]; - mir_snwprintf(strT, TranslateT("%s disconnected."), TranslateTS(stranger)); + mir_snwprintf(strT, TranslateT("%s disconnected."), TranslateW(stranger)); parent->UpdateChat(NULL, strT); // Stranger disconnected @@ -640,7 +640,7 @@ bool Omegle_client::events() ptrW error(json_as_string(json_at(item, 1))); wchar_t strT[255]; - mir_snwprintf(strT, TranslateT("Error: %s"), TranslateTS(error)); + mir_snwprintf(strT, TranslateT("Error: %s"), TranslateW(error)); parent->UpdateChat(NULL, strT); } } diff --git a/protocols/Omegle/src/dialogs.cpp b/protocols/Omegle/src/dialogs.cpp index 206f3af30e..259e34d2e8 100644 --- a/protocols/Omegle/src/dialogs.cpp +++ b/protocols/Omegle/src/dialogs.cpp @@ -38,7 +38,7 @@ static BOOL StoreDBCheckState(OmegleProto* ppro, HWND hwnd, int idCtrl, const ch static void LoadDBText(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* szSetting)
{
- ptrW tstr(db_get_tsa(NULL, ppro->m_szModuleName, szSetting));
+ ptrW tstr(db_get_wsa(NULL, ppro->m_szModuleName, szSetting));
if (tstr)
SetDlgItemText(hwnd, idCtrl, tstr);
}
@@ -49,7 +49,7 @@ static void StoreDBText(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* sz GetDlgItemText(hwnd, idCtrl, tstr, _countof(tstr));
if (tstr[0] != '\0') {
- db_set_ts(NULL, ppro->m_szModuleName, szSetting, tstr);
+ db_set_ws(NULL, ppro->m_szModuleName, szSetting, tstr);
}
else {
db_unset(NULL, ppro->m_szModuleName, szSetting);
diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp index ee0b34a616..91d79f0d5f 100644 --- a/protocols/Omegle/src/proto.cpp +++ b/protocols/Omegle/src/proto.cpp @@ -44,7 +44,7 @@ PROTO<OmegleProto>(proto_name, username) // Create standard network connection
wchar_t descr[512];
NETLIBUSER nlu = { sizeof(nlu) };
- nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
+ nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
@@ -57,10 +57,10 @@ PROTO<OmegleProto>(proto_name, username) facy.set_handle(m_hNetlibUser);
- SkinAddNewSoundExT("StrangerTyp", m_tszUserName, LPGENW("Stranger is typing"));
- SkinAddNewSoundExT("StrangerTypStop", m_tszUserName, LPGENW("Stranger stopped typing"));
- SkinAddNewSoundExT("StrangerChange", m_tszUserName, LPGENW("Changing stranger"));
- SkinAddNewSoundExT("StrangerMessage", m_tszUserName, LPGENW("Receive message"));
+ SkinAddNewSoundExW("StrangerTyp", m_tszUserName, LPGENW("Stranger is typing"));
+ SkinAddNewSoundExW("StrangerTypStop", m_tszUserName, LPGENW("Stranger stopped typing"));
+ SkinAddNewSoundExW("StrangerChange", m_tszUserName, LPGENW("Changing stranger"));
+ SkinAddNewSoundExW("StrangerMessage", m_tszUserName, LPGENW("Receive message"));
}
OmegleProto::~OmegleProto()
@@ -183,7 +183,7 @@ int OmegleProto::OnOptionsInit(WPARAM wParam, LPARAM) odp.hInstance = g_hInstance;
odp.pwszTitle = m_tszUserName;
odp.dwInitParam = LPARAM(this);
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.position = 271828;
odp.pwszGroup = LPGENW("Network");
diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp index dcf7aa0b27..585e74108e 100644 --- a/protocols/Sametime/src/conference.cpp +++ b/protocols/Sametime/src/conference.cpp @@ -27,12 +27,12 @@ void mwServiceConf_on_invited(mwConference* conf, mwLoginInfo* inviter, const ch {
GList *members, *mem;
CSametimeProto* proto = getProtoFromMwConference(conf);
- proto->debugLog(L"mwServiceConf_on_invited() start");
+ proto->debugLogW(L"mwServiceConf_on_invited() start");
members = mem = mwConference_getMembers(conf);
for (;mem;mem=mem->next) {
if (proto->my_login_info && strcmp(proto->my_login_info->login_id, ((mwLoginInfo*)mem->data)->login_id) == 0) {
- proto->debugLog(L"mwServiceConf_on_invited() already present");
+ proto->debugLogW(L"mwServiceConf_on_invited() already present");
mwConference_reject(conf, 0, T2Utf(TranslateT("Invitation rejected - already present.")));
return;
}
@@ -46,11 +46,11 @@ void mwServiceConf_on_invited(mwConference* conf, mwLoginInfo* inviter, const ch MultiByteToWideChar(CP_UTF8, 0, (const char*)invite, -1, ws_invite, 128);
if (MessageBoxW(0, ws_invite, ws_username, MB_OKCANCEL) == IDOK) {
- proto->debugLog(L"mwServiceConf_on_invited() mwConference_accept");
+ proto->debugLogW(L"mwServiceConf_on_invited() mwConference_accept");
mwConference_accept(conf);
}
else {
- proto->debugLog(L"mwServiceConf_on_invited() mwConference_reject");
+ proto->debugLogW(L"mwServiceConf_on_invited() mwConference_reject");
char* temp = mir_utf8encodeW(TranslateT("Your invitation has been rejected."));
mwConference_reject(conf, 0, temp);
mir_free(temp);
@@ -59,7 +59,7 @@ void mwServiceConf_on_invited(mwConference* conf, mwLoginInfo* inviter, const ch void CSametimeProto::ClearInviteQueue()
{
- debugLog(L"CSametimeProto::ClearInviteQueue() start");
+ debugLogW(L"CSametimeProto::ClearInviteQueue() start");
if (!my_conference)
return;
@@ -106,7 +106,7 @@ void CSametimeProto::ClearInviteQueue() void mwServiceConf_conf_opened(mwConference* conf, GList* members)
{
CSametimeProto* proto = getProtoFromMwConference(conf);
- proto->debugLog(L"mwServiceConf_conf_opened() start");
+ proto->debugLogW(L"mwServiceConf_conf_opened() start");
wchar_t* tszConfId = mir_utf8decodeW(mwConference_getName(conf));
wchar_t* tszConfTitle = mir_utf8decodeW(mwConference_getTitle(conf));
@@ -139,7 +139,7 @@ void mwServiceConf_conf_opened(mwConference* conf, GList* members) GList *user = members;
for (;user; user=user->next) {
- proto->debugLog(L"mwServiceConf_conf_opened() add user");
+ proto->debugLogW(L"mwServiceConf_conf_opened() add user");
wchar_t* tszUserName = mir_utf8decodeW(((mwLoginInfo*)user->data)->user_name);
wchar_t* tszUserId = mir_utf8decodeW(((mwLoginInfo*)user->data)->login_id);
@@ -171,7 +171,7 @@ void mwServiceConf_conf_opened(mwConference* conf, GList* members) void mwServiceConf_conf_closed(mwConference* conf, guint32 reason)
{
CSametimeProto* proto = getProtoFromMwConference(conf);
- proto->debugLog(L"mwServiceConf_conf_closed() start");
+ proto->debugLogW(L"mwServiceConf_conf_closed() start");
wchar_t* tszConfId = mir_utf8decodeW(mwConference_getName(conf));
@@ -191,7 +191,7 @@ void mwServiceConf_conf_closed(mwConference* conf, guint32 reason) void mwServiceConf_on_peer_joined(mwConference* conf, mwLoginInfo *user)
{
CSametimeProto* proto = getProtoFromMwConference(conf);
- proto->debugLog(L"mwServiceConf_on_peer_joined() start");
+ proto->debugLogW(L"mwServiceConf_on_peer_joined() start");
MCONTACT hContact = proto->FindContactByUserId(user->user_id);
if (!hContact) {
@@ -235,7 +235,7 @@ void mwServiceConf_on_peer_joined(mwConference* conf, mwLoginInfo *user) void mwServiceConf_on_peer_parted(mwConference* conf, mwLoginInfo* user)
{
CSametimeProto* proto = getProtoFromMwConference(conf);
- proto->debugLog(L"mwServiceConf_on_peer_parted() start");
+ proto->debugLogW(L"mwServiceConf_on_peer_parted() start");
ptrW tszConfId(mir_utf8decodeW(mwConference_getName(conf)));
ptrW tszUserName(mir_utf8decodeW(user->user_name));
@@ -259,7 +259,7 @@ void mwServiceConf_on_peer_parted(mwConference* conf, mwLoginInfo* user) void mwServiceConf_on_text(mwConference* conf, mwLoginInfo* user, const char* what)
{
CSametimeProto* proto = getProtoFromMwConference(conf);
- proto->debugLog(L"mwServiceConf_on_text() start");
+ proto->debugLogW(L"mwServiceConf_on_text() start");
wchar_t* tszConfId = mir_utf8decodeW(mwConference_getName(conf));
@@ -290,7 +290,7 @@ void mwServiceConf_on_text(mwConference* conf, mwLoginInfo* user, const char* wh void mwServiceConf_on_typing(mwConference* conf, mwLoginInfo* who, gboolean typing)
{
CSametimeProto* proto = getProtoFromMwConference(conf);
- proto->debugLog(L"mwServiceConf_on_typing() start");
+ proto->debugLogW(L"mwServiceConf_on_typing() start");
///TODO unimplemented
}
@@ -312,7 +312,7 @@ mwConferenceHandler mwConference_handler = { void CSametimeProto::TerminateConference(char* name)
{
- debugLog(L"CSametimeProto::TerminateConference() start");
+ debugLogW(L"CSametimeProto::TerminateConference() start");
GList *conferences, *conf;
conferences = conf = mwServiceConference_getConferences(service_conference);
@@ -346,17 +346,17 @@ int CSametimeProto::GcEventHook(WPARAM wParam, LPARAM lParam) { switch(gch->pDest->iType) {
case GC_USER_MESSAGE:
{
- debugLog(L"CSametimeProto::GcEventHook() GC_USER_MESSAGE");
+ debugLogW(L"CSametimeProto::GcEventHook() GC_USER_MESSAGE");
mwConference_sendText((mwConference*)conf->data, T2Utf(gch->ptszText));
}
break;
case GC_SESSION_TERMINATE:
{
if (my_conference == conf->data){
- debugLog(L"CSametimeProto::GcEventHook() GC_SESSION_TERMINATE CloseMyConference");
+ debugLogW(L"CSametimeProto::GcEventHook() GC_SESSION_TERMINATE CloseMyConference");
CloseMyConference(this);
} else {
- debugLog(L"CSametimeProto::GcEventHook() GC_SESSION_TERMINATE mwConference_destroy");
+ debugLogW(L"CSametimeProto::GcEventHook() GC_SESSION_TERMINATE mwConference_destroy");
mwConference_destroy((mwConference*)conf->data, 0, T2Utf(TranslateT("I'm outa here.")));
}
}
@@ -378,7 +378,7 @@ int CSametimeProto::ChatDeleted(MCONTACT hContact) { if (db_get_b(hContact, m_szModuleName, "ChatRoom", 0) == 0)
return 0;
- debugLog(L"CSametimeProto::ChatDeleted() hContact=[%x]", hContact);
+ debugLogW(L"CSametimeProto::ChatDeleted() hContact=[%x]", hContact);
DBVARIANT dbv;
if (!db_get_s(hContact, m_szModuleName, "ChatRoomID", &dbv)) {
TerminateConference(dbv.pszVal);
@@ -392,7 +392,7 @@ int CSametimeProto::ChatDeleted(MCONTACT hContact) { INT_PTR CSametimeProto::onMenuLeaveChat(WPARAM wParam, LPARAM lParam)
{
MCONTACT hContact = (MCONTACT)wParam;
- debugLog(L"CSametimeProto::onMenuLeaveChat() hContact=[%x]", hContact);
+ debugLogW(L"CSametimeProto::onMenuLeaveChat() hContact=[%x]", hContact);
ChatDeleted(hContact);
return 0;
}
@@ -401,7 +401,7 @@ INT_PTR CSametimeProto::onMenuLeaveChat(WPARAM wParam, LPARAM lParam) INT_PTR CSametimeProto::onMenuCreateChat(WPARAM wParam, LPARAM lParam)
{
MCONTACT hContact = (MCONTACT)wParam;
- debugLog(L"CSametimeProto::onMenuCreateChat() hContact=[%x]", hContact);
+ debugLogW(L"CSametimeProto::onMenuCreateChat() hContact=[%x]", hContact);
mwAwareIdBlock id_block;
mwIdBlock idb;
if (my_login_info && GetAwareIdFromContact(hContact, &id_block)) {
@@ -416,12 +416,12 @@ INT_PTR CSametimeProto::onMenuCreateChat(WPARAM wParam, LPARAM lParam) invite_queue.push(idb.user);
if (!my_conference) {
- debugLog(L"CSametimeProto::onMenuCreateChat() mwConference_open");
+ debugLogW(L"CSametimeProto::onMenuCreateChat() mwConference_open");
my_conference = mwConference_new(service_conference, T2Utf(title));
mwConference_open(my_conference);
}
else {
- debugLog(L"CSametimeProto::onMenuCreateChat() ClearInviteQueue");
+ debugLogW(L"CSametimeProto::onMenuCreateChat() ClearInviteQueue");
ClearInviteQueue();
}
@@ -434,7 +434,7 @@ INT_PTR CSametimeProto::onMenuCreateChat(WPARAM wParam, LPARAM lParam) int CSametimeProto::PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
MCONTACT hContact = (MCONTACT)wParam;
- debugLog(L"CSametimeProto::PrebuildContactMenu() hContact=[%x]", hContact);
+ debugLogW(L"CSametimeProto::PrebuildContactMenu() hContact=[%x]", hContact);
Menu_ShowItem(hLeaveChatMenuItem, db_get_b(hContact, m_szModuleName, "ChatRoom", 0) == 1);
@@ -463,7 +463,7 @@ int CSametimeProto::PrebuildContactMenu(WPARAM wParam, LPARAM lParam) void CSametimeProto::InitConference()
{
- debugLog(L"CSametimeProto::InitConference()");
+ debugLogW(L"CSametimeProto::InitConference()");
my_login_info = mwSession_getLoginInfo(session);
@@ -476,7 +476,7 @@ void CSametimeProto::InitConference() void CSametimeProto::DeinitConference()
{
GList *conferences, *conf;
- debugLog(L"CSametimeProto::DeinitConference()");
+ debugLogW(L"CSametimeProto::DeinitConference()");
if (service_conference){
conferences = conf = mwServiceConference_getConferences(service_conference);
@@ -500,13 +500,13 @@ void CSametimeProto::DeinitConference() void CSametimeProto::InitConferenceMenu()
{
- debugLog(L"CSametimeProto::InitConferenceMenu()");
+ debugLogW(L"CSametimeProto::InitConferenceMenu()");
CreateProtoService(MS_SAMETIME_MENULEAVECHAT, &CSametimeProto::onMenuLeaveChat);
CreateProtoService(MS_SAMETIME_MENUCREATECHAT, &CSametimeProto::onMenuCreateChat);
CMenuItem mi;
- mi.flags = CMIF_TCHAR | CMIF_NOTOFFLINE;
+ mi.flags = CMIF_UNICODE | CMIF_NOTOFFLINE;
SET_UID(mi, 0x98cf8a8c, 0x75ba, 0x46f2, 0xa3, 0x35, 0x65, 0x46, 0x4a, 0x38, 0x20, 0x7d);
mi.name.w = LPGENW("Leave conference");
diff --git a/protocols/Sametime/src/files.cpp b/protocols/Sametime/src/files.cpp index c606e0587e..9f035200e4 100644 --- a/protocols/Sametime/src/files.cpp +++ b/protocols/Sametime/src/files.cpp @@ -13,11 +13,11 @@ CSametimeProto* getProtoFromMwFileTransfer(mwFileTransfer* ft) void mwFileTransfer_offered(mwFileTransfer* ft)
{
CSametimeProto* proto = getProtoFromMwFileTransfer(ft);
- proto->debugLog(L"mwFileTransfer_offered() start");
+ proto->debugLogW(L"mwFileTransfer_offered() start");
const mwIdBlock* idb = mwFileTransfer_getUser(ft);
MCONTACT hContact = proto->FindContactByUserId(idb->user);
- proto->debugLog(L"Sametime mwFileTransfer_offered hContact=[%x]", hContact);
+ proto->debugLogW(L"Sametime mwFileTransfer_offered hContact=[%x]", hContact);
if (!hContact) {
mwSametimeList* user_list = mwSametimeList_new();
@@ -39,7 +39,7 @@ void mwFileTransfer_offered(mwFileTransfer* ft) wcsncpy_s(descriptionT, filenameT, _TRUNCATE);
PROTORECVFILET pre = {0};
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(NULL);
pre.descr.w = descriptionT;
@@ -59,7 +59,7 @@ int SendFileChunk(CSametimeProto* proto, mwFileTransfer* ft, FileTransferClientD return 0;
if (!ReadFile(ftcd->hFile, ftcd->buffer, FILE_BUFF_SIZE, &bytes_read, 0)) {
- proto->debugLog(L"Sametime closing file transfer (SendFileChunk)");
+ proto->debugLogW(L"Sametime closing file transfer (SendFileChunk)");
mwFileTransfer_close(ft, mwFileTransfer_SUCCESS);
return 0;
}
@@ -79,7 +79,7 @@ void __cdecl SendThread(LPVOID param) { CSametimeProto* proto = getProtoFromMwFileTransfer(ft);
FileTransferClientData* ftcd = (FileTransferClientData*)mwFileTransfer_getClientData(ft);
- proto->debugLog(L"SendThread() start");
+ proto->debugLogW(L"SendThread() start");
PROTOFILETRANSFERSTATUS pfts = {0};
@@ -114,7 +114,7 @@ void __cdecl SendThread(LPVOID param) { if (ftcd->buffer) delete[] ftcd->buffer;
delete ftcd;
- proto->debugLog(L"SendThread() end");
+ proto->debugLogW(L"SendThread() end");
return;
}
@@ -124,7 +124,7 @@ void mwFileTransfer_opened(mwFileTransfer* ft) CSametimeProto* proto = getProtoFromMwFileTransfer(ft);
FileTransferClientData* ftcd = (FileTransferClientData*)mwFileTransfer_getClientData(ft);
- proto->debugLog(L"Sametime mwFileTransfer_opened start");
+ proto->debugLogW(L"Sametime mwFileTransfer_opened start");
if (ftcd->sending) {
// create a thread to send chunks - since it seems not all clients send acks for each of our chunks!
@@ -139,7 +139,7 @@ void mwFileTransfer_closed(mwFileTransfer* ft, guint32 code) {
CSametimeProto* proto = getProtoFromMwFileTransfer(ft);
FileTransferClientData* ftcd = (FileTransferClientData*)mwFileTransfer_getClientData(ft);
- proto->debugLog(L"mwFileTransfer_closed() start");
+ proto->debugLogW(L"mwFileTransfer_closed() start");
if (ftcd) {
if (ftcd->hFile != INVALID_HANDLE_VALUE)
@@ -217,14 +217,14 @@ void mwFileTransfer_recv(mwFileTransfer* ft, struct mwOpaque* data) {
CSametimeProto* proto = getProtoFromMwFileTransfer(ft);
FileTransferClientData* ftcd = (FileTransferClientData*)mwFileTransfer_getClientData(ft);
- proto->debugLog(L"mwFileTransfer_recv() start");
+ proto->debugLogW(L"mwFileTransfer_recv() start");
DWORD bytes_written;
if (!WriteFile(ftcd->hFile, data->data, data->len, &bytes_written, 0)) {
- proto->debugLog(L"mwFileTransfer_recv() !WriteFile");
+ proto->debugLogW(L"mwFileTransfer_recv() !WriteFile");
mwFileTransfer_cancel(ft);
proto->ProtoBroadcastAck(ftcd->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ftcd->hFt, 0);
- proto->debugLog(L"mwFileTransfer_recv() ACKRESULT_FAILED");
+ proto->debugLogW(L"mwFileTransfer_recv() ACKRESULT_FAILED");
}
else {
mwFileTransfer_ack(ft); // acknowledge chunk
@@ -248,11 +248,11 @@ void mwFileTransfer_recv(mwFileTransfer* ft, struct mwOpaque* data) pfts.currentFileTime = 0; //?
proto->ProtoBroadcastAck(ftcd->hContact, ACKTYPE_FILE, ACKRESULT_DATA, ftcd->hFt, (LPARAM)&pfts);
- proto->debugLog(L"mwFileTransfer_recv() ACKRESULT_DATA");
+ proto->debugLogW(L"mwFileTransfer_recv() ACKRESULT_DATA");
if (mwFileTransfer_isDone(ft)) {
proto->ProtoBroadcastAck(ftcd->hContact, ACKTYPE_FILE, ACKRESULT_SUCCESS, ftcd->hFt, 0);
- proto->debugLog(L"mwFileTransfer_recv() ACKRESULT_SUCCESS");
+ proto->debugLogW(L"mwFileTransfer_recv() ACKRESULT_SUCCESS");
}
}
}
@@ -265,7 +265,7 @@ void mwFileTransfer_handle_ack(mwFileTransfer* ft) // see SendThread above - not all clients send us acks
CSametimeProto* proto = getProtoFromMwFileTransfer(ft);
//FileTransferClientData* ftcd = (FileTransferClientData*)mwFileTransfer_getClientData(ft);
- proto->debugLog(L"mwFileTransfer_handle_ack()");
+ proto->debugLogW(L"mwFileTransfer_handle_ack()");
}
/** optional. called from mwService_free */
@@ -284,7 +284,7 @@ mwFileTransferHandler mwFileTransfer_handler = { HANDLE CSametimeProto::SendFilesToUser(MCONTACT hContact, wchar_t** files, const wchar_t* ptszDesc)
{
- debugLog(L"CSametimeProto::SendFilesToUser() start");
+ debugLogW(L"CSametimeProto::SendFilesToUser() start");
mwAwareIdBlock id_block;
if (GetAwareIdFromContact(hContact, &id_block)) {
@@ -359,7 +359,7 @@ HANDLE CSametimeProto::AcceptFileTransfer(MCONTACT hContact, HANDLE hFt, char* s mwFileTransfer* ft = (mwFileTransfer*)hFt;
CSametimeProto* proto = getProtoFromMwFileTransfer(ft);
- debugLog(L"CSametimeProto::AcceptFileTransfer() start");
+ debugLogW(L"CSametimeProto::AcceptFileTransfer() start");
FileTransferClientData* ftcd = new FileTransferClientData;
memset(ftcd, 0, sizeof(FileTransferClientData));
@@ -388,7 +388,7 @@ HANDLE CSametimeProto::AcceptFileTransfer(MCONTACT hContact, HANDLE hFt, char* s ftcd->hFile = CreateFileA(fp, GENERIC_WRITE, FILE_SHARE_READ, 0, OPEN_ALWAYS, 0, 0);
if (ftcd->hFile == INVALID_HANDLE_VALUE) {
- debugLog(L"CSametimeProto::AcceptFileTransfer() INVALID_HANDLE_VALUE");
+ debugLogW(L"CSametimeProto::AcceptFileTransfer() INVALID_HANDLE_VALUE");
mwFileTransfer_close(ft, mwFileTransfer_ERROR);
return 0;
}
@@ -405,7 +405,7 @@ void CSametimeProto::RejectFileTransfer(HANDLE hFt) {
mwFileTransfer* ft = (mwFileTransfer*)hFt;
CSametimeProto* proto = getProtoFromMwFileTransfer(ft);
- debugLog(L"CSametimeProto::RejectFileTransfer() start");
+ debugLogW(L"CSametimeProto::RejectFileTransfer() start");
mwFileTransfer_reject(ft);
}
@@ -414,7 +414,7 @@ void CSametimeProto::CancelFileTransfer(HANDLE hFt) {
mwFileTransfer* ft = (mwFileTransfer*)hFt;
CSametimeProto* proto = getProtoFromMwFileTransfer(ft);
- debugLog(L"CSametimeProto::CancelFileTransfer() start");
+ debugLogW(L"CSametimeProto::CancelFileTransfer() start");
FileTransferClientData* ftcd = (FileTransferClientData*)mwFileTransfer_getClientData(ft);
@@ -429,13 +429,13 @@ void CSametimeProto::CancelFileTransfer(HANDLE hFt) void CSametimeProto::InitFiles()
{
- debugLog(L"CSametimeProto::InitFiles()");
+ debugLogW(L"CSametimeProto::InitFiles()");
mwSession_addService(session, (mwService*)(service_files = mwServiceFileTransfer_new(session, &mwFileTransfer_handler)));
}
void CSametimeProto::DeinitFiles()
{
- debugLog(L"CSametimeProto::DeinitFiles()");
+ debugLogW(L"CSametimeProto::DeinitFiles()");
mwSession_removeService(session, mwService_FILE_TRANSFER);
mwService_free((mwService*)service_files);
service_files = 0;
diff --git a/protocols/Sametime/src/messaging.cpp b/protocols/Sametime/src/messaging.cpp index ee7cc4d659..039aac3cb5 100644 --- a/protocols/Sametime/src/messaging.cpp +++ b/protocols/Sametime/src/messaging.cpp @@ -12,13 +12,13 @@ CSametimeProto* getProtoFromMwConversation(mwConversation* conv) void mwIm_conversation_opened(mwConversation* conv)
{
CSametimeProto* proto = getProtoFromMwConversation(conv);
- proto->debugLog(L"mwIm_conversation_opened() start");
+ proto->debugLogW(L"mwIm_conversation_opened() start");
mwIdBlock* idb = mwConversation_getTarget(conv);
MCONTACT hContact = proto->FindContactByUserId(idb->user);
if (!hContact) {
- proto->debugLog(L"mwIm_conversation_opened() !hContact");
+ proto->debugLogW(L"mwIm_conversation_opened() !hContact");
mwSametimeList* user_list = mwSametimeList_new();
mwSametimeGroup* stgroup = mwSametimeGroup_new(user_list, mwSametimeGroup_NORMAL, Translate("None"));
mwSametimeUser* stuser = mwSametimeUser_new(stgroup, mwSametimeUser_NORMAL, idb);
@@ -45,7 +45,7 @@ void mwIm_conversation_opened(mwConversation* conv) void mwIm_conversation_closed(mwConversation* conv, guint32 err)
{
CSametimeProto* proto = getProtoFromMwConversation(conv);
- proto->debugLog(L"mwIm_conversation_closed() start err=[%d]", err);
+ proto->debugLogW(L"mwIm_conversation_closed() start err=[%d]", err);
if (err & ERR_FAILURE && err != CONNECTION_RESET) {
proto->showPopup(err);
@@ -67,11 +67,11 @@ void mwIm_conversation_closed(mwConversation* conv, guint32 err) void mwIm_conversation_recv(mwConversation* conv, mwImSendType type, gconstpointer msg)
{
CSametimeProto* proto = getProtoFromMwConversation(conv);
- proto->debugLog(L"mwIm_conversation_recv() start");
+ proto->debugLogW(L"mwIm_conversation_recv() start");
mwIdBlock* idb = mwConversation_getTarget(conv);
MCONTACT hContact = proto->FindContactByUserId(idb->user);
- proto->debugLog(L"mwIm_conversation_recv() type=[%d] hContact=[%x]", type, hContact);
+ proto->debugLogW(L"mwIm_conversation_recv() type=[%d] hContact=[%x]", type, hContact);
if (type == mwImSend_TYPING) {
CallService(MS_PROTO_CONTACTISTYPING, hContact, (GPOINTER_TO_UINT(msg) == 0 ? 0 : 2));
@@ -91,7 +91,7 @@ void mwIm_conversation_recv(mwConversation* conv, mwImSendType type, gconstpoint void mwIm_place_invite(struct mwConversation* conv, const char* message, const char* title, const char* name)
{
CSametimeProto* proto = getProtoFromMwConversation(conv);
- proto->debugLog(L"mwIm_place_invite() start");
+ proto->debugLogW(L"mwIm_place_invite() start");
///TODO unimplemented
@@ -114,7 +114,7 @@ mwImHandler mwIm_handler = { HANDLE CSametimeProto::SendMessageToUser(MCONTACT hContact, const char *szMsg)
{
- debugLog(L"CSametimeProto::SendMessageToUser() hContact=[%x]", hContact);
+ debugLogW(L"CSametimeProto::SendMessageToUser() hContact=[%x]", hContact);
mwAwareIdBlock id_block;
if (GetAwareIdFromContact(hContact, &id_block)) {
@@ -125,13 +125,13 @@ HANDLE CSametimeProto::SendMessageToUser(MCONTACT hContact, const char *szMsg) mwConversation* conv = mwServiceIm_getConversation(service_im, &idb);
if (conv) {
if (!mwConversation_isOpen(conv)) {
- debugLog(L"CSametimeProto::SendMessageToUser() mwConversation_isOpen");
+ debugLogW(L"CSametimeProto::SendMessageToUser() mwConversation_isOpen");
mir_cslock lck(q_cs);
contact_message_queue[hContact].push(szMsg);
mwConversation_open(conv);
}
else {
- debugLog(L"CSametimeProto::SendMessageToUser() !mwConversation_isOpen");
+ debugLogW(L"CSametimeProto::SendMessageToUser() !mwConversation_isOpen");
mwConversation_send(conv, mwImSend_PLAIN, szMsg);
}
@@ -147,7 +147,7 @@ HANDLE CSametimeProto::SendMessageToUser(MCONTACT hContact, const char *szMsg) void CSametimeProto::SendTyping(MCONTACT hContact, bool typing)
{
- debugLog(L"CSametimeProto::SendTyping() hContact=[%x] type=[%d]", hContact, typing);
+ debugLogW(L"CSametimeProto::SendTyping() hContact=[%x] type=[%d]", hContact, typing);
mwAwareIdBlock id_block;
if (GetAwareIdFromContact(hContact, &id_block)) {
@@ -158,7 +158,7 @@ void CSametimeProto::SendTyping(MCONTACT hContact, bool typing) mwConversation* conv = mwServiceIm_getConversation(service_im, &idb);
if (conv) {
if (mwConversation_isOpen(conv)) {
- debugLog(L"CSametimeProto::SendTyping() send");
+ debugLogW(L"CSametimeProto::SendTyping() send");
mwConversation_send(conv, mwImSend_TYPING, (gconstpointer)GUINT_TO_POINTER(typing ? 1 : 0));
}
}
@@ -169,7 +169,7 @@ void CSametimeProto::SendTyping(MCONTACT hContact, bool typing) void CSametimeProto::CloseIm(MCONTACT hContact)
{
- debugLog(L"CSametimeProto::CloseIm() hContact=[%x]", hContact);
+ debugLogW(L"CSametimeProto::CloseIm() hContact=[%x]", hContact);
mwAwareIdBlock id_block;
if (GetAwareIdFromContact(hContact, &id_block)) {
@@ -180,7 +180,7 @@ void CSametimeProto::CloseIm(MCONTACT hContact) mwConversation* conv = mwServiceIm_getConversation(service_im, &idb);
if (conv) {
if (mwConversation_isOpen(conv)) {
- debugLog(L"CSametimeProto::CloseIm() mwConversation_close");
+ debugLogW(L"CSametimeProto::CloseIm() mwConversation_close");
mwConversation_close(conv, 0);
}
}
@@ -190,14 +190,14 @@ void CSametimeProto::CloseIm(MCONTACT hContact) void CSametimeProto::InitMessaging()
{
- debugLog(L"CSametimeProto::InitMessaging()");
+ debugLogW(L"CSametimeProto::InitMessaging()");
mwSession_addService(session, (mwService*)(service_im = mwServiceIm_new(session, &mwIm_handler)));
mwServiceIm_setClientType(service_im, mwImClient_PLAIN);
}
void CSametimeProto::DeinitMessaging()
{
- debugLog(L"CSametimeProto::DeinitMessaging()");
+ debugLogW(L"CSametimeProto::DeinitMessaging()");
mwSession_removeService(session, mwService_IM);
mwService_free((mwService*)service_im);
service_im = 0;
diff --git a/protocols/Sametime/src/options.cpp b/protocols/Sametime/src/options.cpp index c848ee911b..672b7e3d11 100644 --- a/protocols/Sametime/src/options.cpp +++ b/protocols/Sametime/src/options.cpp @@ -347,7 +347,7 @@ static INT_PTR CALLBACK DlgProcOptNet(HWND hwndDlg, UINT msg, WPARAM wParam, LPA int CSametimeProto::OptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTNET);
odp.pwszTitle = m_tszUserName;
@@ -410,9 +410,9 @@ void CSametimeProto::LoadOptions() if (options.err_method == ED_POP && !ServiceExists(MS_POPUP_SHOWMESSAGE)) options.err_method = ED_BAL;
if (options.err_method == ED_BAL && !ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) options.err_method = ED_MB;
- debugLog(L"LoadOptions() loaded: ServerName:len=[%d], id:len=[%d], pword:len=[%d]", options.server_name == NULL ? -1 : mir_strlen(options.server_name), options.id == NULL ? -1 : mir_strlen(options.id), options.pword == NULL ? -1 : mir_strlen(options.pword));
- debugLog(L"LoadOptions() loaded: port=[%d], encrypt_session=[%d], ClientID=[%d], ClientVersionMajor=[%d], ClientVersionMinor=[%d]", options.port, options.encrypt_session, options.client_id, options.client_versionMajor, options.client_versionMinor);
- debugLog(L"LoadOptions() loaded: get_server_contacts=[%d], add_contacts=[%d], idle_as_away=[%d], err_method=[%d]", options.get_server_contacts, options.add_contacts, options.idle_as_away, options.err_method);
+ debugLogW(L"LoadOptions() loaded: ServerName:len=[%d], id:len=[%d], pword:len=[%d]", options.server_name == NULL ? -1 : mir_strlen(options.server_name), options.id == NULL ? -1 : mir_strlen(options.id), options.pword == NULL ? -1 : mir_strlen(options.pword));
+ debugLogW(L"LoadOptions() loaded: port=[%d], encrypt_session=[%d], ClientID=[%d], ClientVersionMajor=[%d], ClientVersionMinor=[%d]", options.port, options.encrypt_session, options.client_id, options.client_versionMajor, options.client_versionMinor);
+ debugLogW(L"LoadOptions() loaded: get_server_contacts=[%d], add_contacts=[%d], idle_as_away=[%d], err_method=[%d]", options.get_server_contacts, options.add_contacts, options.idle_as_away, options.err_method);
}
diff --git a/protocols/Sametime/src/places.cpp b/protocols/Sametime/src/places.cpp index 9bffaa9ac3..3a45fa6f67 100644 --- a/protocols/Sametime/src/places.cpp +++ b/protocols/Sametime/src/places.cpp @@ -54,13 +54,13 @@ mwPlaceHandler mwPlace_handler = { void CSametimeProto::InitPlaces(mwSession* session)
{
- debugLog(L"CSametimeProto::InitPlaces()");
+ debugLogW(L"CSametimeProto::InitPlaces()");
mwSession_addService(session, (mwService*)(service_places = mwServicePlace_new(session, &mwPlace_handler)));
}
void CSametimeProto::DeinitPlaces(mwSession* session)
{
- debugLog(L"CSametimeProto::DeinitPlaces()");
+ debugLogW(L"CSametimeProto::DeinitPlaces()");
mwSession_removeService(session, mwService_PLACE);
mwService_free((mwService*)service_places);
service_places = 0;
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index 0a950bc123..f6baf48502 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -124,12 +124,12 @@ void __cdecl sttFakeAckInfoSuccessThread(void *param) {
TFakeAckParams* tParam = (TFakeAckParams*)param;
CSametimeProto* proto = tParam->proto;
- proto->debugLog(L"sttFakeAckInfoSuccessThread() start");
+ proto->debugLogW(L"sttFakeAckInfoSuccessThread() start");
Sleep(100);
proto->ProtoBroadcastAck(tParam->hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0);
- proto->debugLog(L"sttFakeAckInfoSuccessThread() end");
+ proto->debugLogW(L"sttFakeAckInfoSuccessThread() end");
mir_free(tParam);
}
@@ -137,12 +137,12 @@ void __cdecl sttFakeAckMessageSuccessThread(void *param) {
TFakeAckParams* tParam = (TFakeAckParams*)param;
CSametimeProto* proto = tParam->proto;
- proto->debugLog(L"sttFakeAckMessageSuccessThread() start");
+ proto->debugLogW(L"sttFakeAckMessageSuccessThread() start");
Sleep(100);
proto->ProtoBroadcastAck(tParam->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)tParam->lParam, 0);
- proto->debugLog(L"sttFakeAckMessageSuccessThread() end");
+ proto->debugLogW(L"sttFakeAckMessageSuccessThread() end");
mir_free(tParam);
}
@@ -150,12 +150,12 @@ void __cdecl sttFakeAckMessageFailedThread(void *param) {
TFakeAckParams* tParam = (TFakeAckParams*)param;
CSametimeProto* proto = tParam->proto;
- proto->debugLog(L"sttFakeAckMessageFailedThread() start");
+ proto->debugLogW(L"sttFakeAckMessageFailedThread() start");
Sleep(100);
proto->ProtoBroadcastAck(tParam->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, tParam->lParam); ///TODO tParam->lParam: add error message
- proto->debugLog(L"sttFakeAckMessageFailedThread() end");
+ proto->debugLogW(L"sttFakeAckMessageFailedThread() end");
mir_free(tParam);
}
@@ -163,12 +163,12 @@ void __cdecl sttRecvAwayThread(void *param) {
TFakeAckParams* tParam = (TFakeAckParams*)param;
CSametimeProto* proto = tParam->proto;
- proto->debugLog(L"sttRecvAwayThread() start");
+ proto->debugLogW(L"sttRecvAwayThread() start");
Sleep(100);
proto->UserRecvAwayMessage(tParam->hContact);
- proto->debugLog(L"sttRecvAwayThread() end");
+ proto->debugLogW(L"sttRecvAwayThread() end");
free(tParam);
}
@@ -223,7 +223,7 @@ int CSametimeProto::OnSametimeContactDeleted(WPARAM hContact, LPARAM) void CSametimeProto::SetAllOffline()
{
- debugLog(L"SetAllOffline() start");
+ debugLogW(L"SetAllOffline() start");
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (db_get_b(hContact, m_szModuleName, "ChatRoom", 0)) {
@@ -241,7 +241,7 @@ void CSametimeProto::BroadcastNewStatus(int iNewStatus) if (m_iStatus == iNewStatus)
return;
- debugLog(L"BroadcastNewStatus() m_iStatus=[%d], iNewStatus=[%d]", m_iStatus, iNewStatus);
+ debugLogW(L"BroadcastNewStatus() m_iStatus=[%d], iNewStatus=[%d]", m_iStatus, iNewStatus);
previous_status = m_iStatus;
m_iStatus = iNewStatus;
diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp index aa3981f62b..690636b4dd 100644 --- a/protocols/Sametime/src/sametime_proto.cpp +++ b/protocols/Sametime/src/sametime_proto.cpp @@ -18,13 +18,13 @@ CSametimeProto::CSametimeProto(const char* pszProtoName, const wchar_t* tszUserN mir_snwprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_TCHAR | NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS;
+ nlu.flags = NUF_UNICODE | NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS;
nlu.szSettingsModule = m_szModuleName;
nlu.ptszDescriptiveName = name;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
RegisterGLibLogger();
- debugLog(L"CSametimeProto::CSametimeProto() start m_szModuleName=[%s], m_tszUserName=[%s]", _A2T(m_szModuleName), m_tszUserName);
+ debugLogW(L"CSametimeProto::CSametimeProto() start m_szModuleName=[%s], m_tszUserName=[%s]", _A2T(m_szModuleName), m_tszUserName);
SametimeInitIcons();
@@ -58,17 +58,17 @@ CSametimeProto::CSametimeProto(const char* pszProtoName, const wchar_t* tszUserN LoadOptions();
- debugLog(L"CSametimeProto::CSametimeProto() end");
+ debugLogW(L"CSametimeProto::CSametimeProto() end");
}
CSametimeProto::~CSametimeProto()
{
- debugLog(L"CSametimeProto::~CSametimeProto() start");
+ debugLogW(L"CSametimeProto::~CSametimeProto() start");
DeinitAwayMsg();
UnregisterPopups();
- debugLog(L"CSametimeProto::~CSametimeProto() end");
+ debugLogW(L"CSametimeProto::~CSametimeProto() end");
UnRegisterGLibLogger();
Netlib_CloseHandle(m_hNetlibUser);
@@ -79,13 +79,13 @@ CSametimeProto::~CSametimeProto() MCONTACT CSametimeProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
{
MYPROTOSEARCHRESULT* sr = (MYPROTOSEARCHRESULT*)psr;
- debugLog(L"CSametimeProto::AddToList() flags=[%d]", flags);
+ debugLogW(L"CSametimeProto::AddToList() flags=[%d]", flags);
return AddSearchedUser(sr, flags & PALF_TEMPORARY);
}
HANDLE CSametimeProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath)
{
- debugLog(L"CSametimeProto::FileAllow() hContact=[%x], szPath=[%s]", hContact, szPath);
+ debugLogW(L"CSametimeProto::FileAllow() hContact=[%x], szPath=[%s]", hContact, szPath);
char* szPathA = mir_u2a(szPath);
HANDLE res = AcceptFileTransfer(hContact, hTransfer, szPathA);
mir_free(szPathA);
@@ -94,21 +94,21 @@ HANDLE CSametimeProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const wcha int CSametimeProto::FileCancel(MCONTACT hContact, HANDLE hTransfer)
{
- debugLog(L"CSametimeProto::FileCancel() hContact=[%x]", hContact);
+ debugLogW(L"CSametimeProto::FileCancel() hContact=[%x]", hContact);
CancelFileTransfer(hTransfer);
return 0;
}
int CSametimeProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason)
{
- debugLog(L"CSametimeProto::FileDeny() hContact=[%x], szReason=[%s]", hContact, szReason);
+ debugLogW(L"CSametimeProto::FileDeny() hContact=[%x], szReason=[%s]", hContact, szReason);
RejectFileTransfer(hTransfer);
return 0;
}
int CSametimeProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
{
- debugLog(L"CSametimeProto::FileResume() action=[%d]", &action);
+ debugLogW(L"CSametimeProto::FileResume() action=[%d]", &action);
return 0;
}
@@ -138,7 +138,7 @@ DWORD_PTR CSametimeProto::GetCaps(int type, MCONTACT hContact) int CSametimeProto::GetInfo(MCONTACT hContact, int infoType)
{
// GetInfo - retrieves a contact info
- debugLog(L"CSametimeProto::GetInfo() hContact=[%x], infoType=[%d]", hContact, infoType);
+ debugLogW(L"CSametimeProto::GetInfo() hContact=[%x], infoType=[%d]", hContact, infoType);
if (getByte(hContact, "ChatRoom", 0))
return 1;
@@ -159,7 +159,7 @@ int CSametimeProto::GetInfo(MCONTACT hContact, int infoType) HANDLE CSametimeProto::SearchBasic(const wchar_t* id)
{
- debugLog(L"CSametimeProto::SearchBasic() id:len=[%d]", id == NULL ? -1 : mir_wstrlen(id));
+ debugLogW(L"CSametimeProto::SearchBasic() id:len=[%d]", id == NULL ? -1 : mir_wstrlen(id));
return (HANDLE)SearchForUser(T2Utf(id), FALSE);
///TODO - add timeout (like at GGPROTO::searchthread)
}
@@ -168,7 +168,7 @@ HWND CSametimeProto::SearchAdvanced(HWND owner) {
wchar_t buf[512];
if (GetDlgItemText(owner, IDC_EDIT1, buf, _countof(buf))) {
- debugLog(L"CSametimeProto::SearchAdvanced() buf:len=[%d]", mir_wstrlen(buf));
+ debugLogW(L"CSametimeProto::SearchAdvanced() buf:len=[%d]", mir_wstrlen(buf));
return (HWND)SearchForUser(T2Utf(buf), TRUE);
}
return NULL;
@@ -176,14 +176,14 @@ HWND CSametimeProto::SearchAdvanced(HWND owner) HWND CSametimeProto::CreateExtendedSearchUI(HWND owner)
{
- debugLog(L"CSametimeProto::CreateExtendedSearchUI() start");
+ debugLogW(L"CSametimeProto::CreateExtendedSearchUI() start");
return CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_USERSEARCH), owner, SearchDialogFunc, (LPARAM)this);
}
int CSametimeProto::RecvFile(MCONTACT hContact, PROTORECVFILET* pre)
{
- debugLog(L"CSametimeProto::RecvFile() hContact=[%x]", hContact);
+ debugLogW(L"CSametimeProto::RecvFile() hContact=[%x]", hContact);
db_unset(hContact, "CList", "Hidden");
db_unset(hContact, "CList", "NotOnList");
@@ -193,7 +193,7 @@ int CSametimeProto::RecvFile(MCONTACT hContact, PROTORECVFILET* pre) int CSametimeProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre)
{
- debugLog(L"CSametimeProto::RecvMsg() hContact=[%x]", hContact);
+ debugLogW(L"CSametimeProto::RecvMsg() hContact=[%x]", hContact);
db_unset(hContact, "CList", "Hidden");
db_unset(hContact, "CList", "NotOnList");
@@ -203,7 +203,7 @@ int CSametimeProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre) HANDLE CSametimeProto::SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles)
{
- debugLog(L"CSametimeProto::SendFile() hContact=[%x]", hContact);
+ debugLogW(L"CSametimeProto::SendFile() hContact=[%x]", hContact);
if (m_iStatus != ID_STATUS_OFFLINE) {
if (hContact && ppszFiles && szDescription) {
if (db_get_w(hContact, m_szModuleName, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) {
@@ -216,7 +216,7 @@ HANDLE CSametimeProto::SendFile(MCONTACT hContact, const wchar_t* szDescription, int CSametimeProto::SendMsg(MCONTACT hContact, int, const char* msg)
{
- debugLog(L"CSametimeProto::SendMsg() hContact=[%x]", hContact);
+ debugLogW(L"CSametimeProto::SendMsg() hContact=[%x]", hContact);
char *proto = GetContactProto(hContact);
if (!proto || mir_strcmp(proto, m_szModuleName) != 0 || db_get_w(hContact, m_szModuleName, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE) {
@@ -244,7 +244,7 @@ int CSametimeProto::SendMsg(MCONTACT hContact, int, const char* msg) int CSametimeProto::SetStatus(int iNewStatus)
{
- debugLog(L"CSametimeProto::SetStatus() m_iStatus=[%d], m_iDesiredStatus=[%d], iNewStatus=[%d]", m_iStatus, m_iDesiredStatus, iNewStatus);
+ debugLogW(L"CSametimeProto::SetStatus() m_iStatus=[%d], m_iDesiredStatus=[%d], iNewStatus=[%d]", m_iStatus, m_iDesiredStatus, iNewStatus);
m_iDesiredStatus = iNewStatus;
if (iNewStatus != ID_STATUS_OFFLINE) {
if (m_iStatus == ID_STATUS_OFFLINE)
@@ -261,7 +261,7 @@ int CSametimeProto::SetStatus(int iNewStatus) HANDLE CSametimeProto::GetAwayMsg(MCONTACT hContact)
{
- debugLog(L"CSametimeProto::GetInfo() hContact=[%x], m_iStatus=[%d]", hContact, m_iStatus);
+ debugLogW(L"CSametimeProto::GetInfo() hContact=[%x], m_iStatus=[%d]", hContact, m_iStatus);
if (hContact && m_iStatus != ID_STATUS_OFFLINE) {
TFakeAckParams* tfap;
tfap = (TFakeAckParams*)malloc(sizeof(TFakeAckParams));
@@ -275,7 +275,7 @@ HANDLE CSametimeProto::GetAwayMsg(MCONTACT hContact) int CSametimeProto::RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt)
{
- debugLog(L"CSametimeProto::RecvAwayMsg() hContact=[%x], mode=[%d]", hContact, mode);
+ debugLogW(L"CSametimeProto::RecvAwayMsg() hContact=[%x], mode=[%d]", hContact, mode);
ptrW pszMsg(mir_utf8decodeW(evt->szMessage));
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)evt->lParam, pszMsg);
@@ -284,14 +284,14 @@ int CSametimeProto::RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt int CSametimeProto::SetAwayMsg(int iStatus, const wchar_t* msg)
{
- debugLog(L"CSametimeProto::SetAwayMsg() iStatus=[%d], msg:len=[%d]", iStatus, msg == NULL ? -1 : mir_wstrlen(msg));
+ debugLogW(L"CSametimeProto::SetAwayMsg() iStatus=[%d], msg:len=[%d]", iStatus, msg == NULL ? -1 : mir_wstrlen(msg));
SetSessionAwayMessage(iStatus, msg);
return 0;
}
int CSametimeProto::UserIsTyping(MCONTACT hContact, int type)
{
- debugLog(L"CSametimeProto::UserIsTyping() hContact=[%x], type=[%d]", hContact, type);
+ debugLogW(L"CSametimeProto::UserIsTyping() hContact=[%x], type=[%d]", hContact, type);
SendTyping(hContact, type == PROTOTYPE_SELFTYPING_ON);
return 0;
}
@@ -300,7 +300,7 @@ int CSametimeProto::OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lPa {
switch (iEventType) {
case EV_PROTO_ONOPTIONS:
- debugLog(L"CSametimeProto::OnEvent() EV_PROTO_ONOPTIONS");
+ debugLogW(L"CSametimeProto::OnEvent() EV_PROTO_ONOPTIONS");
OptInit(wParam, lParam);
break;
}
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp index d9b8234596..f1f595d8a7 100644 --- a/protocols/Sametime/src/sametime_session.cpp +++ b/protocols/Sametime/src/sametime_session.cpp @@ -17,13 +17,13 @@ struct { void __cdecl SessionClear(mwSession* session)
{
CSametimeProto* proto = (CSametimeProto*)mwSession_getProperty(session, "PROTO_STRUCT_PTR");
- proto->debugLog(L"SessionClear()");
+ proto->debugLogW(L"SessionClear()");
}
int __cdecl SessionWrite(mwSession* session, const unsigned char* buf, gsize len)
{
CSametimeProto* proto = (CSametimeProto*)mwSession_getProperty(session, "PROTO_STRUCT_PTR");
- proto->debugLog(L"SessionWrite() server_connection=[%d], len=[%d]", proto->server_connection, len);
+ proto->debugLogW(L"SessionWrite() server_connection=[%d], len=[%d]", proto->server_connection, len);
if (!proto->server_connection) return 1;
if (Netlib_Send(proto->server_connection, (const char*)buf, len, 0) == SOCKET_ERROR)
return 1;
@@ -33,7 +33,7 @@ int __cdecl SessionWrite(mwSession* session, const unsigned char* buf, gsize len void __cdecl SessionClose(mwSession* session)
{
CSametimeProto* proto = (CSametimeProto*)mwSession_getProperty(session, "PROTO_STRUCT_PTR");
- proto->debugLog(L"SessionClose() server_connection=[%d]", proto->server_connection);
+ proto->debugLogW(L"SessionClose() server_connection=[%d]", proto->server_connection);
Netlib_CloseHandle(proto->server_connection);
proto->server_connection = 0;
}
@@ -52,7 +52,7 @@ void CSametimeProto::SessionStopping() void CSametimeProto::InitMeanwhileServices()
{
- debugLog(L"InitMeanwhileServices() start");
+ debugLogW(L"InitMeanwhileServices() start");
if (options.encrypt_session) {
mwSession_addCipher(session, mwCipher_new_RC2_128(session));
@@ -77,7 +77,7 @@ void CSametimeProto::InitMeanwhileServices() void CSametimeProto::DeinitMeanwhileServices()
{
- debugLog(L"DeinitMeanwhileServices() start");
+ debugLogW(L"DeinitMeanwhileServices() start");
DeinitConference();
DeinitFiles();
DeinitMessaging();
@@ -89,7 +89,7 @@ void CSametimeProto::DeinitMeanwhileServices() void __cdecl SessionStateChange(mwSession* session, mwSessionState state, gpointer info)
{
CSametimeProto* proto = (CSametimeProto*)mwSession_getProperty(session, "PROTO_STRUCT_PTR");
- proto->debugLog(L"SessionStateChange() state=[%d]", state);
+ proto->debugLogW(L"SessionStateChange() state=[%d]", state);
switch (state) {
case mwSession_STARTING:
@@ -136,7 +136,7 @@ void __cdecl SessionStateChange(mwSession* session, mwSessionState state, gpoint void __cdecl SessionAdmin(struct mwSession* session, const char* text)
{
CSametimeProto* proto = (CSametimeProto*)mwSession_getProperty(session, "PROTO_STRUCT_PTR");
- proto->debugLog(L"SessionAdmin()");
+ proto->debugLogW(L"SessionAdmin()");
wchar_t* tt = mir_utf8decodeW(text);
MessageBox(0, tt, TranslateT("Sametime administrator message"), MB_OK);
mir_free(tt);
@@ -145,14 +145,14 @@ void __cdecl SessionAdmin(struct mwSession* session, const char* text) void __cdecl SessionAnnounce(struct mwSession* session, struct mwLoginInfo* from, gboolean may_reply, const char* text)
{
CSametimeProto* proto = (CSametimeProto*)mwSession_getProperty(session, "PROTO_STRUCT_PTR");
- proto->debugLog(L"SessionAnnounce()");
+ proto->debugLogW(L"SessionAnnounce()");
wchar_t* stzFrom;
wchar_t* stzText;
wchar_t stzFromBuff[256];
stzFrom = mir_utf8decodeW(from->user_name);
stzText = mir_utf8decodeW(text);
mir_snwprintf(stzFromBuff, TranslateT("Session announcement - from '%s'"), stzFrom);
- MessageBox(0, TranslateTS(stzText), stzFromBuff, MB_OK);
+ MessageBox(0, TranslateW(stzText), stzFromBuff, MB_OK);
mir_free(stzText);
mir_free(stzFrom);
}
@@ -160,7 +160,7 @@ void __cdecl SessionAnnounce(struct mwSession* session, struct mwLoginInfo* from void __cdecl SessionSetPrivacyInfo(struct mwSession* session)
{
CSametimeProto* proto = (CSametimeProto*)mwSession_getProperty(session, "PROTO_STRUCT_PTR");
- proto->debugLog(L"SessionSetPrivacyInfo()");
+ proto->debugLogW(L"SessionSetPrivacyInfo()");
}
void __cdecl SessionSetUserStatus(struct mwSession* session)
@@ -171,7 +171,7 @@ void __cdecl SessionSetUserStatus(struct mwSession* session) struct mwUserStatus us;
mwUserStatus_clone(&us, mwSession_getUserStatus(session));
- proto->debugLog(L"SessionSetUserStatus() us.status=[%d]", us.status);
+ proto->debugLogW(L"SessionSetUserStatus() us.status=[%d]", us.status);
switch (us.status) {
case mwStatus_ACTIVE:
@@ -211,7 +211,7 @@ void __cdecl SessionSetUserStatus(struct mwSession* session) wchar_t buff[512];
mir_snwprintf(buff, TranslateT("Unknown user status: %d"), us.status);
proto->showPopup(buff, SAMETIME_POPUP_ERROR);
- proto->debugLog(buff);
+ proto->debugLogW(buff);
mwUserStatus_clear(&us);
// just go online...to prevent us getting stuck 'connecting'
@@ -224,7 +224,7 @@ void __cdecl SessionSetUserStatus(struct mwSession* session) if (proto->first_online) {
proto->first_online = false;
//proto->showPopup(TranslateT("Setting login status"), SAMETIME_POPUP_INFO);
- proto->debugLog(L"Setting login status");
+ proto->debugLogW(L"Setting login status");
proto->SetSessionStatus(proto->login_status);
}
else proto->BroadcastNewStatus(new_status);
@@ -241,7 +241,7 @@ void CSametimeProto::UpdateSelfStatus() int CSametimeProto::SetSessionStatus(int status)
{
struct mwUserStatus us;
- debugLog(L"SetSessionStatus() start status=[%d]", status);
+ debugLogW(L"SetSessionStatus() start status=[%d]", status);
if (idle_timerid) KillTimer(0, idle_timerid);
@@ -271,7 +271,7 @@ int CSametimeProto::SetSessionStatus(int status) us.desc = AwayMessages.szOnline; us.status = mwStatus_ACTIVE; break;
}
- debugLog(L"SetSessionStatus() mwSession_setUserStatus us.status=[%d], us.desc:len=[%d]", us.status, us.desc == NULL ? -1 : mir_strlen(us.desc));
+ debugLogW(L"SetSessionStatus() mwSession_setUserStatus us.status=[%d], us.desc:len=[%d]", us.status, us.desc == NULL ? -1 : mir_strlen(us.desc));
mwSession_setUserStatus(session, &us);
return 0;
@@ -297,7 +297,7 @@ VOID CALLBACK IdleTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime int CSametimeProto::SetIdle(bool idle)
{
// set a timer, to wait for any autoaway module which might set our status
- debugLog(L"CSametimeProto::SetIdle() idle=[%d], idle_status=[%d], idle_timerid=[%d]", idle, idle_status, idle_timerid);
+ debugLogW(L"CSametimeProto::SetIdle() idle=[%d], idle_status=[%d], idle_timerid=[%d]", idle, idle_status, idle_timerid);
if (idle && !idle_status) {
idle_status = true;
if (!idle_timerid)
@@ -313,7 +313,7 @@ int CSametimeProto::SetIdle(bool idle) void CSametimeProto::SetSessionAwayMessage(int status, const wchar_t* msgT)
{
- debugLog(L"SetSessionAwayMessage() status=[%d], msgT:len=[%d]", status, msgT == NULL ? -1 : mir_wstrlen(msgT));
+ debugLogW(L"SetSessionAwayMessage() status=[%d], msgT:len=[%d]", status, msgT == NULL ? -1 : mir_wstrlen(msgT));
T2Utf msg(msgT);
if (status == ID_STATUS_ONLINE)
@@ -345,7 +345,7 @@ void __cdecl KeepAliveThread(LPVOID param) {
CSametimeProto* proto = (CSametimeProto*)param;
int i = 120;
- proto->debugLog(L"KeepAliveThread() start");
+ proto->debugLogW(L"KeepAliveThread() start");
while (1) {
@@ -363,7 +363,7 @@ void __cdecl KeepAliveThread(LPVOID param) mir_cslock lck(proto->session_cs);
if (Miranda_Terminated() || !proto->session) {
- proto->debugLog(L"KeepAliveThread() end");
+ proto->debugLogW(L"KeepAliveThread() end");
break;
}
}
@@ -380,7 +380,7 @@ void __cdecl SessionThread(LPVOID param) {
CSametimeProto* proto = (CSametimeProto*)param;
HANDLE hNetlibUser = proto->m_hNetlibUser;
- proto->debugLog(L"SessionThread() start");
+ proto->debugLogW(L"SessionThread() start");
continue_connect = true;
@@ -406,7 +406,7 @@ void __cdecl SessionThread(LPVOID param) proto->showPopup(TranslateT("No server connection!"), SAMETIME_POPUP_ERROR);
}
- proto->debugLog(L"SessionThread() end, no server_connection, continue_connect=[%d]", continue_connect);
+ proto->debugLogW(L"SessionThread() end, no server_connection, continue_connect=[%d]", continue_connect);
return;
}
@@ -436,7 +436,7 @@ void __cdecl SessionThread(LPVOID param) //while(session && server_connection && mwSession_getState(session) != mwSession_STOPPED) {
while (proto->server_connection) {// && session) {// && !mwSession_isStopped(session)) { // break on error
bytes = Netlib_Recv(proto->server_connection, (char *)recv_buffer, 1024 * 32, 0);
- proto->debugLog(L"SessionThread() Netlib_Recv'ed bytes=[%d]", bytes);
+ proto->debugLogW(L"SessionThread() Netlib_Recv'ed bytes=[%d]", bytes);
if (bytes == 0) {
break;
@@ -462,7 +462,7 @@ void __cdecl SessionThread(LPVOID param) proto->SetAllOffline();
proto->first_online = true;
- proto->debugLog(L"SessionThread() end");
+ proto->debugLogW(L"SessionThread() end");
return;
}
@@ -488,11 +488,11 @@ WORD CSametimeProto::GetServerVersion() int CSametimeProto::LogIn(int ls, HANDLE hNetlibUser)
{
- debugLog(L"LogIn() start");
+ debugLogW(L"LogIn() start");
mir_cslock lck(session_cs);
if (session) {
- debugLog(L"LogIn() end, currently in session");
+ debugLogW(L"LogIn() end, currently in session");
return 0;
}
@@ -505,12 +505,12 @@ int CSametimeProto::LogIn(int ls, HANDLE hNetlibUser) int CSametimeProto::LogOut()
{
- debugLog(L"LogOut() start");
+ debugLogW(L"LogOut() start");
continue_connect = false;
mir_cslock lck(session_cs);
if (session && server_connection && m_iStatus != ID_STATUS_OFFLINE && !mwSession_isStopped(session) && !mwSession_isStopping(session)) {
- debugLog(L"LogOut() mwSession_stop");
+ debugLogW(L"LogOut() mwSession_stop");
mwSession_stop(session, 0);
}
@@ -519,15 +519,15 @@ int CSametimeProto::LogOut() int CSametimeProto::OnLogInRedirect(char* newHost)
{
- debugLog(L"OnLogInRedirect() mwSession_LOGIN_REDIR newHost=[%s]", newHost ? _A2T(newHost) : "(null)");
+ debugLogW(L"OnLogInRedirect() mwSession_LOGIN_REDIR newHost=[%s]", newHost ? _A2T(newHost) : "(null)");
if (!newHost || !mir_strcmp(newHost, options.server_name) || db_get_b(0, m_szModuleName, "ForceLogin", 0) == 1) {
- debugLog(L"OnLogInRedirect() forceLogin");
+ debugLogW(L"OnLogInRedirect() forceLogin");
mwSession_forceLogin(session);
return 0;
}
- debugLog(L"OnLogInRedirect() redirect");
+ debugLogW(L"OnLogInRedirect() redirect");
mir_strcpy(options.server_name, newHost);
LogOut();
Sleep(50); //wait for SessionThread end
@@ -561,7 +561,7 @@ void SendAnnouncement(SendAnnouncementFunc_arg* arg) INT_PTR CSametimeProto::SessionAnnounce(WPARAM wParam, LPARAM lParam)
{
- debugLog(L"CSametimeProto::SessionAnnounce() start");
+ debugLogW(L"CSametimeProto::SessionAnnounce() start");
SessionAnnounceDialogProc_arg* sadpArg = (SessionAnnounceDialogProc_arg*)mir_calloc(sizeof(SessionAnnounceDialogProc_arg));
sadpArg->proto = this;
sadpArg->sendAnnouncementFunc = SendAnnouncement;
@@ -571,12 +571,12 @@ INT_PTR CSametimeProto::SessionAnnounce(WPARAM wParam, LPARAM lParam) void CSametimeProto::InitSessionMenu()
{
- debugLog(L"CSametimeProto::InitSessionMenu()");
+ debugLogW(L"CSametimeProto::InitSessionMenu()");
CreateProtoService(MS_SAMETIME_MENUANNOUNCESESSION, &CSametimeProto::SessionAnnounce);
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.position = 2000060000;
mi.name.w = LPGENW("Send announcement...");
mi.pszService = MS_SAMETIME_MENUANNOUNCESESSION;
diff --git a/protocols/Sametime/src/session_announce_win.cpp b/protocols/Sametime/src/session_announce_win.cpp index 03081b51c5..99b85c6bb3 100644 --- a/protocols/Sametime/src/session_announce_win.cpp +++ b/protocols/Sametime/src/session_announce_win.cpp @@ -14,7 +14,7 @@ INT_PTR CALLBACK SessionAnnounceDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPara SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
arg = (SessionAnnounceDialogProc_arg*)lParam;
proto = arg->proto;
- proto->debugLog(L"SessionAnnounceDialogProc WM_INITDIALOG");
+ proto->debugLogW(L"SessionAnnounceDialogProc WM_INITDIALOG");
SendDlgItemMessage(hwndDlg, IDC_LST_ANTO, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES);
{
@@ -55,7 +55,7 @@ INT_PTR CALLBACK SessionAnnounceDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPara case WM_CLOSE:
proto = arg->proto;
- proto->debugLog(L"SessionAnnounceDialogProc WM_CLOSE");
+ proto->debugLogW(L"SessionAnnounceDialogProc WM_CLOSE");
mir_free(arg);
DestroyWindow(hwndDlg);
break;
@@ -79,7 +79,7 @@ INT_PTR CALLBACK SessionAnnounceDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPara return 0;
case IDOK:
- proto->debugLog(L"SessionAnnounceDialogProc IDOK BN_CLICKED");
+ proto->debugLogW(L"SessionAnnounceDialogProc IDOK BN_CLICKED");
{
// build SendAnnouncementFunc_arg
SendAnnouncementFunc_arg* safArg = (SendAnnouncementFunc_arg*)mir_calloc(sizeof(SendAnnouncementFunc_arg));
diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp index 4d65b377da..cb91800016 100644 --- a/protocols/Sametime/src/userlist.cpp +++ b/protocols/Sametime/src/userlist.cpp @@ -54,7 +54,7 @@ void CSametimeProto::AddGroup(const char* name, bool expanded) MCONTACT CSametimeProto::AddContact(mwSametimeUser* user, bool temporary)
{
- debugLog(L"CSametimeProto::AddContact() start");
+ debugLogW(L"CSametimeProto::AddContact() start");
const char* id = mwSametimeUser_getUser(user);
const char* name = mwSametimeUser_getShortName(user);
const char* nick = mwSametimeUser_getAlias(user);
@@ -66,12 +66,12 @@ MCONTACT CSametimeProto::AddContact(mwSametimeUser* user, bool temporary) if (!hContact) {
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (!hContact) {
- debugLog(L"AddContact(): Failed to create Sametime contact");
+ debugLogW(L"AddContact(): Failed to create Sametime contact");
return NULL; ///TODO error handling
}
if (Proto_AddToContact(hContact, m_szModuleName) != 0) {
CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
- debugLog(L"AddContact(): Failed to register Sametime contact");
+ debugLogW(L"AddContact(): Failed to register Sametime contact");
return NULL; ///TODO error handling
}
new_contact = true;
@@ -125,7 +125,7 @@ MCONTACT CSametimeProto::AddContact(mwSametimeUser* user, bool temporary) void CSametimeProto::ImportContactsFromList(mwSametimeList* user_list, bool temporary)
{
- debugLog(L"CSametimeProto::ImportContactsFromList() start");
+ debugLogW(L"CSametimeProto::ImportContactsFromList() start");
// add contacts
mwSametimeGroup* stgroup;
mwSametimeUser* stuser;
@@ -187,7 +187,7 @@ void CSametimeProto::ImportContactsFromList(mwSametimeList* user_list, bool temp void CSametimeProto::ExportContactsToList(mwSametimeList* user_list)
{
- debugLog(L"CSametimeProto::ExportContactsToList() start");
+ debugLogW(L"CSametimeProto::ExportContactsToList() start");
mwSametimeGroup* stgroup = 0;
char* group_name;
char* group_alias;
@@ -300,7 +300,7 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list) void CSametimeProto::ImportContactsFromFile(wchar_t* filename)
{
- debugLog(L"CSametimeProto::ImportContactsFromFile() start");
+ debugLogW(L"CSametimeProto::ImportContactsFromFile() start");
std::ifstream in(filename);
std::string text;
std::string line;
@@ -326,9 +326,9 @@ void CSametimeProto::ExportContactsToServer() mwPutBuffer* buff;
mwOpaque* op;
- debugLog(L"CSametimeProto::ExportContactsToServer() start");
+ debugLogW(L"CSametimeProto::ExportContactsToServer() start");
if (MW_SERVICE_IS_DEAD(service_storage)) {
- debugLog(L"CSametimeProto::ExportContactsToServer() Failed");
+ debugLogW(L"CSametimeProto::ExportContactsToServer() Failed");
showPopup(TranslateT("Failed to upload contacts - storage service unavailable."), SAMETIME_POPUP_ERROR);
return;
}
@@ -386,7 +386,7 @@ int CSametimeProto::ContactDeleted(MCONTACT hContact) if (db_get_b(hContact, m_szModuleName, "ChatRoom", 0))
return 0;
- debugLog(L"CSametimeProto::ContactDeleted()");
+ debugLogW(L"CSametimeProto::ContactDeleted()");
if (GetAwareIdFromContact(hContact, &id_block)) {
GList* gl = g_list_prepend(NULL, &id_block);
@@ -580,7 +580,7 @@ mwAwareListHandler mwAwareList_handler = void CSametimeProto::UserListCreate()
{
- debugLog(L"CSametimeProto::UserListCreate() start");
+ debugLogW(L"CSametimeProto::UserListCreate() start");
mwServiceAware_unsetAttribute(service_aware, mwAttribute_SPEAKERS);
mwServiceAware_unsetAttribute(service_aware, mwAttribute_MICROPHONE);
mwServiceAware_unsetAttribute(service_aware, mwAttribute_VIDEO_CAMERA);
@@ -634,9 +634,9 @@ void CSametimeProto::UserListDestroy() void CSametimeProto::UserRecvAwayMessage(MCONTACT hContact)
{
- debugLog(L"CSametimeProto::UserRecvAwayMessage() start hContact=[%x]", hContact);
+ debugLogW(L"CSametimeProto::UserRecvAwayMessage() start hContact=[%x]", hContact);
DBVARIANT dbv;
- if (!db_get_s((MCONTACT)hContact, "CList", "StatusMsg", &dbv, DBVT_TCHAR)) {
+ if (!db_get_s((MCONTACT)hContact, "CList", "StatusMsg", &dbv, DBVT_WCHAR)) {
ProtoBroadcastAck((MCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
@@ -765,7 +765,7 @@ INT_PTR CALLBACK CALLBACK SearchDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam MCONTACT CSametimeProto::AddSearchedUser(MYPROTOSEARCHRESULT* mpsr, bool temporary)
{
MCONTACT hContact = 0;
- debugLog(L"CSametimeProto::AddSearchedUser() start");
+ debugLogW(L"CSametimeProto::AddSearchedUser() start");
mwSametimeList* user_list = mwSametimeList_new();
mwSametimeGroup* stgroup = 0;
if (mpsr->group) {
@@ -799,7 +799,7 @@ void mwServiceAware_clear_callback(mwServiceAware* srvc) void CSametimeProto::InitUserList()
{
- debugLog(L"CSametimeProto::InitUserList()");
+ debugLogW(L"CSametimeProto::InitUserList()");
mwSession_addService(session, (mwService*)(service_storage = mwServiceStorage_new(session)));
mwSession_addService(session, (mwService*)(service_resolve = mwServiceResolve_new(session)));
@@ -813,7 +813,7 @@ void CSametimeProto::InitUserList() void CSametimeProto::DeinitUserList()
{
- debugLog(L"CSametimeProto::DeinitUserList()");
+ debugLogW(L"CSametimeProto::DeinitUserList()");
mwSession_removeService(session, mwService_AWARE);
mwService_free((mwService*)service_aware);
diff --git a/protocols/Sametime/src/utils.cpp b/protocols/Sametime/src/utils.cpp index f876860fc0..7bbc3ff804 100644 --- a/protocols/Sametime/src/utils.cpp +++ b/protocols/Sametime/src/utils.cpp @@ -32,12 +32,12 @@ void CSametimeProto::RegisterPopups() wchar_t szDescr[256];
char szName[256];
- debugLog(L"CSametimeProto::RegisterPopups()");
+ debugLogW(L"CSametimeProto::RegisterPopups()");
POPUPCLASS puc = { sizeof(puc) };
puc.PluginWindowProc = PopupWindowProc;
puc.flags = PCF_TCHAR;
- puc.ptszDescription = szDescr;
+ puc.pwszDescription = szDescr;
puc.pszName = szName;
mir_snprintf(szName, "%s_%s", m_szModuleName, "Notify");
@@ -62,7 +62,7 @@ void CSametimeProto::RegisterPopups() void CSametimeProto::UnregisterPopups()
{
- debugLog(L"CSametimeProto::RegisterPopups()");
+ debugLogW(L"CSametimeProto::RegisterPopups()");
Popup_UnregisterClass(hPopupError);
Popup_UnregisterClass(hPopupNotify);
}
@@ -144,10 +144,10 @@ void CSametimeProto::showPopup(guint32 code) SametimePopupEnum flag = (rcDesc->type == mwReturnCodeError ? SAMETIME_POPUP_ERROR : SAMETIME_POPUP_INFO);
wchar_t buff[512];
- mir_snwprintf(buff, TranslateT("%s\n\nSametime error %S\n%s"), TranslateTS(_A2T(rcDesc->name)), rcDesc->codeString, TranslateTS(_A2T(rcDesc->description)));
+ mir_snwprintf(buff, TranslateT("%s\n\nSametime error %S\n%s"), TranslateW(_A2T(rcDesc->name)), rcDesc->codeString, TranslateW(_A2T(rcDesc->description)));
showPopup(buff, flag);
- debugLog(buff);
+ debugLogW(buff);
g_free(rcDesc->codeString);
g_free(rcDesc->name);
@@ -158,17 +158,17 @@ void CSametimeProto::showPopup(guint32 code) void LogFromGLib(const gchar* log_domain, GLogLevelFlags log_level, const gchar* message, gpointer user_data)
{
CSametimeProto* proto = (CSametimeProto*)user_data;
- proto->debugLog(_A2T(message));
+ proto->debugLogW(_A2T(message));
}
void CSametimeProto::RegisterGLibLogger()
{
- debugLog(L"CSametimeProto::RegisterGLibLogger");
+ debugLogW(L"CSametimeProto::RegisterGLibLogger");
gLogHandler = g_log_set_handler(G_LOG_DOMAIN, G_LOG_LEVEL_MASK, LogFromGLib, this);
}
void CSametimeProto::UnRegisterGLibLogger()
{
- debugLog(L"CSametimeProto::UnRegisterGLibLogger");
+ debugLogW(L"CSametimeProto::UnRegisterGLibLogger");
if (gLogHandler) g_log_remove_handler(G_LOG_DOMAIN, gLogHandler);
}
diff --git a/protocols/SkypeWeb/src/skype_avatars.cpp b/protocols/SkypeWeb/src/skype_avatars.cpp index 0c780094ff..361f145e11 100644 --- a/protocols/SkypeWeb/src/skype_avatars.cpp +++ b/protocols/SkypeWeb/src/skype_avatars.cpp @@ -127,11 +127,11 @@ INT_PTR CSkypeProto::SvcGetMyAvatar(WPARAM wParam, LPARAM lParam) void CSkypeProto::GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen)
{
- int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%s", VARST(L"%miranda_avatarcache%"), m_tszUserName);
+ int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%s", VARSW(L"%miranda_avatarcache%"), m_tszUserName);
DWORD dwAttributes = GetFileAttributes(pszDest);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
- CreateDirectoryTreeT(pszDest);
+ CreateDirectoryTreeW(pszDest);
pszDest[tPathLen++] = '\\';
@@ -142,9 +142,9 @@ void CSkypeProto::GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t mir_snwprintf(pszDest + tPathLen, MAX_PATH - tPathLen, L"%S%s", username.c_str(), szFileType);
}
-void CSkypeProto::SetAvatarUrl(MCONTACT hContact, CMString &tszUrl)
+void CSkypeProto::SetAvatarUrl(MCONTACT hContact, CMStringW &tszUrl)
{
- ptrW oldUrl(getTStringA(hContact, "AvatarUrl"));
+ ptrW oldUrl(getWStringA(hContact, "AvatarUrl"));
if (oldUrl != NULL)
if (tszUrl == oldUrl)
return;
@@ -154,7 +154,7 @@ void CSkypeProto::SetAvatarUrl(MCONTACT hContact, CMString &tszUrl) ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, 0);
}
else {
- setTString(hContact, "AvatarUrl", tszUrl.GetBuffer());
+ setWString(hContact, "AvatarUrl", tszUrl.GetBuffer());
setByte(hContact, "NeedNewAvatar", 1);
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index 6916ad1c35..35e40e9045 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -116,7 +116,7 @@ void CSkypeProto::OnLoadChats(const NETLIBHTTPREQUEST *response) if (!conversation["lastMessage"])
continue;
- CMString topic(threadProperties["topic"].as_mstring());
+ CMStringW topic(threadProperties["topic"].as_mstring());
SendRequest(new GetChatInfoRequest(id.as_string().c_str(), li), &CSkypeProto::OnGetChatInfo, topic.Detach());
}
}
@@ -153,10 +153,10 @@ int CSkypeProto::OnGroupChatEventHook(WPARAM, LPARAM lParam) hContact = AddContact(_T2A(gch->ptszUID), true);
setWord(hContact, "Status", ID_STATUS_ONLINE);
db_set_b(hContact, "CList", "Hidden", 1);
- setTString(hContact, "Nick", gch->ptszUID);
+ setWString(hContact, "Nick", gch->ptszUID);
db_set_dw(hContact, "Ignore", "Mask1", 0);
}
- CallService(MS_MSG_SENDMESSAGET, hContact, 0);
+ CallService(MS_MSG_SENDMESSAGEW, hContact, 0);
break;
}
@@ -184,7 +184,7 @@ int CSkypeProto::OnGroupChatEventHook(WPARAM, LPARAM lParam) OnLeaveChatRoom(FindChatRoom(chat_id), NULL);
break;
case 30:
- CMString newTopic = ChangeTopicForm();
+ CMStringW newTopic = ChangeTopicForm();
if (!newTopic.IsEmpty())
SendRequest(new SetChatPropertiesRequest(chat_id, "topic", T2Utf(newTopic.GetBuffer()), li));
break;
@@ -232,7 +232,7 @@ int CSkypeProto::OnGroupChatEventHook(WPARAM, LPARAM lParam) gce.time = time(NULL);
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
- db_set_ts(FindChatRoom(chat_id), "UsersNicks", _T2A(gch->ptszUID), pForm.ptszResult);
+ db_set_ws(FindChatRoom(chat_id), "UsersNicks", _T2A(gch->ptszUID), pForm.ptszResult);
break;
@@ -248,8 +248,8 @@ INT_PTR CSkypeProto::OnJoinChatRoom(WPARAM hContact, LPARAM) {
if (hContact)
{
- ptrW idT(getTStringA(hContact, "ChatRoomID"));
- ptrW nameT(getTStringA(hContact, "Nick"));
+ ptrW idT(getWStringA(hContact, "ChatRoomID"));
+ ptrW nameT(getWStringA(hContact, "Nick"));
StartChatRoom(idT, nameT != NULL ? nameT : idT);
}
return 0;
@@ -261,7 +261,7 @@ INT_PTR CSkypeProto::OnLeaveChatRoom(WPARAM hContact, LPARAM) return 1;
if (hContact && IDYES == MessageBox(NULL, TranslateT("This chat is going to be destroyed forever with all its contents. This action cannot be undone. Are you sure?"), TranslateT("Warning"), MB_YESNO | MB_ICONQUESTION))
{
- ptrW idT(getTStringA(hContact, "ChatRoomID"));
+ ptrW idT(getWStringA(hContact, "ChatRoomID"));
GCDEST gcd = { m_szModuleName, NULL, GC_EVENT_CONTROL };
gcd.ptszID = idT;
@@ -287,7 +287,7 @@ void CSkypeProto::OnChatEvent(const JSONNode &node) CMStringA szConversationName(UrlToSkypename(node["conversationLink"].as_string().c_str()));
CMStringA szFromSkypename(UrlToSkypename(node["from"].as_string().c_str()));
- CMString szTopic(node["threadtopic"].as_mstring());
+ CMStringW szTopic(node["threadtopic"].as_mstring());
time_t timestamp = IsoToUnixTime(node["composetime"].as_string().c_str());
@@ -448,7 +448,7 @@ void CSkypeProto::AddMessageToChat(const wchar_t *chat_id, const wchar_t *from, gce.time = timestamp;
gce.ptszUID = from;
- CMString tszText(ptrW(mir_utf8decodeW(content)));
+ CMStringW tszText(ptrW(mir_utf8decodeW(content)));
tszText.Replace(L"%", L"%%");
if (!isAction)
@@ -542,7 +542,7 @@ void CSkypeProto::AddChatContact(const wchar_t *tchat_id, const char *id, const return;
ptrW tnick(mir_a2u_cp(name, CP_UTF8));
- if (wchar_t *tmp = db_get_tsa(FindChatRoom(_T2A(tchat_id)), "UsersNicks", id))
+ if (wchar_t *tmp = db_get_wsa(FindChatRoom(_T2A(tchat_id)), "UsersNicks", id))
tnick = tmp;
ptrW tid(mir_a2u(id));
@@ -555,7 +555,7 @@ void CSkypeProto::AddChatContact(const wchar_t *tchat_id, const char *id, const gce.ptszUID = tid;
gce.time = !isChange ? time(NULL) : NULL;
gce.bIsMe = IsMe(id);
- gce.ptszStatus = TranslateTS(role);
+ gce.ptszStatus = TranslateW(role);
CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast<LPARAM>(&gce));
}
@@ -653,13 +653,13 @@ int CSkypeProto::OnGroupChatMenuHook(WPARAM, LPARAM lParam) return 0;
}
-CMString CSkypeProto::ChangeTopicForm()
+CMStringW CSkypeProto::ChangeTopicForm()
{
- CMString caption(FORMAT, L"[%s] %s", _A2T(m_szModuleName), TranslateT("Enter new chatroom topic"));
+ CMStringW caption(FORMAT, L"[%s] %s", _A2T(m_szModuleName), TranslateT("Enter new chatroom topic"));
ENTER_STRING pForm = { sizeof(pForm) };
pForm.type = ESF_MULTILINE;
pForm.caption = caption;
pForm.ptszInitVal = NULL;
pForm.szModuleName = m_szModuleName;
- return (!EnterString(&pForm)) ? CMString() : CMString(ptrW(pForm.ptszResult));
+ return (!EnterString(&pForm)) ? CMStringW() : CMStringW(ptrW(pForm.ptszResult));
}
\ No newline at end of file diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index bbe4765ca7..38bc23ecc5 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -46,7 +46,7 @@ void CSkypeProto::SetAllContactsStatus(WORD status) void CSkypeProto::SetChatStatus(MCONTACT hContact, int iStatus)
{
- ptrW tszChatID(getTStringA(hContact, "ChatRoomID"));
+ ptrW tszChatID(getWStringA(hContact, "ChatRoomID"));
if (tszChatID == NULL)
return;
GCDEST gcd = { m_szModuleName, tszChatID, GC_EVENT_CONTROL };
@@ -95,9 +95,9 @@ MCONTACT CSkypeProto::AddContact(const char *skypename, bool isTemporary) setString(hContact, SKYPE_SETTINGS_ID, skypename);
DBVARIANT dbv;
- if (!getTString(SKYPE_SETTINGS_GROUP, &dbv))
+ if (!getWString(SKYPE_SETTINGS_GROUP, &dbv))
{
- db_set_ts(hContact, "CList", "Group", dbv.ptszVal);
+ db_set_ws(hContact, "CList", "Group", dbv.ptszVal);
db_free(&dbv);
}
@@ -206,10 +206,10 @@ void CSkypeProto::LoadContactList(const NETLIBHTTPREQUEST *response) const JSONNode &phones = item["phones"];
std::string skypename = item["id"].as_string();
- CMString display_name = item["display_name"].as_mstring();
- CMString first_name = name["first"].as_mstring();
- CMString last_name = name["surname"].as_mstring();
- CMString avatar_url = item["avatar_url"].as_mstring();
+ CMStringW display_name = item["display_name"].as_mstring();
+ CMStringW first_name = name["first"].as_mstring();
+ CMStringW last_name = name["surname"].as_mstring();
+ CMStringW avatar_url = item["avatar_url"].as_mstring();
std::string type = item["type"].as_string();
if (type == "skype" || loadAll)
@@ -243,11 +243,11 @@ void CSkypeProto::LoadContactList(const NETLIBHTTPREQUEST *response) setString(hContact, "Type", type.c_str());
if (display_name)
- setTString(hContact, "Nick", display_name);
+ setWString(hContact, "Nick", display_name);
if (first_name)
- setTString(hContact, "FirstName", first_name);
+ setWString(hContact, "FirstName", first_name);
if (last_name)
- setTString(hContact, "LastName", last_name);
+ setWString(hContact, "LastName", last_name);
if (item["mood"])
{
@@ -263,15 +263,15 @@ void CSkypeProto::LoadContactList(const NETLIBHTTPREQUEST *response) if (!phone)
break;
- CMString number = phone["number"].as_mstring();
+ CMStringW number = phone["number"].as_mstring();
switch (phone["type"].as_int())
{
case 0:
- setTString(hContact, "Phone", number);
+ setWString(hContact, "Phone", number);
break;
case 2:
- setTString(hContact, "Cellular", number);
+ setWString(hContact, "Cellular", number);
break;
}
}
diff --git a/protocols/SkypeWeb/src/skype_events.cpp b/protocols/SkypeWeb/src/skype_events.cpp index 227661c944..cb9a8bf3bb 100644 --- a/protocols/SkypeWeb/src/skype_events.cpp +++ b/protocols/SkypeWeb/src/skype_events.cpp @@ -173,7 +173,7 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam) switch(pEvent->datatype)
{
- case DBVT_TCHAR:
+ case DBVT_WCHAR:
{
return (INT_PTR)mir_a2u(szText);
}
diff --git a/protocols/SkypeWeb/src/skype_menus.cpp b/protocols/SkypeWeb/src/skype_menus.cpp index 8ad180448e..c03a048f7d 100644 --- a/protocols/SkypeWeb/src/skype_menus.cpp +++ b/protocols/SkypeWeb/src/skype_menus.cpp @@ -61,7 +61,7 @@ void CSkypeProto::InitMenus() //hChooserMenu = Menu_AddObject("SkypeAccountChooser", LPGEN("Skype menu chooser"), 0, "Skype/MenuChoose");
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
// Request authorization
mi.pszService = MODULE"/RequestAuth";
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp index f4a42e2f2b..3ee550dd21 100644 --- a/protocols/SkypeWeb/src/skype_messages.cpp +++ b/protocols/SkypeWeb/src/skype_messages.cpp @@ -295,7 +295,7 @@ void CSkypeProto::ProcessContactRecv(MCONTACT hContact, time_t timestamp, const psr[nCount] = (PROTOSEARCHRESULT*)mir_calloc(sizeof(PROTOSEARCHRESULT));
psr[nCount]->cbSize = sizeof(psr);
- psr[nCount]->flags = PSR_TCHAR;
+ psr[nCount]->flags = PSR_UNICODE;
psr[nCount]->id.w = mir_wstrdup(tszContactId);
//psr[nCount]->nick.w = mir_wstrdup(tszContactName == NULL ? L"" : tszContactName);
nCount++;
diff --git a/protocols/SkypeWeb/src/skype_mslogin.cpp b/protocols/SkypeWeb/src/skype_mslogin.cpp index 976cf98d77..1986d2475f 100644 --- a/protocols/SkypeWeb/src/skype_mslogin.cpp +++ b/protocols/SkypeWeb/src/skype_mslogin.cpp @@ -174,13 +174,13 @@ void CSkypeProto::OnMSLoginEnd(const NETLIBHTTPREQUEST *response) OnLoginSuccess();
}
-CMString CSkypeProto::RunConfirmationCode()
+CMStringW CSkypeProto::RunConfirmationCode()
{
- CMString caption(FORMAT, L"[%s] %s", _A2T(m_szModuleName), TranslateT("Enter confirmation code"));
+ CMStringW caption(FORMAT, L"[%s] %s", _A2T(m_szModuleName), TranslateT("Enter confirmation code"));
ENTER_STRING pForm = { sizeof(pForm) };
pForm.type = ESF_PASSWORD;
pForm.caption = caption;
pForm.ptszInitVal = NULL;
pForm.szModuleName = m_szModuleName;
- return (!EnterString(&pForm)) ? CMString() : CMString(ptrW(pForm.ptszResult));
+ return (!EnterString(&pForm)) ? CMStringW() : CMStringW(ptrW(pForm.ptszResult));
}
\ No newline at end of file diff --git a/protocols/SkypeWeb/src/skype_network.cpp b/protocols/SkypeWeb/src/skype_network.cpp index 1442140613..51ddd963f8 100644 --- a/protocols/SkypeWeb/src/skype_network.cpp +++ b/protocols/SkypeWeb/src/skype_network.cpp @@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. void CSkypeProto::InitNetwork()
{
- CMString name(FORMAT, TranslateT("%s connection"), m_tszUserName);
+ CMStringW name(FORMAT, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
diff --git a/protocols/SkypeWeb/src/skype_options.cpp b/protocols/SkypeWeb/src/skype_options.cpp index dafd60ebf2..b6ce46f0c5 100644 --- a/protocols/SkypeWeb/src/skype_options.cpp +++ b/protocols/SkypeWeb/src/skype_options.cpp @@ -73,7 +73,7 @@ int CSkypeProto::OnOptionsInit(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { sizeof(odp) };
odp.hInstance = g_hInstance;
odp.pwszTitle = m_tszUserName;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.pwszGroup = LPGENW("Network");
odp.pwszTab = LPGENW("Account");
diff --git a/protocols/SkypeWeb/src/skype_popups.cpp b/protocols/SkypeWeb/src/skype_popups.cpp index 6cc8c44cd6..810491c807 100644 --- a/protocols/SkypeWeb/src/skype_popups.cpp +++ b/protocols/SkypeWeb/src/skype_popups.cpp @@ -9,7 +9,7 @@ void CSkypeProto::InitPopups() mir_snwprintf(desc, L"%s %s", m_tszUserName, TranslateT("Notifications"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Notification");
- ppc.ptszDescription = desc;
+ ppc.pwszDescription = desc;
ppc.pszName = name;
ppc.hIcon = GetIcon(IDI_NOTIFY);
ppc.colorBack = RGB(255, 255, 255);
@@ -19,7 +19,7 @@ void CSkypeProto::InitPopups() mir_snwprintf(desc, L"%s %s", m_tszUserName, TranslateT("Errors"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
- ppc.ptszDescription = desc;
+ ppc.pwszDescription = desc;
ppc.pszName = name;
ppc.hIcon = GetIcon(IDI_ERRORICON);
ppc.colorBack = RGB(255, 255, 255);
@@ -29,7 +29,7 @@ void CSkypeProto::InitPopups() mir_snwprintf(desc, L"%s %s", m_tszUserName, TranslateT("Calls"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Call");
- ppc.ptszDescription = desc;
+ ppc.pwszDescription = desc;
ppc.pszName = name;
ppc.hIcon = GetIcon(IDI_CALL);
ppc.colorBack = RGB(255, 255, 255);
diff --git a/protocols/SkypeWeb/src/skype_profile.cpp b/protocols/SkypeWeb/src/skype_profile.cpp index ac9b4d6a9b..832a8f60b7 100644 --- a/protocols/SkypeWeb/src/skype_profile.cpp +++ b/protocols/SkypeWeb/src/skype_profile.cpp @@ -245,40 +245,40 @@ void CSkypeProto::InitLanguages() void CSkypeProto::UpdateProfileFirstName(const JSONNode &root, MCONTACT hContact)
{
- CMString firstname = root["firstname"].as_mstring();
+ CMStringW firstname = root["firstname"].as_mstring();
if (!firstname.IsEmpty() && firstname != "null")
- setTString(hContact, "FirstName", firstname);
+ setWString(hContact, "FirstName", firstname);
else
delSetting(hContact, "FirstName");
}
void CSkypeProto::UpdateProfileLastName(const JSONNode &root, MCONTACT hContact)
{
- CMString lastname = root["lastname"].as_mstring();
+ CMStringW lastname = root["lastname"].as_mstring();
if (!lastname.IsEmpty() && lastname != "null")
- setTString(hContact, "LastName", lastname);
+ setWString(hContact, "LastName", lastname);
else
delSetting(hContact, "LastName");
}
void CSkypeProto::UpdateProfileDisplayName(const JSONNode &root, MCONTACT hContact)
{
- ptrW firstname(getTStringA(hContact, "FirstName"));
- ptrW lastname(getTStringA(hContact, "LastName"));
+ ptrW firstname(getWStringA(hContact, "FirstName"));
+ ptrW lastname(getWStringA(hContact, "LastName"));
if (firstname) {
- CMString nick(firstname);
+ CMStringW nick(firstname);
if (lastname)
nick.AppendFormat(L" %s", lastname);
- setTString(hContact, "Nick", nick);
+ setWString(hContact, "Nick", nick);
}
else if (lastname)
- setTString(hContact, "Nick", lastname);
+ setWString(hContact, "Nick", lastname);
else {
const JSONNode &node = root["displayname"];
- CMString displayname((!node) ? root["username"].as_mstring() : node.as_mstring());
+ CMStringW displayname((!node) ? root["username"].as_mstring() : node.as_mstring());
if (!displayname.IsEmpty() && displayname != "null")
- setTString(hContact, "Nick", displayname);
+ setWString(hContact, "Nick", displayname);
else
delSetting(hContact, "Nick");
}
@@ -286,7 +286,7 @@ void CSkypeProto::UpdateProfileDisplayName(const JSONNode &root, MCONTACT hConta void CSkypeProto::UpdateProfileGender(const JSONNode &root, MCONTACT hContact)
{
- CMString gender = root["gender"].as_mstring();
+ CMStringW gender = root["gender"].as_mstring();
if (!gender.IsEmpty() && gender != "null")
setByte(hContact, "Gender", (BYTE)(_wtoi(gender) == 1 ? 'M' : 'F'));
else
@@ -295,7 +295,7 @@ void CSkypeProto::UpdateProfileGender(const JSONNode &root, MCONTACT hContact) void CSkypeProto::UpdateProfileBirthday(const JSONNode &root, MCONTACT hContact)
{
- CMString birthday = root["birthday"].as_mstring();
+ CMStringW birthday = root["birthday"].as_mstring();
if (!birthday.IsEmpty() && birthday != "null")
{
int d, m, y;
@@ -325,45 +325,45 @@ void CSkypeProto::UpdateProfileCountry(const JSONNode &root, MCONTACT hContact) void CSkypeProto::UpdateProfileState(const JSONNode &root, MCONTACT hContact)
{
- CMString province = root["province"].as_mstring();
+ CMStringW province = root["province"].as_mstring();
if (!province.IsEmpty() && province != "null")
- setTString(hContact, "State", province);
+ setWString(hContact, "State", province);
else
delSetting(hContact, "State");
}
void CSkypeProto::UpdateProfileCity(const JSONNode &root, MCONTACT hContact)
{
- CMString city = root["city"].as_mstring();
+ CMStringW city = root["city"].as_mstring();
if (!city.IsEmpty() && city != "null")
- setTString(hContact, "City", city);
+ setWString(hContact, "City", city);
else
delSetting(hContact, "City");
}
void CSkypeProto::UpdateProfileLanguage(const JSONNode &root, MCONTACT hContact)
{
- CMString isocode = root["language"].as_mstring();
+ CMStringW isocode = root["language"].as_mstring();
if (!isocode.IsEmpty() && isocode != "null")
- setTString(hContact, "Language0", languages[isocode.GetBuffer()].c_str());
+ setWString(hContact, "Language0", languages[isocode.GetBuffer()].c_str());
else
delSetting(hContact, "Language0");
}
void CSkypeProto::UpdateProfileHomepage(const JSONNode &root, MCONTACT hContact)
{
- CMString homepage = root["homepage"].as_mstring();
+ CMStringW homepage = root["homepage"].as_mstring();
if (!homepage.IsEmpty() && homepage != "null")
- setTString(hContact, "Homepage", homepage);
+ setWString(hContact, "Homepage", homepage);
else
delSetting(hContact, "Homepage");
}
void CSkypeProto::UpdateProfileAbout(const JSONNode &root, MCONTACT hContact)
{
- CMString about = root["about"].as_mstring();
+ CMStringW about = root["about"].as_mstring();
if (!about.IsEmpty() && about != "null")
- setTString(hContact, "About", about);
+ setWString(hContact, "About", about);
else
delSetting(hContact, "About");
}
@@ -381,7 +381,7 @@ void CSkypeProto::UpdateProfileEmails(const JSONNode &root, MCONTACT hContact) break;
CMStringA name(FORMAT, "e-mail%d", i);
- setTString(hContact, name, item.as_mstring());
+ setWString(hContact, name, item.as_mstring());
}
}
else
@@ -394,43 +394,43 @@ void CSkypeProto::UpdateProfileEmails(const JSONNode &root, MCONTACT hContact) void CSkypeProto::UpdateProfilePhoneMobile(const JSONNode &root, MCONTACT hContact)
{
- CMString province = root["phoneMobile"].as_mstring();
+ CMStringW province = root["phoneMobile"].as_mstring();
if (!province.IsEmpty() && province != "null")
- setTString(hContact, "Cellular", province);
+ setWString(hContact, "Cellular", province);
else
delSetting(hContact, "Cellular");
}
void CSkypeProto::UpdateProfilePhoneHome(const JSONNode &root, MCONTACT hContact)
{
- CMString province = root["phone"].as_mstring();
+ CMStringW province = root["phone"].as_mstring();
if (!province.IsEmpty() && province != "null")
- setTString(hContact, "Phone", province);
+ setWString(hContact, "Phone", province);
else
delSetting(hContact, "Phone");
}
void CSkypeProto::UpdateProfilePhoneOffice(const JSONNode &root, MCONTACT hContact)
{
- CMString province = root["phoneOffice"].as_mstring();
+ CMStringW province = root["phoneOffice"].as_mstring();
if (!province.IsEmpty() && province != "null")
- setTString(hContact, "CompanyPhone", province);
+ setWString(hContact, "CompanyPhone", province);
else
delSetting(hContact, "CompanyPhone");
}
void CSkypeProto::UpdateProfileXStatusMessage(const JSONNode &root, MCONTACT hContact)
{
- CMString province = root["richMood"].as_mstring();
+ CMStringW province = root["richMood"].as_mstring();
if (!province.IsEmpty() && province != "null")
- setTString(hContact, "XStatusMsg", province);
+ setWString(hContact, "XStatusMsg", province);
else
delSetting(hContact, "XStatusMsg");
}
void CSkypeProto::UpdateProfileAvatar(const JSONNode &root, MCONTACT hContact)
{
- CMString province = root["avatarUrl"].as_mstring();
+ CMStringW province = root["avatarUrl"].as_mstring();
if (!province.IsEmpty() && province != "null")
{
SetAvatarUrl(hContact, province);
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index b496e4c2d7..1d5b85e89e 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -42,10 +42,10 @@ CSkypeProto::CSkypeProto(const char* protoName, const wchar_t* userName) : CreateProtoService("/IncomingCallCLE", &CSkypeProto::OnIncomingCallCLE);
CreateProtoService("/IncomingCallPP", &CSkypeProto::OnIncomingCallPP);
- m_tszAvatarFolder = std::wstring(VARST(L"%miranda_avatarcache%")) + L"\\" + m_tszUserName;
+ m_tszAvatarFolder = std::wstring(VARSW(L"%miranda_avatarcache%")) + L"\\" + m_tszUserName;
DWORD dwAttributes = GetFileAttributes(m_tszAvatarFolder.c_str());
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
- CreateDirectoryTreeT(m_tszAvatarFolder.c_str());
+ CreateDirectoryTreeW(m_tszAvatarFolder.c_str());
//sounds
SkinAddNewSoundEx("skype_inc_call", "SkypeWeb", LPGEN("Incoming call sound"));
@@ -131,7 +131,7 @@ HANDLE CSkypeProto::GetAwayMsg(MCONTACT hContact) if (JSONNode &mood = root["mood"])
{
- CMString str = mood.as_mstring();
+ CMStringW str = mood.as_mstring();
this->ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)str.c_str());
}
this->ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, 0);
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 37320a43d6..964bbc1ac5 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -280,7 +280,7 @@ private: void SetContactStatus(MCONTACT hContact, WORD status);
void SetAllContactsStatus(WORD status);
- void SetAvatarUrl(MCONTACT hContact, CMString &tszUrl);
+ void SetAvatarUrl(MCONTACT hContact, CMStringW &tszUrl);
void ReloadAvatarInfo(MCONTACT hContact);
void GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen);
@@ -408,8 +408,8 @@ private: //---/
time_t GetLastMessageTime(MCONTACT hContact);
- CMString RunConfirmationCode();
- CMString ChangeTopicForm();
+ CMStringW RunConfirmationCode();
+ CMStringW ChangeTopicForm();
void CloseDialogs();
//events
void InitDBEvents();
diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp index 0f9506ad6c..bc82399167 100644 --- a/protocols/SkypeWeb/src/skype_trouter.cpp +++ b/protocols/SkypeWeb/src/skype_trouter.cpp @@ -212,7 +212,7 @@ void CSkypeProto::OnTrouterEvent(const JSONNode &body, const JSONNode &) CMStringA service(FORMAT, "%s/IncomingCallCLE", GetContactProto(hContact));
cle.pszService = service.GetBuffer();
- CMString tooltip(FORMAT, TranslateT("Incoming call from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ CMStringW tooltip(FORMAT, TranslateT("Incoming call from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = tooltip.GetBuffer();
pcli->pfnAddEvent(&cle);
diff --git a/protocols/Steam/src/steam_avatars.cpp b/protocols/Steam/src/steam_avatars.cpp index 0ebd7d1c8b..2faa102476 100644 --- a/protocols/Steam/src/steam_avatars.cpp +++ b/protocols/Steam/src/steam_avatars.cpp @@ -3,11 +3,11 @@ wchar_t* CSteamProto::GetAvatarFilePath(MCONTACT hContact)
{
wchar_t path[MAX_PATH];
- mir_snwprintf(path, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
+ mir_snwprintf(path, L"%s\\%S", VARSW(L"%miranda_avatarcache%"), m_szModuleName);
DWORD dwAttributes = GetFileAttributes(path);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
- CreateDirectoryTreeT(path);
+ CreateDirectoryTreeW(path);
ptrA steamId(getStringA(hContact, "SteamID"));
if (steamId != NULL)
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 1477b2d19f..a6a8c0668e 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -14,7 +14,7 @@ void CSteamProto::SetContactStatus(MCONTACT hContact, WORD status) { // Contact is looking to play, save it to as status message if (hContact) - db_set_ts(hContact, "CList", "StatusMsg", TranslateT("Looking to play")); + db_set_ws(hContact, "CList", "StatusMsg", TranslateT("Looking to play")); } break; @@ -22,7 +22,7 @@ void CSteamProto::SetContactStatus(MCONTACT hContact, WORD status) { // Contact is looking to trade, save it to as status message if (hContact) - db_set_ts(hContact, "CList", "StatusMsg", TranslateT("Looking to trade")); + db_set_ws(hContact, "CList", "StatusMsg", TranslateT("Looking to trade")); } break; @@ -98,7 +98,7 @@ void CSteamProto::UpdateContact(MCONTACT hContact, JSONNode *data) { // set common data JSONNode *node = json_get(data, "personaname"); - setTString(hContact, "Nick", ptrW(json_as_string(node))); + setWString(hContact, "Nick", ptrW(json_as_string(node))); node = json_get(data, "profileurl"); setString(hContact, "Homepage", _T2A(ptrW(json_as_string(node)))); @@ -116,12 +116,12 @@ void CSteamProto::UpdateContact(MCONTACT hContact, JSONNode *data) size_t pos = realname.find(L' ', 1); if (pos != std::wstring::npos) { - setTString(hContact, "FirstName", realname.substr(0, pos).c_str()); - setTString(hContact, "LastName", realname.substr(pos + 1).c_str()); + setWString(hContact, "FirstName", realname.substr(0, pos).c_str()); + setWString(hContact, "LastName", realname.substr(pos + 1).c_str()); } else { - setTString(hContact, "FirstName", realname.c_str()); + setWString(hContact, "FirstName", realname.c_str()); delSetting(hContact, "LastName"); } } @@ -186,23 +186,23 @@ void CSteamProto::UpdateContact(MCONTACT hContact, JSONNode *data) // nothing special, either standard client or in different status (only online, I want to play, I want to trade statuses support this flags) WORD status = getWord(hContact, "Status", ID_STATUS_OFFLINE); if (status == ID_STATUS_ONLINE || status == ID_STATUS_OUTTOLUNCH || status == ID_STATUS_FREECHAT) - setTString(hContact, "MirVer", L"Steam"); + setWString(hContact, "MirVer", L"Steam"); } else if (stateflags & 2) { // game - setTString(hContact, "MirVer", L"Steam (in game)"); + setWString(hContact, "MirVer", L"Steam (in game)"); } else if (stateflags & 256) { // on website - setTString(hContact, "MirVer", L"Steam (website)"); + setWString(hContact, "MirVer", L"Steam (website)"); } else if (stateflags & 512) { // on mobile - setTString(hContact, "MirVer", L"Steam (mobile)"); + setWString(hContact, "MirVer", L"Steam (mobile)"); } else if (stateflags & 1024) { // big picture mode - setTString(hContact, "MirVer", L"Steam (Big Picture)"); + setWString(hContact, "MirVer", L"Steam (Big Picture)"); } else { // none/unknown (e.g. when contact is offline) @@ -228,15 +228,15 @@ void CSteamProto::UpdateContact(MCONTACT hContact, JSONNode *data) setString(hContact, "ServerIP", _T2A(serverIP)); setString(hContact, "ServerID", _T2A(serverID)); - CMString message(gameInfo); + CMStringW message(gameInfo); if (!gameId) message.Append(TranslateT(" (Non-Steam)")); if (serverIP[0] != '\0') message.AppendFormat(TranslateT(" on server %s"), serverIP); setDword(hContact, "XStatusId", gameId); - setTString(hContact, "XStatusName", TranslateT("Playing")); - setTString(hContact, "XStatusMsg", message); + setWString(hContact, "XStatusName", TranslateT("Playing")); + setWString(hContact, "XStatusMsg", message); SetContactExtraIcon(hContact, gameId); } @@ -264,7 +264,7 @@ void CSteamProto::ContactIsRemoved(MCONTACT hContact) setDword(hContact, "DeletedTS", ::time(NULL)); SetContactStatus(hContact, ID_STATUS_OFFLINE); - ptrW nick(getTStringA(hContact, "Nick")); + ptrW nick(getWStringA(hContact, "Nick")); wchar_t message[MAX_PATH]; mir_snwprintf(message, MAX_PATH, TranslateT("%s has been removed from your contact list"), nick); @@ -282,7 +282,7 @@ void CSteamProto::ContactIsFriend(MCONTACT hContact) delSetting(hContact, "DeletedTS"); delSetting(hContact, "Grant"); - ptrW nick(getTStringA(hContact, "Nick")); + ptrW nick(getWStringA(hContact, "Nick")); wchar_t message[MAX_PATH]; mir_snwprintf(message, MAX_PATH, TranslateT("%s is back in your contact list"), nick); @@ -374,10 +374,10 @@ MCONTACT CSteamProto::AddContact(const char *steamId, bool isTemporary) // move to default group DBVARIANT dbv; - if (!getTString("DefaultGroup", &dbv)) + if (!getWString("DefaultGroup", &dbv)) { if(Clist_GroupExists(dbv.ptszVal)) - db_set_ts(hContact, "CList", "Group", dbv.ptszVal); + db_set_ws(hContact, "CList", "Group", dbv.ptszVal); db_free(&dbv); } } @@ -760,7 +760,7 @@ void CSteamProto::OnSearchResults(const HttpResponse *response, void *arg) STEAM_SEARCH_RESULT ssr = { 0 }; ssr.hdr.cbSize = sizeof(STEAM_SEARCH_RESULT); - ssr.hdr.flags = PSR_TCHAR; + ssr.hdr.flags = PSR_UNICODE; node = json_get(child, "steamid"); ssr.hdr.id.w = mir_wstrdup(ptrW(json_as_string(node))); diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp index a51193f9cf..c3099c67c6 100644 --- a/protocols/Steam/src/steam_dialogs.cpp +++ b/protocols/Steam/src/steam_dialogs.cpp @@ -24,7 +24,7 @@ void CSteamPasswordEditor::OnOk(CCtrlButton*) mir_free(m_proto->password);
m_proto->password = m_password.GetText();
if (m_savePermanently.Enabled())
- m_proto->setTString("Password", m_proto->password);
+ m_proto->setWString("Password", m_proto->password);
EndDialog(m_hwnd, DIALOG_RESULT_OK);
}
diff --git a/protocols/Steam/src/steam_events.cpp b/protocols/Steam/src/steam_events.cpp index 9caa7091b9..0303a9a08a 100644 --- a/protocols/Steam/src/steam_events.cpp +++ b/protocols/Steam/src/steam_events.cpp @@ -35,7 +35,7 @@ int CSteamProto::OnOptionsInit(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 }; odp.hInstance = g_hInstance; odp.pwszTitle = m_tszUserName; - odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; + odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.pwszGroup = LPGENW("Network"); odp.pwszTab = LPGENW("Account"); diff --git a/protocols/Steam/src/steam_login.cpp b/protocols/Steam/src/steam_login.cpp index 8bf65f6f30..f399eb0195 100644 --- a/protocols/Steam/src/steam_login.cpp +++ b/protocols/Steam/src/steam_login.cpp @@ -92,7 +92,7 @@ void CSteamProto::OnGotRsaKey(const HttpResponse *response) mir_free(encryptedPassword); // run authorization request - T2Utf username(getTStringA("Username")); + T2Utf username(getWStringA("Username")); ptrA twoFactorCode(getStringA("TwoFactorCode")); if (!twoFactorCode) twoFactorCode = mir_strdup(""); @@ -159,7 +159,7 @@ void CSteamProto::OnAuthorizationError(const JSONNode &node) return; } - T2Utf username(getTStringA("Username")); + T2Utf username(getWStringA("Username")); if (node["requires_twofactor"].as_bool()) { diff --git a/protocols/Steam/src/steam_menus.cpp b/protocols/Steam/src/steam_menus.cpp index c6252dc81b..9a4430882d 100644 --- a/protocols/Steam/src/steam_menus.cpp +++ b/protocols/Steam/src/steam_menus.cpp @@ -97,7 +97,7 @@ int CSteamProto::PrebuildContactMenu(WPARAM wParam, LPARAM lParam) void CSteamProto::OnInitStatusMenu()
{
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.root = Menu_GetProtocolRoot(this);
// Show block list
@@ -115,7 +115,7 @@ void CSteamProto::InitMenus() //////////////////////////////////////////////////////////////////////////////////////
// Contact menu initialization
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
// "Request authorization"
SET_UID(mi, 0x36375a1f, 0xc142, 0x4d6e, 0xa6, 0x57, 0xe4, 0x76, 0x5d, 0xbc, 0x59, 0x8e);
diff --git a/protocols/Steam/src/steam_messages.cpp b/protocols/Steam/src/steam_messages.cpp index d399f7ff47..e5f6665a6f 100644 --- a/protocols/Steam/src/steam_messages.cpp +++ b/protocols/Steam/src/steam_messages.cpp @@ -39,7 +39,7 @@ void CSteamProto::OnMessageSent(const HttpResponse *response, void *arg) SendMessageParam *param = (SendMessageParam*)arg;
ptrW error(mir_wstrdup(TranslateT("Unknown error")));
- ptrW steamId(getTStringA(param->hContact, "SteamID"));
+ ptrW steamId(getWStringA(param->hContact, "SteamID"));
time_t timestamp = NULL;
if (ResponseHttpOk(response))
diff --git a/protocols/Steam/src/steam_polling.cpp b/protocols/Steam/src/steam_polling.cpp index 6774bb60ab..eb5db69c3c 100644 --- a/protocols/Steam/src/steam_polling.cpp +++ b/protocols/Steam/src/steam_polling.cpp @@ -61,14 +61,14 @@ void CSteamProto::ParsePollData(JSONNode *data) if (IsMe(steamId)) { node = json_get(item, "persona_name"); - setTString("Nick", ptrW(json_as_string(node))); + setWString("Nick", ptrW(json_as_string(node))); if (status == -1 || status == ID_STATUS_OFFLINE) continue; if (status != m_iStatus) { - debugLog(L"CSteamProto::ParsePollData: Change own status to %i", status); + debugLogW(L"CSteamProto::ParsePollData: Change own status to %i", status); int oldStatus = m_iStatus; m_iStatus = m_iDesiredStatus = status; ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus); @@ -85,7 +85,7 @@ void CSteamProto::ParsePollData(JSONNode *data) SetContactStatus(hContact, status); node = json_get(item, "persona_name"); - setTString(hContact, "Nick", ptrW(json_as_string(node))); + setWString(hContact, "Nick", ptrW(json_as_string(node))); // todo: find difference between state changing and info changing steamIds.append(steamId).append(","); @@ -185,7 +185,7 @@ void CSteamProto::ParsePollData(JSONNode *data) void CSteamProto::PollingThread(void*) { - debugLog(L"CSteamProto::PollingThread: entering"); + debugLogW(L"CSteamProto::PollingThread: entering"); ptrA token(getStringA("TokenSecret")); ptrA umqId(getStringA("UMQID")); @@ -251,7 +251,7 @@ void CSteamProto::PollingThread(void*) else if (!lstrcmpi(error, L"Not Logged On")) // 'else' below will handle this error, we don't need this particular check right now { // need to relogin - debugLog(L"CSteamProto::PollingThread: Not Logged On"); + debugLogW(L"CSteamProto::PollingThread: Not Logged On"); // try to reconnect only when we're actually online (during normal logout we will still got this error anyway, but in that case our status is already offline) if (IsOnline() && Relogin()) @@ -269,7 +269,7 @@ void CSteamProto::PollingThread(void*) else { // something wrong - debugLog(L"CSteamProto::PollingThread: %s (%d)", error, response->resultCode); + debugLogW(L"CSteamProto::PollingThread: %s (%d)", error, response->resultCode); // token has expired if (response->resultCode == HTTP_CODE_UNAUTHORIZED) @@ -279,7 +279,7 @@ void CSteamProto::PollingThread(void*) node = json_get(root, "sectimeout"); int timeout = json_as_int(node); if (timeout < STEAM_API_TIMEOUT) - debugLog(L"CSteamProto::PollingThread: Timeout is too low (%d)", timeout); + debugLogW(L"CSteamProto::PollingThread: Timeout is too low (%d)", timeout); // let it jump out of further processing errors = errorsLimit; @@ -295,10 +295,10 @@ void CSteamProto::PollingThread(void*) if (IsOnline()) { - debugLog(L"CSteamProto::PollingThread: unexpected termination; switching protocol to offline"); + debugLogW(L"CSteamProto::PollingThread: unexpected termination; switching protocol to offline"); SetStatus(ID_STATUS_OFFLINE); } m_hPollingThread = NULL; - debugLog(L"CSteamProto::PollingThread: leaving"); + debugLogW(L"CSteamProto::PollingThread: leaving"); }
\ No newline at end of file diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 964225abcc..107c086f08 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -24,7 +24,7 @@ CSteamProto::CSteamProto(const char* protoName, const wchar_t* userName) mir_snprintf(settingName, "%s_%s", MODULE, "main"); SKINICONDESC sid = { 0 }; - sid.flags = SIDF_ALL_TCHAR; + sid.flags = SIDF_ALL_UNICODE; sid.defaultFile.w = filePath; sid.pszName = settingName; sid.section.w = sectionName; @@ -69,7 +69,7 @@ CSteamProto::CSteamProto(const char* protoName, const wchar_t* userName) mir_snwprintf(name, TranslateT("%s connection"), m_tszUserName); NETLIBUSER nlu = { sizeof(nlu) }; - nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR; + nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE; nlu.ptszDescriptiveName = name; nlu.szSettingsModule = m_szModuleName; m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu); @@ -296,7 +296,7 @@ int CSteamProto::SetStatus(int new_status) if (new_status == m_iDesiredStatus) return 0; - debugLog(L"CSteamProto::SetStatus: changing status from %i to %i", m_iStatus, new_status); + debugLogW(L"CSteamProto::SetStatus: changing status from %i to %i", m_iStatus, new_status); int old_status = m_iStatus; m_iDesiredStatus = new_status; @@ -338,7 +338,7 @@ int CSteamProto::SetStatus(int new_status) } else { - ptrA username(mir_urlEncode(ptrA(mir_utf8encodeW(getTStringA("Username"))))); + ptrA username(mir_urlEncode(ptrA(mir_utf8encodeW(getWStringA("Username"))))); if (username == NULL || username[0] == '\0') { m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE; @@ -366,13 +366,13 @@ void __cdecl CSteamProto::GetAwayMsgThread(void *arg) Sleep(50); MCONTACT hContact = (UINT_PTR)arg; - CMString message(db_get_tsa(hContact, "CList", "StatusMsg")); + CMStringW message(db_get_wsa(hContact, "CList", "StatusMsg")); // if contact has no status message, get xstatus message if (message.IsEmpty()) { - ptrW xStatusName(getTStringA(hContact, "XStatusName")); - ptrW xStatusMsg(getTStringA(hContact, "XStatusMsg")); + ptrW xStatusName(getWStringA(hContact, "XStatusName")); + ptrW xStatusMsg(getWStringA(hContact, "XStatusMsg")); if (xStatusName) message.AppendFormat(L"%s: %s", xStatusName, xStatusMsg); diff --git a/protocols/Steam/src/steam_xstatus.cpp b/protocols/Steam/src/steam_xstatus.cpp index 8f8cdd015c..ea8796448a 100644 --- a/protocols/Steam/src/steam_xstatus.cpp +++ b/protocols/Steam/src/steam_xstatus.cpp @@ -48,7 +48,7 @@ INT_PTR CSteamProto::OnGetXStatusEx(WPARAM wParam, LPARAM lParam) if (pData->flags & CSSF_DEFAULT_NAME) title = mir_wstrdup(TranslateT("Playing")); else - title = getTStringA(hContact, "XStatusName"); + title = getWStringA(hContact, "XStatusName"); if (pData->flags & CSSF_UNICODE) mir_wstrncpy(pData->ptszName, title, STATUS_TITLE_MAX); @@ -58,7 +58,7 @@ INT_PTR CSteamProto::OnGetXStatusEx(WPARAM wParam, LPARAM lParam) // fill status message member if (pData->flags & CSSF_MASK_MESSAGE) { - ptrW message(getTStringA(hContact, "XStatusMsg")); + ptrW message(getWStringA(hContact, "XStatusMsg")); if (pData->flags & CSSF_UNICODE) mir_wstrncpy(pData->ptszMessage, message, STATUS_DESC_MAX); diff --git a/protocols/Tlen/src/tlen_advsearch.cpp b/protocols/Tlen/src/tlen_advsearch.cpp index b140736096..62ee5cde41 100644 --- a/protocols/Tlen/src/tlen_advsearch.cpp +++ b/protocols/Tlen/src/tlen_advsearch.cpp @@ -34,7 +34,7 @@ static void InitComboBox(HWND hwndCombo, TLEN_FIELD_MAP *fieldMap) for (i=0;;i++) {
if (fieldMap[i].name == NULL)
break;
- n = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) TranslateTS(fieldMap[i].name));
+ n = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) TranslateW(fieldMap[i].name));
SendMessage(hwndCombo, CB_SETITEMDATA, n, fieldMap[i].id);
}
}
diff --git a/protocols/Tlen/src/tlen_avatar.cpp b/protocols/Tlen/src/tlen_avatar.cpp index 83bd751010..f82d450634 100644 --- a/protocols/Tlen/src/tlen_avatar.cpp +++ b/protocols/Tlen/src/tlen_avatar.cpp @@ -33,13 +33,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void TlenGetAvatarFileName(TlenProtocol *proto, TLEN_LIST_ITEM *item, wchar_t* ptszDest, int cbLen) { - int tPathLen = mir_snwprintf(ptszDest, cbLen, TEXT("%s\\%S"), VARST(TEXT("%miranda_avatarcache%")), proto->m_szModuleName); + int tPathLen = mir_snwprintf(ptszDest, cbLen, TEXT("%s\\%S"), VARSW(TEXT("%miranda_avatarcache%")), proto->m_szModuleName); if (_waccess(ptszDest, 0)) { - int ret = CreateDirectoryTreeT(ptszDest); + int ret = CreateDirectoryTreeW(ptszDest); if (ret == 0) - proto->debugLog(L"getAvatarFilename(): Created new directory for avatar cache: %s.", ptszDest); + proto->debugLogW(L"getAvatarFilename(): Created new directory for avatar cache: %s.", ptszDest); else { - proto->debugLog(L"getAvatarFilename(): Can not create directory for avatar cache: %s. errno=%d: %s", ptszDest, errno, strerror(errno)); + proto->debugLogW(L"getAvatarFilename(): Can not create directory for avatar cache: %s. errno=%d: %s", ptszDest, errno, strerror(errno)); wchar_t buffer[512]; mir_snwprintf(buffer, TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, _wcserror(errno), ptszDest); PUShowMessageT(buffer, SM_WARNING); @@ -108,7 +108,7 @@ static void SetAvatar(TlenProtocol *proto, MCONTACT hContact, TLEN_LIST_ITEM *it if (out != NULL) { fwrite(data, len, 1, out); fclose(out); - db_set_ts(hContact, "ContactPhoto", "File", filename); + db_set_ws(hContact, "ContactPhoto", "File", filename); db_set_s(hContact, proto->m_szModuleName, "AvatarHash", md5); db_set_dw(hContact, proto->m_szModuleName, "AvatarFormat", format); } @@ -116,7 +116,7 @@ static void SetAvatar(TlenProtocol *proto, MCONTACT hContact, TLEN_LIST_ITEM *it wchar_t buffer[128]; mir_snwprintf(buffer, TranslateT("Cannot save new avatar file \"%s\" Error:\n\t%s (Error: %d)"), filename, _wcserror(errno), errno); PUShowMessageT(buffer, SM_WARNING); - proto->debugLog(buffer); + proto->debugLogW(buffer); return; } ProtoBroadcastAck(proto->m_szModuleName, hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0); diff --git a/protocols/Tlen/src/tlen_file.cpp b/protocols/Tlen/src/tlen_file.cpp index dadf79e4b3..11a269f377 100644 --- a/protocols/Tlen/src/tlen_file.cpp +++ b/protocols/Tlen/src/tlen_file.cpp @@ -585,7 +585,7 @@ void TlenProcessF(XmlNode *node, ThreadData *info) if (szFilename[0] != '\0' && ft->iqId != NULL) {
wchar_t* filenameT = mir_utf8decodeW((char*)szFilename);
PROTORECVFILET pre = { 0 };
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(NULL);
pre.descr.w = filenameT;
diff --git a/protocols/Tlen/src/tlen_iqid.cpp b/protocols/Tlen/src/tlen_iqid.cpp index 50d77a3c3b..4089af4a85 100644 --- a/protocols/Tlen/src/tlen_iqid.cpp +++ b/protocols/Tlen/src/tlen_iqid.cpp @@ -417,7 +417,7 @@ void TlenIqResultSearch(TlenProtocol *proto, XmlNode *iqNode) if ((queryNode = TlenXmlGetChild(iqNode, "query")) == NULL) return;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
jsr.hdr.cbSize = sizeof(TLEN_SEARCH_RESULT);
- jsr.hdr.flags = PSR_TCHAR;
+ jsr.hdr.flags = PSR_UNICODE;
for (i = 0; i < queryNode->numChild; i++) {
itemNode = queryNode->child[i];
if (!mir_strcmp(itemNode->name, "item")) {
diff --git a/protocols/Tlen/src/tlen_opt.cpp b/protocols/Tlen/src/tlen_opt.cpp index 2a855116dd..c5ac79b364 100644 --- a/protocols/Tlen/src/tlen_opt.cpp +++ b/protocols/Tlen/src/tlen_opt.cpp @@ -88,7 +88,7 @@ int TlenProtocol::OptionsInit(WPARAM wParam, LPARAM) odp.hInstance = hInst; odp.pwszGroup = LPGENW("Network"); odp.pwszTitle = m_tszUserName; - odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; + odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.dwInitParam = (LPARAM)this; for (int i = 0; i < _countof(tabPages); i++) { odp.pszTemplate = MAKEINTRESOURCEA(tabPages[i].dlgId); @@ -122,7 +122,7 @@ INT_PTR CALLBACK TlenAccMgrUIDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR proto = (TlenProtocol *)lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)proto); TranslateDialogDefault(hwndDlg); - if (!db_get_ts(NULL, proto->m_szModuleName, "LoginName", &dbv)) { + if (!db_get_ws(NULL, proto->m_szModuleName, "LoginName", &dbv)) { SetDlgItemText(hwndDlg, IDC_EDIT_USERNAME, dbv.ptszVal); db_free(&dbv); } @@ -208,7 +208,7 @@ static INT_PTR CALLBACK TlenBasicOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara proto = (TlenProtocol *)lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)proto); TranslateDialogDefault(hwndDlg); - if (!db_get_ts(NULL, proto->m_szModuleName, "LoginName", &dbv)) { + if (!db_get_ws(NULL, proto->m_szModuleName, "LoginName", &dbv)) { SetDlgItemText(hwndDlg, IDC_EDIT_USERNAME, dbv.ptszVal); db_free(&dbv); } @@ -412,7 +412,7 @@ static INT_PTR CALLBACK TlenAdvOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, proto = (TlenProtocol *)lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)proto); TranslateDialogDefault(hwndDlg); - if (!db_get_ts(NULL, proto->m_szModuleName, "LoginServer", &dbv)) { + if (!db_get_ws(NULL, proto->m_szModuleName, "LoginServer", &dbv)) { SetDlgItemText(hwndDlg, IDC_EDIT_LOGIN_SERVER, dbv.ptszVal); db_free(&dbv); } @@ -421,7 +421,7 @@ static INT_PTR CALLBACK TlenAdvOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, EnableWindow(GetDlgItem(hwndDlg, IDC_HOST), TRUE); EnableWindow(GetDlgItem(hwndDlg, IDC_HOSTPORT), TRUE); - if (!db_get_ts(NULL, proto->m_szModuleName, "ManualHost", &dbv)) { + if (!db_get_ws(NULL, proto->m_szModuleName, "ManualHost", &dbv)) { SetDlgItemText(hwndDlg, IDC_HOST, dbv.ptszVal); db_free(&dbv); } @@ -461,12 +461,12 @@ static INT_PTR CALLBACK TlenAdvOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, SendDlgItemMessage(hwndDlg, IDC_FILE_PROXY_TYPE, CB_ADDSTRING, 0, (LPARAM)L"SOCKS4"); SendDlgItemMessage(hwndDlg, IDC_FILE_PROXY_TYPE, CB_ADDSTRING, 0, (LPARAM)L"SOCKS5"); SendDlgItemMessage(hwndDlg, IDC_FILE_PROXY_TYPE, CB_SETCURSEL, db_get_w(NULL, proto->m_szModuleName, "FileProxyType", 0), 0); - if (!db_get_ts(NULL, proto->m_szModuleName, "FileProxyHost", &dbv)) { + if (!db_get_ws(NULL, proto->m_szModuleName, "FileProxyHost", &dbv)) { SetDlgItemText(hwndDlg, IDC_FILE_PROXY_HOST, dbv.ptszVal); db_free(&dbv); } SetDlgItemInt(hwndDlg, IDC_FILE_PROXY_PORT, db_get_w(NULL, proto->m_szModuleName, "FileProxyPort", 0), FALSE); - if (!db_get_ts(NULL, proto->m_szModuleName, "FileProxyUsername", &dbv)) { + if (!db_get_ws(NULL, proto->m_szModuleName, "FileProxyUsername", &dbv)) { SetDlgItemText(hwndDlg, IDC_FILE_PROXY_USER, dbv.ptszVal); db_free(&dbv); } diff --git a/protocols/Tlen/src/tlen_p2p_new.cpp b/protocols/Tlen/src/tlen_p2p_new.cpp index d091aaa825..43615e4316 100644 --- a/protocols/Tlen/src/tlen_p2p_new.cpp +++ b/protocols/Tlen/src/tlen_p2p_new.cpp @@ -262,7 +262,7 @@ void __cdecl TlenProcessP2P(XmlNode *node, ThreadData *info) { mir_snprintf(fileInfo, "%s file(s), %s bytes", c, s);
wchar_t* filenameT = mir_utf8decodeW((char*)fileInfo);
PROTORECVFILET pre = { 0 };
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(NULL);
pre.descr.w = filenameT;
diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp index ee3759740c..dcc6395496 100644 --- a/protocols/Tlen/src/tlen_svc.cpp +++ b/protocols/Tlen/src/tlen_svc.cpp @@ -578,7 +578,7 @@ static void __cdecl TlenGetAwayMsgThread(void *ptr) ptrA ownJid(db_get_sa(NULL, data->proto->m_szModuleName, "jid"));
if (!mir_strcmp(ownJid, dbv.pszVal)) {
DBVARIANT dbv2;
- if (!db_get_s(data->hContact, "CList", "StatusMsg", &dbv2, DBVT_TCHAR)) {
+ if (!db_get_s(data->hContact, "CList", "StatusMsg", &dbv2, DBVT_WCHAR)) {
data->proto->ProtoBroadcastAck(data->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv2.ptszVal);
db_free(&dbv2);
}
diff --git a/protocols/Tlen/src/tlen_userinfo.cpp b/protocols/Tlen/src/tlen_userinfo.cpp index c361120161..0742ccdf38 100644 --- a/protocols/Tlen/src/tlen_userinfo.cpp +++ b/protocols/Tlen/src/tlen_userinfo.cpp @@ -87,7 +87,7 @@ static void InitComboBox(HWND hwndCombo, TLEN_FIELD_MAP *fieldMap) for (i=0;;i++) {
if (fieldMap[i].name == NULL)
break;
- n = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) TranslateTS(fieldMap[i].name));
+ n = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) TranslateW(fieldMap[i].name));
SendMessage(hwndCombo, CB_SETITEMDATA, n, fieldMap[i].id);
}
}
@@ -135,7 +135,7 @@ int TlenProtocol::UserInfoInit(WPARAM wParam, LPARAM lParam) if ((szProto != NULL && !mir_strcmp(szProto, m_szModuleName)) || !lParam) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.flags = ODPF_TCHAR;
+ odp.flags = ODPF_UNICODE;
odp.pfnDlgProc = TlenUserInfoDlgProc;
odp.position = -2000000000;
odp.pszTemplate = ((HANDLE)lParam != NULL) ? MAKEINTRESOURCEA(IDD_USER_INFO):MAKEINTRESOURCEA(IDD_USER_VCARD);
@@ -184,19 +184,19 @@ static INT_PTR CALLBACK TlenUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara SetDlgItemText(hwndDlg, IDC_SUBSCRIPTION, L"");
SetFocus(GetDlgItem(hwndDlg, IDC_STATIC));
- if (!db_get_ts(data->hContact, data->proto->m_szModuleName, "FirstName", &dbv)) {
+ if (!db_get_ws(data->hContact, data->proto->m_szModuleName, "FirstName", &dbv)) {
SetDlgItemText(hwndDlg, IDC_FIRSTNAME, dbv.ptszVal);
db_free(&dbv);
} else SetDlgItemText(hwndDlg, IDC_FIRSTNAME, L"");
- if (!db_get_ts(data->hContact, data->proto->m_szModuleName, "LastName", &dbv)) {
+ if (!db_get_ws(data->hContact, data->proto->m_szModuleName, "LastName", &dbv)) {
SetDlgItemText(hwndDlg, IDC_LASTNAME, dbv.ptszVal);
db_free(&dbv);
} else SetDlgItemText(hwndDlg, IDC_LASTNAME, L"");
- if (!db_get_ts(data->hContact, data->proto->m_szModuleName, "Nick", &dbv)) {
+ if (!db_get_ws(data->hContact, data->proto->m_szModuleName, "Nick", &dbv)) {
SetDlgItemText(hwndDlg, IDC_NICKNAME, dbv.ptszVal);
db_free(&dbv);
} else SetDlgItemText(hwndDlg, IDC_NICKNAME, L"");
- if (!db_get_ts(data->hContact, data->proto->m_szModuleName, "e-mail", &dbv)) {
+ if (!db_get_ws(data->hContact, data->proto->m_szModuleName, "e-mail", &dbv)) {
SetDlgItemText(hwndDlg, IDC_EMAIL, dbv.ptszVal);
db_free(&dbv);
} else SetDlgItemText(hwndDlg, IDC_EMAIL, L"");
@@ -204,22 +204,22 @@ static INT_PTR CALLBACK TlenUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara SetDlgItemInt(hwndDlg, IDC_AGE, dbv.wVal, FALSE);
db_free(&dbv);
} else SetDlgItemText(hwndDlg, IDC_AGE, L"");
- if (!db_get_ts(data->hContact, data->proto->m_szModuleName, "City", &dbv)) {
+ if (!db_get_ws(data->hContact, data->proto->m_szModuleName, "City", &dbv)) {
SetDlgItemText(hwndDlg, IDC_CITY, dbv.ptszVal);
db_free(&dbv);
} else SetDlgItemText(hwndDlg, IDC_CITY, L"");
- if (!db_get_ts(data->hContact, data->proto->m_szModuleName, "School", &dbv)) {
+ if (!db_get_ws(data->hContact, data->proto->m_szModuleName, "School", &dbv)) {
SetDlgItemText(hwndDlg, IDC_SCHOOL, dbv.ptszVal);
db_free(&dbv);
} else SetDlgItemText(hwndDlg, IDC_SCHOOL, L"");
switch (db_get_b(data->hContact, data->proto->m_szModuleName, "Gender", '?')) {
case 'M':
SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_SETCURSEL, 1, 0);
- SetDlgItemText(hwndDlg, IDC_GENDER_TEXT, TranslateTS(tlenFieldGender[0].name));
+ SetDlgItemText(hwndDlg, IDC_GENDER_TEXT, TranslateW(tlenFieldGender[0].name));
break;
case 'F':
SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_SETCURSEL, 2, 0);
- SetDlgItemText(hwndDlg, IDC_GENDER_TEXT, TranslateTS(tlenFieldGender[1].name));
+ SetDlgItemText(hwndDlg, IDC_GENDER_TEXT, TranslateW(tlenFieldGender[1].name));
break;
default:
SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_SETCURSEL, 0, 0);
@@ -228,7 +228,7 @@ static INT_PTR CALLBACK TlenUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara }
i = db_get_w(data->hContact, data->proto->m_szModuleName, "Occupation", 0);
if (i>0 && i<13) {
- SetDlgItemText(hwndDlg, IDC_OCCUPATION_TEXT, TranslateTS(tlenFieldOccupation[i-1].name));
+ SetDlgItemText(hwndDlg, IDC_OCCUPATION_TEXT, TranslateW(tlenFieldOccupation[i-1].name));
SendDlgItemMessage(hwndDlg, IDC_OCCUPATION, CB_SETCURSEL, i, 0);
} else {
SetDlgItemText(hwndDlg, IDC_OCCUPATION_TEXT, L"");
@@ -236,7 +236,7 @@ static INT_PTR CALLBACK TlenUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara }
i = db_get_w(data->hContact, data->proto->m_szModuleName, "LookingFor", 0);
if (i>0 && i<6) {
- SetDlgItemText(hwndDlg, IDC_LOOKFOR_TEXT, TranslateTS(tlenFieldLookfor[i-1].name));
+ SetDlgItemText(hwndDlg, IDC_LOOKFOR_TEXT, TranslateW(tlenFieldLookfor[i-1].name));
SendDlgItemMessage(hwndDlg, IDC_LOOKFOR, CB_SETCURSEL, i, 0);
} else {
SetDlgItemText(hwndDlg, IDC_LOOKFOR_TEXT, L"");
diff --git a/protocols/Tlen/src/tlen_ws.cpp b/protocols/Tlen/src/tlen_ws.cpp index ec0a691917..c9008cd2ee 100644 --- a/protocols/Tlen/src/tlen_ws.cpp +++ b/protocols/Tlen/src/tlen_ws.cpp @@ -31,13 +31,13 @@ BOOL TlenWsInit(TlenProtocol *proto) nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR; // | NUF_HTTPGATEWAY;
+ nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE; // | NUF_HTTPGATEWAY;
mir_snwprintf(name, TranslateT("%s connection"), proto->m_tszUserName);
nlu.ptszDescriptiveName = name;
nlu.szSettingsModule = proto->m_szModuleName;
proto->m_hNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM) &nlu);
- nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_NOOPTIONS | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_NOOPTIONS | NUF_UNICODE;
mir_snwprintf(name, TranslateT("%s SOCKS connection"), proto->m_tszUserName);
nlu.ptszDescriptiveName = name;
proto->hFileNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM) &nlu);
diff --git a/protocols/Tox/src/tox_accounts.cpp b/protocols/Tox/src/tox_accounts.cpp index dfdca9e4f7..f6e8f4ddd3 100644 --- a/protocols/Tox/src/tox_accounts.cpp +++ b/protocols/Tox/src/tox_accounts.cpp @@ -46,7 +46,7 @@ int CToxProto::OnAccountRenamed(WPARAM, LPARAM) ptrW newPath(GetToxProfilePath());
wchar_t oldPath[MAX_PATH];
- mir_snwprintf(oldPath, MAX_PATH, L"%s\\%s.tox", VARST(L"%miranda_userdata%"), accountName);
+ mir_snwprintf(oldPath, MAX_PATH, L"%s\\%s.tox", VARSW(L"%miranda_userdata%"), accountName);
_wrename(oldPath, newPath);
mir_free(accountName);
accountName = mir_wstrdup(m_tszUserName);
diff --git a/protocols/Tox/src/tox_avatars.cpp b/protocols/Tox/src/tox_avatars.cpp index ed0c482cda..9dfdd36b69 100644 --- a/protocols/Tox/src/tox_avatars.cpp +++ b/protocols/Tox/src/tox_avatars.cpp @@ -3,13 +3,13 @@ wchar_t* CToxProto::GetAvatarFilePath(MCONTACT hContact)
{
wchar_t *path = (wchar_t*)mir_calloc(MAX_PATH * sizeof(wchar_t) + 1);
- mir_snwprintf(path, MAX_PATH, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
+ mir_snwprintf(path, MAX_PATH, L"%s\\%S", VARSW(L"%miranda_avatarcache%"), m_szModuleName);
DWORD dwAttributes = GetFileAttributes(path);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
- CreateDirectoryTreeT(path);
+ CreateDirectoryTreeW(path);
- ptrW address(getTStringA(hContact, TOX_SETTINGS_ID));
+ ptrW address(getWStringA(hContact, TOX_SETTINGS_ID));
if (address == NULL) {
mir_free(path);
return mir_wstrdup(L"");
@@ -231,7 +231,7 @@ void CToxProto::OnGotFriendAvatarInfo(AvatarTransferParam *transfer) }
wchar_t path[MAX_PATH];
- mir_snwprintf(path, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
+ mir_snwprintf(path, L"%s\\%S", VARSW(L"%miranda_avatarcache%"), m_szModuleName);
OnFileAllow(transfer->pfts.hContact, transfer, path);
}
diff --git a/protocols/Tox/src/tox_chatrooms.cpp b/protocols/Tox/src/tox_chatrooms.cpp index fde562fe83..e44b337a18 100644 --- a/protocols/Tox/src/tox_chatrooms.cpp +++ b/protocols/Tox/src/tox_chatrooms.cpp @@ -30,12 +30,12 @@ MCONTACT CToxProto::AddChatRoom(int groupNumber) wchar_t title[MAX_PATH];
mir_snwprintf(title, L"%s #%d", TranslateT("Group chat"), groupNumber);
- setTString(hContact, "Nick", title);
+ setWString(hContact, "Nick", title);
DBVARIANT dbv;
- if (!db_get_s(NULL, "Chat", "AddToGroup", &dbv, DBVT_TCHAR))
+ if (!db_get_s(NULL, "Chat", "AddToGroup", &dbv, DBVT_WCHAR))
{
- db_set_ts(hContact, "CList", "Group", dbv.ptszVal);
+ db_set_ws(hContact, "CList", "Group", dbv.ptszVal);
db_free(&dbv);
}
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index d3e094e0db..5abda14238 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -91,15 +91,15 @@ MCONTACT CToxProto::AddContact(const char *address, const char *nick, const char setString(hContact, TOX_SETTINGS_ID, address);
if (mir_strlen(nick))
- setTString(hContact, "Nick", ptrW(mir_utf8decodeW(nick)));
+ setWString(hContact, "Nick", ptrW(mir_utf8decodeW(nick)));
if (mir_strlen(dnsId))
- setTString(hContact, TOX_SETTINGS_DNS, ptrW(mir_utf8decodeW(dnsId)));
+ setWString(hContact, TOX_SETTINGS_DNS, ptrW(mir_utf8decodeW(dnsId)));
DBVARIANT dbv;
- if (!getTString(TOX_SETTINGS_GROUP, &dbv))
+ if (!getWString(TOX_SETTINGS_GROUP, &dbv))
{
- db_set_ts(hContact, "CList", "Group", dbv.ptszVal);
+ db_set_ws(hContact, "CList", "Group", dbv.ptszVal);
db_free(&dbv);
}
@@ -149,7 +149,7 @@ void CToxProto::LoadFriendList(void*) TOX_ERR_FRIEND_QUERY getNameResult;
uint8_t nick[TOX_MAX_NAME_LENGTH] = { 0 };
if (tox_friend_get_name(toxThread->Tox(), friendNumber, nick, &getNameResult))
- setTString(hContact, "Nick", ptrW(mir_utf8decodeW((char*)nick)));
+ setWString(hContact, "Nick", ptrW(mir_utf8decodeW((char*)nick)));
else
debugLogA(__FUNCTION__": failed to get friend name (%d)", getNameResult);
@@ -188,7 +188,7 @@ INT_PTR CToxProto::OnRequestAuth(WPARAM hContact, LPARAM lParam) uint8_t nick[TOX_MAX_NAME_LENGTH] = { 0 };
TOX_ERR_FRIEND_QUERY errorFriendQuery;
if (tox_friend_get_name(toxThread->Tox(), friendNumber, nick, &errorFriendQuery))
- setTString(hContact, "Nick", ptrW(mir_utf8decodeW((char*)nick)));
+ setWString(hContact, "Nick", ptrW(mir_utf8decodeW((char*)nick)));
else
debugLogA(__FUNCTION__": failed to get friend name (%d)", errorFriendQuery);
@@ -292,7 +292,7 @@ void CToxProto::OnFriendNameChange(Tox*, uint32_t friendNumber, const uint8_t *n rawName[length] = 0;
ptrW nickname(mir_utf8decodeW(rawName));
- proto->setTString(hContact, "Nick", nickname);
+ proto->setWString(hContact, "Nick", nickname);
}
}
@@ -307,7 +307,7 @@ void CToxProto::OnStatusMessageChanged(Tox*, uint32_t friendNumber, const uint8_ rawMessage[length] = 0;
ptrW statusMessage(mir_utf8decodeW(rawMessage));
- db_set_ts(hContact, "CList", "StatusMsg", statusMessage);
+ db_set_ws(hContact, "CList", "StatusMsg", statusMessage);
}
}
@@ -398,7 +398,7 @@ int CToxProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) if (szProto != NULL && !mir_strcmp(szProto, m_szModuleName))
{
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
- odp.flags = ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.hInstance = g_hInstance;
odp.dwInitParam = (LPARAM)this;
odp.pwszTitle = m_tszUserName;
@@ -441,7 +441,7 @@ INT_PTR CToxProto::UserInfoProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar break;
}
- SetDlgItemText(hwnd, IDC_DNS_ID, ptrW(proto->getTStringA(hContact, TOX_SETTINGS_DNS)));
+ SetDlgItemText(hwnd, IDC_DNS_ID, ptrW(proto->getWStringA(hContact, TOX_SETTINGS_DNS)));
}
break;
@@ -458,7 +458,7 @@ INT_PTR CToxProto::UserInfoProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar }
wchar_t dnsId[MAX_PATH];
GetDlgItemText(hwnd, IDC_DNS_ID, dnsId, MAX_PATH);
- proto->setTString(hContact, TOX_SETTINGS_DNS, dnsId);
+ proto->setWString(hContact, TOX_SETTINGS_DNS, dnsId);
break;
}
break;
@@ -471,8 +471,6 @@ INT_PTR CToxProto::UserInfoProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
}
break;
-
- break;
}
return FALSE;
diff --git a/protocols/Tox/src/tox_core.cpp b/protocols/Tox/src/tox_core.cpp index 108d9b0003..89687f69d4 100644 --- a/protocols/Tox/src/tox_core.cpp +++ b/protocols/Tox/src/tox_core.cpp @@ -95,9 +95,9 @@ bool CToxProto::InitToxCore(CToxThread *toxThread) /*uint8_t nick[TOX_MAX_NAME_LENGTH] = { 0 };
tox_self_get_name(toxThread->Tox(), nick);
- setTString("Nick", ptrW(Utf8DecodeT((char*)nick)));*/
+ setWString("Nick", ptrW(Utf8DecodeT((char*)nick)));*/
- ptrA nick(mir_utf8encodeW(ptrW(getTStringA("Nick"))));
+ ptrA nick(mir_utf8encodeW(ptrW(getWStringA("Nick"))));
tox_self_set_name(toxThread->Tox(), (uint8_t*)(char*)nick, mir_strlen(nick), &error);
if (error != TOX_ERR_SET_INFO_OK)
{
@@ -107,9 +107,9 @@ bool CToxProto::InitToxCore(CToxThread *toxThread) /*uint8_t statusMessage[TOX_MAX_STATUS_MESSAGE_LENGTH] = { 0 };
tox_self_get_status_message(toxThread->Tox(), statusMessage);
- setTString("StatusMsg", ptrW(Utf8DecodeT((char*)statusMessage)));*/
+ setWString("StatusMsg", ptrW(Utf8DecodeT((char*)statusMessage)));*/
- ptrA statusMessage(mir_utf8encodeW(ptrW(getTStringA("StatusMsg"))));
+ ptrA statusMessage(mir_utf8encodeW(ptrW(getWStringA("StatusMsg"))));
tox_self_set_status_message(toxThread->Tox(), (uint8_t*)(char*)statusMessage, mir_strlen(statusMessage), &error);
if (error != TOX_ERR_SET_INFO_OK)
{
diff --git a/protocols/Tox/src/tox_dialogs.h b/protocols/Tox/src/tox_dialogs.h index d72c83eb92..dedd355e1b 100644 --- a/protocols/Tox/src/tox_dialogs.h +++ b/protocols/Tox/src/tox_dialogs.h @@ -19,7 +19,7 @@ public: virtual void OnReset()
{
- if (GetDataType() == DBVT_TCHAR)
+ if (GetDataType() == DBVT_WCHAR)
SetText(LoadText());
else if (GetDataType() != DBVT_DELETED)
SetInt(LoadInt());
diff --git a/protocols/Tox/src/tox_menus.cpp b/protocols/Tox/src/tox_menus.cpp index e7580ef650..61b3801928 100644 --- a/protocols/Tox/src/tox_menus.cpp +++ b/protocols/Tox/src/tox_menus.cpp @@ -40,7 +40,7 @@ void CToxProto::InitMenus() HookEvent(ME_CLIST_PREBUILDCONTACTMENU, &CToxProto::PrebuildContactMenu);
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
// Request authorization
SET_UID(mi, 0x36375a1f, 0xc142, 0x4d6e, 0xa6, 0x57, 0xe4, 0x76, 0x5d, 0xbc, 0x59, 0x8e);
@@ -73,7 +73,7 @@ void CToxProto::InitMenus() int CToxProto::OnInitStatusMenu()
{
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.root = Menu_GetProtocolRoot(this);
// Create copy tox id command
diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp index 580fa31622..32a2d71298 100644 --- a/protocols/Tox/src/tox_network.cpp +++ b/protocols/Tox/src/tox_network.cpp @@ -66,7 +66,7 @@ void CToxProto::BootstrapNodesFromJson(CToxThread *toxThread, bool isUdp, bool i {
ptrA json;
- VARST path(_A2W(TOX_JSON_PATH));
+ VARSW path(_A2W(TOX_JSON_PATH));
if (!IsFileExists(path))
UpdateNodes();
@@ -157,7 +157,7 @@ void CToxProto::UpdateNodes() if (lastUpdate <= getDword("NodesUpdate", 0))
return;
- ptrW path(mir_wstrdup((wchar_t*)VARST(_A2W(TOX_JSON_PATH))));
+ ptrW path(mir_wstrdup((wchar_t*)VARSW(_A2W(TOX_JSON_PATH))));
if (!IsFileExists(path))
{
HANDLE hProfile = CreateFile(path, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index 96564f432e..271df96825 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -90,9 +90,9 @@ void CToxOptionsMain::ProfileCreate_OnClick(CCtrlButton*) m_toxAddress.Enable();
m_toxAddress.SetTextA(ptrA(m_proto->getStringA(TOX_SETTINGS_ID)));
- m_nickname.SetText(ptrW(m_proto->getTStringA("Nick")));
- m_password.SetText(ptrW(m_proto->getTStringA("Password")));
- m_group.SetText(ptrW(m_proto->getTStringA(TOX_SETTINGS_GROUP)));
+ m_nickname.SetText(ptrW(m_proto->getWStringA("Nick")));
+ m_password.SetText(ptrW(m_proto->getWStringA("Password")));
+ m_group.SetText(ptrW(m_proto->getWStringA(TOX_SETTINGS_GROUP)));
ShowWindow(m_profileCreate.GetHwnd(), FALSE);
ShowWindow(m_profileImport.GetHwnd(), FALSE);
@@ -144,12 +144,12 @@ void CToxOptionsMain::ProfileImport_OnClick(CCtrlButton*) uint8_t nick[TOX_MAX_NAME_LENGTH] = { 0 };
tox_self_get_name(toxThread.Tox(), nick);
ptrW nickname(Utf8DecodeT((char*)nick));
- m_proto->setTString("Nick", nickname);
+ m_proto->setWString("Nick", nickname);
m_nickname.SetText(nickname);
uint8_t statusMessage[TOX_MAX_STATUS_MESSAGE_LENGTH] = { 0 };
tox_self_get_status_message(toxThread.Tox(), statusMessage);
- m_proto->setTString("StatusMsg", ptrW(Utf8DecodeT((char*)statusMessage)));
+ m_proto->setWString("StatusMsg", ptrW(Utf8DecodeT((char*)statusMessage)));
ShowWindow(m_profileCreate.GetHwnd(), FALSE);
ShowWindow(m_profileImport.GetHwnd(), FALSE);
@@ -195,10 +195,10 @@ void CToxOptionsMain::OnApply() if (m_proto->IsOnline())
{
- CallProtoService(m_proto->m_szModuleName, PS_SETMYNICKNAME, SMNN_TCHAR, (LPARAM)ptrW(m_nickname.GetText()));
+ CallProtoService(m_proto->m_szModuleName, PS_SETMYNICKNAME, SMNN_UNICODE, (LPARAM)ptrW(m_nickname.GetText()));
// todo: add checkbox
- m_proto->setTString("Password", pass_ptrT(m_password.GetText()));
+ m_proto->setWString("Password", pass_ptrT(m_password.GetText()));
m_proto->SaveToxProfile(m_proto->toxThread);
}
@@ -537,7 +537,7 @@ void CToxOptionsNodeList::ReloadNodeList() int iItem = -1;
- VARST path(_A2W(TOX_JSON_PATH));
+ VARSW path(_A2W(TOX_JSON_PATH));
if (CToxProto::IsFileExists(path))
{
ptrA json;
@@ -586,11 +586,11 @@ void CToxOptionsNodeList::ReloadNodeList() for (int i = 0; i < nodeCount; i++)
{
mir_snprintf(setting, TOX_SETTINGS_NODE_IPV4, i);
- ptrW value(db_get_tsa(NULL, module, setting));
+ ptrW value(db_get_wsa(NULL, module, setting));
iItem = m_nodes.AddItem(value, -1, NULL, 1);
mir_snprintf(setting, TOX_SETTINGS_NODE_IPV6, i);
- value = db_get_tsa(NULL, module, setting);
+ value = db_get_wsa(NULL, module, setting);
m_nodes.SetItem(iItem, 1, value);
mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, i);
@@ -603,7 +603,7 @@ void CToxOptionsNodeList::ReloadNodeList() }
mir_snprintf(setting, TOX_SETTINGS_NODE_PKEY, i);
- value = db_get_tsa(NULL, module, setting);
+ value = db_get_wsa(NULL, module, setting);
m_nodes.SetItem(iItem, 3, value);
m_nodes.SetItem(iItem, 4, L"", 0);
@@ -681,7 +681,7 @@ int CToxProto::OnOptionsInit(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.pwszTitle = m_tszUserName;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.pwszGroup = LPGENW("Network");
odp.pwszTab = LPGENW("Account");
diff --git a/protocols/Tox/src/tox_profile.cpp b/protocols/Tox/src/tox_profile.cpp index 16658bc7c6..c1d71bd40f 100644 --- a/protocols/Tox/src/tox_profile.cpp +++ b/protocols/Tox/src/tox_profile.cpp @@ -11,7 +11,7 @@ wchar_t* CToxProto::GetToxProfilePath(const wchar_t *accountName) {
wchar_t *profilePath = (wchar_t*)mir_calloc(MAX_PATH * sizeof(wchar_t) + 1);
wchar_t profileRootPath[MAX_PATH];
- FoldersGetCustomPathT(hProfileFolderPath, profileRootPath, _countof(profileRootPath), VARST(L"%miranda_userdata%"));
+ FoldersGetCustomPathT(hProfileFolderPath, profileRootPath, _countof(profileRootPath), VARSW(L"%miranda_userdata%"));
mir_snwprintf(profilePath, MAX_PATH, L"%s\\%s.tox", profileRootPath, accountName);
return profilePath;
}
@@ -62,7 +62,7 @@ bool CToxProto::LoadToxProfile(Tox_Options *options) if (tox_is_data_encrypted(data))
{
- pass_ptrA password(mir_utf8encodeW(pass_ptrT(getTStringA("Password"))));
+ pass_ptrA password(mir_utf8encodeW(pass_ptrT(getWStringA("Password"))));
if (password == NULL || mir_strlen(password) == 0)
{
CToxPasswordEditor passwordEditor(this);
@@ -108,7 +108,7 @@ void CToxProto::SaveToxProfile(CToxThread *toxThread) uint8_t *data = (uint8_t*)mir_calloc(size + TOX_PASS_ENCRYPTION_EXTRA_LENGTH);
tox_get_savedata(toxThread->Tox(), data);
- pass_ptrA password(mir_utf8encodeW(pass_ptrT(getTStringA("Password"))));
+ pass_ptrA password(mir_utf8encodeW(pass_ptrT(getWStringA("Password"))));
if (password && mir_strlen(password))
{
TOX_ERR_ENCRYPTION coreEncryptError;
@@ -167,7 +167,7 @@ void CToxPasswordEditor::OnOk(CCtrlButton*) {
pass_ptrT tszPassword(password.GetText());
if (savePermanently.Enabled())
- m_proto->setTString("Password", tszPassword);
+ m_proto->setWString("Password", tszPassword);
EndDialog(m_hwnd, 1);
}
diff --git a/protocols/Tox/src/tox_search.cpp b/protocols/Tox/src/tox_search.cpp index ece71c724d..952515d60d 100644 --- a/protocols/Tox/src/tox_search.cpp +++ b/protocols/Tox/src/tox_search.cpp @@ -91,7 +91,7 @@ void CToxProto::SearchByNameAsync(void *arg) /*int resolved = 0;
- if (IsFileExists((wchar_t*)VARST(_T(TOX_INI_PATH))))
+ if (IsFileExists((wchar_t*)VARSW(_T(TOX_INI_PATH))))
{
char fileName[MAX_PATH];
mir_strcpy(fileName, VARS(TOX_INI_PATH));
diff --git a/protocols/Tox/src/tox_services.cpp b/protocols/Tox/src/tox_services.cpp index 1651bbc597..5f3db0ac89 100644 --- a/protocols/Tox/src/tox_services.cpp +++ b/protocols/Tox/src/tox_services.cpp @@ -3,7 +3,7 @@ INT_PTR CToxProto::SetMyNickname(WPARAM wParam, LPARAM lParam)
{
ptrW nickname((wParam & SMNN_UNICODE) ? mir_wstrdup((wchar_t*)lParam) : mir_a2u((char*)lParam));
- setTString("Nick", nickname);
+ setWString("Nick", nickname);
if (IsOnline())
{
diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp index 5eaf69dffe..c00cc4bf59 100644 --- a/protocols/Tox/src/tox_transfer.cpp +++ b/protocols/Tox/src/tox_transfer.cpp @@ -18,7 +18,7 @@ void CToxProto::OnFriendFile(Tox*, uint32_t friendNumber, uint32_t fileNumber, u {
Netlib_Logf(proto->m_hNetlibUser, __FUNCTION__": incoming avatar (%d) from (%d)", fileNumber, friendNumber);
- ptrW address(proto->getTStringA(hContact, TOX_SETTINGS_ID));
+ ptrW address(proto->getWStringA(hContact, TOX_SETTINGS_ID));
wchar_t avatarName[MAX_PATH];
mir_snwprintf(avatarName, MAX_PATH, L"%s.png", address);
@@ -53,7 +53,7 @@ void CToxProto::OnFriendFile(Tox*, uint32_t friendNumber, uint32_t fileNumber, u proto->transfers.Add(transfer);
PROTORECVFILET pre = { 0 };
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(NULL);
pre.descr.w = L"";
diff --git a/protocols/Tox/src/tox_transfer.h b/protocols/Tox/src/tox_transfer.h index af5b51d8cc..372b047fb3 100644 --- a/protocols/Tox/src/tox_transfer.h +++ b/protocols/Tox/src/tox_transfer.h @@ -19,7 +19,7 @@ struct FileTransferParam transferNumber = (((int64_t)friendNumber) << 32) | ((int64_t)fileNumber);
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
- pfts.flags = PFTS_TCHAR;
+ pfts.flags = PFTS_UNICODE;
pfts.hContact = NULL;
pfts.totalFiles = 1;
pfts.ptszFiles = (wchar_t**)mir_alloc(sizeof(wchar_t*)*(pfts.totalFiles + 1));
diff --git a/protocols/Twitter/src/chat.cpp b/protocols/Twitter/src/chat.cpp index 8a7d155f26..0daee31258 100644 --- a/protocols/Twitter/src/chat.cpp +++ b/protocols/Twitter/src/chat.cpp @@ -64,7 +64,7 @@ int TwitterProto::OnChatOutgoing(WPARAM, LPARAM lParam) switch (hook->pDest->iType) {
case GC_USER_MESSAGE:
- debugLog(L"**Chat - Outgoing message: %s", hook->ptszText);
+ debugLogW(L"**Chat - Outgoing message: %s", hook->ptszText);
{
T2Utf text(hook->ptszText);
diff --git a/protocols/Twitter/src/connection.cpp b/protocols/Twitter/src/connection.cpp index bad7284cbf..913bcd70e2 100644 --- a/protocols/Twitter/src/connection.cpp +++ b/protocols/Twitter/src/connection.cpp @@ -162,8 +162,8 @@ bool TwitterProto::NegotiateConnection() }
//write those bitches to the db foe latta
- setTString(TWITTER_KEY_OAUTH_TOK, oauthToken.c_str());
- setTString(TWITTER_KEY_OAUTH_TOK_SECRET, oauthTokenSecret.c_str());
+ setWString(TWITTER_KEY_OAUTH_TOK, oauthToken.c_str());
+ setWString(TWITTER_KEY_OAUTH_TOK_SECRET, oauthTokenSecret.c_str());
// this looks like bad code.. can someone clean this up please? or confirm that it's ok
wchar_t buf[1024] = {};
@@ -175,7 +175,7 @@ bool TwitterProto::NegotiateConnection() ShowPinDialog();
}
- if (!getTString(TWITTER_KEY_GROUP, &dbv)) {
+ if (!getWString(TWITTER_KEY_GROUP, &dbv)) {
Clist_GroupCreate(0, dbv.ptszVal);
db_free(&dbv);
}
@@ -396,7 +396,7 @@ void TwitterProto::UpdateAvatarWorker(void *p) // db_get_s returns 0 when it suceeds, so if this suceeds it will return 0, or false.
// therefore if it returns 1, or true, we want to return as there is no such user.
// as a side effect, dbv now has the username in it i think
- if (getTString(data->hContact, TWITTER_KEY_UN, &dbv))
+ if (getWString(data->hContact, TWITTER_KEY_UN, &dbv))
return;
std::string ext = data->url.substr(data->url.rfind('.')); // finds the filetype of the avatar
@@ -535,7 +535,7 @@ void TwitterProto::ShowContactPopup(MCONTACT hContact, const std::string &text, popup.colorBack = GetSysColor(COLOR_WINDOWTEXT);
DBVARIANT dbv;
- if (!db_get_ts(hContact, "CList", "MyHandle", &dbv) || !getTString(hContact, TWITTER_KEY_UN, &dbv)) {
+ if (!db_get_ws(hContact, "CList", "MyHandle", &dbv) || !getWString(hContact, TWITTER_KEY_UN, &dbv)) {
wcsncpy(popup.lptzContactName, dbv.ptszVal, MAX_CONTACTNAME);
db_free(&dbv);
}
diff --git a/protocols/Twitter/src/contacts.cpp b/protocols/Twitter/src/contacts.cpp index 174046afdb..d5d56f9d85 100644 --- a/protocols/Twitter/src/contacts.cpp +++ b/protocols/Twitter/src/contacts.cpp @@ -126,7 +126,7 @@ void TwitterProto::DoSearch(void *pArg) if (found) {
PROTOSEARCHRESULT psr = { sizeof(psr) };
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.nick.w = mir_a2u(info.username.c_str());
psr.firstName.w = mir_a2u(info.real_name.c_str());
@@ -162,7 +162,7 @@ void TwitterProto::GetAwayMsgWorker(void *arg) return;
DBVARIANT dbv;
- if (!db_get_ts(hContact, "CList", "StatusMsg", &dbv)) {
+ if (!db_get_ws(hContact, "CList", "StatusMsg", &dbv)) {
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
@@ -251,8 +251,8 @@ MCONTACT TwitterProto::AddToClientList(const char *name, const char *status) setString(hContact, "Homepage", url.c_str());
SkinPlaySound("TwitterNewContact");
DBVARIANT dbv;
- if (!getTString(TWITTER_KEY_GROUP, &dbv)) {
- db_set_ts(hContact, "CList", "Group", dbv.ptszVal);
+ if (!getWString(TWITTER_KEY_GROUP, &dbv)) {
+ db_set_ws(hContact, "CList", "Group", dbv.ptszVal);
db_free(&dbv);
}
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index c0f1e32b01..bfe83fcb81 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -256,7 +256,7 @@ int TwitterProto::OnBuildStatusMenu(WPARAM, LPARAM) {
CMenuItem mi;
mi.root = Menu_GetProtocolRoot(this);
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.position = 1001;
Menu_AddStatusMenuItem(&mi, m_szModuleName);
@@ -279,7 +279,7 @@ int TwitterProto::OnOptionsInit(WPARAM wParam, LPARAM) odp.pwszGroup = LPGENW("Network");
odp.pwszTitle = m_tszUserName;
odp.dwInitParam = LPARAM(this);
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pwszTab = LPGENW("Basic");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
@@ -309,7 +309,7 @@ int TwitterProto::OnModulesLoaded(WPARAM, LPARAM) {
wchar_t descr[512];
NETLIBUSER nlu = { sizeof(nlu) };
- nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
// Create standard network connection
@@ -455,7 +455,7 @@ void TwitterProto::UpdateSettings() std::wstring TwitterProto::GetAvatarFolder()
{
wchar_t path[MAX_PATH];
- mir_snwprintf(path, L"%s\\%s", VARST(L"%miranda_avatarcache%"), m_tszUserName);
+ mir_snwprintf(path, L"%s\\%s", VARSW(L"%miranda_avatarcache%"), m_tszUserName);
return path;
}
diff --git a/protocols/Twitter/src/theme.cpp b/protocols/Twitter/src/theme.cpp index 4f0f988d02..3365299b08 100644 --- a/protocols/Twitter/src/theme.cpp +++ b/protocols/Twitter/src/theme.cpp @@ -90,7 +90,7 @@ void InitContactMenus() HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
CMenuItem mi;
- mi.flags = CMIF_NOTOFFLINE | CMIF_TCHAR;
+ mi.flags = CMIF_NOTOFFLINE | CMIF_UNICODE;
SET_UID(mi, 0xfc4e1245, 0xc8e0, 0x4de2, 0x92, 0x15, 0xfc, 0xcf, 0x48, 0xf9, 0x41, 0x56);
mi.position = -2000006000;
diff --git a/protocols/Twitter/src/ui.cpp b/protocols/Twitter/src/ui.cpp index e6e5dc2a5e..f2bad47bed 100644 --- a/protocols/Twitter/src/ui.cpp +++ b/protocols/Twitter/src/ui.cpp @@ -39,7 +39,7 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
DBVARIANT dbv;
- if (!proto->getTString(TWITTER_KEY_GROUP, &dbv)) {
+ if (!proto->getWString(TWITTER_KEY_GROUP, &dbv)) {
SetDlgItemText(hwndDlg, IDC_GROUP, dbv.ptszVal);
db_free(&dbv);
}
@@ -88,7 +88,7 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM proto->setString(TWITTER_KEY_BASEURL, str);
GetDlgItemText(hwndDlg, IDC_GROUP, tstr, _countof(tstr));
- proto->setTString(TWITTER_KEY_GROUP, tstr);
+ proto->setWString(TWITTER_KEY_GROUP, tstr);
return true;
}
diff --git a/protocols/Twitter/src/utility.cpp b/protocols/Twitter/src/utility.cpp index 565ef3622b..b427f64f1f 100644 --- a/protocols/Twitter/src/utility.cpp +++ b/protocols/Twitter/src/utility.cpp @@ -146,7 +146,7 @@ bool save_url(HANDLE hNetlib, const std::string &url, const std::wstring &filena // Create folder if necessary
std::wstring dir = filename.substr(0, filename.rfind('\\'));
if (_waccess(dir.c_str(), 0))
- CreateDirectoryTreeT(dir.c_str());
+ CreateDirectoryTreeW(dir.c_str());
// Write to file
FILE *f = _wfopen(filename.c_str(), L"wb");
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 494ef63183..4f1a9c6cb4 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -292,7 +292,7 @@ bool CVkProto::CheckJsonResult(AsyncHttpRequest *pReq, const JSONNode &jnNode) pReq->m_iRetry--;
}
else {
- CMString msg(FORMAT, TranslateT("Error %d. Data will not be sent or received."), pReq->m_iErrorCode);
+ CMStringW msg(FORMAT, TranslateT("Error %d. Data will not be sent or received."), pReq->m_iErrorCode);
MsgPopup(NULL, msg, TranslateT("Error"), true);
debugLogA("CVkProto::CheckJsonResult SendError");
}
@@ -413,7 +413,7 @@ bool CVkProto::AutoFillForm(char *pBody, CMStringA &szAction, CMStringA& szResul return true;
}
-CMString CVkProto::RunConfirmationCode()
+CMStringW CVkProto::RunConfirmationCode()
{
ENTER_STRING pForm = { sizeof(pForm) };
pForm.type = ESF_PASSWORD;
@@ -421,10 +421,10 @@ CMString CVkProto::RunConfirmationCode() pForm.ptszInitVal = NULL;
pForm.szModuleName = m_szModuleName;
pForm.szDataPrefix = "confirmcode_";
- return (!EnterString(&pForm)) ? CMString() : CMString(ptrW(pForm.ptszResult));
+ return (!EnterString(&pForm)) ? CMStringW() : CMStringW(ptrW(pForm.ptszResult));
}
-CMString CVkProto::RunRenameNick(LPCWSTR pwszOldName)
+CMStringW CVkProto::RunRenameNick(LPCWSTR pwszOldName)
{
ENTER_STRING pForm = { sizeof(pForm) };
pForm.type = ESF_COMBO;
@@ -433,7 +433,7 @@ CMString CVkProto::RunRenameNick(LPCWSTR pwszOldName) pForm.ptszInitVal = pwszOldName;
pForm.szModuleName = m_szModuleName;
pForm.szDataPrefix = "renamenick_";
- return (!EnterString(&pForm)) ? CMString() : CMString(ptrW(pForm.ptszResult));
+ return (!EnterString(&pForm)) ? CMStringW() : CMStringW(ptrW(pForm.ptszResult));
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -589,7 +589,7 @@ void CVkProto::SetMirVer(MCONTACT hContact, int platform) return;
}
- CMString MirVer, OldMirVer(ptrW(db_get_wsa(hContact, m_szModuleName, "MirVer")));
+ CMStringW MirVer, OldMirVer(ptrW(db_get_wsa(hContact, m_szModuleName, "MirVer")));
bool bSetFlag = true;
switch (platform) {
@@ -830,7 +830,7 @@ int CVkProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam) /////////////////////////////////////////////////////////////////////////////////////////
-CMString CVkProto::SpanVKNotificationType(CMString& wszType, VKObjType& vkFeedback, VKObjType& vkParent)
+CMStringW CVkProto::SpanVKNotificationType(CMStringW& wszType, VKObjType& vkFeedback, VKObjType& vkParent)
{
CVKNotification vkNotification[] = {
// type, parent, feedback, string for translate
@@ -866,7 +866,7 @@ CMString CVkProto::SpanVKNotificationType(CMString& wszType, VKObjType& vkFeedba { L"mention_comment_video", vkVideo, vkComment, L"mentioned you in comment to video" }
};
- CMString wszRes;
+ CMStringW wszRes;
vkFeedback = vkParent = vkNull;
for (int i = 0; i < _countof(vkNotification); i++)
if (wszType == vkNotification[i].pwszType) {
@@ -878,14 +878,14 @@ CMString CVkProto::SpanVKNotificationType(CMString& wszType, VKObjType& vkFeedba return wszRes;
}
-CMString CVkProto::GetVkPhotoItem(const JSONNode &jnPhoto, BBCSupport iBBC)
+CMStringW CVkProto::GetVkPhotoItem(const JSONNode &jnPhoto, BBCSupport iBBC)
{
- CMString wszRes;
+ CMStringW wszRes;
if (!jnPhoto)
return wszRes;
- CMString wszLink, wszPreviewLink;
+ CMStringW wszLink, wszPreviewLink;
for (int i = 0; i < _countof(szImageTypes); i++) {
const JSONNode &n = jnPhoto[szImageTypes[i]];
if (n) {
@@ -913,14 +913,14 @@ CMString CVkProto::GetVkPhotoItem(const JSONNode &jnPhoto, BBCSupport iBBC) wszRes.AppendFormat(L"%s (%dx%d)", SetBBCString(TranslateT("Photo"), iBBC, vkbbcUrl, wszLink), iWidth, iHeight);
if (m_vkOptions.iIMGBBCSupport && iBBC != bbcNo)
wszRes.AppendFormat(L"\n\t%s", SetBBCString(!wszPreviewLink.IsEmpty() ? wszPreviewLink : (!wszLink.IsEmpty() ? wszLink : L""), bbcBasic, vkbbcImg));
- CMString wszText(jnPhoto["text"].as_mstring());
+ CMStringW wszText(jnPhoto["text"].as_mstring());
if (!wszText.IsEmpty())
wszRes += L"\n" + wszText;
return wszRes;
}
-CMString CVkProto::SetBBCString(LPCWSTR pwszString, BBCSupport iBBC, VKBBCType bbcType, LPCWSTR wszAddString)
+CMStringW CVkProto::SetBBCString(LPCWSTR pwszString, BBCSupport iBBC, VKBBCType bbcType, LPCWSTR wszAddString)
{
CVKBBCItem bbcItem[] = {
{ vkbbcB, bbcNo, L"%s" },
@@ -953,7 +953,7 @@ CMString CVkProto::SetBBCString(LPCWSTR pwszString, BBCSupport iBBC, VKBBCType b };
if (IsEmpty(pwszString))
- return CMString();
+ return CMStringW();
wchar_t *pwszFormat = NULL;
for (int i = 0; i < _countof(bbcItem); i++)
@@ -962,9 +962,9 @@ CMString CVkProto::SetBBCString(LPCWSTR pwszString, BBCSupport iBBC, VKBBCType b break;
}
- CMString res;
+ CMStringW res;
if (pwszFormat == NULL)
- return CMString(pwszString);
+ return CMStringW(pwszString);
if (bbcType == vkbbcUrl && iBBC != bbcAdvanced)
res.AppendFormat(pwszFormat, pwszString, wszAddString ? wszAddString : L"");
@@ -976,12 +976,12 @@ CMString CVkProto::SetBBCString(LPCWSTR pwszString, BBCSupport iBBC, VKBBCType b return res;
}
-CMString& CVkProto::ClearFormatNick(CMString& wszText)
+CMStringW& CVkProto::ClearFormatNick(CMStringW& wszText)
{
int iNameEnd = wszText.Find(L"],"), iNameBeg = wszText.Find(L"|");
if (iNameEnd != -1 && iNameBeg != -1 && iNameBeg < iNameEnd) {
- CMString wszName = wszText.Mid(iNameBeg + 1, iNameEnd - iNameBeg - 1);
- CMString wszBody = wszText.Mid(iNameEnd + 2);
+ CMStringW wszName = wszText.Mid(iNameBeg + 1, iNameEnd - iNameBeg - 1);
+ CMStringW wszBody = wszText.Mid(iNameEnd + 2);
if (!wszName.IsEmpty() && !wszBody.IsEmpty())
wszText = wszName + L"," + wszBody;
}
@@ -991,10 +991,10 @@ CMString& CVkProto::ClearFormatNick(CMString& wszText) /////////////////////////////////////////////////////////////////////////////////////////
-CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport iBBC)
+CMStringW CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport iBBC)
{
debugLogA("CVkProto::GetAttachmentDescr");
- CMString res;
+ CMStringW res;
if (!jnAttachments) {
debugLogA("CVkProto::GetAttachmentDescr pAttachments == NULL");
return res;
@@ -1007,7 +1007,7 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport const JSONNode &jnAttach = (*it);
res.AppendChar('\t');
- CMString wszType(jnAttach["type"].as_mstring());
+ CMStringW wszType(jnAttach["type"].as_mstring());
if (wszType == L"photo") {
const JSONNode &jnPhoto = jnAttach["photo"];
if (!jnPhoto)
@@ -1020,10 +1020,10 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport if (!jnAudio)
continue;
- CMString wszArtist(jnAudio["artist"].as_mstring());
- CMString wszTitle(jnAudio["title"].as_mstring());
- CMString wszUrl(jnAudio["url"].as_mstring());
- CMString wszAudio(FORMAT, L"%s - %s", wszArtist, wszTitle);
+ CMStringW wszArtist(jnAudio["artist"].as_mstring());
+ CMStringW wszTitle(jnAudio["title"].as_mstring());
+ CMStringW wszUrl(jnAudio["url"].as_mstring());
+ CMStringW wszAudio(FORMAT, L"%s - %s", wszArtist, wszTitle);
int iParamPos = wszUrl.Find(L"?");
if (m_vkOptions.bShortenLinksForAudio && iParamPos != -1)
@@ -1038,10 +1038,10 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport if (!jnVideo)
continue;
- CMString wszTitle(jnVideo["title"].as_mstring());
+ CMStringW wszTitle(jnVideo["title"].as_mstring());
int vid = jnVideo["id"].as_int();
int ownerID = jnVideo["owner_id"].as_int();
- CMString wszUrl(FORMAT, L"https://vk.com/video%d_%d", ownerID, vid);
+ CMStringW wszUrl(FORMAT, L"https://vk.com/video%d_%d", ownerID, vid);
res.AppendFormat(L"%s: %s",
SetBBCString(TranslateT("Video"), iBBC, vkbbcB),
SetBBCString(wszTitle, iBBC, vkbbcUrl, wszUrl));
@@ -1051,8 +1051,8 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport if (!jnDoc)
continue;
- CMString wszTitle(jnDoc["title"].as_mstring());
- CMString wszUrl(jnDoc["url"].as_mstring());
+ CMStringW wszTitle(jnDoc["title"].as_mstring());
+ CMStringW wszUrl(jnDoc["url"].as_mstring());
res.AppendFormat(L"%s: %s",
SetBBCString(TranslateT("Document"), iBBC, vkbbcB),
SetBBCString(wszTitle, iBBC, vkbbcUrl, wszUrl));
@@ -1062,10 +1062,10 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport if (!jnWall)
continue;
- CMString wszText(jnWall["text"].as_mstring());
+ CMStringW wszText(jnWall["text"].as_mstring());
int id = jnWall["id"].as_int();
int fromID = jnWall["from_id"].as_int();
- CMString wszUrl(FORMAT, L"https://vk.com/wall%d_%d", fromID, id);
+ CMStringW wszUrl(FORMAT, L"https://vk.com/wall%d_%d", fromID, id);
res.AppendFormat(L"%s: %s",
SetBBCString(TranslateT("Wall post"), iBBC, vkbbcUrl, wszUrl),
wszText.IsEmpty() ? L" " : wszText);
@@ -1074,10 +1074,10 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport for (auto aCHit = jnCopyHystory.begin(); aCHit != jnCopyHystory.end(); ++aCHit) {
const JSONNode &jnCopyHystoryItem = (*aCHit);
- CMString wszCHText(jnCopyHystoryItem["text"].as_mstring());
+ CMStringW wszCHText(jnCopyHystoryItem["text"].as_mstring());
int iCHid = jnCopyHystoryItem["id"].as_int();
int iCHfromID = jnCopyHystoryItem["from_id"].as_int();
- CMString wszCHUrl(FORMAT, L"https://vk.com/wall%d_%d", iCHfromID, iCHid);
+ CMStringW wszCHUrl(FORMAT, L"https://vk.com/wall%d_%d", iCHfromID, iCHid);
wszCHText.Replace(L"\n", L"\n\t\t");
res.AppendFormat(L"\n\t\t%s: %s",
SetBBCString(TranslateT("Wall post"), iBBC, vkbbcUrl, wszCHUrl),
@@ -1086,7 +1086,7 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport const JSONNode &jnSubAttachments = jnCopyHystoryItem["attachments"];
if (jnSubAttachments) {
debugLogA("CVkProto::GetAttachmentDescr SubAttachments");
- CMString wszAttachmentDescr = GetAttachmentDescr(jnSubAttachments, iBBC);
+ CMStringW wszAttachmentDescr = GetAttachmentDescr(jnSubAttachments, iBBC);
wszAttachmentDescr.Replace(L"\n", L"\n\t\t");
res += L"\n\t\t" + wszAttachmentDescr;
}
@@ -1095,7 +1095,7 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport const JSONNode &jnSubAttachments = jnWall["attachments"];
if (jnSubAttachments) {
debugLogA("CVkProto::GetAttachmentDescr SubAttachments");
- CMString wszAttachmentDescr = GetAttachmentDescr(jnSubAttachments, iBBC);
+ CMStringW wszAttachmentDescr = GetAttachmentDescr(jnSubAttachments, iBBC);
wszAttachmentDescr.Replace(L"\n", L"\n\t");
res += L"\n\t" + wszAttachmentDescr;
}
@@ -1111,7 +1111,7 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport res.AppendFormat(L"[sticker:%d]", id);
}
else {
- CMString wszLink;
+ CMStringW wszLink;
for (int i = 0; i < _countof(szImageTypes); i++) {
const JSONNode &n = jnSticker[szImageTypes[i]];
if (n) {
@@ -1130,10 +1130,10 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport if (!jnLink)
continue;
- CMString wszUrl(jnLink["url"].as_mstring());
- CMString wszTitle(jnLink["title"].as_mstring());
- CMString wszCaption(jnLink["caption"].as_mstring());
- CMString wszDescription(jnLink["description"].as_mstring());
+ CMStringW wszUrl(jnLink["url"].as_mstring());
+ CMStringW wszTitle(jnLink["title"].as_mstring());
+ CMStringW wszCaption(jnLink["caption"].as_mstring());
+ CMStringW wszDescription(jnLink["description"].as_mstring());
res.AppendFormat(L"%s: %s",
SetBBCString(TranslateT("Link"), iBBC, vkbbcB),
@@ -1153,10 +1153,10 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport int id = jnMarket["id"].as_int();
int ownerID = jnMarket["owner_id"].as_int();
- CMString wszTitle(jnMarket["title"].as_mstring());
- CMString wszDescription(jnMarket["description"].as_mstring());
- CMString wszPhoto(jnMarket["thumb_photo"].as_mstring());
- CMString wszUrl(FORMAT, L"https://vk.com/%s%d?w=product%d_%d",
+ CMStringW wszTitle(jnMarket["title"].as_mstring());
+ CMStringW wszDescription(jnMarket["description"].as_mstring());
+ CMStringW wszPhoto(jnMarket["thumb_photo"].as_mstring());
+ CMStringW wszUrl(FORMAT, L"https://vk.com/%s%d?w=product%d_%d",
ownerID > 0 ? L"id" : L"club",
ownerID > 0 ? ownerID : (-1)*ownerID,
ownerID,
@@ -1184,7 +1184,7 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport if (!jnGift)
continue;
- CMString wszLink;
+ CMStringW wszLink;
for (int i = 0; i < _countof(szGiftTypes); i++) {
const JSONNode &n = jnGift[szGiftTypes[i]];
if (n) {
@@ -1208,9 +1208,9 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport return res;
}
-CMString CVkProto::GetFwdMessages(const JSONNode &jnMessages, const JSONNode &jnFUsers, BBCSupport iBBC)
+CMStringW CVkProto::GetFwdMessages(const JSONNode &jnMessages, const JSONNode &jnFUsers, BBCSupport iBBC)
{
- CMString res;
+ CMStringW res;
debugLogA("CVkProto::GetFwdMessages");
if (!jnMessages) {
debugLogA("CVkProto::GetFwdMessages pMessages == NULL");
@@ -1223,8 +1223,8 @@ CMString CVkProto::GetFwdMessages(const JSONNode &jnMessages, const JSONNode &jn const JSONNode &jnUser = (*it);
int iUserId = jnUser["id"].as_int();
- CMString wszNick(FORMAT, L"%s %s", jnUser["first_name"].as_mstring(), jnUser["last_name"].as_mstring());
- CMString wszLink(FORMAT, L"https://vk.com/id%d", iUserId);
+ CMStringW wszNick(FORMAT, L"%s %s", jnUser["first_name"].as_mstring(), jnUser["last_name"].as_mstring());
+ CMStringW wszLink(FORMAT, L"https://vk.com/id%d", iUserId);
CVkUserInfo *vkUser = new CVkUserInfo(jnUser["id"].as_int(), false, wszNick, wszLink, FindUser(iUserId));
vkUsers.insert(vkUser);
@@ -1236,7 +1236,7 @@ CMString CVkProto::GetFwdMessages(const JSONNode &jnMessages, const JSONNode &jn UINT uid = jnMsg["user_id"].as_int();
CVkUserInfo *vkUser = vkUsers.find((CVkUserInfo *)&uid);
- CMString wszNick, wszUrl;
+ CMStringW wszNick, wszUrl;
if (vkUser) {
wszNick = vkUser->m_wszUserNick;
@@ -1257,11 +1257,11 @@ CMString CVkProto::GetFwdMessages(const JSONNode &jnMessages, const JSONNode &jn _wcsftime_l(ttime, _countof(ttime), L"%x %X", localtime(&datetime), locale);
_free_locale(locale);
- CMString wszBody(jnMsg["body"].as_mstring());
+ CMStringW wszBody(jnMsg["body"].as_mstring());
const JSONNode &jnFwdMessages = jnMsg["fwd_messages"];
if (jnFwdMessages) {
- CMString wszFwdMessages = GetFwdMessages(jnFwdMessages, jnFUsers, iBBC == bbcNo ? iBBC : m_vkOptions.BBCForAttachments());
+ CMStringW wszFwdMessages = GetFwdMessages(jnFwdMessages, jnFUsers, iBBC == bbcNo ? iBBC : m_vkOptions.BBCForAttachments());
if (!wszBody.IsEmpty())
wszFwdMessages = L"\n" + wszFwdMessages;
wszBody += wszFwdMessages;
@@ -1269,7 +1269,7 @@ CMString CVkProto::GetFwdMessages(const JSONNode &jnMessages, const JSONNode &jn const JSONNode &jnAttachments = jnMsg["attachments"];
if (jnAttachments) {
- CMString wszAttachmentDescr = GetAttachmentDescr(jnAttachments, iBBC == bbcNo ? iBBC : m_vkOptions.BBCForAttachments());
+ CMStringW wszAttachmentDescr = GetAttachmentDescr(jnAttachments, iBBC == bbcNo ? iBBC : m_vkOptions.BBCForAttachments());
if (!wszBody.IsEmpty())
wszAttachmentDescr = L"\n" + wszAttachmentDescr;
wszBody += wszAttachmentDescr;
@@ -1277,7 +1277,7 @@ CMString CVkProto::GetFwdMessages(const JSONNode &jnMessages, const JSONNode &jn wszBody.Replace(L"\n", L"\n\t");
wchar_t tcSplit = m_vkOptions.bSplitFormatFwdMsg ? '\n' : ' ';
- CMString wszMes(FORMAT, L"%s %s%c%s %s:\n\n%s\n",
+ CMStringW wszMes(FORMAT, L"%s %s%c%s %s:\n\n%s\n",
SetBBCString(TranslateT("Message from"), iBBC, vkbbcB),
SetBBCString(wszNick, iBBC, vkbbcUrl, wszUrl),
tcSplit,
@@ -1310,7 +1310,7 @@ void CVkProto::SetInvisible(MCONTACT hContact) setDword(hContact, "InvisibleTS", (DWORD)now);
}
-CMString CVkProto::RemoveBBC(CMString& wszSrc)
+CMStringW CVkProto::RemoveBBC(CMStringW& wszSrc)
{
static const wchar_t *wszSimpleBBCodes[][2] = {
{ L"[b]", L"[/b]" },
@@ -1326,13 +1326,13 @@ CMString CVkProto::RemoveBBC(CMString& wszSrc) { L"[color=", L"[/color]" },
};
- CMString wszRes(wszSrc);
- CMString wszLow(wszSrc);
+ CMStringW wszRes(wszSrc);
+ CMStringW wszLow(wszSrc);
wszLow.MakeLower();
for (int i = 0; i < _countof(wszSimpleBBCodes); i++) {
- CMString wszOpenTag(wszSimpleBBCodes[i][0]);
- CMString wszCloseTag(wszSimpleBBCodes[i][1]);
+ CMStringW wszOpenTag(wszSimpleBBCodes[i][0]);
+ CMStringW wszCloseTag(wszSimpleBBCodes[i][1]);
int lenOpen = wszOpenTag.GetLength();
int lenClose = wszCloseTag.GetLength();
@@ -1357,8 +1357,8 @@ CMString CVkProto::RemoveBBC(CMString& wszSrc) }
for (int i = 0; i < _countof(wszParamBBCodes); i++) {
- CMString wszOpenTag(wszParamBBCodes[i][0]);
- CMString wszCloseTag(wszParamBBCodes[i][1]);
+ CMStringW wszOpenTag(wszParamBBCodes[i][0]);
+ CMStringW wszCloseTag(wszParamBBCodes[i][1]);
int lenOpen = wszOpenTag.GetLength();
int lenClose = wszCloseTag.GetLength();
@@ -1396,7 +1396,7 @@ void CVkProto::ShowCaptchaInBrowser(HBITMAP hBitmap) if (!GetEnvironmentVariable(L"TEMP", wszTempDir, MAX_PATH))
return;
- CMString wszHTMLPath(FORMAT, L"%s\\miranda_captcha.html", wszTempDir);
+ CMStringW wszHTMLPath(FORMAT, L"%s\\miranda_captcha.html", wszTempDir);
FILE *pFile = _wfopen(wszHTMLPath, L"w");
if (pFile == NULL)
diff --git a/protocols/VKontakte/src/vk_avatars.cpp b/protocols/VKontakte/src/vk_avatars.cpp index 61a05f3002..1bb02b1287 100644 --- a/protocols/VKontakte/src/vk_avatars.cpp +++ b/protocols/VKontakte/src/vk_avatars.cpp @@ -130,7 +130,7 @@ INT_PTR CVkProto::SvcGetMyAvatar(WPARAM wParam, LPARAM lParam) void CVkProto::GetAvatarFileName(MCONTACT hContact, wchar_t *pwszDest, size_t cbLen)
{
- int tPathLen = mir_snwprintf(pwszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
+ int tPathLen = mir_snwprintf(pwszDest, cbLen, L"%s\\%S", VARSW(L"%miranda_avatarcache%"), m_szModuleName);
DWORD dwAttributes = GetFileAttributes(pwszDest);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
@@ -150,9 +150,9 @@ void CVkProto::GetAvatarFileName(MCONTACT hContact, wchar_t *pwszDest, size_t cb mir_snwprintf(pwszDest + tPathLen, MAX_PATH - tPathLen, L"%d%s", id, szFileType);
}
-void CVkProto::SetAvatarUrl(MCONTACT hContact, CMString &wszUrl)
+void CVkProto::SetAvatarUrl(MCONTACT hContact, CMStringW &wszUrl)
{
- CMString oldUrl(getWStringA(hContact, "AvatarUrl"));
+ CMStringW oldUrl(getWStringA(hContact, "AvatarUrl"));
if (wszUrl == oldUrl)
return;
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp index ff8cee7677..4b0853d9d2 100644 --- a/protocols/VKontakte/src/vk_chats.cpp +++ b/protocols/VKontakte/src/vk_chats.cpp @@ -30,7 +30,7 @@ extern JSONNode nullNode; CVkChatInfo* CVkProto::AppendChat(int id, const JSONNode &jnDlg)
{
- debugLog(L"CVkProto::AppendChat");
+ debugLogW(L"CVkProto::AppendChat");
if (id == 0)
return NULL;
@@ -42,14 +42,14 @@ CVkChatInfo* CVkProto::AppendChat(int id, const JSONNode &jnDlg) if (c != NULL)
return c;
- CMString wszTitle;
+ CMStringW wszTitle;
c = new CVkChatInfo(id);
if (jnDlg) {
wszTitle = jnDlg["title"].as_mstring();
c->m_wszTopic = mir_wstrdup(!wszTitle.IsEmpty() ? wszTitle : L"");
}
- CMString sid;
+ CMStringW sid;
sid.Format(L"%S_%d", m_szModuleName, id);
c->m_wszId = mir_wstrdup(sid);
@@ -73,13 +73,13 @@ CVkChatInfo* CVkProto::AppendChat(int id, const JSONNode &jnDlg) GCDEST gcd = { m_szModuleName, sid, GC_EVENT_ADDGROUP };
GCEVENT gce = { sizeof(gce), &gcd };
for (int i = _countof(sttStatuses)-1; i >= 0; i--) {
- gce.ptszStatus = TranslateTS(sttStatuses[i]);
+ gce.ptszStatus = TranslateW(sttStatuses[i]);
CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
}
setDword(gci.hContact, "vk_chat_id", id);
- CMString wszHomepage(FORMAT, L"https://vk.com/im?sel=c%d", id);
+ CMStringW wszHomepage(FORMAT, L"https://vk.com/im?sel=c%d", id);
setWString(gci.hContact, "Homepage", wszHomepage);
db_unset(gci.hContact, m_szModuleName, "off");
@@ -183,10 +183,10 @@ void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe bNew = cu->m_bUnknown;
cu->m_bDel = false;
- CMString wszNick(ptrW(db_get_wsa(cc->m_hContact, m_szModuleName, CMStringA(FORMAT, "nick%d", cu->m_uid))));
+ CMStringW wszNick(ptrW(db_get_wsa(cc->m_hContact, m_szModuleName, CMStringA(FORMAT, "nick%d", cu->m_uid))));
if (wszNick.IsEmpty()) {
- CMString fName(jnUser["first_name"].as_mstring());
- CMString lName(jnUser["last_name"].as_mstring());
+ CMStringW fName(jnUser["first_name"].as_mstring());
+ CMStringW lName(jnUser["last_name"].as_mstring());
wszNick = fName.Trim() + L" " + lName.Trim();
}
cu->m_wszNick = mir_wstrdup(wszNick);
@@ -198,7 +198,7 @@ void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe gce.bIsMe = uid == m_myUserId;
gce.ptszUID = wszId;
gce.ptszNick = wszNick;
- gce.ptszStatus = TranslateTS(sttStatuses[uid == cc->m_admin_id]);
+ gce.ptszStatus = TranslateW(sttStatuses[uid == cc->m_admin_id]);
gce.dwItemData = (INT_PTR)cu;
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
}
@@ -217,7 +217,7 @@ void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe gce.ptszUID = wszId;
gce.dwFlags = GCEF_REMOVECONTACT | GCEF_NOTNOTIFY;
gce.time = time(NULL);
- gce.ptszNick = mir_wstrdup(CMString(FORMAT, L"%s (https://vk.com/id%s)", cu.m_wszNick, wszId));
+ gce.ptszNick = mir_wstrdup(CMStringW(FORMAT, L"%s (https://vk.com/id%s)", cu.m_wszNick, wszId));
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
cc->m_users.remove(i);
@@ -268,7 +268,7 @@ void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe void CVkProto::SetChatTitle(CVkChatInfo *cc, LPCWSTR wszTopic)
{
- debugLog(L"CVkProto::SetChatTitle");
+ debugLogW(L"CVkProto::SetChatTitle");
if (!cc)
return;
@@ -302,11 +302,11 @@ void CVkProto::AppendChatMessage(int id, const JSONNode &jnMsg, const JSONNode & if (!msgTime || msgTime > now)
msgTime = now;
- CMString wszBody(jnMsg["body"].as_mstring());
+ CMStringW wszBody(jnMsg["body"].as_mstring());
const JSONNode &jnFwdMessages = jnMsg["fwd_messages"];
if (jnFwdMessages) {
- CMString wszFwdMessages = GetFwdMessages(jnFwdMessages, jnFUsers, bbcNo);
+ CMStringW wszFwdMessages = GetFwdMessages(jnFwdMessages, jnFUsers, bbcNo);
if (!wszBody.IsEmpty())
wszFwdMessages = L"\n" + wszFwdMessages;
wszBody += wszFwdMessages;
@@ -314,7 +314,7 @@ void CVkProto::AppendChatMessage(int id, const JSONNode &jnMsg, const JSONNode & const JSONNode &jnAttachments = jnMsg["attachments"];
if (jnAttachments) {
- CMString wszAttachmentDescr = GetAttachmentDescr(jnAttachments, bbcNo);
+ CMStringW wszAttachmentDescr = GetAttachmentDescr(jnAttachments, bbcNo);
if (!wszBody.IsEmpty())
wszAttachmentDescr = L"\n" + wszAttachmentDescr;
wszBody += wszAttachmentDescr;
@@ -322,18 +322,18 @@ void CVkProto::AppendChatMessage(int id, const JSONNode &jnMsg, const JSONNode & if (jnMsg["action"]) {
bIsAction = true;
- CMString wszAction = jnMsg["action"].as_mstring();
+ CMStringW wszAction = jnMsg["action"].as_mstring();
if (wszAction == L"chat_create") {
- CMString wszActionText = jnMsg["action_text"].as_mstring();
+ CMStringW wszActionText = jnMsg["action_text"].as_mstring();
wszBody.AppendFormat(L"%s \"%s\"", TranslateT("create chat"), wszActionText.IsEmpty() ? L" " : wszActionText);
}
else if (wszAction == L"chat_kick_user") {
- CMString wszActionMid = jnMsg["action_mid"].as_mstring();
+ CMStringW wszActionMid = jnMsg["action_mid"].as_mstring();
if (wszActionMid.IsEmpty())
wszBody = TranslateT("kick user");
else {
- CMString wszUid(FORMAT, L"%d", uid);
+ CMStringW wszUid(FORMAT, L"%d", uid);
if (wszUid == wszActionMid) {
if (cc->m_bHistoryRead)
return;
@@ -355,11 +355,11 @@ void CVkProto::AppendChatMessage(int id, const JSONNode &jnMsg, const JSONNode & }
}
else if (wszAction == L"chat_invite_user") {
- CMString wszActionMid = jnMsg["action_mid"].as_mstring();
+ CMStringW wszActionMid = jnMsg["action_mid"].as_mstring();
if (wszActionMid.IsEmpty())
wszBody = TranslateT("invite user");
else {
- CMString wszUid(FORMAT, L"%d", uid);
+ CMStringW wszUid(FORMAT, L"%d", uid);
if (wszUid == wszActionMid)
wszBody.AppendFormat(L" (https://vk.com/id%s) %s", wszUid, TranslateT("returned to chat"));
else {
@@ -378,7 +378,7 @@ void CVkProto::AppendChatMessage(int id, const JSONNode &jnMsg, const JSONNode & }
}
else if (wszAction == L"chat_title_update") {
- CMString wszTitle = jnMsg["action_text"].as_mstring();
+ CMStringW wszTitle = jnMsg["action_text"].as_mstring();
wszBody.AppendFormat(L"%s \"%s\"", TranslateT("change chat title to"), wszTitle.IsEmpty() ? L" " : wszTitle);
if (!bIsHistory)
@@ -419,7 +419,7 @@ void CVkProto::AppendChatMessage(CVkChatInfo *cc, int uid, int msgTime, LPCWSTR CVkChatUser *cu = cc->m_users.find((CVkChatUser*)&uid);
if (cu == NULL) {
cc->m_users.insert(cu = new CVkChatUser(uid));
- CMString wszNick(ptrW(db_get_wsa(cc->m_hContact, m_szModuleName, CMStringA(FORMAT, "nick%d", cu->m_uid))));
+ CMStringW wszNick(ptrW(db_get_wsa(cc->m_hContact, m_szModuleName, CMStringA(FORMAT, "nick%d", cu->m_uid))));
cu->m_wszNick = mir_wstrdup(wszNick.IsEmpty() ? (hContact ? ptrW(db_get_wsa(hContact, m_szModuleName, "Nick")) : TranslateT("Unknown")) : wszNick);
cu->m_bUnknown = true;
}
@@ -514,7 +514,7 @@ int CVkProto::OnChatEvent(WPARAM, LPARAM lParam) db_set_dw(hContact, "Ignore", "Mask1", 0);
RetrieveUserInfo(_wtoi(gch->ptszUID));
}
- CallService(MS_MSG_SENDMESSAGET, hContact);
+ CallService(MS_MSG_SENDMESSAGEW, hContact);
}
break;
@@ -691,7 +691,7 @@ void CVkProto::KickFromChat(int chat_id, int user_id, const JSONNode &jnMsg, con return;
MCONTACT hContact = FindUser(user_id, false);
- CMString msg(jnMsg["body"].as_mstring());
+ CMStringW msg(jnMsg["body"].as_mstring());
if (msg.IsEmpty()) {
msg = TranslateT("You've been kicked by ");
if (hContact != NULL)
@@ -782,14 +782,14 @@ void CVkProto::NickMenuHook(CVkChatInfo *cc, GCHOOK *gch) case IDM_VISIT_PROFILE:
hContact = FindUser(cu->m_uid);
if (hContact == NULL)
- Utils_OpenUrlW(CMString(FORMAT, L"https://vk.com/id%d", cu->m_uid));
+ Utils_OpenUrlW(CMStringW(FORMAT, L"https://vk.com/id%d", cu->m_uid));
else
SvcVisitProfile(hContact, 0);
break;
case IDM_CHANGENICK:
{
- CMString wszNewNick = RunRenameNick(cu->m_wszNick);
+ CMStringW wszNewNick = RunRenameNick(cu->m_wszNick);
if (wszNewNick.IsEmpty() || wszNewNick == cu->m_wszNick)
break;
diff --git a/protocols/VKontakte/src/vk_dialogs.cpp b/protocols/VKontakte/src/vk_dialogs.cpp index 889ded760b..0c9f5287a1 100644 --- a/protocols/VKontakte/src/vk_dialogs.cpp +++ b/protocols/VKontakte/src/vk_dialogs.cpp @@ -120,7 +120,7 @@ void CVkWallPostForm::OnInitDialog() {
Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_WALL));
- CMString wszTitle(FORMAT, L"%s %s", TranslateT("Wall message for"), m_param->pwszNick);
+ CMStringW wszTitle(FORMAT, L"%s %s", TranslateT("Wall message for"), m_param->pwszNick);
SetCaption(wszTitle);
m_btnShare.Disable();
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index 2d52d12b9c..64c020b12a 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -32,7 +32,7 @@ void CVkProto::AddFeedSpecialUser() hContact = FindUser(VK_FEED_USER, true);
setWString(hContact, "Nick", TranslateT("VKontakte"));
- CMString wszUrl = L"https://vk.com/press/Simple.png";
+ CMStringW wszUrl = L"https://vk.com/press/Simple.png";
SetAvatarUrl(hContact, wszUrl);
ReloadAvatarInfo(hContact);
@@ -102,8 +102,8 @@ CVkUserInfo* CVkProto::GetVkUserInfo(LONG iUserId, OBJLIST<CVkUserInfo> &vkUsers CVkUserInfo *vkUser = vkUsers.find((CVkUserInfo *)&iUserId);
if (vkUser == NULL) {
- CMString wszNick = TranslateT("Unknown");
- CMString wszLink(L"https://vk.com/");
+ CMStringW wszNick = TranslateT("Unknown");
+ CMStringW wszLink(L"https://vk.com/");
if (iUserId) {
wszLink += bIsGroup ? "club" : "id";
wszLink.AppendFormat(L"%d", bIsGroup ? -iUserId : iUserId);
@@ -130,11 +130,11 @@ void CVkProto::CreateVkUserInfoList(OBJLIST<CVkUserInfo> &vkUsers, const JSONNod continue;
LONG UserId = jnProfile["id"].as_int();
- CMString wszNick(jnProfile["first_name"].as_mstring());
+ CMStringW wszNick(jnProfile["first_name"].as_mstring());
wszNick.AppendChar(' ');
wszNick += jnProfile["last_name"].as_mstring();
- CMString wszLink = L"https://vk.com/";
- CMString wszScreenName(jnProfile["screen_name"].as_mstring());
+ CMStringW wszLink = L"https://vk.com/";
+ CMStringW wszScreenName(jnProfile["screen_name"].as_mstring());
if (wszScreenName.IsEmpty())
wszScreenName.AppendFormat(L"id%d", UserId);
wszLink += wszScreenName;
@@ -150,8 +150,8 @@ void CVkProto::CreateVkUserInfoList(OBJLIST<CVkUserInfo> &vkUsers, const JSONNod continue;
LONG UserId = - jnProfile["id"].as_int();
- CMString wszNick(jnProfile["name"].as_mstring());
- CMString wszLink = L"https://vk.com/";
+ CMStringW wszNick(jnProfile["name"].as_mstring());
+ CMStringW wszLink = L"https://vk.com/";
wszLink += jnProfile["screen_name"].as_mstring();
CVkUserInfo *vkUser = new CVkUserInfo(UserId, true, wszNick, wszLink);
vkUsers.insert(vkUser);
@@ -169,8 +169,8 @@ CVKNewsItem* CVkProto::GetVkNewsItem(const JSONNode &jnItem, OBJLIST<CVkUserInfo LONG iSourceId = !jnItem["source_id"] ? jnItem["owner_id"].as_int() : jnItem["source_id"].as_int();
LONG iPostId = jnItem["post_id"].as_int();
- CMString wszText(jnItem["text"].as_mstring());
- CMString wszPopupText(wszText);
+ CMStringW wszText(jnItem["text"].as_mstring());
+ CMStringW wszPopupText(wszText);
vkNewsItem->wszType = jnItem["type"].as_mstring();
vkNewsItem->vkUser = GetVkUserInfo(iSourceId, vkUsers);
@@ -180,7 +180,7 @@ CVKNewsItem* CVkProto::GetVkNewsItem(const JSONNode &jnItem, OBJLIST<CVkUserInfo if (!wszText.IsEmpty())
wszText += L"\n";
- debugLog(L"CVkProto::GetVkNewsItem %d %d %s", iSourceId, iPostId, vkNewsItem->wszType);
+ debugLogW(L"CVkProto::GetVkNewsItem %d %d %s", iSourceId, iPostId, vkNewsItem->wszType);
if (vkNewsItem->wszType == L"photo_tag") {
bPostLink = false;
@@ -246,7 +246,7 @@ CVKNewsItem* CVkProto::GetVkNewsItem(const JSONNode &jnItem, OBJLIST<CVkUserInfo }
}
- CMString wszResFormat, wszTitleFormat;
+ CMStringW wszResFormat, wszTitleFormat;
if (!isRepost) {
wszResFormat = Translate("News from %s\n%s");
@@ -266,26 +266,26 @@ CVKNewsItem* CVkProto::GetVkNewsItem(const JSONNode &jnItem, OBJLIST<CVkUserInfo vkNewsItem->wszId.AppendFormat(L"%d_%d", vkNewsItem->vkUser->m_UserId, iPostId);
if (bPostLink) {
- vkNewsItem->wszLink = CMString(L"https://vk.com/wall") + vkNewsItem->wszId;
+ vkNewsItem->wszLink = CMStringW(L"https://vk.com/wall") + vkNewsItem->wszId;
vkNewsItem->wszText.AppendChar('\n');
vkNewsItem->wszText += SetBBCString(TranslateT("Link"), m_vkOptions.BBCForNews(), vkbbcUrl, vkNewsItem->wszLink);
}
- debugLog(L"CVkProto::GetVkNewsItem %d %d <\n%s\n>", iSourceId, iPostId, vkNewsItem->wszText);
+ debugLogW(L"CVkProto::GetVkNewsItem %d %d <\n%s\n>", iSourceId, iPostId, vkNewsItem->wszText);
return vkNewsItem;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////
-CMString CVkProto::GetVkFeedback(const JSONNode &jnFeedback, VKObjType vkFeedbackType, OBJLIST<CVkUserInfo> &vkUsers, CVkUserInfo *vkUser)
+CMStringW CVkProto::GetVkFeedback(const JSONNode &jnFeedback, VKObjType vkFeedbackType, OBJLIST<CVkUserInfo> &vkUsers, CVkUserInfo *vkUser)
{
debugLogA("CVkProto::GetVkFeedback");
- CMString wszRes;
+ CMStringW wszRes;
if (!jnFeedback || !vkFeedbackType)
return wszRes;
- CMString wszFormat;
+ CMStringW wszFormat;
LONG iUserId = 0;
if (vkFeedbackType == vkComment) {
@@ -299,7 +299,7 @@ CMString CVkProto::GetVkFeedback(const JSONNode &jnFeedback, VKObjType vkFeedbac else if (vkFeedbackType == VKObjType::vkUsers || vkFeedbackType == vkCopy) {
const JSONNode &jnUsers = jnFeedback["items"];
- CMString wszUsers;
+ CMStringW wszUsers;
for (auto it = jnUsers.begin(); it != jnUsers.end(); ++it) {
const JSONNode &jnUserItem = (*it);
if (!jnUserItem["from_id"])
@@ -317,7 +317,7 @@ CMString CVkProto::GetVkFeedback(const JSONNode &jnFeedback, VKObjType vkFeedbac if (iUserId) {
vkUser = GetVkUserInfo(iUserId, vkUsers);
- CMString wszText(jnFeedback["text"].as_mstring());
+ CMStringW wszText(jnFeedback["text"].as_mstring());
wszText.Replace(L"%", L"%%");
wszRes.AppendFormat(wszFormat, SetBBCString(vkUser->m_wszUserNick, m_vkOptions.BBCForNews(), vkbbcUrl, vkUser->m_wszLink), ClearFormatNick(wszText));
}
@@ -328,14 +328,14 @@ CMString CVkProto::GetVkFeedback(const JSONNode &jnFeedback, VKObjType vkFeedbac CVKNewsItem* CVkProto::GetVkParent(const JSONNode &jnParent, VKObjType vkParentType, LPCWSTR pwszReplyText, LPCWSTR pwszReplyLink)
{
debugLogA("CVkProto::GetVkParent");
- CMString wszRes;
+ CMStringW wszRes;
if (!jnParent || !vkParentType)
return NULL;
CVKNewsItem *vkNotificationItem = new CVKNewsItem();
if (vkParentType == vkPhoto) {
- CMString wszPhoto = GetVkPhotoItem(jnParent, m_vkOptions.BBCForNews());
+ CMStringW wszPhoto = GetVkPhotoItem(jnParent, m_vkOptions.BBCForNews());
LONG iOwnerId = jnParent["owner_id"].as_int();
LONG iId = jnParent["id"].as_int();
vkNotificationItem->wszId.AppendFormat(L"%d_%d", iOwnerId, iId);
@@ -352,11 +352,11 @@ CVKNewsItem* CVkProto::GetVkParent(const JSONNode &jnParent, VKObjType vkParentT else if (vkParentType == vkVideo) {
LONG iOwnerId = jnParent["owner_id"].as_int();
LONG iId = jnParent["id"].as_int();
- CMString wszTitle(jnParent["title"].as_mstring());
+ CMStringW wszTitle(jnParent["title"].as_mstring());
vkNotificationItem->wszId.AppendFormat(L"%d_%d", iOwnerId, iId);
vkNotificationItem->wszLink.AppendFormat(L"https://vk.com/video%s", vkNotificationItem->wszId);
- CMString wszText(jnParent["text"].as_mstring());
+ CMStringW wszText(jnParent["text"].as_mstring());
ClearFormatNick(wszText);
if (!wszText.IsEmpty())
@@ -375,7 +375,7 @@ CVKNewsItem* CVkProto::GetVkParent(const JSONNode &jnParent, VKObjType vkParentT vkNotificationItem->wszId.AppendFormat(L"%d_%d", iToId, iId);
vkNotificationItem->wszLink.AppendFormat(L"https://vk.com/wall%s%s", vkNotificationItem->wszId, pwszReplyLink ? pwszReplyLink : L"");
- CMString wszText(jnParent["text"].as_mstring());
+ CMStringW wszText(jnParent["text"].as_mstring());
ClearFormatNick(wszText);
if (!wszText.IsEmpty()) {
@@ -395,12 +395,12 @@ CVKNewsItem* CVkProto::GetVkParent(const JSONNode &jnParent, VKObjType vkParentT else if (vkParentType == vkTopic) {
LONG iOwnerId = jnParent["owner_id"].as_int();
LONG iId = jnParent["id"].as_int();
- CMString wszTitle(jnParent["title"].as_mstring());
+ CMStringW wszTitle(jnParent["title"].as_mstring());
vkNotificationItem->wszId.AppendFormat(L"%d_%d", iOwnerId, iId);
vkNotificationItem->wszLink.AppendFormat(L"https://vk.com/topic%s%s",
vkNotificationItem->wszId, pwszReplyLink ? pwszReplyLink : L"");
- CMString wszText(jnParent["text"].as_mstring());
+ CMStringW wszText(jnParent["text"].as_mstring());
ClearFormatNick(wszText);
if (!wszText.IsEmpty()) {
@@ -418,7 +418,7 @@ CVKNewsItem* CVkProto::GetVkParent(const JSONNode &jnParent, VKObjType vkParentT vkNotificationItem->wszText.AppendFormat(L"\n%s", SetBBCString(wszTitle, m_vkOptions.BBCForNews(), vkbbcUrl, vkNotificationItem->wszLink));
}
else if (vkParentType == vkComment) {
- CMString wszText(jnParent["text"].as_mstring());
+ CMStringW wszText(jnParent["text"].as_mstring());
ClearFormatNick(wszText);
const JSONNode &jnPhoto = jnParent["photo"];
@@ -437,14 +437,14 @@ CVKNewsItem* CVkProto::GetVkParent(const JSONNode &jnParent, VKObjType vkParentT const JSONNode &jnPost = jnParent["post"];
if (jnPost) {
- CMString wszRepl(FORMAT, L"?reply=%d", iId);
+ CMStringW wszRepl(FORMAT, L"?reply=%d", iId);
delete vkNotificationItem;
return GetVkParent(jnPost, vkPost, wszText, wszRepl);
}
const JSONNode &jnTopic = jnParent["topic"];
if (jnTopic) {
- CMString wszRepl(FORMAT, L"?reply=%d", iId);
+ CMStringW wszRepl(FORMAT, L"?reply=%d", iId);
delete vkNotificationItem;
return GetVkParent(jnTopic, vkTopic, wszText, wszRepl);
}
@@ -459,9 +459,9 @@ CVKNewsItem* CVkProto::GetVkNotificationsItem(const JSONNode &jnItem, OBJLIST<CV if (!jnItem)
return NULL;
- CMString wszType(jnItem["type"].as_mstring());
+ CMStringW wszType(jnItem["type"].as_mstring());
VKObjType vkFeedbackType = vkNull, vkParentType = vkNull;
- CMString wszNotificationTranslate = SpanVKNotificationType(wszType, vkFeedbackType, vkParentType);
+ CMStringW wszNotificationTranslate = SpanVKNotificationType(wszType, vkFeedbackType, vkParentType);
const JSONNode &jnFeedback = jnItem["feedback"];
const JSONNode &jnParent = jnItem["parent"];
@@ -475,14 +475,14 @@ CVKNewsItem* CVkProto::GetVkNotificationsItem(const JSONNode &jnItem, OBJLIST<CV return NULL;
CVkUserInfo *vkUser = NULL;
- CMString wszFeedback = GetVkFeedback(jnFeedback, vkFeedbackType, vkUsers, vkUser);
+ CMStringW wszFeedback = GetVkFeedback(jnFeedback, vkFeedbackType, vkUsers, vkUser);
CVKNewsItem *vkNotification = GetVkParent(jnParent, vkParentType);
if (!vkNotification)
return NULL;
if (vkNotification && !wszFeedback.IsEmpty()) {
- CMString wszNotificaton;
+ CMStringW wszNotificaton;
wszNotificaton.AppendFormat(wszFeedback, wszNotificationTranslate, vkNotification->wszText);
vkNotification->wszText = wszNotificaton;
@@ -532,16 +532,16 @@ CVKNewsItem* CVkProto::GetVkGroupInvates(const JSONNode &jnItem, OBJLIST<CVkUser if (!jnItem)
return NULL;
- CMString wszType(jnItem["type"].as_mstring());
+ CMStringW wszType(jnItem["type"].as_mstring());
VKObjType vkFeedbackType = vkNull, vkParentType = vkNull;
- CMString wszNotificationTranslate = SpanVKNotificationType(wszType, vkFeedbackType, vkParentType);
+ CMStringW wszNotificationTranslate = SpanVKNotificationType(wszType, vkFeedbackType, vkParentType);
if (!jnItem["id"])
return NULL;
LONG iGroupId = jnItem["id"].as_int();
- CMString wszId(FORMAT, L"%d,", iGroupId);
- CMString wszIds(ptrW(db_get_wsa(NULL, m_szModuleName, "InviteGroupIds")));
+ CMStringW wszId(FORMAT, L"%d,", iGroupId);
+ CMStringW wszIds(ptrW(db_get_wsa(NULL, m_szModuleName, "InviteGroupIds")));
if (wszIds.Find(wszId, 0) != -1)
return NULL;
@@ -555,12 +555,12 @@ CVKNewsItem* CVkProto::GetVkGroupInvates(const JSONNode &jnItem, OBJLIST<CVkUser vkNotification->vkFeedbackType = vkFeedbackType;
vkNotification->vkParentType = vkParentType;
- CMString wszGroupName;
- CMString wszGName = jnItem["name"].as_mstring();
- CMString wszGLink(FORMAT, L"https://vk.com/%s", jnItem["screen_name"].as_mstring());
+ CMStringW wszGroupName;
+ CMStringW wszGName = jnItem["name"].as_mstring();
+ CMStringW wszGLink(FORMAT, L"https://vk.com/%s", jnItem["screen_name"].as_mstring());
wszGroupName = SetBBCString(wszGName, m_vkOptions.BBCForNews(), vkbbcUrl, wszGLink);
- CMString wszUsers = SetBBCString(iUserId ? vkNotification->vkUser->m_wszUserNick : TranslateT("Unknown"), m_vkOptions.BBCForNews(), vkbbcUrl, iUserId ? vkNotification->vkUser->m_wszLink : L"https://vk.com/");
+ CMStringW wszUsers = SetBBCString(iUserId ? vkNotification->vkUser->m_wszUserNick : TranslateT("Unknown"), m_vkOptions.BBCForNews(), vkbbcUrl, iUserId ? vkNotification->vkUser->m_wszLink : L"https://vk.com/");
vkNotification->wszText.AppendFormat(L"%s %s %s", wszUsers, wszNotificationTranslate, wszGroupName);
vkNotification->wszPopupTitle.AppendFormat(L"%s %s %s", iUserId ? vkNotification->vkUser->m_wszUserNick : TranslateT("Unknown"), wszNotificationTranslate, wszGName);
@@ -708,7 +708,7 @@ void CVkProto::RetrieveUnreadNotifications(time_t tLastNotificationsTime) if (time(NULL) - tLastNotificationsReqTime < 3 * 60)
return;
- CMString code(FORMAT, L"return{\"notifications\":API.notifications.get({\"count\": 100, \"start_time\":%d})%s",
+ CMStringW code(FORMAT, L"return{\"notifications\":API.notifications.get({\"count\": 100, \"start_time\":%d})%s",
(LONG)(tLastNotificationsTime + 1),
m_vkOptions.bNotificationFilterInvites ? L",\"groupinvates\":API.groups.getInvites({\"extended\":1})};" : L"};");
diff --git a/protocols/VKontakte/src/vk_files.cpp b/protocols/VKontakte/src/vk_files.cpp index af491c5729..2d977768fb 100644 --- a/protocols/VKontakte/src/vk_files.cpp +++ b/protocols/VKontakte/src/vk_files.cpp @@ -32,7 +32,7 @@ HANDLE CVkProto::SendFile(MCONTACT hContact, const wchar_t *desc, wchar_t **file void CVkProto::SendFileFiled(CVkFileUploadParam *fup, int ErrorCode)
{
- CMString wszError;
+ CMStringW wszError;
switch (ErrorCode) {
case VKERR_OFFLINE:
wszError = TranslateT("Protocol is offline");
@@ -89,7 +89,7 @@ void CVkProto::SendFileFiled(CVkFileUploadParam *fup, int ErrorCode) wszError = TranslateT("Unknown error occurred");
}
ProtoBroadcastAck(fup->hContact, ACKTYPE_FILE, ErrorCode== VKERR_AUDIO_DEL_COPYRIGHT ? ACKRESULT_DENIED : ACKRESULT_FAILED, (HANDLE)fup);
- debugLog(L"CVkProto::SendFileFiled error code = %d (%s)", ErrorCode, wszError);
+ debugLogW(L"CVkProto::SendFileFiled error code = %d (%s)", ErrorCode, wszError);
MsgPopup(NULL, wszError, TranslateT("File upload error"), true);
delete fup;
}
@@ -97,7 +97,7 @@ void CVkProto::SendFileFiled(CVkFileUploadParam *fup, int ErrorCode) void CVkProto::SendFileThread(void *p)
{
CVkFileUploadParam *fup = (CVkFileUploadParam *)p;
- debugLog(L"CVkProto::SendFileThread %d %s", fup->GetType(), fup->fileName());
+ debugLogW(L"CVkProto::SendFileThread %d %s", fup->GetType(), fup->fileName());
if (!IsOnline()) {
SendFileFiled(fup, VKERR_OFFLINE);
return;
@@ -252,9 +252,9 @@ void CVkProto::OnReciveUpload(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) return;
}
- CMString server(jnRoot["server"].as_mstring());
- CMString hash(jnRoot["hash"].as_mstring());
- CMString upload;
+ CMStringW server(jnRoot["server"].as_mstring());
+ CMStringW hash(jnRoot["hash"].as_mstring());
+ CMStringW upload;
AsyncHttpRequest *pUploadReq;
@@ -330,7 +330,7 @@ void CVkProto::OnReciveUploadFile(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pR return;
}
- CMString Attachment;
+ CMStringW Attachment;
switch (fup->GetType()) {
case CVkFileUploadParam::typeImg:
diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp index ed5671492e..706f38568e 100644 --- a/protocols/VKontakte/src/vk_history.cpp +++ b/protocols/VKontakte/src/vk_history.cpp @@ -168,7 +168,7 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque mir_cslock lck(m_csLoadHistoryTask);
if (m_iLoadHistoryTask > 0)
m_iLoadHistoryTask--;
- debugLog(L"CVkProto::OnReceiveHistoryMessages error m_iLoadHistoryTask=%d", m_iLoadHistoryTask);
+ debugLogW(L"CVkProto::OnReceiveHistoryMessages error m_iLoadHistoryTask=%d", m_iLoadHistoryTask);
MsgPopup(NULL, TranslateT("Error loading message history from server"), TranslateT("Error"), true);
if (m_iLoadHistoryTask == 0 && m_bNotifyForEndLoadingHistoryAllContact) {
@@ -189,10 +189,10 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque m_iLoadHistoryTask--;
ptrW pwszNick(db_get_wsa(param->hContact, m_szModuleName, "Nick"));
- CMString str(FORMAT, L"%s %s %s", TranslateT("Error loading message history from server"), TranslateT("for"), pwszNick);
+ CMStringW str(FORMAT, L"%s %s %s", TranslateT("Error loading message history from server"), TranslateT("for"), pwszNick);
MsgPopup(param->hContact, str, TranslateT("Error"), true);
- debugLog(L"CVkProto::OnReceiveHistoryMessages error for %s m_iLoadHistoryTask=%d", pwszNick, m_iLoadHistoryTask);
+ debugLogW(L"CVkProto::OnReceiveHistoryMessages error for %s m_iLoadHistoryTask=%d", pwszNick, m_iLoadHistoryTask);
if (m_iLoadHistoryTask == 0 && m_bNotifyForEndLoadingHistoryAllContact) {
MsgPopup(NULL, TranslateT("Loading messages for all contacts is completed"), TranslateT("Loading history"));
@@ -223,7 +223,7 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque char szMid[40];
_itoa(mid, szMid, 10);
- CMString wszBody(jnMsg["body"].as_mstring());
+ CMStringW wszBody(jnMsg["body"].as_mstring());
int datetime = jnMsg["date"].as_int();
int isOut = jnMsg["out"].as_int();
int isRead = jnMsg["read_state"].as_int();
@@ -231,7 +231,7 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque const JSONNode &jnFwdMessages = jnMsg["fwd_messages"];
if (jnFwdMessages) {
- CMString wszFwdMessages = GetFwdMessages(jnFwdMessages, jnFUsers, m_vkOptions.BBCForAttachments());
+ CMStringW wszFwdMessages = GetFwdMessages(jnFwdMessages, jnFUsers, m_vkOptions.BBCForAttachments());
if (!wszBody.IsEmpty())
wszFwdMessages = L"\n" + wszFwdMessages;
wszBody += wszFwdMessages;
@@ -239,7 +239,7 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque const JSONNode &jnAttachments = jnMsg["attachments"];
if (jnAttachments) {
- CMString wszAttachmentDescr = GetAttachmentDescr(jnAttachments, m_vkOptions.BBCForAttachments());
+ CMStringW wszAttachmentDescr = GetAttachmentDescr(jnAttachments, m_vkOptions.BBCForAttachments());
if (!wszBody.IsEmpty())
wszAttachmentDescr = L"\n" + wszAttachmentDescr;
wszBody += wszAttachmentDescr;
@@ -281,8 +281,8 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque m_iLoadHistoryTask--;
ptrW pwszNick(db_get_wsa(param->hContact, m_szModuleName, "Nick"));
- CMString str(FORMAT, TranslateT("Loading messages for %s is completed"), pwszNick);
- debugLog(L"CVkProto::OnReceiveHistoryMessages for %s m_iLoadHistoryTask=%d", pwszNick, m_iLoadHistoryTask);
+ CMStringW str(FORMAT, TranslateT("Loading messages for %s is completed"), pwszNick);
+ debugLogW(L"CVkProto::OnReceiveHistoryMessages for %s m_iLoadHistoryTask=%d", pwszNick, m_iLoadHistoryTask);
if (m_bNotifyForEndLoadingHistory)
MsgPopup(param->hContact, str, TranslateT("Loading history"));
diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp index bf5cb8bc7f..1ebed06e69 100644 --- a/protocols/VKontakte/src/vk_messages.cpp +++ b/protocols/VKontakte/src/vk_messages.cpp @@ -242,7 +242,7 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe }
UINT mid = jnMsg["id"].as_int();
- CMString wszBody(jnMsg["body"].as_mstring());
+ CMStringW wszBody(jnMsg["body"].as_mstring());
int datetime = jnMsg["date"].as_int();
int isOut = jnMsg["out"].as_int();
int isRead = jnMsg["read_state"].as_int();
@@ -250,13 +250,13 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe const JSONNode &jnFwdMessages = jnMsg["fwd_messages"];
if (jnFwdMessages) {
- CMString wszFwdMessages = GetFwdMessages(jnFwdMessages, jnFUsers, m_vkOptions.BBCForAttachments());
+ CMStringW wszFwdMessages = GetFwdMessages(jnFwdMessages, jnFUsers, m_vkOptions.BBCForAttachments());
if (!wszBody.IsEmpty())
wszFwdMessages = L"\n" + wszFwdMessages;
wszBody += wszFwdMessages;
}
- CMString wszAttachmentDescr;
+ CMStringW wszAttachmentDescr;
const JSONNode &jnAttachments = jnMsg["attachments"];
if (jnAttachments) {
wszAttachmentDescr = GetAttachmentDescr(jnAttachments, m_vkOptions.BBCForAttachments());
@@ -280,7 +280,7 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe if (chat_id != 0) {
debugLogA("CVkProto::OnReceiveMessages chat_id != 0");
- CMString action_chat = jnMsg["action"].as_mstring();
+ CMStringW action_chat = jnMsg["action"].as_mstring();
int action_mid = _wtoi(jnMsg["action_mid"].as_mstring());
if ((action_chat == "chat_kick_user") && (action_mid == m_myUserId))
KickFromChat(chat_id, uid, jnMsg, jnFUsers);
diff --git a/protocols/VKontakte/src/vk_options.cpp b/protocols/VKontakte/src/vk_options.cpp index 9007aaeef3..c30fed271d 100644 --- a/protocols/VKontakte/src/vk_options.cpp +++ b/protocols/VKontakte/src/vk_options.cpp @@ -181,7 +181,7 @@ void CVkOptionAccountForm::OnInitDialog() }
for (size_t i = 0; i < _countof(vkLangCodes); i++) {
- int cur = m_cbxVKLang.AddString(TranslateTS(vkLangCodes[i].szDescription), (LPARAM)vkLangCodes[i].szCode);
+ int cur = m_cbxVKLang.AddString(TranslateW(vkLangCodes[i].szDescription), (LPARAM)vkLangCodes[i].szCode);
if (!mir_wstrcmpi(vkLangCodes[i].szCode, m_proto->m_vkOptions.pwszVKLang))
m_cbxVKLang.SetCurSel(cur);
}
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 984799dad1..0ebfaf6079 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -65,7 +65,7 @@ CVkProto::CVkProto(const char *szModuleName, const wchar_t *pwszUserName) : mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName);
NETLIBUSER nlu = {sizeof(nlu)};
- nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
+ nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
nlu.ptszDescriptiveName = descr;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
@@ -120,7 +120,7 @@ int CVkProto::OnModulesLoaded(WPARAM, LPARAM) HookProtoEvent(ME_DB_EVENT_MARKED_READ, &CVkProto::OnDbEventRead);
HookProtoEvent(ME_DB_CONTACT_SETTINGCHANGED, &CVkProto::OnDbSettingChanged);
//Sounds
- SkinAddNewSoundExT("VKNewsFeed", m_tszUserName, LPGENW("VKontakte newsfeed & notification event"));
+ SkinAddNewSoundExW("VKNewsFeed", m_tszUserName, LPGENW("VKontakte newsfeed & notification event"));
InitPopups();
InitMenus();
@@ -228,7 +228,7 @@ void CVkProto::InitMenus() // Contact Menu Items
mi.root = NULL;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.pszService = PS_VISITPROFILE;
mi.position = -200001000 + CMI_VISITPROFILE;
@@ -575,7 +575,7 @@ void CVkProto::OnReceiveAuthRequest(NETLIBHTTPREQUEST *reply, AsyncHttpRequest * int iRet = jnResponse.as_int();
setByte(param->hContact, "Auth", 0);
if (iRet == 2) {
- CMString msg,
+ CMStringW msg,
wszNick(ptrW(db_get_wsa(param->hContact, m_szModuleName, "Nick")));
if (wszNick.IsEmpty())
wszNick = TranslateT("(Unknown contact)");
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index 65f127836b..ae91f9d5f0 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -268,7 +268,7 @@ private: CVKNewsItem* GetVkGroupInvates(const JSONNode &jnItem, OBJLIST<CVkUserInfo> &vkUsers);
CVKNewsItem* GetVkNotificationsItem(const JSONNode &jnItem, OBJLIST<CVkUserInfo> &vkUsers);
void OnFriendAccepted(const JSONNode &jnFeedback);
- CMString GetVkFeedback(const JSONNode &jnFeedback, VKObjType vkFeedbackType, OBJLIST<CVkUserInfo> &vkUsers, CVkUserInfo *vkUser);
+ CMStringW GetVkFeedback(const JSONNode &jnFeedback, VKObjType vkFeedbackType, OBJLIST<CVkUserInfo> &vkUsers, CVkUserInfo *vkUser);
CVKNewsItem* GetVkParent(const JSONNode &jnParent, VKObjType vkParentType, LPCWSTR pwszReplyText = NULL, LPCWSTR pwszReplyLink = NULL);
void RetrieveUnreadNews(time_t tLastNewsTime);
void OnReceiveUnreadNews(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
@@ -284,8 +284,8 @@ private: void SetServerStatus(int);
void RetrieveUsersInfo(bool flag = false, bool bRepeat = false);
- void RetrieveStatusMsg(const CMString &StatusMsg);
- void RetrieveStatusMusic(const CMString &StatusMsg);
+ void RetrieveStatusMsg(const CMStringW &StatusMsg);
+ void RetrieveStatusMusic(const CMStringW &StatusMsg);
void OnReceiveStatus(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
void OnReceiveStatusMsg(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
MCONTACT SetContactInfo(const JSONNode &jnItem, bool flag = false, bool self = false);
@@ -325,8 +325,8 @@ private: bool CheckJsonResult(AsyncHttpRequest *pReq, const JSONNode &Node);
void OnReceiveSmth(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
bool AutoFillForm(char*, CMStringA&, CMStringA&);
- CMString RunConfirmationCode();
- CMString RunRenameNick(LPCWSTR pwszOldName);
+ CMStringW RunConfirmationCode();
+ CMStringW RunRenameNick(LPCWSTR pwszOldName);
void GrabCookies(NETLIBHTTPREQUEST *nhr);
void ApplyCookies(AsyncHttpRequest*);
void __cdecl DBAddAuthRequestThread(void *p);
@@ -338,14 +338,14 @@ private: void MarkDialogAsRead(MCONTACT hContact);
char* GetStickerId(const char *Msg, int& stickerid);
CMStringA GetAttachmentsFromMessage(const char * Msg);
- CMString SpanVKNotificationType(CMString& wszType, VKObjType& vkFeedback, VKObjType& vkParent);
- CMString GetVkPhotoItem(const JSONNode &jnPhoto, BBCSupport iBBC);
- CMString SetBBCString(LPCWSTR wszString, BBCSupport iBBC, VKBBCType bbcType, LPCWSTR wszAddString = NULL);
- CMString& ClearFormatNick(CMString& wszText);
- CMString GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport iBBC = bbcNo);
- CMString GetFwdMessages(const JSONNode &jnMessages, const JSONNode &jnFUsers, BBCSupport iBBC = bbcNo);
+ CMStringW SpanVKNotificationType(CMStringW& wszType, VKObjType& vkFeedback, VKObjType& vkParent);
+ CMStringW GetVkPhotoItem(const JSONNode &jnPhoto, BBCSupport iBBC);
+ CMStringW SetBBCString(LPCWSTR wszString, BBCSupport iBBC, VKBBCType bbcType, LPCWSTR wszAddString = NULL);
+ CMStringW& ClearFormatNick(CMStringW& wszText);
+ CMStringW GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport iBBC = bbcNo);
+ CMStringW GetFwdMessages(const JSONNode &jnMessages, const JSONNode &jnFUsers, BBCSupport iBBC = bbcNo);
void SetInvisible(MCONTACT hContact);
- CMString RemoveBBC(CMString& wszSrc);
+ CMStringW RemoveBBC(CMStringW& wszSrc);
void InitQueue();
void UninitQueue();
void ExecuteRequest(AsyncHttpRequest*);
@@ -357,7 +357,7 @@ private: void OnLoggedIn();
void OnLoggedOut();
void ShutdownSession();
- void SetAvatarUrl(MCONTACT hContact, CMString &wszUrl);
+ void SetAvatarUrl(MCONTACT hContact, CMStringW &wszUrl);
void GetAvatarFileName(MCONTACT hContact, wchar_t *pwszDest, size_t cbLen);
void ReloadAvatarInfo(MCONTACT hContact);
void __cdecl SendMsgAck(void *param);
diff --git a/protocols/VKontakte/src/vk_search.cpp b/protocols/VKontakte/src/vk_search.cpp index b56376b265..7b08a446da 100644 --- a/protocols/VKontakte/src/vk_search.cpp +++ b/protocols/VKontakte/src/vk_search.cpp @@ -70,7 +70,7 @@ void __cdecl CVkProto::SearchThread(void *p) wchar_t arg[200];
mir_snwprintf(arg, L"%s %s %s", pParam->pszFirstName, pParam->pszNick, pParam->pszLastName);
- debugLog(L"CVkProto::SearchThread %s", arg);
+ debugLogW(L"CVkProto::SearchThread %s", arg);
if (!IsOnline())
return;
@@ -118,13 +118,13 @@ void CVkProto::OnSearch(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) break;
PROTOSEARCHRESULT psr = { sizeof(psr) };
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
- CMString Id(FORMAT, L"%d", jnRecord["id"].as_int());
- CMString FirstName(jnRecord["first_name"].as_mstring());
- CMString LastName(jnRecord["last_name"].as_mstring());
- CMString Nick(jnRecord["nickname"].as_mstring());
- CMString Domain(jnRecord["domain"].as_mstring());
+ CMStringW Id(FORMAT, L"%d", jnRecord["id"].as_int());
+ CMStringW FirstName(jnRecord["first_name"].as_mstring());
+ CMStringW LastName(jnRecord["last_name"].as_mstring());
+ CMStringW Nick(jnRecord["nickname"].as_mstring());
+ CMStringW Domain(jnRecord["domain"].as_mstring());
psr.id.w = mir_wstrdup(Id);
psr.firstName.w = mir_wstrdup(FirstName);
@@ -176,13 +176,13 @@ void CVkProto::OnSearchByMail(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) break;
PROTOSEARCHRESULT psr = { sizeof(psr) };
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
- CMString Id(FORMAT, L"%d", jnRecord["id"].as_int());
- CMString FirstName(jnRecord["first_name"].as_mstring());
- CMString LastName(jnRecord["last_name"].as_mstring());
- CMString Nick(jnRecord["nickname"].as_mstring());
- CMString Email(jnRecord["contact"].as_mstring());
+ CMStringW Id(FORMAT, L"%d", jnRecord["id"].as_int());
+ CMStringW FirstName(jnRecord["first_name"].as_mstring());
+ CMStringW LastName(jnRecord["last_name"].as_mstring());
+ CMStringW Nick(jnRecord["nickname"].as_mstring());
+ CMStringW Email(jnRecord["contact"].as_mstring());
psr.id.w = mir_wstrdup(Id);
psr.firstName.w = mir_wstrdup(FirstName);
diff --git a/protocols/VKontakte/src/vk_status.cpp b/protocols/VKontakte/src/vk_status.cpp index 5f58c9dcf3..6bba4870c6 100644 --- a/protocols/VKontakte/src/vk_status.cpp +++ b/protocols/VKontakte/src/vk_status.cpp @@ -69,7 +69,7 @@ void CVkProto::SetServerStatus(int iNewStatus) return;
int iOldStatus = m_iStatus;
- CMString oldStatusMsg(ptrW(db_get_wsa(NULL, m_szModuleName, "OldStatusMsg")));
+ CMStringW oldStatusMsg(ptrW(db_get_wsa(NULL, m_szModuleName, "OldStatusMsg")));
ptrW pwszListeningToMsg(db_get_wsa(NULL, m_szModuleName, "ListeningTo"));
if (iNewStatus == ID_STATUS_OFFLINE) {
@@ -127,7 +127,7 @@ void CVkProto::OnReceiveStatusMsg(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pR OnReceiveStatus(reply, pReq);
ptrW pwszOldStatusMsg(db_get_wsa(NULL, m_szModuleName, "OldStatusMsg"));
- CMString wszOldStatusMsg(pwszOldStatusMsg);
+ CMStringW wszOldStatusMsg(pwszOldStatusMsg);
ENTER_STRING pForm = { sizeof(pForm) };
pForm.type = ESF_MULTILINE;
@@ -139,7 +139,7 @@ void CVkProto::OnReceiveStatusMsg(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pR if (!EnterString(&pForm))
return;
- CMString wszNewStatusMsg(ptrW(pForm.ptszResult));
+ CMStringW wszNewStatusMsg(ptrW(pForm.ptszResult));
if (wszOldStatusMsg == wszNewStatusMsg)
return;
@@ -159,13 +159,13 @@ void CVkProto::OnReceiveStatus(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) const JSONNode &jnAudio = jnResponse["audio"];
if (!jnAudio) {
- CMString wszStatusText(jnResponse["text"].as_mstring());
+ CMStringW wszStatusText(jnResponse["text"].as_mstring());
if (wszStatusText[0] != wchar_t(9835))
setWString("OldStatusMsg", wszStatusText);
}
}
-void CVkProto::RetrieveStatusMsg(const CMString &StatusMsg)
+void CVkProto::RetrieveStatusMsg(const CMStringW &StatusMsg)
{
debugLogA("CVkProto::RetrieveStatusMsg");
if (!IsOnline())
@@ -175,26 +175,26 @@ void CVkProto::RetrieveStatusMsg(const CMString &StatusMsg) << WCHAR_PARAM("text", StatusMsg));
}
-void CVkProto::RetrieveStatusMusic(const CMString &StatusMsg)
+void CVkProto::RetrieveStatusMusic(const CMStringW &StatusMsg)
{
debugLogA("CVkProto::RetrieveStatusMusic");
if (!IsOnline() || m_iStatus == ID_STATUS_INVISIBLE || m_vkOptions.iMusicSendMetod == MusicSendMetod::sendNone)
return;
- CMString code;
- CMString wszOldStatusMsg(db_get_wsa(0, m_szModuleName, "OldStatusMsg"));
+ CMStringW code;
+ CMStringW wszOldStatusMsg(db_get_wsa(0, m_szModuleName, "OldStatusMsg"));
if (StatusMsg.IsEmpty()) {
if (m_vkOptions.iMusicSendMetod == MusicSendMetod::sendBroadcastOnly)
code = "API.audio.setBroadcast();return null;";
else {
- CMString codeformat("API.status.set({text:\"%s\"});return null;");
+ CMStringW codeformat("API.status.set({text:\"%s\"});return null;");
code.AppendFormat(codeformat, wszOldStatusMsg);
}
m_bSetBroadcast = false;
}
else {
if (m_vkOptions.iMusicSendMetod == MusicSendMetod::sendBroadcastOnly) {
- CMString codeformat("var StatusMsg=\"%s\";var CntLmt=100;var OldMsg=API.status.get();"
+ CMStringW codeformat("var StatusMsg=\"%s\";var CntLmt=100;var OldMsg=API.status.get();"
"var Tracks=API.audio.search({\"q\":StatusMsg,\"count\":CntLmt,\"search_own\":1});"
"var Cnt=Tracks.count;if(Cnt>CntLmt){Cnt=CntLmt;}"
"if(Cnt==0){API.audio.setBroadcast();}"
@@ -205,13 +205,13 @@ void CVkProto::RetrieveStatusMusic(const CMString &StatusMsg) code.AppendFormat(codeformat, StatusMsg);
}
else if (m_vkOptions.iMusicSendMetod == MusicSendMetod::sendStatusOnly) {
- CMString codeformat("var StatusMsg=\"♫ %s\";var OldMsg=API.status.get();"
+ CMStringW codeformat("var StatusMsg=\"♫ %s\";var OldMsg=API.status.get();"
"API.status.set({\"text\":StatusMsg});"
"return OldMsg;");
code.AppendFormat(codeformat, StatusMsg);
}
else if (m_vkOptions.iMusicSendMetod == MusicSendMetod::sendBroadcastAndStatus) {
- CMString codeformat("var StatusMsg=\"%s\";var CntLmt=100;var Track=\" \";var OldMsg=API.status.get();"
+ CMStringW codeformat("var StatusMsg=\"%s\";var CntLmt=100;var Track=\" \";var OldMsg=API.status.get();"
"var Tracks=API.audio.search({\"q\":StatusMsg,\"count\":CntLmt,\"search_own\":1});"
"var Cnt=Tracks.count;if(Cnt>CntLmt){Cnt=CntLmt;}"
"if(Cnt==0){Track=\"♫ \"+StatusMsg;API.status.set({\"text\":Track});}"
@@ -235,7 +235,7 @@ INT_PTR __cdecl CVkProto::SvcSetListeningTo(WPARAM, LPARAM lParam) return 1;
LISTENINGTOINFO *pliInfo = (LISTENINGTOINFO*)lParam;
- CMString wszListeningTo;
+ CMStringW wszListeningTo;
if (pliInfo == NULL || pliInfo->cbSize != sizeof(LISTENINGTOINFO))
db_unset(NULL, m_szModuleName, "ListeningTo");
else if (pliInfo->dwFlags & LTI_UNICODE) {
diff --git a/protocols/VKontakte/src/vk_struct.h b/protocols/VKontakte/src/vk_struct.h index 54813f388f..8d787a6101 100644 --- a/protocols/VKontakte/src/vk_struct.h +++ b/protocols/VKontakte/src/vk_struct.h @@ -185,7 +185,7 @@ struct CVkUserInfo : public MZeroedObject { m_bIsGroup(false)
{}
- CVkUserInfo(LONG _UserId, bool _bIsGroup, CMString& _wszUserNick, CMString& _wszLink, MCONTACT _hContact = NULL) :
+ CVkUserInfo(LONG _UserId, bool _bIsGroup, CMStringW& _wszUserNick, CMStringW& _wszLink, MCONTACT _hContact = NULL) :
m_UserId(_UserId),
m_bIsGroup(_bIsGroup),
m_wszUserNick(_wszUserNick),
@@ -195,8 +195,8 @@ struct CVkUserInfo : public MZeroedObject { LONG m_UserId;
MCONTACT m_hContact;
- CMString m_wszUserNick;
- CMString m_wszLink;
+ CMStringW m_wszUserNick;
+ CMStringW m_wszLink;
bool m_bIsGroup;
};
@@ -218,14 +218,14 @@ struct CVKNewsItem : public MZeroedObject { vkParentType(vkNull)
{}
- CMString wszId;
+ CMStringW wszId;
time_t tDate;
CVkUserInfo *vkUser;
- CMString wszText;
- CMString wszLink;
- CMString wszType;
- CMString wszPopupTitle;
- CMString wszPopupText;
+ CMStringW wszText;
+ CMStringW wszLink;
+ CMStringW wszType;
+ CMStringW wszPopupTitle;
+ CMStringW wszPopupText;
VKObjType vkFeedbackType, vkParentType;
bool bIsGroup;
bool bIsRepost;
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 05cf3f6daa..d2022cb2df 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -271,7 +271,7 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self) else if (hContact == NULL)
return NULL;
- CMString wszNick, wszValue;
+ CMStringW wszNick, wszValue;
int iValue;
wszValue = jnItem["first_name"].as_mstring();
@@ -355,14 +355,14 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self) setWString(hContact, "Phone", wszValue);
wszValue = jnItem["status"].as_mstring();
- CMString wszOldStatus(ptrW(db_get_wsa(hContact, hContact ? "CList" : m_szModuleName, "StatusMsg")));
+ CMStringW wszOldStatus(ptrW(db_get_wsa(hContact, hContact ? "CList" : m_szModuleName, "StatusMsg")));
if (wszValue != wszOldStatus)
db_set_ws(hContact, hContact ? "CList" : m_szModuleName, "StatusMsg", wszValue);
- CMString wszOldListeningTo(ptrW(db_get_wsa(hContact, m_szModuleName, "ListeningTo")));
+ CMStringW wszOldListeningTo(ptrW(db_get_wsa(hContact, m_szModuleName, "ListeningTo")));
const JSONNode &jnAudio = jnItem["status_audio"];
if (jnAudio) {
- CMString wszListeningTo(FORMAT, L"%s - %s", jnAudio["artist"].as_mstring(), jnAudio["title"].as_mstring());
+ CMStringW wszListeningTo(FORMAT, L"%s - %s", jnAudio["artist"].as_mstring(), jnAudio["title"].as_mstring());
if (wszListeningTo != wszOldListeningTo) {
setWString(hContact, "ListeningTo", wszListeningTo);
setWString(hContact, "AudioUrl", jnAudio["url"].as_mstring());
@@ -447,7 +447,7 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self) wszValue = jnItem["domain"].as_mstring();
if (!wszValue.IsEmpty()) {
setWString(hContact, "domain", wszValue);
- CMString wszUrl("https://vk.com/");
+ CMStringW wszUrl("https://vk.com/");
wszUrl.Append(wszValue);
setWString(hContact, "Homepage", wszUrl);
}
@@ -461,8 +461,8 @@ void CVkProto::RetrieveUserInfo(LONG userID) if (userID == VK_FEED_USER || !IsOnline())
return;
- CMString code(FORMAT, L"var userIDs=\"%i\";var res=API.users.get({\"user_ids\":userIDs,\"fields\":\"%s\",\"name_case\":\"nom\"});return{\"freeoffline\":0,\"norepeat\":1,\"usercount\":res.length,\"users\":res};",
- userID, CMString(fieldsName));
+ CMStringW code(FORMAT, L"var userIDs=\"%i\";var res=API.users.get({\"user_ids\":userIDs,\"fields\":\"%s\",\"name_case\":\"nom\"});return{\"freeoffline\":0,\"norepeat\":1,\"usercount\":res.length,\"users\":res};",
+ userID, CMStringW(fieldsName));
Push(new AsyncHttpRequest(this, REQUEST_POST, "/method/execute.json", true, &CVkProto::OnReceiveUserInfo)
<< WCHAR_PARAM("code", code));
}
@@ -473,7 +473,7 @@ void CVkProto::RetrieveUsersInfo(bool bFreeOffline, bool bRepeat) if (!IsOnline())
return;
- CMString userIDs, code;
+ CMStringW userIDs, code;
int i = 0;
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
LONG userID = getDword(hContact, "ID", -1);
@@ -488,22 +488,22 @@ void CVkProto::RetrieveUsersInfo(bool bFreeOffline, bool bRepeat) i++;
}
- CMString codeformat("var userIDs=\"%s\";var _fields=\"%s\";");
+ CMStringW codeformat("var userIDs=\"%s\";var _fields=\"%s\";");
if (m_bNeedSendOnline)
codeformat += L"API.account.setOnline();";
if (bFreeOffline && !m_vkOptions.bLoadFullCList)
- codeformat += CMString("var US=[];var res=[];var t=10;while(t>0){"
+ codeformat += CMStringW("var US=[];var res=[];var t=10;while(t>0){"
"US=API.users.get({\"user_ids\":userIDs,\"fields\":_fields,\"name_case\":\"nom\"});"
"var index=US.length;while(index>0){"
"index=index-1;if(US[index].online!=0){res.push(US[index]);};};"
"t=t-1;if(res.length>0)t=0;};"
"return{\"freeoffline\":1,\"norepeat\":%d,\"usercount\":res.length,\"users\":res,\"requests\":API.friends.getRequests({\"extended\":0,\"need_mutual\":0,\"out\":0})};");
else
- codeformat += CMString("var res=API.users.get({\"user_ids\":userIDs,\"fields\":_fields,\"name_case\":\"nom\"});"
+ codeformat += CMStringW("var res=API.users.get({\"user_ids\":userIDs,\"fields\":_fields,\"name_case\":\"nom\"});"
"return{\"freeoffline\":0,\"norepeat\":%d,\"usercount\":res.length,\"users\":res,\"requests\":API.friends.getRequests({\"extended\":0,\"need_mutual\":0,\"out\":0})};");
- code.AppendFormat(codeformat, userIDs, CMString(bFreeOffline ? "online,status" : fieldsName), (int)bRepeat);
+ code.AppendFormat(codeformat, userIDs, CMStringW(bFreeOffline ? "online,status" : fieldsName), (int)bRepeat);
Push(new AsyncHttpRequest(this, REQUEST_POST, "/method/execute.json", true, &CVkProto::OnReceiveUserInfo)
<< WCHAR_PARAM("code", code));
@@ -679,7 +679,7 @@ INT_PTR __cdecl CVkProto::SvcDeleteFriend(WPARAM hContact, LPARAM flag) return 1;
ptrW pwszNick(db_get_wsa(hContact, m_szModuleName, "Nick"));
- CMString pwszMsg;
+ CMStringW pwszMsg;
if (flag == 0) {
pwszMsg.AppendFormat(TranslateT("Are you sure to delete %s from your friend list?"), IsEmpty(pwszNick) ? TranslateT("(Unknown contact)") : pwszNick);
if (IDNO == MessageBox(NULL, pwszMsg, TranslateT("Attention!"), MB_ICONWARNING | MB_YESNO))
@@ -699,10 +699,10 @@ void CVkProto::OnReceiveDeleteFriend(NETLIBHTTPREQUEST *reply, AsyncHttpRequest JSONNode jnRoot;
const JSONNode &jnResponse = CheckJsonResponse(pReq, reply, jnRoot);
if (jnResponse) {
- CMString wszNick(ptrW(db_get_wsa(param->hContact, m_szModuleName, "Nick")));
+ CMStringW wszNick(ptrW(db_get_wsa(param->hContact, m_szModuleName, "Nick")));
if (wszNick.IsEmpty())
wszNick = TranslateT("(Unknown contact)");
- CMString msgformat, msg;
+ CMStringW msgformat, msg;
if (jnResponse["success"].as_bool()) {
if (jnResponse["friend_deleted"].as_bool())
@@ -739,7 +739,7 @@ INT_PTR __cdecl CVkProto::SvcBanUser(WPARAM hContact, LPARAM) return 1;
CMStringA code(FORMAT, "var userID=\"%d\";API.account.banUser({\"user_id\":userID});", userID);
- CMString wszVarWarning;
+ CMStringW wszVarWarning;
if (m_vkOptions.bReportAbuse) {
debugLogA("CVkProto::SvcBanUser m_vkOptions.bReportAbuse = true");
@@ -772,7 +772,7 @@ INT_PTR __cdecl CVkProto::SvcBanUser(WPARAM hContact, LPARAM) code += "return 1;";
ptrW pwszNick(db_get_wsa(hContact, m_szModuleName, "Nick"));
- CMString pwszMsg(FORMAT, TranslateT("Are you sure to ban %s? %s%sContinue?"),
+ CMStringW pwszMsg(FORMAT, TranslateT("Are you sure to ban %s? %s%sContinue?"),
IsEmpty(pwszNick) ? TranslateT("(Unknown contact)") : pwszNick,
wszVarWarning.IsEmpty() ? L" " : TranslateT("\nIt will also"),
wszVarWarning.IsEmpty() ? L"\n" : wszVarWarning);
@@ -796,7 +796,7 @@ INT_PTR __cdecl CVkProto::SvcReportAbuse(WPARAM hContact, LPARAM) if (!IsOnline() || userID == -1 || userID == VK_FEED_USER)
return 1;
- CMString wszNick(ptrW(db_get_wsa(hContact, m_szModuleName, "Nick"))),
+ CMStringW wszNick(ptrW(db_get_wsa(hContact, m_szModuleName, "Nick"))),
pwszMsg(FORMAT, TranslateT("Are you sure to report abuse on %s?"), wszNick.IsEmpty() ? TranslateT("(Unknown contact)") : wszNick);
if (IDNO == MessageBox(NULL, pwszMsg, TranslateT("Attention!"), MB_ICONWARNING | MB_YESNO))
return 1;
@@ -812,7 +812,7 @@ INT_PTR __cdecl CVkProto::SvcOpenBroadcast(WPARAM hContact, LPARAM) {
debugLogA("CVkProto::SvcOpenBroadcast");
- CMString wszAudio(ptrW(db_get_wsa(hContact, m_szModuleName, "AudioUrl")));
+ CMStringW wszAudio(ptrW(db_get_wsa(hContact, m_szModuleName, "AudioUrl")));
if (!wszAudio.IsEmpty())
Utils_OpenUrlW(wszAudio);
@@ -832,7 +832,7 @@ INT_PTR __cdecl CVkProto::SvcVisitProfile(WPARAM hContact, LPARAM) LONG userID = getDword(hContact, "ID", -1);
ptrW wszDomain(db_get_wsa(hContact, m_szModuleName, "domain"));
- CMString wszUrl("https://vk.com/");
+ CMStringW wszUrl("https://vk.com/");
if (wszDomain)
wszUrl.Append(wszDomain);
else
diff --git a/protocols/WhatsApp/src/avatars.cpp b/protocols/WhatsApp/src/avatars.cpp index 536602bcb2..bb163013d5 100644 --- a/protocols/WhatsApp/src/avatars.cpp +++ b/protocols/WhatsApp/src/avatars.cpp @@ -116,7 +116,7 @@ int WhatsAppProto::InternalSetAvatar(MCONTACT hContact, const char *szJid, const saveInfo.tszName = tszTempFile;
saveInfo.dwMask = IMGI_HBITMAP;
saveInfo.fif = FIF_JPEG;
- CallService(MS_IMG_SAVE, (WPARAM)&saveInfo, IMGL_TCHAR);
+ CallService(MS_IMG_SAVE, (WPARAM)&saveInfo, IMGL_WCHAR);
if (hbmpPreview != resize.hBmp)
DeleteObject(hbmpPreview);
diff --git a/protocols/WhatsApp/src/chat.cpp b/protocols/WhatsApp/src/chat.cpp index 26a46bec48..eded520031 100644 --- a/protocols/WhatsApp/src/chat.cpp +++ b/protocols/WhatsApp/src/chat.cpp @@ -85,7 +85,7 @@ int WhatsAppProto::onGroupChatEvent(WPARAM, LPARAM lParam) setWord(hContact, "Status", ID_STATUS_ONLINE);
db_set_b(hContact, "CList", "Hidden", 1);
- setTString(hContact, "Nick", gch->ptszUID);
+ setWString(hContact, "Nick", gch->ptszUID);
db_set_dw(hContact, "Ignore", "Mask1", 0);
}
CallService(MS_MSG_SENDMESSAGE, hContact, 0);
@@ -145,8 +145,8 @@ void WhatsAppProto::ChatLogMenuHook(WAChatInfo *pInfo, struct GCHOOK *gch) void WhatsAppProto::EditChatSubject(WAChatInfo *pInfo)
{
- CMString title(FORMAT, TranslateT("Set new subject for %s"), pInfo->tszNick);
- ptrW tszOldValue(getTStringA(pInfo->hContact, WHATSAPP_KEY_NICK));
+ CMStringW title(FORMAT, TranslateT("Set new subject for %s"), pInfo->tszNick);
+ ptrW tszOldValue(getWStringA(pInfo->hContact, WHATSAPP_KEY_NICK));
ENTER_STRING es = { 0 };
es.cbSize = sizeof(es);
@@ -225,7 +225,7 @@ void WhatsAppProto::AddChatUser(WAChatInfo*, const wchar_t *ptszJid) PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.id.w = (wchar_t*)ptszJid;
psr.nick.w = GetChatUserNick(jid);
@@ -253,7 +253,7 @@ void WhatsAppProto::KickChatUser(WAChatInfo *pInfo, const wchar_t *ptszJid) int WhatsAppProto::OnDeleteChat(WPARAM hContact, LPARAM)
{
if (isChatRoom(hContact) && isOnline()) {
- ptrW tszID(getTStringA(hContact, WHATSAPP_KEY_ID));
+ ptrW tszID(getWStringA(hContact, WHATSAPP_KEY_ID));
if (tszID)
m_pConnection->sendJoinLeaveGroup(_T2A(tszID), false);
}
@@ -314,7 +314,7 @@ WAChatInfo* WhatsAppProto::InitChat(const std::string &jid, const std::string &n GCDEST gcd = { m_szModuleName, ptszJid, GC_EVENT_ADDGROUP };
GCEVENT gce = { sizeof(gce), &gcd };
for (int i = _countof(sttStatuses) - 1; i >= 0; i--) {
- gce.ptszStatus = TranslateTS(sttStatuses[i]);
+ gce.ptszStatus = TranslateW(sttStatuses[i]);
CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
}
@@ -419,7 +419,7 @@ void WhatsAppProto::onGroupNewSubject(const std::string &gjid, const std::string return;
ptrW tszText(str2t(newSubject));
- ptrW tszTextDb(getTStringA(pInfo->hContact, WHATSAPP_KEY_NICK));
+ ptrW tszTextDb(getWStringA(pInfo->hContact, WHATSAPP_KEY_NICK));
if (!mir_wstrcmp(tszText, tszTextDb)) // notify about subject change only if differs from the stored one
return;
@@ -436,7 +436,7 @@ void WhatsAppProto::onGroupNewSubject(const std::string &gjid, const std::string gce.ptszText = tszText;
CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
- setTString(pInfo->hContact, WHATSAPP_KEY_NICK, tszText);
+ setWString(pInfo->hContact, WHATSAPP_KEY_NICK, tszText);
}
void WhatsAppProto::onGroupAddUser(const std::string &gjid, const std::string &ujid, int ts)
diff --git a/protocols/WhatsApp/src/contacts.cpp b/protocols/WhatsApp/src/contacts.cpp index 8026cc0912..e4f0d50330 100644 --- a/protocols/WhatsApp/src/contacts.cpp +++ b/protocols/WhatsApp/src/contacts.cpp @@ -21,7 +21,7 @@ MCONTACT WhatsAppProto::AddToContactList(const std::string &jid, const char *new if (oldName.compare(string(new_name)) != 0) {
db_set_utf(hContact, m_szModuleName, WHATSAPP_KEY_NICK, new_name);
- CMString tmp(FORMAT, TranslateT("is now known as '%s'"), ptrW(mir_utf8decodeW(new_name)));
+ CMStringW tmp(FORMAT, TranslateT("is now known as '%s'"), ptrW(mir_utf8decodeW(new_name)));
this->NotifyEvent(_A2T(oldName.c_str()), tmp, hContact, WHATSAPP_EVENT_OTHER);
}
}
@@ -42,7 +42,7 @@ MCONTACT WhatsAppProto::AddToContactList(const std::string &jid, const char *new setString(hContact, "MirVer", "WhatsApp");
db_unset(hContact, "CList", "MyHandle");
db_set_b(hContact, "CList", "NotOnList", 1);
- db_set_ts(hContact, "CList", "Group", m_tszDefaultGroup);
+ db_set_ws(hContact, "CList", "Group", m_tszDefaultGroup);
if (new_name != NULL)
db_set_utf(hContact, m_szModuleName, WHATSAPP_KEY_NICK, new_name);
@@ -74,9 +74,9 @@ void WhatsAppProto::SetAllContactStatuses(int status, bool reset_client) {
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (reset_client) {
- ptrW tszMirVer(getTStringA(hContact, "MirVer"));
+ ptrW tszMirVer(getWStringA(hContact, "MirVer"));
if (mir_wstrcmp(tszMirVer, L"WhatsApp"))
- setTString(hContact, "MirVer", L"WhatsApp");
+ setWString(hContact, "MirVer", L"WhatsApp");
db_set_ws(hContact, "CList", "StatusMsg", L"");
}
diff --git a/protocols/WhatsApp/src/dialogs.cpp b/protocols/WhatsApp/src/dialogs.cpp index 6a86685895..be9cb7de70 100644 --- a/protocols/WhatsApp/src/dialogs.cpp +++ b/protocols/WhatsApp/src/dialogs.cpp @@ -134,7 +134,7 @@ int WhatsAppProto::OnOptionsInit(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.pwszTitle = m_tszUserName;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.pwszGroup = LPGENW("Network");
odp.pwszTab = LPGENW("Account");
diff --git a/protocols/WhatsApp/src/messages.cpp b/protocols/WhatsApp/src/messages.cpp index 388b12f309..98bea34363 100644 --- a/protocols/WhatsApp/src/messages.cpp +++ b/protocols/WhatsApp/src/messages.cpp @@ -133,5 +133,5 @@ void WhatsAppProto::onMessageStatusUpdate(const FMessage &fmsg) wchar_t ttime[64];
wcsftime(ttime, _countof(ttime), L"%X", localtime(&ts));
- utils::setStatusMessage(hContact, CMString(FORMAT, TranslateT("Message received: %s by %s"), ttime, ptszBy));
+ utils::setStatusMessage(hContact, CMStringW(FORMAT, TranslateT("Message received: %s by %s"), ttime, ptszBy));
}
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index e40588f0cc..a0b3b3cbe4 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -14,7 +14,7 @@ struct SearchParam WhatsAppProto::WhatsAppProto(const char *proto_name, const wchar_t *username)
: PROTO<WhatsAppProto>(proto_name, username),
- m_tszDefaultGroup(getTStringA(WHATSAPP_KEY_DEF_GROUP))
+ m_tszDefaultGroup(getWStringA(WHATSAPP_KEY_DEF_GROUP))
{
update_loop_lock_ = CreateEvent(NULL, false, false, NULL);
@@ -36,7 +36,7 @@ WhatsAppProto::WhatsAppProto(const char *proto_name, const wchar_t *username) mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName);
NETLIBUSER nlu = { sizeof(nlu) };
- nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
+ nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
nlu.ptszDescriptiveName = descr;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
@@ -48,10 +48,10 @@ WhatsAppProto::WhatsAppProto(const char *proto_name, const wchar_t *username) WASocketConnection::initNetwork(m_hNetlibUser);
- m_tszAvatarFolder = std::wstring(VARST(L"%miranda_avatarcache%")) + L"\\" + m_tszUserName;
+ m_tszAvatarFolder = std::wstring(VARSW(L"%miranda_avatarcache%")) + L"\\" + m_tszUserName;
DWORD dwAttributes = GetFileAttributes(m_tszAvatarFolder.c_str());
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
- CreateDirectoryTreeT(m_tszAvatarFolder.c_str());
+ CreateDirectoryTreeW(m_tszAvatarFolder.c_str());
if (m_tszDefaultGroup == NULL)
m_tszDefaultGroup = mir_wstrdup(L"WhatsApp");
@@ -196,7 +196,7 @@ void WhatsAppProto::SearchAckThread(void *targ) SearchParam *param = (SearchParam*)targ;
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.nick.w = psr.firstName.w = psr.lastName.w = L"";
psr.id.w = (wchar_t*)param->jid.c_str();
@@ -285,13 +285,13 @@ bool WhatsAppProto::Register(int state, const string &cc, const string &number, if (reason == "stale")
NotifyEvent(ptszTitle, TranslateT("Registration failed due to stale code. Please request a new code"), NULL, WHATSAPP_EVENT_CLIENT);
else {
- CMString tmp(FORMAT, TranslateT("Registration failed. Reason: %s"), _A2T(reason.c_str()));
+ CMStringW tmp(FORMAT, TranslateT("Registration failed. Reason: %s"), _A2T(reason.c_str()));
NotifyEvent(ptszTitle, tmp, NULL, WHATSAPP_EVENT_CLIENT);
}
const JSONNode &tmpVal = resp["retry_after"];
if (tmpVal) {
- CMString tmp(FORMAT, TranslateT("Please try again in %i seconds"), tmpVal.as_int());
+ CMStringW tmp(FORMAT, TranslateT("Please try again in %i seconds"), tmpVal.as_int());
NotifyEvent(ptszTitle, tmp, NULL, WHATSAPP_EVENT_OTHER);
}
return false;
diff --git a/protocols/Yahoo/src/avatar.cpp b/protocols/Yahoo/src/avatar.cpp index 93dbff7f38..e57a331c0c 100644 --- a/protocols/Yahoo/src/avatar.cpp +++ b/protocols/Yahoo/src/avatar.cpp @@ -293,7 +293,7 @@ void CYahooProto::ext_got_picture(const char*, const char *who, const char *pic_ */
if (getByte("AvatarUL", 0) != 1) {
// NO avatar URL??
- if (!getTString("AvatarFile", &dbv)) {
+ if (!getWString("AvatarFile", &dbv)) {
struct _stat statbuf;
if (_wstat(dbv.ptszVal, &statbuf) != 0) {
LOG(("[ext_yahoo_got_picture] Avatar File Missing? Can't find file: %s", dbv.ptszVal));
@@ -411,7 +411,7 @@ void CYahooProto::ext_got_picture(const char*, const char *who, const char *pic_ LOG(("[ext_yahoo_got_picture] Buddy: %s told us this is bad??Expired??. Re-uploading", who));
delSetting("AvatarURL");
- if (!getTString("AvatarFile", &dbv2)) {
+ if (!getWString("AvatarFile", &dbv2)) {
setString("AvatarInv", who);
SendAvatar(dbv2.ptszVal);
db_free(&dbv2);
@@ -596,10 +596,10 @@ void CYahooProto::request_avatar(const char* who) void CYahooProto::GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, int cbLen, int type)
{
- int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
+ int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARSW(L"%miranda_avatarcache%"), m_szModuleName);
if (_waccess(pszDest, 0))
- CreateDirectoryTreeT(pszDest);
+ CreateDirectoryTreeW(pszDest);
if (hContact != NULL) {
int ck_sum = getDword(hContact, "PictCK", 0);
@@ -748,7 +748,7 @@ INT_PTR __cdecl CYahooProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) int ret = -3;
if (getDword("AvatarHash", 0)) {
- if (!getTString("AvatarFile", &dbv)) {
+ if (!getWString("AvatarFile", &dbv)) {
if (_waccess(dbv.ptszVal, 0) == 0) {
mir_wstrncpy(buffer, dbv.ptszVal, size - 1);
buffer[size - 1] = '\0';
@@ -836,7 +836,7 @@ INT_PTR __cdecl CYahooProto::SetMyAvatar(WPARAM, LPARAM lParam) /* now check and make sure we don't reupload same thing over again */
if (hash != getDword("AvatarHash", 0)) {
- setTString("AvatarFile", tszMyFile);
+ setWString("AvatarFile", tszMyFile);
setDword("TMPAvatarHash", hash);
/* Set Sharing to ON if it's OFF */
diff --git a/protocols/Yahoo/src/file_transfer.cpp b/protocols/Yahoo/src/file_transfer.cpp index 50156ddd5d..099c78235c 100644 --- a/protocols/Yahoo/src/file_transfer.cpp +++ b/protocols/Yahoo/src/file_transfer.cpp @@ -45,7 +45,7 @@ static y_filetransfer* new_ft(CYahooProto* ppro, int id, MCONTACT hContact, cons ft->pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
ft->pfts.hContact = hContact;
- ft->pfts.flags = PFTS_TCHAR;
+ ft->pfts.flags = PFTS_UNICODE;
ft->pfts.flags |= (sending != 0) ? PFTS_SENDING : PFTS_RECEIVING;
ft->pfts.tszWorkingDir = NULL;
@@ -505,7 +505,7 @@ void CYahooProto::ext_got_file(const char *me, const char *who, const char *url, char *szFileName = fn;
PROTORECVFILET pre = { 0 };
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(NULL);
pre.descr.a = (char*)msg;
diff --git a/protocols/Yahoo/src/links.cpp b/protocols/Yahoo/src/links.cpp index 1eaeadaf44..b831f4cfcd 100644 --- a/protocols/Yahoo/src/links.cpp +++ b/protocols/Yahoo/src/links.cpp @@ -140,7 +140,7 @@ static INT_PTR ServiceParseYmsgrLink(WPARAM, LPARAM lParam) MCONTACT hContact = proto->add_buddy(id, id, 0, PALF_TEMPORARY); /* ensure contact is on list */
if (hContact)
- CallService(MS_MSG_SENDMESSAGET, hContact, (LPARAM)msg);
+ CallService(MS_MSG_SENDMESSAGEW, hContact, (LPARAM)msg);
mir_free(id);
return 0;
diff --git a/protocols/Yahoo/src/main.cpp b/protocols/Yahoo/src/main.cpp index f7c04b8097..b7c0c3ff11 100644 --- a/protocols/Yahoo/src/main.cpp +++ b/protocols/Yahoo/src/main.cpp @@ -109,7 +109,7 @@ extern "C" int __declspec(dllexport)Load(void) NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_TCHAR | NUF_OUTGOING | NUF_HTTPCONNS;
+ nlu.flags = NUF_UNICODE | NUF_OUTGOING | NUF_HTTPCONNS;
nlu.szSettingsModule = "YAHOO/libyahoo2";
nlu.ptszDescriptiveName = TranslateT("YAHOO plugin HTTP connections");
g_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
diff --git a/protocols/Yahoo/src/options.cpp b/protocols/Yahoo/src/options.cpp index 321851d965..5fe42858d8 100644 --- a/protocols/Yahoo/src/options.cpp +++ b/protocols/Yahoo/src/options.cpp @@ -361,7 +361,7 @@ int __cdecl CYahooProto::OnOptionsInit(WPARAM wParam, LPARAM) odp.hInstance = hInstance; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_YAHOO); odp.pwszTitle = m_tszUserName; - odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE; + odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE; odp.pwszGroup = LPGENW("Network"); odp.pwszTab = LPGENW("Account"); odp.pfnDlgProc = DlgProcYahooOpts; diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp index 56ad2d559e..3d47152262 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -35,7 +35,7 @@ CYahooProto::CYahooProto(const char *aProtoName, const wchar_t *aUserName) logoff_buddies();
- SkinAddNewSoundExT("mail", m_tszUserName, LPGENW("New E-mail available in Inbox"));
+ SkinAddNewSoundExW("mail", m_tszUserName, LPGENW("New E-mail available in Inbox"));
LoadYahooServices();
}
@@ -72,9 +72,9 @@ int CYahooProto::OnModulesLoadedEx(WPARAM, LPARAM) NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
#ifdef HTTP_GATEWAY
- nlu.flags = NUF_OUTGOING | NUF_HTTPGATEWAY| NUF_HTTPCONNS | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_HTTPGATEWAY| NUF_HTTPCONNS | NUF_UNICODE;
#else
- nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
#endif
nlu.szSettingsModule = m_szModuleName;
nlu.ptszDescriptiveName = tModuleDescr;
diff --git a/protocols/Yahoo/src/search.cpp b/protocols/Yahoo/src/search.cpp index 5b0427d2a4..8a7fa143a8 100644 --- a/protocols/Yahoo/src/search.cpp +++ b/protocols/Yahoo/src/search.cpp @@ -36,7 +36,7 @@ void __cdecl CYahooProto::search_simplethread(void *snsearch) YAHOO_SEARCH_RESULT psr;
memset(&psr, 0, sizeof(psr));
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.id.w = (wchar_t*)wcslwr(id);
psr.protocol = YAHOO_IM_YAHOO;
diff --git a/protocols/Yahoo/src/user_info.cpp b/protocols/Yahoo/src/user_info.cpp index 4b90a00e41..965e51acd4 100644 --- a/protocols/Yahoo/src/user_info.cpp +++ b/protocols/Yahoo/src/user_info.cpp @@ -117,7 +117,7 @@ int __cdecl CYahooProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInstance;
odp.dwInitParam = (LPARAM)this;
- odp.flags = ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_UNICODE | ODPF_DONTTRANSLATE;
MCONTACT hContact = lParam;
if (IsMyContact(hContact)) {
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index ec97c1c3f1..2d5df96084 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -217,8 +217,8 @@ void CYahooProto::AddBuddy(MCONTACT hContact, const char *group, const wchar_t * T2Utf u_msg(msg);
ptrA ident(getStringA(hContact, "MyIdentity"));
- ptrW fname(getTStringA(NULL, "FirstName"));
- ptrW lname(getTStringA(NULL, "LastName"));
+ ptrW fname(getWStringA(NULL, "FirstName"));
+ ptrW lname(getWStringA(NULL, "LastName"));
SetStringUtf(hContact, "YGroup", group);
diff --git a/src/core/stdaway/src/sendmsg.cpp b/src/core/stdaway/src/sendmsg.cpp index 409e598a07..982820b259 100644 --- a/src/core/stdaway/src/sendmsg.cpp +++ b/src/core/stdaway/src/sendmsg.cpp @@ -89,11 +89,11 @@ static wchar_t* GetAwayMessage(int statusMode, char *szProto) DBVARIANT dbv;
if ( GetStatusModeByte(statusMode, "UsePrev")) {
- if ( db_get_ts(NULL, "SRAway", StatusModeToDbSetting(statusMode, "Msg"), &dbv))
+ if ( db_get_ws(NULL, "SRAway", StatusModeToDbSetting(statusMode, "Msg"), &dbv))
dbv.ptszVal = mir_wstrdup(GetDefaultMessage(statusMode));
}
else {
- if ( db_get_ts(NULL, "SRAway", StatusModeToDbSetting(statusMode, "Default"), &dbv))
+ if ( db_get_ws(NULL, "SRAway", StatusModeToDbSetting(statusMode, "Default"), &dbv))
dbv.ptszVal = mir_wstrdup(GetDefaultMessage(statusMode));
for (int i=0; dbv.ptszVal[i]; i++) {
@@ -272,7 +272,7 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa wchar_t str[1024];
GetDlgItemText(hwndDlg, IDC_MSG, str, _countof(str));
ChangeAllProtoMessages(dat->szProto, dat->statusMode, str);
- db_set_ts(NULL, "SRAway", StatusModeToDbSetting(dat->statusMode, "Msg"), str);
+ db_set_ws(NULL, "SRAway", StatusModeToDbSetting(dat->statusMode, "Msg"), str);
DestroyWindow(hwndDlg);
}
else PostMessage(hwndDlg, WM_CLOSE, 0, 0);
@@ -395,8 +395,8 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam dat->info[j].usePrevious = GetStatusModeByte(statusModes[i], "UsePrev");
DBVARIANT dbv;
- if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(statusModes[i], "Default"), &dbv))
- if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(statusModes[i], "Msg"), &dbv))
+ if (db_get_ws(NULL, "SRAway", StatusModeToDbSetting(statusModes[i], "Default"), &dbv))
+ if (db_get_ws(NULL, "SRAway", StatusModeToDbSetting(statusModes[i], "Msg"), &dbv))
dbv.ptszVal = mir_wstrdup(GetDefaultMessage(statusModes[i]));
mir_wstrcpy(dat->info[j].msg, dbv.ptszVal);
mir_free(dbv.ptszVal);
@@ -501,7 +501,7 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam SetStatusModeByte(status, "Ignore", (BYTE)dat->info[i].ignore);
SetStatusModeByte(status, "NoDlg", (BYTE)dat->info[i].noDialog);
SetStatusModeByte(status, "UsePrev", (BYTE)dat->info[i].usePrevious);
- db_set_ts(NULL, "SRAway", StatusModeToDbSetting(status, "Default"), dat->info[i].msg);
+ db_set_ws(NULL, "SRAway", StatusModeToDbSetting(status, "Default"), dat->info[i].msg);
}
return TRUE;
}
diff --git a/src/core/stdchat/src/main.cpp b/src/core/stdchat/src/main.cpp index 430992defb..07859e361a 100644 --- a/src/core/stdchat/src/main.cpp +++ b/src/core/stdchat/src/main.cpp @@ -285,34 +285,34 @@ static void OnLoadSettings() static void RegisterFonts()
{
- ColourIDT colourid = { sizeof(colourid) };
+ ColourIDW colourid = { sizeof(colourid) };
strncpy(colourid.dbSettingsGroup, CHAT_MODULE, sizeof(colourid.dbSettingsGroup));
wcsncpy(colourid.group, LPGENW("Chat module"), _countof(colourid.group));
strncpy(colourid.setting, "ColorLogBG", _countof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Group chat log background"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_WINDOW);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
strncpy(colourid.setting, "ColorMessageBG", _countof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Message background"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_WINDOW);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
strncpy(colourid.setting, "ColorNicklistBG", _countof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Nick list background"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_WINDOW);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
strncpy(colourid.setting, "ColorNicklistLines", _countof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Nick list lines"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_INACTIVEBORDER);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
strncpy(colourid.setting, "ColorNicklistSelectedBG", _countof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Nick list background (selected)"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
}
static int OnCheckPlugins(WPARAM, LPARAM)
diff --git a/src/core/stdchat/src/options.cpp b/src/core/stdchat/src/options.cpp index 79ea5fc3d2..0635bd0b54 100644 --- a/src/core/stdchat/src/options.cpp +++ b/src/core/stdchat/src/options.cpp @@ -161,7 +161,7 @@ static void FillBranch(HWND hwndTree, HTREEITEM hParent, const struct branch_t * tvis.hInsertAfter = TVI_LAST;
tvis.item.mask = TVIF_TEXT | TVIF_STATE;
for (int i = 0; i < nValues; i++) {
- tvis.item.pszText = TranslateTS(branch[i].szDescr);
+ tvis.item.pszText = TranslateW(branch[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
if (branch[i].iMode)
iState = ((db_get_dw(NULL, CHAT_MODULE, branch[i].szDBName, defaultval)&branch[i].iMode)&branch[i].iMode) != 0 ? 2 : 1;
@@ -323,7 +323,7 @@ HANDLE GetIconHandle(const char *pszIcoLibName) static void InitSetting(wchar_t** ppPointer, char* pszSetting, wchar_t* pszDefault)
{
DBVARIANT dbv;
- if (!db_get_ts(NULL, CHAT_MODULE, pszSetting, &dbv)) {
+ if (!db_get_ws(NULL, CHAT_MODULE, pszSetting, &dbv)) {
replaceStrW(*ppPointer, dbv.ptszVal);
db_free(&dbv);
}
@@ -574,7 +574,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, *p2 = ' ';
p2 = wcschr(ptszText, ',');
}
- db_set_ts(NULL, CHAT_MODULE, "HighlightWords", ptszText);
+ db_set_ws(NULL, CHAT_MODULE, "HighlightWords", ptszText);
mir_free(ptszText);
}
}
@@ -584,7 +584,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (iLen > 0) {
pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, pszText, iLen + 1);
- db_set_ts(NULL, CHAT_MODULE, "LogDirectory", pszText);
+ db_set_ws(NULL, CHAT_MODULE, "LogDirectory", pszText);
}
else db_unset(NULL, CHAT_MODULE, "LogDirectory");
pci->SM_InvalidateLogDirectories();
@@ -593,7 +593,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (iLen > 0) {
pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_LOGTIMESTAMP, pszText, iLen + 1);
- db_set_ts(NULL, CHAT_MODULE, "LogTimestamp", pszText);
+ db_set_ws(NULL, CHAT_MODULE, "LogTimestamp", pszText);
}
else db_unset(NULL, CHAT_MODULE, "LogTimestamp");
@@ -601,7 +601,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (iLen > 0) {
pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_TIMESTAMP, pszText, iLen + 1);
- db_set_ts(NULL, CHAT_MODULE, "HeaderTime", pszText);
+ db_set_ws(NULL, CHAT_MODULE, "HeaderTime", pszText);
}
else db_unset(NULL, CHAT_MODULE, "HeaderTime");
@@ -609,7 +609,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (iLen > 0) {
pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_INSTAMP, pszText, iLen + 1);
- db_set_ts(NULL, CHAT_MODULE, "HeaderIncoming", pszText);
+ db_set_ws(NULL, CHAT_MODULE, "HeaderIncoming", pszText);
}
else db_unset(NULL, CHAT_MODULE, "HeaderIncoming");
@@ -617,7 +617,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (iLen > 0) {
pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_OUTSTAMP, pszText, iLen + 1);
- db_set_ts(NULL, CHAT_MODULE, "HeaderOutgoing", pszText);
+ db_set_ws(NULL, CHAT_MODULE, "HeaderOutgoing", pszText);
}
else db_unset(NULL, CHAT_MODULE, "HeaderOutgoing");
@@ -636,7 +636,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (iLen > 0) {
pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_GROUP, pszText, iLen + 1);
- db_set_ts(NULL, CHAT_MODULE, "AddToGroup", pszText);
+ db_set_ws(NULL, CHAT_MODULE, "AddToGroup", pszText);
}
else db_set_s(NULL, CHAT_MODULE, "AddToGroup", "");
mir_free(pszText);
diff --git a/src/core/stdchat/src/tools.cpp b/src/core/stdchat/src/tools.cpp index 3568f75caf..54dd4cb3e8 100644 --- a/src/core/stdchat/src/tools.cpp +++ b/src/core/stdchat/src/tools.cpp @@ -50,7 +50,7 @@ bool LoadMessageFont(LOGFONT *lf, COLORREF *colour) mir_snprintf(str, "SRMFont%d", i);
DBVARIANT dbv;
- if (db_get_ts(NULL, "SRMM", str, &dbv))
+ if (db_get_ws(NULL, "SRMM", str, &dbv))
mir_wstrcpy(lf->lfFaceName, L"Arial");
else {
mir_wstrncpy(lf->lfFaceName, dbv.ptszVal, _countof(lf->lfFaceName));
@@ -160,7 +160,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO AppendMenu(*hMenu, MF_SEPARATOR, 0, 0);
for (int i = 0; i < gcmi.nItems; i++) {
- wchar_t* ptszText = TranslateTS(gcmi.Item[i].pszDesc);
+ wchar_t* ptszText = TranslateW(gcmi.Item[i].pszDesc);
DWORD dwState = gcmi.Item[i].bDisabled ? MF_GRAYED : 0;
if (gcmi.Item[i].uType == MENU_NEWPOPUP) {
diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index b6b54681b8..c9525b7723 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -2236,14 +2236,14 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case ID_SEARCH_GOOGLE:
if (pszWord[0])
- Utils_OpenUrlT(CMString(FORMAT, L"http://www.google.com/search?q=%s", pszWord));
+ Utils_OpenUrlT(CMStringW(FORMAT, L"http://www.google.com/search?q=%s", pszWord));
PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0);
break;
case ID_SEARCH_WIKIPEDIA:
if (pszWord[0])
- Utils_OpenUrlT(CMString(FORMAT, L"http://en.wikipedia.org/wiki/%s", pszWord));
+ Utils_OpenUrlT(CMStringW(FORMAT, L"http://en.wikipedia.org/wiki/%s", pszWord));
PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0);
break;
@@ -2388,7 +2388,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar pci->SM_AddCommand(si->ptszID, si->pszModule, pszRtf);
- CMString ptszText(ptrW(mir_utf8decodeW(pszRtf)));
+ CMStringW ptszText(ptrW(mir_utf8decodeW(pszRtf)));
pci->DoRtfToTags(ptszText, mi->nColorCount, mi->crColors);
ptszText.Trim();
ptszText.Replace(L"%", L"%%");
diff --git a/src/core/stdclist/src/clcfonts.cpp b/src/core/stdclist/src/clcfonts.cpp index 74c09a7278..dc53eed62d 100644 --- a/src/core/stdclist/src/clcfonts.cpp +++ b/src/core/stdclist/src/clcfonts.cpp @@ -51,7 +51,7 @@ static int FS_FontsChanged(WPARAM, LPARAM) void RegisterCListFonts()
{
- FontIDT fontid = { sizeof(fontid) };
+ FontIDW fontid = { sizeof(fontid) };
fontid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWREREGISTER | FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS;
strncpy(fontid.dbSettingsGroup, "CLC", sizeof(fontid.dbSettingsGroup));
wcsncpy(fontid.group, LPGENW("Contact list"), _countof(fontid.group));
@@ -76,13 +76,13 @@ void RegisterCListFonts() mir_snprintf(idstr, "Font%d", i);
strncpy(fontid.prefix, idstr, _countof(fontid.prefix));
fontid.order = i;
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
}
ReleaseDC(NULL, hdc);
// and colours
- ColourIDT colourid = { 0 };
- colourid.cbSize = sizeof(ColourIDT);
+ ColourIDW colourid = { 0 };
+ colourid.cbSize = sizeof(ColourIDW);
colourid.order = 0;
strncpy(colourid.dbSettingsGroup, "CLC", sizeof(colourid.dbSettingsGroup));
@@ -90,25 +90,25 @@ void RegisterCListFonts() wcsncpy(colourid.name, LPGENW("Background"), _countof(colourid.name));
wcsncpy(colourid.group, LPGENW("Contact list"), _countof(colourid.group));
colourid.defcolour = CLCDEFAULT_BKCOLOUR;
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Selected text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_SELTEXTCOLOUR;
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Hottrack text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_HOTTEXTCOLOUR;
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Quicksearch text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR;
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
HookEvent(ME_FONT_RELOAD, FS_FontsChanged);
}
diff --git a/src/core/stdclist/src/clcopts.cpp b/src/core/stdclist/src/clcopts.cpp index 53d42c65c3..d0c625c2c7 100644 --- a/src/core/stdclist/src/clcopts.cpp +++ b/src/core/stdclist/src/clcopts.cpp @@ -94,7 +94,7 @@ static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *value tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
for (int i = 0; i < nValues; i++) {
tvis.item.lParam = values[i].style;
- tvis.item.pszText = TranslateTS(values[i].szDescr);
+ tvis.item.pszText = TranslateW(values[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.state = INDEXTOSTATEIMAGEMASK((style & tvis.item.lParam) != 0 ? 2 : 1);
TreeView_InsertItem(hwndTree, &tvis);
diff --git a/src/core/stdclist/src/cluiopts.cpp b/src/core/stdclist/src/cluiopts.cpp index fdd473a268..d911261f71 100644 --- a/src/core/stdclist/src/cluiopts.cpp +++ b/src/core/stdclist/src/cluiopts.cpp @@ -74,7 +74,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L }
{ DBVARIANT dbv;
- if (!db_get_ts(NULL, "CList", "TitleText", &dbv)) {
+ if (!db_get_ws(NULL, "CList", "TitleText", &dbv)) {
SetDlgItemText(hwndDlg, IDC_TITLETEXT, dbv.ptszVal);
db_free(&dbv);
}
@@ -172,7 +172,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L {
wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
- db_set_ts(NULL, "CList", "TitleText", title);
+ db_set_ws(NULL, "CList", "TitleText", title);
SetWindowText(pcli->hwndContactList, title);
}
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 2d394b6ab0..3de6a7e28a 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -36,7 +36,7 @@ wchar_t* GetContactID(MCONTACT hContact) {
char *szProto = GetContactProto(hContact);
if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1)
- if (wchar_t *theValue = db_get_tsa(hContact, szProto, "ChatRoomID"))
+ if (wchar_t *theValue = db_get_wsa(hContact, szProto, "ChatRoomID"))
return theValue;
return Contact_GetInfo(CNF_UNIQUEID, hContact, szProto);
@@ -212,7 +212,7 @@ void CopyProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANSFE }
if (src->tszWorkingDir) dest->tszWorkingDir = PFTS_StringToTchar(src->flags, src->tszWorkingDir);
dest->flags &= ~PFTS_UTF;
- dest->flags |= PFTS_TCHAR;
+ dest->flags |= PFTS_UNICODE;
}
void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANSFERSTATUS *src)
@@ -266,7 +266,7 @@ void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANS dest->currentFileProgress = src->currentFileProgress;
dest->currentFileTime = src->currentFileTime;
dest->flags &= ~PFTS_UTF;
- dest->flags |= PFTS_TCHAR;
+ dest->flags |= PFTS_UNICODE;
}
static void RemoveUnreadFileEvents(void)
diff --git a/src/core/stdfile/src/fileopts.cpp b/src/core/stdfile/src/fileopts.cpp index 93aca138ae..0a021853a4 100644 --- a/src/core/stdfile/src/fileopts.cpp +++ b/src/core/stdfile/src/fileopts.cpp @@ -90,7 +90,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L }
DBVARIANT dbv;
- if (db_get_ts(NULL, "SRFile", "ScanCmdLine", &dbv) == 0) {
+ if (db_get_ws(NULL, "SRFile", "ScanCmdLine", &dbv) == 0) {
SetDlgItemText(hwndDlg, IDC_SCANCMDLINE, dbv.ptszVal);
db_free(&dbv);
}
@@ -165,7 +165,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L wchar_t str[MAX_PATH + 2];
GetDlgItemText(hwndDlg, IDC_SCANCMDLINE, str, _countof(str));
- CMString tszFilter;
+ CMStringW tszFilter;
tszFilter.AppendFormat(L"%s (*.exe)%c*.exe%c", TranslateT("Executable files"), 0, 0);
tszFilter.AppendFormat(L"%s (*)%c*%c", TranslateT("All files"), 0, 0);
@@ -205,14 +205,14 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L wchar_t str[512];
GetDlgItemText(hwndDlg, IDC_FILEDIR, str, _countof(str));
RemoveInvalidPathChars(str);
- db_set_ts(NULL, "SRFile", "RecvFilesDirAdv", str);
+ db_set_ws(NULL, "SRFile", "RecvFilesDirAdv", str);
db_set_b(NULL, "SRFile", "AutoAccept", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOACCEPT));
db_set_b(NULL, "SRFile", "AutoMin", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOMIN));
db_set_b(NULL, "SRFile", "AutoClose", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOCLOSE));
db_set_b(NULL, "SRFile", "AutoClear", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOCLEAR));
db_set_b(NULL, "SRFile", "UseScanner", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SCANAFTERDL) ? VIRUSSCAN_AFTERDL : (IsDlgButtonChecked(hwndDlg, IDC_SCANDURINGDL) ? VIRUSSCAN_DURINGDL : VIRUSSCAN_DISABLE)));
GetDlgItemText(hwndDlg, IDC_SCANCMDLINE, str, _countof(str));
- db_set_ts(NULL, "SRFile", "ScanCmdLine", str);
+ db_set_ws(NULL, "SRFile", "ScanCmdLine", str);
db_set_b(NULL, "SRFile", "WarnBeforeOpening", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_WARNBEFOREOPENING));
db_set_b(NULL, "SRFile", "IfExists", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ASK) ? FILERESUME_ASK : (IsDlgButtonChecked(hwndDlg, IDC_RESUME) ? FILERESUME_RESUMEALL : (IsDlgButtonChecked(hwndDlg, IDC_OVERWRITE) ? FILERESUME_OVERWRITEALL : FILERESUME_RENAMEALL))));
return TRUE;
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp index 06f182cd42..660b717bae 100644 --- a/src/core/stdfile/src/filerecvdlg.cpp +++ b/src/core/stdfile/src/filerecvdlg.cpp @@ -125,7 +125,7 @@ void GetContactReceivedFilesDir(MCONTACT hContact, wchar_t *szDir, int cchDir, B {
wchar_t tszTemp[MAX_PATH];
- ptrW tszRecvPath(db_get_tsa(NULL, "SRFile", "RecvFilesDirAdv"));
+ ptrW tszRecvPath(db_get_wsa(NULL, "SRFile", "RecvFilesDirAdv"));
if (tszRecvPath)
wcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE);
else
@@ -165,7 +165,7 @@ void GetReceivedFilesDir(wchar_t *szDir, int cchDir) {
wchar_t tszTemp[MAX_PATH];
- ptrW tszRecvPath(db_get_tsa(NULL, "SRFile", "RecvFilesDirAdv"));
+ ptrW tszRecvPath(db_get_wsa(NULL, "SRFile", "RecvFilesDirAdv"));
if (tszRecvPath)
wcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE);
else
@@ -214,7 +214,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l mir_snprintf(idstr, "MruDir%d", i);
DBVARIANT dbv;
- if (db_get_ts(NULL, "SRFile", idstr, &dbv))
+ if (db_get_ws(NULL, "SRFile", idstr, &dbv))
break;
SendDlgItemMessage(hwndDlg, IDC_FILEDIR, CB_ADDSTRING, 0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
@@ -237,8 +237,8 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l unsigned len = (unsigned)mir_strlen(str) + 1;
if (len + 4 < dbei.cbBlob) {
str += len;
- ptrW ptszDescription(DbGetEventStringT(&dbei, str));
- SetDlgItemText(hwndDlg, IDC_MSG, ptszDescription);
+ ptrW pwszDescription(DbGetEventStringT(&dbei, str));
+ SetDlgItemText(hwndDlg, IDC_MSG, pwszDescription);
}
}
else DestroyWindow(hwndDlg);
@@ -313,12 +313,12 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l DBVARIANT dbv;
for (i = MAX_MRU_DIRS-2;i>=0;i--) {
mir_snprintf(idstr, "MruDir%d", i);
- if (db_get_ts(NULL, "SRFile", idstr, &dbv)) continue;
+ if (db_get_ws(NULL, "SRFile", idstr, &dbv)) continue;
mir_snprintf(idstr, "MruDir%d", i+1);
- db_set_ts(NULL, "SRFile", idstr, dbv.ptszVal);
+ db_set_ws(NULL, "SRFile", idstr, dbv.ptszVal);
db_free(&dbv);
}
- db_set_ts(NULL, "SRFile", idstr, szRecvDir);
+ db_set_ws(NULL, "SRFile", idstr, szRecvDir);
}
}
EnableWindow(GetDlgItem(hwndDlg, IDC_FILENAMES), FALSE);
diff --git a/src/core/stdfile/src/filesenddlg.cpp b/src/core/stdfile/src/filesenddlg.cpp index 4c6089c8c5..3148d36c59 100644 --- a/src/core/stdfile/src/filesenddlg.cpp +++ b/src/core/stdfile/src/filesenddlg.cpp @@ -49,7 +49,7 @@ static void SetFileListAndSizeControls(HWND hwndDlg, FileDlgData *dat) if (i > 1) {
wchar_t szFormat[32];
if (fileCount && dirCount) {
- mir_snwprintf(szFormat, L"%s, %s", TranslateTS(fileCount == 1 ? L"%d file" : L"%d files"), TranslateTS(dirCount == 1 ? L"%d directory" : L"%d directories"));
+ mir_snwprintf(szFormat, L"%s, %s", TranslateW(fileCount == 1 ? L"%d file" : L"%d files"), TranslateW(dirCount == 1 ? L"%d directory" : L"%d directories"));
mir_snwprintf(str, szFormat, fileCount, dirCount);
}
else if (fileCount) {
diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index ed513f02bb..810587b75e 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -95,7 +95,7 @@ void FillSendData(FileDlgData *dat, DBEVENTINFO& dbei) static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info) { DBVARIANT dbv; - if (!db_get_ts(NULL, "SRFile", "ScanCmdLine", &dbv)) { + if (!db_get_ws(NULL, "SRFile", "ScanCmdLine", &dbv)) { if (dbv.ptszVal[0]) { STARTUPINFO si = { 0 }; si.cb = sizeof(si); @@ -168,8 +168,8 @@ static void SetFilenameControls(HWND hwndDlg, FileDlgData *dat, PROTOFILETRANSFE enum { FTS_TEXT, FTS_PROGRESS, FTS_OPEN }; static void SetFtStatus(HWND hwndDlg, wchar_t *text, int mode) { - SetDlgItemText(hwndDlg, IDC_STATUS, TranslateTS(text)); - SetDlgItemText(hwndDlg, IDC_TRANSFERCOMPLETED, TranslateTS(text)); + SetDlgItemText(hwndDlg, IDC_STATUS, TranslateW(text)); + SetDlgItemText(hwndDlg, IDC_TRANSFERCOMPLETED, TranslateW(text)); ShowWindow(GetDlgItem(hwndDlg, IDC_STATUS), (mode == FTS_TEXT) ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(hwndDlg, IDC_ALLFILESPROGRESS), (mode == FTS_PROGRESS) ? SW_SHOW : SW_HIDE); @@ -245,7 +245,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR ShowWindow(GetDlgItem(hwndDlg, IDC_OPENFOLDER), SW_HIDE); } else { //recv - CreateDirectoryTreeT(dat->szSavePath); + CreateDirectoryTreeW(dat->szSavePath); dat->fs = (HANDLE)ProtoChainSend(dat->hContact, PSS_FILEALLOW, (WPARAM)dat->fs, (LPARAM)dat->szSavePath); dat->transferStatus.tszWorkingDir = mir_wstrdup(dat->szSavePath); if (db_get_b(dat->hContact, "CList", "NotOnList", 0)) dat->resumeBehaviour = FILERESUME_ASK; diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 0c68e5b22d..2c335fec1a 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -763,7 +763,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l //restore saved msg if any...
if (dat->hContact) {
DBVARIANT dbv;
- if (!db_get_ts(dat->hContact, SRMSGMOD, DBSAVEDMSG, &dbv)) {
+ if (!db_get_ws(dat->hContact, SRMSGMOD, DBSAVEDMSG, &dbv)) {
if (dbv.ptszVal[0]) {
SetDlgItemText(hwndDlg, IDC_MESSAGE, dbv.ptszVal);
EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
@@ -1589,7 +1589,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l wchar_t *msg = (wchar_t*)alloca(sizeof(wchar_t)*len);
GetDlgItemText(hwndDlg, IDC_MESSAGE, msg, len);
if (msg[0])
- db_set_ts(dat->hContact, SRMSGMOD, DBSAVEDMSG, msg);
+ db_set_ws(dat->hContact, SRMSGMOD, DBSAVEDMSG, msg);
else
db_unset(dat->hContact, SRMSGMOD, DBSAVEDMSG);
}
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 7096284dac..4771ce1622 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -305,7 +305,7 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT AppendToBufferWithRTF(buffer, szName);
AppendToBufferWithRTF(buffer, L" ");
- msg = DbGetEventTextT(&dbei, CP_ACP);
+ msg = DbGetEventTextW(&dbei, CP_ACP);
if (msg) {
AppendToBufferWithRTF(buffer, msg);
mir_free(msg);
@@ -334,7 +334,7 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT case EVENTTYPE_MESSAGE:
default:
- msg = DbGetEventTextT(&dbei, CP_ACP);
+ msg = DbGetEventTextW(&dbei, CP_ACP);
buffer.AppendFormat(" %s ", SetToStyle((dbei.eventType == EVENTTYPE_MESSAGE) ? ((dbei.flags & DBEF_SENT) ? MSGFONTID_MYMSG : MSGFONTID_YOURMSG) : MSGFONTID_NOTICE));
AppendToBufferWithRTF(buffer, msg);
mir_free(msg);
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index f5968b5cce..5fb40206cf 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -81,7 +81,7 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour) mir_snprintf(str, "SRMFont%d", i);
DBVARIANT dbv;
- if (db_get_ts(NULL, SRMMMOD, str, &dbv))
+ if (db_get_ws(NULL, SRMMMOD, str, &dbv))
wcsncpy(lf->lfFaceName, fontOptionsList[i].szDefFace, _countof(lf->lfFaceName)-1);
else {
mir_wstrncpy(lf->lfFaceName, dbv.ptszVal, _countof(lf->lfFaceName));
@@ -97,7 +97,7 @@ void RegisterSRMMFonts(void) {
char idstr[10];
- FontIDT fontid = { sizeof(fontid) };
+ FontIDW fontid = { sizeof(fontid) };
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID;
for (int i = 0; i < _countof(fontOptionsList); i++) {
strncpy_s(fontid.dbSettingsGroup, SRMMMOD, _TRUNCATE);
@@ -117,16 +117,16 @@ void RegisterSRMMFonts(void) fontid.deffontsettings.charset = MsgDlgGetFontDefaultCharset(fontOptionsList[i].szDefFace);
wcsncpy_s(fontid.backgroundGroup, LPGENW("Message log"), _TRUNCATE);
wcsncpy_s(fontid.backgroundName, LPGENW("Background"), _TRUNCATE);
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
}
- ColourIDT colourid = { sizeof(colourid) };
+ ColourIDW colourid = { sizeof(colourid) };
strncpy_s(colourid.dbSettingsGroup, SRMMMOD, _TRUNCATE);
strncpy_s(colourid.setting, SRMSGSET_BKGCOLOUR, _TRUNCATE);
colourid.defcolour = SRMSGDEFSET_BKGCOLOUR;
wcsncpy_s(colourid.name, LPGENW("Background"), _TRUNCATE);
wcsncpy_s(colourid.group, LPGENW("Message log"), _TRUNCATE);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -158,7 +158,7 @@ static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *value tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
for (int i = 0; i < nValues; i++) {
tvis.item.lParam = values[i].style;
- tvis.item.pszText = TranslateTS(values[i].szDescr);
+ tvis.item.pszText = TranslateW(values[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.state = INDEXTOSTATEIMAGEMASK((style & tvis.item.lParam) != 0 ? 2 : 1);
TreeView_InsertItem(hwndTree, &tvis);
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 2737384610..b38fea7b07 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -407,7 +407,7 @@ static wchar_t tszError[] = LPGENW("Miranda could not load the built-in message int LoadSendRecvMessageModule(void)
{
if ((hMsftEdit = LoadLibrary(L"Msftedit.dll")) == NULL) {
- if (IDYES != MessageBox(0, TranslateTS(tszError), TranslateT("Information"), MB_YESNO | MB_ICONINFORMATION))
+ if (IDYES != MessageBox(0, TranslateW(tszError), TranslateT("Information"), MB_YESNO | MB_ICONINFORMATION))
return 1;
return 0;
}
diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp index 193e730b19..d87b602c8d 100644 --- a/src/core/stduihist/src/history.cpp +++ b/src/core/stduihist/src/history.cpp @@ -39,7 +39,7 @@ static HGENMENU hContactMenu = 0; static void GetMessageDescription(DBEVENTINFO *dbei, wchar_t* buf, int cbBuf)
{
- wchar_t *msg = DbGetEventTextT(dbei, CP_ACP);
+ wchar_t *msg = DbGetEventTextW(dbei, CP_ACP);
wcsncpy(buf, msg ? msg : TranslateT("Invalid message"), cbBuf);
buf[ cbBuf-1 ] = 0;
mir_free(msg);
@@ -118,7 +118,7 @@ static void GetObjectSummary(DBEVENTINFO *dbei, wchar_t* str, int cbStr) DBEVENTTYPEDESCR* et = (DBEVENTTYPEDESCR*)CallService(MS_DB_EVENT_GETTYPE, (WPARAM)dbei->szModule, (LPARAM)dbei->eventType);
if (et && (et->flags & DETF_HISTORY)) {
pszTmp = mir_a2u(et->descr);
- pszSrc = TranslateTS(pszTmp);
+ pszSrc = TranslateW(pszTmp);
break;
}
*str = 0;
diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp index ca14e50201..79511853a8 100644 --- a/src/core/stduserinfo/src/contactinfo.cpp +++ b/src/core/stduserinfo/src/contactinfo.cpp @@ -274,13 +274,13 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.iItem = 0;
for (i = -1;; i++) {
if (i == -1) {
- if (db_get_ts(hContact, szProto, "e-mail", &dbv))
+ if (db_get_ws(hContact, szProto, "e-mail", &dbv))
continue;
lvi.pszText = TranslateT("Primary");
}
else {
mir_snprintf(idstr, "e-mail%d", i);
- if (db_get_ts(hContact, szProto, idstr, &dbv))
+ if (db_get_ws(hContact, szProto, idstr, &dbv))
break;
lvi.pszText = idstr2;
@@ -295,7 +295,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP for (i = 0;; i++) {
lvi.lParam = i;
mir_snprintf(idstr, "Mye-mail%d", i);
- if (db_get_ts(hContact, "UserInfo", idstr, &dbv))
+ if (db_get_ws(hContact, "UserInfo", idstr, &dbv))
break;
lvi.pszText = idstr2;
mir_snwprintf(idstr2, TranslateT("Custom %d"), i + 1);
@@ -313,21 +313,21 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.lParam = -1;
lvi.iSubItem = 0;
lvi.iItem = 0;
- if (!db_get_ts(hContact, szProto, "Phone", &dbv)) {
+ if (!db_get_ws(hContact, szProto, "Phone", &dbv)) {
lvi.pszText = TranslateT("Primary");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
db_free(&dbv);
lvi.iItem++;
}
- if (!db_get_ts(hContact, szProto, "Fax", &dbv)) {
+ if (!db_get_ws(hContact, szProto, "Fax", &dbv)) {
lvi.pszText = TranslateT("Fax");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
db_free(&dbv);
lvi.iItem++;
}
- if (!db_get_ts(hContact, szProto, "Cellular", &dbv)) {
+ if (!db_get_ws(hContact, szProto, "Cellular", &dbv)) {
lvi.pszText = TranslateT("Mobile");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
if (mir_strlen(dbv.pszVal) > 4 && !mir_strcmp(dbv.pszVal + mir_strlen(dbv.pszVal) - 4, " SMS")) {
@@ -338,14 +338,14 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP db_free(&dbv);
lvi.iItem++;
}
- if (!db_get_ts(hContact, szProto, "CompanyPhone", &dbv)) {
+ if (!db_get_ws(hContact, szProto, "CompanyPhone", &dbv)) {
lvi.pszText = TranslateT("Work phone");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
db_free(&dbv);
lvi.iItem++;
}
- if (!db_get_ts(hContact, szProto, "CompanyFax", &dbv)) {
+ if (!db_get_ws(hContact, szProto, "CompanyFax", &dbv)) {
lvi.pszText = TranslateT("Work fax");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
@@ -356,7 +356,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP for (i = 0;; i++) {
lvi.lParam = i;
mir_snprintf(idstr, "MyPhone%d", i);
- if (db_get_ts(hContact, "UserInfo", idstr, &dbv))
+ if (db_get_ws(hContact, "UserInfo", idstr, &dbv))
break;
lvi.pszText = idstr2;
mir_snwprintf(idstr2, TranslateT("Custom %d"), i + 1);
diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp index bd2420bdca..fd3ae677bc 100644 --- a/src/core/stduserinfo/src/stdinfo.cpp +++ b/src/core/stduserinfo/src/stdinfo.cpp @@ -47,11 +47,11 @@ static int Proto_GetContactInfoSetting(MCONTACT hContact, const char *szProto, c static wchar_t* Proto_GetContactInfoSettingStr(bool proto_service, MCONTACT hContact, const char *szModule, const char *szSetting)
{
if (!proto_service)
- return db_get_tsa(hContact, szModule, szSetting);
+ return db_get_wsa(hContact, szModule, szSetting);
DBVARIANT dbv;
DBCONTACTGETSETTING cgs = { szModule, szSetting, &dbv };
- dbv.type = DBVT_TCHAR;
+ dbv.type = DBVT_WCHAR;
if (CallProtoService(szModule, PS_GETINFOSETTING, hContact, (LPARAM)&cgs))
return NULL;
@@ -148,7 +148,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule if (wSave == (WORD)-1) {
char szSettingName[100];
mir_snprintf(szSettingName, "%sName", szSetting);
- if (!db_get_ts(hContact, szModule, szSettingName, &dbv)) {
+ if (!db_get_ws(hContact, szModule, szSettingName, &dbv)) {
ptstr = dbv.ptszVal;
unspecified = false;
break;
@@ -185,7 +185,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule if (!unspecified) {
WCHAR *wszStr;
Utf8Decode(dbv.pszVal, &wszStr);
- SetDlgItemTextW(hwndDlg, idCtrl, TranslateTS(wszStr));
+ SetDlgItemTextW(hwndDlg, idCtrl, TranslateW(wszStr));
mir_free(wszStr);
goto LBL_Exit;
}
@@ -446,7 +446,7 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (tszColText == NULL)
break;
mir_snprintf(idstr, "Past%dText", i);
- ptrW tszText(db_get_tsa(hContact, szProto, idstr));
+ ptrW tszText(db_get_wsa(hContact, szProto, idstr));
if (tszText == NULL)
break;
@@ -463,7 +463,7 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (tszColText == NULL)
break;
mir_snprintf(idstr, "Affiliation%dText", i);
- ptrW tszText(db_get_tsa(hContact, szProto, idstr));
+ ptrW tszText(db_get_wsa(hContact, szProto, idstr));
if (tszText == NULL)
break;
@@ -486,7 +486,7 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (tszColText == NULL)
break;
mir_snprintf(idstr, "Interest%dText", i);
- ptrW tszText(db_get_tsa(hContact, szProto, idstr));
+ ptrW tszText(db_get_wsa(hContact, szProto, idstr));
if (tszText == NULL)
break;
@@ -548,7 +548,7 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR HFONT hFont = CreateFontIndirect(&lf);
SendDlgItemMessage(hwndDlg, IDC_ABOUT, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
- ptrW szNotes(db_get_tsa(lParam, "UserInfo", "MyNotes"));
+ ptrW szNotes(db_get_wsa(lParam, "UserInfo", "MyNotes"));
if (szNotes != nullptr)
SetDlgItemText(hwndDlg, IDC_MYNOTES, szNotes);
}
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index bcb7e20a39..82ce214f67 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -66,12 +66,12 @@ struct DetailsData wchar_t* getTitle(OPTIONSDIALOGPAGE *p)
{
- return (p->flags & ODPF_DONTTRANSLATE) ? p->pwszTitle : TranslateTH(p->hLangpack, p->pwszTitle);
+ return (p->flags & ODPF_DONTTRANSLATE) ? p->pwszTitle : TranslateW_LP(p->pwszTitle, p->hLangpack);
}
wchar_t* getTab(OPTIONSDIALOGPAGE *p)
{
- return (p->flags & ODPF_DONTTRANSLATE) ? p->pwszTab : TranslateTH(p->hLangpack, p->pwszTab);
+ return (p->flags & ODPF_DONTTRANSLATE) ? p->pwszTab : TranslateW_LP(p->pwszTab, p->hLangpack);
}
static int PageSortProc(OPTIONSDIALOGPAGE *item1, OPTIONSDIALOGPAGE *item2)
@@ -183,7 +183,7 @@ static void CreateDetailsTabs(HWND hwndDlg, DetailsData *dat, DetailsPageData *p if (!odp.ptszTab || mir_wstrcmp(odp.ptszTitle, ppg->ptszTitle))
continue;
- tie.pszText = TranslateTH(odp.hLangpack, odp.ptszTab);
+ tie.pszText = TranslateW_LP(odp.ptszTab, odp.hLangpack);
tie.lParam = i;
TabCtrl_InsertItem(hwndTab, pages, &tie);
if (!mir_wstrcmp(odp.ptszTab, ppg->ptszTab))
@@ -268,7 +268,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP LPTSTR ptszLastTab;
DBVARIANT dbv;
- if (!db_get_ts(NULL, "UserInfo", "LastTab", &dbv)) {
+ if (!db_get_ws(NULL, "UserInfo", "LastTab", &dbv)) {
ptszLastTab = NEWWSTR_ALLOCA(dbv.ptszVal);
db_free(&dbv);
}
@@ -306,7 +306,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (odp[i].flags & ODPF_DONTTRANSLATE)
tvis.item.pszText = p.ptszTitle;
else
- tvis.item.pszText = TranslateTH(p.hLangpack, p.ptszTitle);
+ tvis.item.pszText = TranslateW_LP(p.ptszTitle, p.hLangpack);
if (ptszLastTab && !mir_wstrcmp(tvis.item.pszText, ptszLastTab))
dat->currentPage = i;
p.hItem = TreeView_InsertItem(hwndTree, &tvis);
@@ -587,7 +587,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP tvi.pszText = name;
tvi.cchTextMax = _countof(name);
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_PAGETREE), &tvi);
- db_set_ts(NULL, "UserInfo", "LastTab", name);
+ db_set_ws(NULL, "UserInfo", "LastTab", name);
Window_FreeIcon_IcoLib(hwndDlg);
SendDlgItemMessage(hwndDlg, IDC_NAME, WM_SETFONT, SendDlgItemMessage(hwndDlg, IDC_WHITERECT, WM_GETFONT, 0, 0), 0);
diff --git a/src/mir_app/src/ExtraIconGroup.cpp b/src/mir_app/src/ExtraIconGroup.cpp index 7101175272..1057ab073e 100644 --- a/src/mir_app/src/ExtraIconGroup.cpp +++ b/src/mir_app/src/ExtraIconGroup.cpp @@ -38,7 +38,7 @@ void ExtraIconGroup::addExtraIcon(BaseExtraIcon *extra) {
m_items.insert(extra);
- CMString description;
+ CMStringW description;
for (int i = 0; i < m_items.getCount(); i++) {
if (i > 0)
description += L" / ";
diff --git a/src/mir_app/src/FontOptions.cpp b/src/mir_app/src/FontOptions.cpp index 30a6aa4d5e..b415cc284b 100644 --- a/src/mir_app/src/FontOptions.cpp +++ b/src/mir_app/src/FontOptions.cpp @@ -121,7 +121,7 @@ int __inline DrawTextWithEffect(HDC hdc, LPCTSTR lpchText, int cchText, RECT * l #define FSUI_FONTFRAMEVERT 4
#define FSUI_FONTLEFT (FSUI_COLORBOXLEFT+FSUI_COLORBOXWIDTH+5)
-void UpdateFontSettings(FontIDW *font_id, FontSettingsT *fontsettings);
+void UpdateFontSettings(FontIDW *font_id, FontSettingsW *fontsettings);
void UpdateColourSettings(ColourIDW *colour_id, COLORREF *colour);
void UpdateEffectSettings(EffectIDW *effect_id, FONTEFFECT* effectsettings);
@@ -340,7 +340,7 @@ static void sttFsuiCreateSettingsTreeNode(HWND hwndTree, const wchar_t *groupNam if (sectionName = wcschr(sectionName, '/'))
*sectionName = 0;
- pItemName = TranslateTH(_hLang, pItemName);
+ pItemName = TranslateW_LP(pItemName, _hLang);
hItem = sttFindNamedTreeItemAt(hwndTree, hSection, pItemName);
if (!sectionName || !hItem) {
@@ -448,7 +448,7 @@ static INT_PTR CALLBACK ChooseEffectDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wPar pEffect = (FONTEFFECT*)lParam;
{
for (int i = 0; i < _countof(ModernEffectNames); i++) {
- int itemid = SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_ADDSTRING, 0, (LPARAM)TranslateTS(ModernEffectNames[i]));
+ int itemid = SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_ADDSTRING, 0, (LPARAM)TranslateW(ModernEffectNames[i]));
SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_SETITEMDATA, itemid, i);
SendDlgItemMessage(hwndDlg, IDC_EFFECT_COMBO, CB_SETCURSEL, 0, 0);
}
@@ -505,7 +505,7 @@ static void sttSaveFontData(HWND hwndDlg, FontInternal &F) else
strncpy_s(str, F.prefix, _TRUNCATE);
- if (db_set_ts(NULL, F.dbSettingsGroup, str, F.value.szFace)) {
+ if (db_set_ws(NULL, F.dbSettingsGroup, str, F.value.szFace)) {
char buff[1024];
WideCharToMultiByte(code_page, 0, F.value.szFace, -1, buff, 1024, 0, 0);
db_set_s(NULL, F.dbSettingsGroup, str, buff);
diff --git a/src/mir_app/src/FontService.cpp b/src/mir_app/src/FontService.cpp index 6e1d678965..58aefe7638 100644 --- a/src/mir_app/src/FontService.cpp +++ b/src/mir_app/src/FontService.cpp @@ -95,24 +95,24 @@ int LoadFontserviceModule(void) hColourReloadEvent = CreateHookableEvent(ME_COLOUR_RELOAD);
// create generic fonts
- FontIDT fontid = { sizeof(fontid) };
+ FontIDW fontid = { sizeof(fontid) };
strncpy(fontid.dbSettingsGroup, "Fonts", sizeof(fontid.dbSettingsGroup));
wcsncpy_s(fontid.group, LPGENW("General"), _TRUNCATE);
wcsncpy_s(fontid.name, LPGENW("Headers"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSHEADER;
strncpy(fontid.prefix, "Header", _countof(fontid.prefix));
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
wcsncpy_s(fontid.name, LPGENW("Generic text"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSGENERAL;
strncpy(fontid.prefix, "Generic", _countof(fontid.prefix));
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
wcsncpy_s(fontid.name, LPGENW("Small text"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSSMALL;
strncpy(fontid.prefix, "Small", _countof(fontid.prefix));
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
// do last for silly dyna plugin
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
diff --git a/src/mir_app/src/FontService.h b/src/mir_app/src/FontService.h index 9a1ea0c9d0..55d58f4089 100644 --- a/src/mir_app/src/FontService.h +++ b/src/mir_app/src/FontService.h @@ -26,12 +26,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // a font identifier structure - used for registering a font, and getting one out again
-struct FontInternal : public FontIDT
+struct FontInternal : public FontIDW
{
- FontSettingsT value;
+ FontSettingsW value;
int hLangpack;
- __inline wchar_t* getName() const { return TranslateTH(hLangpack, name); }
+ __inline wchar_t* getName() const { return TranslateW_LP(name, hLangpack); }
__inline bool isHeader() const
{
@@ -45,17 +45,17 @@ struct FontInternal : public FontIDT }
};
-struct ColourInternal : public ColourIDT
+struct ColourInternal : public ColourIDW
{
- __inline wchar_t* getName() const { return TranslateTH(hLangpack, name); }
+ __inline wchar_t* getName() const { return TranslateW_LP(name, hLangpack); }
COLORREF value;
int hLangpack;
};
-struct EffectInternal : public EffectIDT
+struct EffectInternal : public EffectIDW
{
- __inline wchar_t* getName() const { return TranslateTH(hLangpack, name); }
+ __inline wchar_t* getName() const { return TranslateW_LP(name, hLangpack); }
int hLangpack;
};
@@ -77,4 +77,4 @@ extern OBJLIST<EffectInternal> effect_id_list; extern int code_page;
extern HANDLE hFontReloadEvent, hColourReloadEvent;
-int CreateFromFontSettings(FontSettingsT *fs, LOGFONT *lf);
+int CreateFromFontSettings(FontSettingsW *fs, LOGFONT *lf);
diff --git a/src/mir_app/src/IcoLib.h b/src/mir_app/src/IcoLib.h index 5510e92996..1356762945 100644 --- a/src/mir_app/src/IcoLib.h +++ b/src/mir_app/src/IcoLib.h @@ -78,7 +78,7 @@ struct IcolibItem : public MZeroedObject char* name;
SectionItem* section;
int orderID;
- wchar_t* description;
+ wchar_t* description;
IconSourceFile* default_file;
int default_indx;
int cx, cy;
@@ -88,12 +88,12 @@ struct IcolibItem : public MZeroedObject IconSourceItem* source_big;
IconSourceItem* default_icon;
- wchar_t* temp_file;
+ wchar_t* temp_file;
HICON temp_icon;
BOOL temp_reset;
__inline ~IcolibItem() { clear(); }
- __inline wchar_t* getDescr() const { return TranslateTH(hLangpack, description); }
+ __inline wchar_t* getDescr() const { return TranslateW_LP(description, hLangpack); }
void clear();
};
diff --git a/src/mir_app/src/addcontact.cpp b/src/mir_app/src/addcontact.cpp index fb6380f9e7..7b049000c0 100644 --- a/src/mir_app/src/addcontact.cpp +++ b/src/mir_app/src/addcontact.cpp @@ -110,7 +110,7 @@ public: }
if (szName && szName[0])
- SetCaption(CMString(FORMAT, TranslateT("Add %s"), szName));
+ SetCaption(CMStringW(FORMAT, TranslateT("Add %s"), szName));
else
SetCaption(TranslateT("Add contact"));
mir_free(tmpStr);
@@ -120,7 +120,7 @@ public: m_acs.szProto = GetContactProto(m_acs.hContact);
int groupSel = 0;
- ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_wsa(hContact, "CList", "Group"));
wchar_t *grpName;
for (int groupId = 1; (grpName = Clist_GroupGetName(groupId, NULL)) != NULL; groupId++) {
int id = m_group.AddString(grpName, groupId);
@@ -200,7 +200,7 @@ public: ptrW szHandle(m_myHandle.GetText());
if (mir_wstrlen(szHandle))
- db_set_ts(hContact, "CList", "MyHandle", szHandle);
+ db_set_ws(hContact, "CList", "MyHandle", szHandle);
int item = m_group.GetCurSel();
if (item > 0)
diff --git a/src/mir_app/src/button.cpp b/src/mir_app/src/button.cpp index c020904f0d..a406d172c0 100644 --- a/src/mir_app/src/button.cpp +++ b/src/mir_app/src/button.cpp @@ -486,7 +486,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR ti.uFlags = TTF_IDISHWND|TTF_SUBCLASS;
ti.uId = (UINT_PTR)bct->hwnd;
if (lParam & BATF_UNICODE)
- ti.lpszText = mir_wstrdup(TranslateTS((WCHAR*)wParam));
+ ti.lpszText = mir_wstrdup(TranslateW((WCHAR*)wParam));
else
ti.lpszText = Langpack_PcharToTchar((char*)wParam);
diff --git a/src/mir_app/src/chat.h b/src/mir_app/src/chat.h index 7f493c3bcf..84d418ac78 100644 --- a/src/mir_app/src/chat.h +++ b/src/mir_app/src/chat.h @@ -87,7 +87,7 @@ int LoadChatModule(void); void UnloadChatModule(void);
// tools.c
-int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors);
+int DoRtfToTags(CMStringW &pszText, int iNumColors, COLORREF *pColors);
int GetTextPixelSize(wchar_t* pszText, HFONT hFont, BOOL bWidth);
wchar_t *RemoveFormatting(const wchar_t* pszText);
BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight, int bManyFix);
diff --git a/src/mir_app/src/chat_clist.cpp b/src/mir_app/src/chat_clist.cpp index ea92494bc7..859c93e59a 100644 --- a/src/mir_app/src/chat_clist.cpp +++ b/src/mir_app/src/chat_clist.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. MCONTACT AddRoom(const char *pszModule, const wchar_t *pszRoom, const wchar_t *pszDisplayName, int iType)
{
wchar_t pszGroup[50]; *pszGroup = '\0';
- ptrW groupName(db_get_tsa(NULL, CHAT_MODULE, "AddToGroup"));
+ ptrW groupName(db_get_wsa(NULL, CHAT_MODULE, "AddToGroup"));
if (groupName)
wcsncpy_s(pszGroup, groupName, _TRUNCATE);
else
@@ -43,13 +43,13 @@ MCONTACT AddRoom(const char *pszModule, const wchar_t *pszRoom, const wchar_t *p MCONTACT hContact = chatApi.FindRoom(pszModule, pszRoom);
if (hContact) { //contact exist, make sure it is in the right group
if (pszGroup[0]) {
- ptrW grpName(db_get_tsa(hContact, "CList", "Group"));
+ ptrW grpName(db_get_wsa(hContact, "CList", "Group"));
if (!mir_wstrcmp(pszGroup, grpName))
- db_set_ts(hContact, "CList", "Group", pszGroup);
+ db_set_ws(hContact, "CList", "Group", pszGroup);
}
db_set_w(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
- db_set_ts(hContact, pszModule, "Nick", pszDisplayName);
+ db_set_ws(hContact, pszModule, "Nick", pszDisplayName);
return hContact;
}
@@ -59,11 +59,11 @@ MCONTACT AddRoom(const char *pszModule, const wchar_t *pszRoom, const wchar_t *p Proto_AddToContact(hContact, pszModule);
if (pszGroup[0])
- db_set_ts(hContact, "CList", "Group", pszGroup);
+ db_set_ws(hContact, "CList", "Group", pszGroup);
else
db_unset(hContact, "CList", "Group");
- db_set_ts(hContact, pszModule, "Nick", pszDisplayName);
- db_set_ts(hContact, pszModule, "ChatRoomID", pszRoom);
+ db_set_ws(hContact, pszModule, "Nick", pszDisplayName);
+ db_set_ws(hContact, pszModule, "ChatRoomID", pszRoom);
db_set_b(hContact, pszModule, "ChatRoom", (BYTE)iType);
db_set_w(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
return hContact;
@@ -110,7 +110,7 @@ int RoomDoubleclicked(WPARAM hContact, LPARAM) if (db_get_b(hContact, szProto, "ChatRoom", 0) == 0)
return 0;
- ptrW roomid(db_get_tsa(hContact, szProto, "ChatRoomID"));
+ ptrW roomid(db_get_wsa(hContact, szProto, "ChatRoomID"));
if (roomid == NULL)
return 0;
@@ -216,7 +216,7 @@ BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, wchar_t* cle.flags = type | CLEF_TCHAR;
cle.hIcon = hIcon;
cle.pszService = "GChat/DblClickEvent" ;
- cle.ptszTooltip = TranslateTS(szBuf);
+ cle.ptszTooltip = TranslateW(szBuf);
if (type) {
if (!cli.pfnGetEvent(hContact, 0))
cli.pfnAddEvent(&cle);
@@ -235,7 +235,7 @@ MCONTACT FindRoom(const char *pszModule, const wchar_t *pszRoom) if (!db_get_b(hContact, pszModule, "ChatRoom", 0))
continue;
- ptrW roomid(db_get_tsa(hContact, pszModule, "ChatRoomID"));
+ ptrW roomid(db_get_wsa(hContact, pszModule, "ChatRoomID"));
if (roomid != NULL && !mir_wstrcmpi(roomid, pszRoom))
return hContact;
}
diff --git a/src/mir_app/src/chat_opts.cpp b/src/mir_app/src/chat_opts.cpp index 969e01ebb6..8fd7591762 100644 --- a/src/mir_app/src/chat_opts.cpp +++ b/src/mir_app/src/chat_opts.cpp @@ -120,7 +120,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour) lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
mir_snprintf(str, "Font%d", i);
- ptrW tszFace(db_get_tsa(NULL, CHATFONT_MODULE, str));
+ ptrW tszFace(db_get_wsa(NULL, CHATFONT_MODULE, str));
if (tszFace == NULL)
mir_wstrcpy(lf->lfFaceName, FO.szDefFace);
else
@@ -134,7 +134,7 @@ void RegisterFonts(void) SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(lfDefault), &lfDefault, FALSE);
- FontIDT fontid = { sizeof(fontid) };
+ FontIDW fontid = { sizeof(fontid) };
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID | FIDF_NEEDRESTART;
wcsncpy_s(fontid.backgroundGroup, g_szFontGroup, _TRUNCATE);
wcsncpy_s(fontid.group, g_szFontGroup, _TRUNCATE);
@@ -192,7 +192,7 @@ HICON LoadIconEx(char* pszIcoLibName, bool big) static void InitSetting(wchar_t** ppPointer, char* pszSetting, wchar_t* pszDefault)
{
DBVARIANT dbv;
- if (!db_get_ts(NULL, CHAT_MODULE, pszSetting, &dbv)) {
+ if (!db_get_ws(NULL, CHAT_MODULE, pszSetting, &dbv)) {
replaceStrW(*ppPointer, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/src/mir_app/src/chat_rtf.cpp b/src/mir_app/src/chat_rtf.cpp index 1b901c3cb4..d24a9c0a9f 100644 --- a/src/mir_app/src/chat_rtf.cpp +++ b/src/mir_app/src/chat_rtf.cpp @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static wchar_t tszRtfBreaks[] = L" \\\n\r"; -static void CreateColorMap(CMString &Text, int iCount, COLORREF *pSrc, int *pDst) +static void CreateColorMap(CMStringW &Text, int iCount, COLORREF *pSrc, int *pDst) { const wchar_t *pszText = Text; int iIndex = 1; @@ -73,7 +73,7 @@ static int GetRtfIndex(int iCol, int iCount, int *pIndex) return -1; } -int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors) +int DoRtfToTags(CMStringW &pszText, int iNumColors, COLORREF *pColors) { if (pszText.IsEmpty()) return FALSE; @@ -93,7 +93,7 @@ int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors) else idx += 5; bool bInsideColor = false, bInsideUl = false; - CMString res; + CMStringW res; // iterate through all characters, if rtf control character found then take action for (const wchar_t *p = pszText.GetString() + idx; *p;) { diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp index dd1ad27d09..58fdbb1bb3 100644 --- a/src/mir_app/src/chat_svc.cpp +++ b/src/mir_app/src/chat_svc.cpp @@ -257,7 +257,7 @@ static INT_PTR Service_NewChat(WPARAM, LPARAM lParam) db_set_s(si->hContact, si->pszModule, "Topic", "");
db_unset(si->hContact, "CList", "StatusMsg");
if (si->ptszStatusbarText)
- db_set_ts(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
+ db_set_ws(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
db_set_s(si->hContact, si->pszModule, "StatusBar", "");
@@ -358,7 +358,7 @@ static int DoControl(GCEVENT *gce, WPARAM wp) if (si = chatApi.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
replaceStrW(si->ptszStatusbarText, gce->ptszText);
if (si->ptszStatusbarText)
- db_set_ts(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
+ db_set_ws(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
db_set_s(si->hContact, si->pszModule, "StatusBar", "");
@@ -451,11 +451,11 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam) if (SESSION_INFO *si = chatApi.SM_FindSession(gcd->ptszID, gcd->pszModule)) {
if (gce->ptszText) {
replaceStrW(si->ptszTopic, RemoveFormatting(gce->ptszText));
- db_set_ts(si->hContact, si->pszModule, "Topic", si->ptszTopic);
+ db_set_ws(si->hContact, si->pszModule, "Topic", si->ptszTopic);
if (chatApi.OnSetTopic)
chatApi.OnSetTopic(si);
if (db_get_b(NULL, CHAT_MODULE, "TopicOnClist", 0))
- db_set_ts(si->hContact, "CList", "StatusMsg", si->ptszTopic);
+ db_set_ws(si->hContact, "CList", "StatusMsg", si->ptszTopic);
}
}
break;
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index 33f7574dd2..0ac5311f81 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -185,7 +185,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char *pszProtoNa PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
mir_snwprintf(pd.lptzContactName, L"%s - %s", (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, cli.pfnGetContactDisplayName(hContact, 0));
- mir_wstrncpy(pd.lptzText, TranslateTS(szBuf), _countof(pd.lptzText));
+ mir_wstrncpy(pd.lptzText, TranslateW(szBuf), _countof(pd.lptzText));
pd.iSeconds = g_Settings->iPopupTimeout;
if (g_Settings->iPopupStyle == 2) {
@@ -424,10 +424,10 @@ BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce) wchar_t *buf = RemoveFormatting(NEWWSTR_ALLOCA(gce->ptszText));
int iStart = 0;
- CMString tszHighlightWords(g_Settings->pszHighlightWords);
+ CMStringW tszHighlightWords(g_Settings->pszHighlightWords);
while (true) {
- CMString tszToken = tszHighlightWords.Tokenize(L"\t ", iStart);
+ CMStringW tszToken = tszHighlightWords.Tokenize(L"\t ", iStart);
if (iStart == -1)
break;
@@ -465,7 +465,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) wcsncpy_s(tszFolder, si->pszLogFileName, _TRUNCATE);
PathRemoveFileSpec(tszFolder);
if (!PathIsDirectory(tszFolder))
- CreateDirectoryTreeT(tszFolder);
+ CreateDirectoryTreeW(tszFolder);
wchar_t szTime[100];
mir_wstrncpy(szTime, chatApi.MakeTimeStamp(g_Settings->pszTimeStampLog, gce->time), 99);
@@ -588,7 +588,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) wchar_t tszNewPath[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20];
mir_snwprintf(tszNewPath, L"%s%sarchived\\", tszDrive, tszDir);
- CreateDirectoryTreeT(tszNewPath);
+ CreateDirectoryTreeW(tszNewPath);
wchar_t tszNewName[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20];
mir_snwprintf(tszNewName, L"%s%s-%s%s", tszNewPath, tszName, tszTimestamp, tszExt);
@@ -748,7 +748,7 @@ wchar_t* GetChatLogsFilename(SESSION_INFO *si, time_t tTime) if (chatApi.OnGetLogName)
chatApi.OnGetLogName(si, tszParsedName);
else
- PathToAbsoluteT(tszParsedName, si->pszLogFileName);
+ PathToAbsoluteW(tszParsedName, si->pszLogFileName);
mir_free(tszParsedName);
for (int i = 0; i < _countof(rva); i++)
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index d331cbbb51..23fcc6e060 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -389,7 +389,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam int i, eq;
//check name of group and ignore message if just being expanded/collapsed
if (cli.pfnFindItem(hwnd, dat, groupId | HCONTACT_ISGROUP, &contact, &group, NULL)) {
- CMString szFullName(contact->szText);
+ CMStringW szFullName(contact->szText);
while (group->parent) {
ClcContact *cc = NULL;
for (i = 0; i < group->parent->cl.getCount(); i++) {
@@ -401,7 +401,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam szFullName.Empty();
break;
}
- szFullName = CMString(cc->szText) + L"\\" + szFullName;
+ szFullName = CMStringW(cc->szText) + L"\\" + szFullName;
group = group->parent;
}
diff --git a/src/mir_app/src/clcitems.cpp b/src/mir_app/src/clcitems.cpp index c8de95e416..7305d6658e 100644 --- a/src/mir_app/src/clcitems.cpp +++ b/src/mir_app/src/clcitems.cpp @@ -224,7 +224,7 @@ void fnAddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTo int i; DWORD groupFlags; ClcGroup *group; - ptrW tszGroup(db_get_tsa(hContact, "CList", "Group")); + ptrW tszGroup(db_get_wsa(hContact, "CList", "Group")); if (tszGroup == NULL) group = &dat->list; else { @@ -310,7 +310,7 @@ void fnDeleteItemFromTree(HWND hwnd, MCONTACT hItem) int i, nameOffset; if (!IsHContactContact(hItem)) return; - if (db_get_ts(hItem, "CList", "Group", &dbv)) + if (db_get_ws(hItem, "CList", "Group", &dbv)) return; //decrease member counts of all parent groups too @@ -365,7 +365,7 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat) ClcCacheEntry *pce = cli.pfnGetCacheEntry(hContact); ClcGroup *group; - ptrW tszGroupName(db_get_tsa(hContact, "CList", "Group")); + ptrW tszGroupName(db_get_wsa(hContact, "CList", "Group")); if (tszGroupName == NULL) group = &dat->list; else { diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp index e1814d1f37..de469d6a17 100644 --- a/src/mir_app/src/clcutils.cpp +++ b/src/mir_app/src/clcutils.cpp @@ -434,7 +434,7 @@ void fnEndRename(HWND, ClcData *dat, int save) if (!text[0] || !mir_wstrcmp(otherName, text))
db_unset(contact->hContact, "CList", "MyHandle");
else
- db_set_ts(contact->hContact, "CList", "MyHandle", text);
+ db_set_ws(contact->hContact, "CList", "MyHandle", text);
mir_free(otherName);
}
}
@@ -698,7 +698,7 @@ void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour) char idstr[20];
mir_snprintf(idstr, "Font%dName", i);
- ptrW tszFace(db_get_tsa(NULL, "CLC", idstr));
+ ptrW tszFace(db_get_wsa(NULL, "CLC", idstr));
if (tszFace)
mir_wstrcpy(lf->lfFaceName, tszFace);
@@ -769,7 +769,7 @@ void fnLoadClcOptions(HWND hwnd, ClcData *dat, BOOL bFirst) dat->hBmpBackground = NULL;
}
if (db_get_b(NULL, "CLC", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- ptrW tszBitmap(db_get_tsa(NULL, "CLC", "BkBitmap"));
+ ptrW tszBitmap(db_get_wsa(NULL, "CLC", "BkBitmap"));
if (tszBitmap)
dat->hBmpBackground = Bitmap_Load(tszBitmap);
}
diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp index a9b1e0ab2f..b8b3bbdb0e 100644 --- a/src/mir_app/src/clistgroups.cpp +++ b/src/mir_app/src/clistgroups.cpp @@ -43,7 +43,7 @@ struct CGroupInternal {
char idstr[33];
itoa(groupId, idstr, 10);
- db_set_ts(NULL, "CListGroups", idstr, groupName);
+ db_set_ws(NULL, "CListGroups", idstr, groupName);
}
};
@@ -204,14 +204,14 @@ MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup) }
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- ptrW tszGroupName(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroupName(db_get_wsa(hContact, "CList", "Group"));
if (mir_wstrcmp(tszGroupName, pGroup->groupName+1))
continue;
CLISTGROUPCHANGE grpChg = { sizeof(grpChg), NULL, NULL };
grpChg.pszOldName = pGroup->groupName+1;
if (szNewParent[0]) {
- db_set_ts(hContact, "CList", "Group", szNewParent);
+ db_set_ws(hContact, "CList", "Group", szNewParent);
grpChg.pszNewName = szNewParent;
}
else {
@@ -340,7 +340,7 @@ static int RenameGroupWithMove(int groupId, const wchar_t *szName, int move) for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
ClcCacheEntry *cache = cli.pfnGetCacheEntry(hContact);
if (!mir_wstrcmp(cache->tszGroup, oldName)) {
- db_set_ts(hContact, "CList", "Group", szName);
+ db_set_ws(hContact, "CList", "Group", szName);
replaceStrW(cache->tszGroup, szName);
}
}
@@ -512,7 +512,7 @@ int InitGroupServices(void) for (int i = 0;; i++) {
char str[32];
_itoa(i, str, 10);
- ptrW tszGroup(db_get_tsa(NULL, "CListGroups", str));
+ ptrW tszGroup(db_get_wsa(NULL, "CListGroups", str));
if (tszGroup == NULL)
break;
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index f33faa939a..844027ecf1 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -101,13 +101,13 @@ wchar_t* fnGetStatusModeDescription(int mode, int flags) default:
if (IsStatusConnecting(mode)) {
const wchar_t* connFmt = LPGENW("Connecting (attempt %d)");
- mir_snwprintf(szMode, (flags & GSMDF_UNTRANSLATED) ? connFmt : TranslateTS(connFmt), mode - ID_STATUS_CONNECTING + 1);
+ mir_snwprintf(szMode, (flags & GSMDF_UNTRANSLATED) ? connFmt : TranslateW(connFmt), mode - ID_STATUS_CONNECTING + 1);
return szMode;
}
return NULL;
}
- return (flags & GSMDF_UNTRANSLATED) ? descr : TranslateTS(descr);
+ return (flags & GSMDF_UNTRANSLATED) ? descr : TranslateW(descr);
}
static int ProtocolAck(WPARAM, LPARAM lParam)
diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp index b82bc7c746..86652d5078 100644 --- a/src/mir_app/src/clistsettings.cpp +++ b/src/mir_app/src/clistsettings.cpp @@ -55,7 +55,7 @@ ClcCacheEntry* fnCreateCacheItem(MCONTACT hContact) void fnCheckCacheItem(ClcCacheEntry *p)
{
if (p->tszGroup == NULL) {
- p->tszGroup = db_get_tsa(p->hContact, "CList", "Group");
+ p->tszGroup = db_get_wsa(p->hContact, "CList", "Group");
if (p->tszGroup == NULL)
p->tszGroup = mir_wstrdup(L"");
}
diff --git a/src/mir_app/src/clisttray.cpp b/src/mir_app/src/clisttray.cpp index aafe45ab1c..5254bb9372 100644 --- a/src/mir_app/src/clisttray.cpp +++ b/src/mir_app/src/clisttray.cpp @@ -49,7 +49,7 @@ static wchar_t* sttGetXStatus(const char *szProto) if (CallProtoServiceInt(NULL, szProto, PS_GETSTATUS, 0, 0) > ID_STATUS_OFFLINE) {
wchar_t tszStatus[512];
CUSTOM_STATUS cs = { sizeof(cs) };
- cs.flags = CSSF_MASK_MESSAGE | CSSF_TCHAR;
+ cs.flags = CSSF_MASK_MESSAGE | CSSF_UNICODE;
cs.ptszMessage = tszStatus;
if (CallProtoServiceInt(NULL, szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&cs) == 0)
return mir_wstrdup(tszStatus);
@@ -81,7 +81,7 @@ wchar_t* fnTrayIconMakeTooltip(const wchar_t *szPrefix, const char *szProto) if (accounts.getCount() == 1)
return cli.pfnTrayIconMakeTooltip(szPrefix, accounts[0]->szModuleName);
- CMString tszTip;
+ CMStringW tszTip;
if (szPrefix && szPrefix[0]) {
if (!db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT)) {
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 37a7fc8739..250287f634 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -275,7 +275,7 @@ int LoadCLUIModule(void) wndclass.hIconSm = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
RegisterClassEx(&wndclass);
- if (db_get_ts(NULL, "CList", "TitleText", &dbv))
+ if (db_get_ws(NULL, "CList", "TitleText", &dbv))
mir_wstrncpy(titleText, _T(MIRANDANAME), _countof(titleText));
else {
mir_wstrncpy(titleText, dbv.ptszVal, _countof(titleText));
@@ -412,7 +412,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (msg == uMsgProcessProfile) {
wchar_t profile[MAX_PATH];
if (GlobalGetAtomName((ATOM)wParam, profile, _countof(profile))) {
- int rc = mir_wstrcmpi(profile, VARST(L"%miranda_userdata%\\%miranda_profilename%.dat")) == 0;
+ int rc = mir_wstrcmpi(profile, VARSW(L"%miranda_userdata%\\%miranda_profilename%.dat")) == 0;
ReplyMessage(rc);
if (rc) {
ShowWindow(hwnd, SW_RESTORE);
diff --git a/src/mir_app/src/contact.cpp b/src/mir_app/src/contact.cpp index ceedd7a125..c482deed19 100644 --- a/src/mir_app/src/contact.cpp +++ b/src/mir_app/src/contact.cpp @@ -54,7 +54,7 @@ INT_PTR ContactChangeGroup(WPARAM wParam, LPARAM lParam) db_unset(wParam, "CList", "Group"); else { grpChg.pszNewName = Clist_GroupGetName(lParam, NULL); - db_set_ts(wParam, "CList", "Group", grpChg.pszNewName); + db_set_ws(wParam, "CList", "Group", grpChg.pszNewName); } NotifyEventHooks(hGroupChangeEvent, wParam, (LPARAM)&grpChg); diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp index f9e717d541..ced2f8ab5a 100644 --- a/src/mir_app/src/contacts.cpp +++ b/src/mir_app/src/contacts.cpp @@ -309,7 +309,7 @@ public: tvis.item.mask = TVIF_TEXT | TVIF_PARAM;
for (int i = 0; i < _countof(nameOrderDescr); i++) {
tvis.item.lParam = nameOrder[i];
- tvis.item.pszText = TranslateTS(nameOrderDescr[nameOrder[i]]);
+ tvis.item.pszText = TranslateW(nameOrderDescr[nameOrder[i]]);
m_nameOrder.InsertItem(&tvis);
}
}
diff --git a/src/mir_app/src/database.cpp b/src/mir_app/src/database.cpp index 2331ee3159..420e442f15 100644 --- a/src/mir_app/src/database.cpp +++ b/src/mir_app/src/database.cpp @@ -62,7 +62,7 @@ static void fillProfileName(const wchar_t* ptszFileName) bool IsInsideRootDir(wchar_t* profiledir, bool exact)
{
- VARST pfd(L"%miranda_path%");
+ VARSW pfd(L"%miranda_path%");
if (exact)
return mir_wstrcmpi(profiledir, pfd) == 0;
@@ -78,7 +78,7 @@ int getProfilePath(wchar_t *buf, size_t) if (profiledir[0] == 0)
mir_wstrcpy(profiledir, L"%miranda_path%\\Profiles");
- size_t len = PathToAbsoluteT(VARST(profiledir), buf);
+ size_t len = PathToAbsoluteW(VARSW(profiledir), buf);
if (buf[len - 1] == '/' || buf[len - 1] == '\\')
buf[len - 1] = 0;
@@ -124,7 +124,7 @@ static void getDefaultProfile(wchar_t *szProfile, size_t cch) if (defaultProfile[0] == 0)
return;
- VARST res(defaultProfile);
+ VARSW res(defaultProfile);
if (res)
mir_snwprintf(szProfile, cch, L"%s\\%s\\%s%s", g_profileDir, (wchar_t*)res, (wchar_t*)res, isValidProfileName(res) ? L"" : L".dat");
else
@@ -150,7 +150,7 @@ static void loadProfileByShortName(const wchar_t* src, wchar_t *szProfile, size_ p = wcsrchr(profileName, '.'); if (p) *p = 0;
mir_snwprintf(newProfileDir, cch, L"%s\\%s\\", g_profileDir, profileName);
- PathToAbsoluteT(buf, szProfile, newProfileDir);
+ PathToAbsoluteW(buf, szProfile, newProfileDir);
if (wcschr(buf, '\\')) {
wcsncpy_s(g_profileDir, szProfile, _TRUNCATE);
@@ -184,7 +184,7 @@ static void moveProfileDirProfiles(wchar_t *profiledir, BOOL isRootDir = TRUE) {
wchar_t pfd[MAX_PATH];
if (isRootDir)
- wcsncpy_s(pfd, VARST(L"%miranda_path%\\*.dat"), _TRUNCATE);
+ wcsncpy_s(pfd, VARSW(L"%miranda_path%\\*.dat"), _TRUNCATE);
else
mir_snwprintf(pfd, L"%s\\*.dat", profiledir);
@@ -198,7 +198,7 @@ static void moveProfileDirProfiles(wchar_t *profiledir, BOOL isRootDir = TRUE) c = wcsrchr(profile, '.'); if (c) *c = 0;
mir_snwprintf(path, L"%s\\%s", pfd, ffd.cFileName);
mir_snwprintf(path2, L"%s\\%s", profiledir, profile);
- CreateDirectoryTreeT(path2);
+ CreateDirectoryTreeW(path2);
mir_snwprintf(path2, L"%s\\%s\\%s", profiledir, profile, ffd.cFileName);
if (_waccess(path2, 0) == 0) {
wchar_t buf[512];
@@ -420,7 +420,7 @@ int tryOpenDatabase(const wchar_t *tszProfile) static int tryCreateDatabase(const wchar_t *ptszProfile)
{
wchar_t *tszProfile = NEWWSTR_ALLOCA(ptszProfile);
- CreatePathToFileT(tszProfile);
+ CreatePathToFileW(tszProfile);
for (int i = 0; i < arDbPlugins.getCount(); i++) {
DATABASELINK* p = arDbPlugins[i];
@@ -482,7 +482,7 @@ static wchar_t tszNoSuitableDriver[] = LPGENW("Miranda was unable to open '%s'\n int LoadDatabaseModule(void)
{
wchar_t szProfile[MAX_PATH];
- PathToAbsoluteT(L".", szProfile);
+ PathToAbsoluteW(L".", szProfile);
_tchdir(szProfile);
szProfile[0] = 0;
@@ -497,7 +497,7 @@ int LoadDatabaseModule(void) if (arDbPlugins.getCount() == 0) {
MessageBox(NULL,
- CMString(FORMAT, TranslateTS(tszNoDrivers), ptszFileName),
+ CMStringW(FORMAT, TranslateW(tszNoDrivers), ptszFileName),
TranslateT("No profile support installed!"), MB_OK | MB_ICONERROR);
return 1;
}
@@ -515,7 +515,7 @@ int LoadDatabaseModule(void) // there were no suitable driver installed
if (rc == -1) {
MessageBox(NULL,
- CMString(FORMAT, TranslateTS(tszNoSuitableDriver), ptszFileName),
+ CMStringW(FORMAT, TranslateW(tszNoSuitableDriver), ptszFileName),
TranslateT("Miranda can't open that profile"), MB_OK | MB_ICONERROR);
}
else if (rc > 0) {
@@ -523,12 +523,12 @@ int LoadDatabaseModule(void) if (fileExist(szProfile)) {
// file isn't locked, just no driver could open it.
MessageBox(NULL,
- CMString(FORMAT, TranslateTS(tszUnknownFormat), ptszFileName),
+ CMStringW(FORMAT, TranslateW(tszUnknownFormat), ptszFileName),
TranslateT("Miranda can't understand that profile"), MB_OK | MB_ICONERROR);
}
else if (!FindMirandaForProfile(szProfile)) {
retry = IDRETRY == MessageBox(NULL,
- CMString(FORMAT, TranslateTS(tszProfileLocked), ptszFileName),
+ CMStringW(FORMAT, TranslateW(tszProfileLocked), ptszFileName),
TranslateT("Miranda can't open that profile"), MB_RETRYCANCEL | MB_ICONERROR);
}
}
diff --git a/src/mir_app/src/dbini.cpp b/src/mir_app/src/dbini.cpp index b545aae71c..09d6a336ff 100644 --- a/src/mir_app/src/dbini.cpp +++ b/src/mir_app/src/dbini.cpp @@ -46,7 +46,7 @@ static INT_PTR CALLBACK InstallIniDlgProc(HWND hwndDlg, UINT message, WPARAM wPa else if (!mir_wstrcmpi(szSecurity, L"none"))
pszSecurityInfo = LPGENW("Security systems to prevent malicious changes have been disabled. You will receive no further warnings.");
else pszSecurityInfo = NULL;
- if (pszSecurityInfo) SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateTS(pszSecurityInfo));
+ if (pszSecurityInfo) SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateW(pszSecurityInfo));
}
return TRUE;
@@ -122,7 +122,7 @@ static INT_PTR CALLBACK WarnIniChangeDlgProc(HWND hwndDlg, UINT message, WPARAM pszSecurityInfo = LPGENW("This change is known to be potentially hazardous.");
else
pszSecurityInfo = LPGENW("This change is not known to be safe.");
- SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateTS(pszSecurityInfo));
+ SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateW(pszSecurityInfo));
}
return TRUE;
@@ -455,11 +455,11 @@ static void DoAutoExec(void) GetPrivateProfileString(L"AutoExec", L"Glob", L"autoexec_*.ini", szFindPath, _countof(szFindPath), mirandabootini);
if (g_bDbCreated && szOnCreateFilename[0]) {
- PathToAbsoluteT(VARST(szOnCreateFilename), szIniPath);
+ PathToAbsoluteW(VARSW(szOnCreateFilename), szIniPath);
ProcessIniFile(szIniPath, szSafeSections, szUnsafeSections, 0, 1);
}
- PathToAbsoluteT(VARST(szFindPath), szFindPath);
+ PathToAbsoluteW(VARSW(szFindPath), szFindPath);
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(szFindPath, &fd);
@@ -537,7 +537,7 @@ int InitIni(void) DoAutoExec();
wchar_t szMirandaDir[MAX_PATH];
- PathToAbsoluteT(L".", szMirandaDir);
+ PathToAbsoluteW(L".", szMirandaDir);
hIniChangeNotification = FindFirstChangeNotification(szMirandaDir, 0, FILE_NOTIFY_CHANGE_FILE_NAME);
if (hIniChangeNotification != INVALID_HANDLE_VALUE) {
CreateServiceFunction("DB/Ini/CheckImportNow", CheckIniImportNow);
diff --git a/src/mir_app/src/dbintf.cpp b/src/mir_app/src/dbintf.cpp index dca13b96f3..ffa510f9e9 100644 --- a/src/mir_app/src/dbintf.cpp +++ b/src/mir_app/src/dbintf.cpp @@ -48,7 +48,7 @@ static INT_PTR srvGetContactCount(WPARAM, LPARAM) static INT_PTR srvDeleteContact(WPARAM wParam, LPARAM)
{
DBVARIANT dbv = { 0 };
- if (!db_get_ts(wParam, "ContactPhoto", "File", &dbv)) {
+ if (!db_get_ws(wParam, "ContactPhoto", "File", &dbv)) {
DeleteFile(dbv.ptszVal);
db_free(&dbv);
}
diff --git a/src/mir_app/src/dbutils.cpp b/src/mir_app/src/dbutils.cpp index 8f63f74dbf..a8003bec86 100644 --- a/src/mir_app/src/dbutils.cpp +++ b/src/mir_app/src/dbutils.cpp @@ -118,7 +118,7 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam) ptrW tszLast(getEventString(dbei, buf));
ptrW tszEmail(getEventString(dbei, buf));
- CMString nick, text;
+ CMStringW nick, text;
if (tszFirst || tszLast) {
nick.AppendFormat(L"%s %s", tszFirst, tszLast);
nick.Trim();
@@ -147,7 +147,7 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam) }
if (dbei->eventType == EVENTTYPE_CONTACTS) {
- CMString text(TranslateT("Contacts: "));
+ CMStringW text(TranslateT("Contacts: "));
// blob is: [uin(ASCIIZ), nick(ASCIIZ)]*
char *buf = LPSTR(dbei->pBlob), *limit = LPSTR(dbei->pBlob) + dbei->cbBlob;
while (buf < limit) {
diff --git a/src/mir_app/src/enterstring.cpp b/src/mir_app/src/enterstring.cpp index b68b24b661..5632a6acf1 100644 --- a/src/mir_app/src/enterstring.cpp +++ b/src/mir_app/src/enterstring.cpp @@ -57,7 +57,7 @@ static void ComboLoadRecentStrings(HWND hwndDlg, EnterStringFormParam *pForm) for (int i = 0; i < pForm->recentCount; i++) {
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "%s%d", pForm->szDataPrefix, i);
- ptrW tszRecent(db_get_tsa(NULL, pForm->szModuleName, setting));
+ ptrW tszRecent(db_get_wsa(NULL, pForm->szModuleName, setting));
if (tszRecent != NULL)
SendDlgItemMessage(hwndDlg, pForm->idcControl, CB_ADDSTRING, 0, tszRecent);
}
@@ -83,7 +83,7 @@ static void ComboAddRecentString(HWND hwndDlg, EnterStringFormParam *pForm) id = db_get_b(NULL, pForm->szModuleName, pForm->szDataPrefix, 0);
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "%s%d", pForm->szDataPrefix, id);
- db_set_ts(NULL, pForm->szModuleName, setting, string);
+ db_set_ws(NULL, pForm->szModuleName, setting, string);
db_set_b(NULL, pForm->szModuleName, pForm->szDataPrefix, (id + 1) % pForm->idcControl);
}
diff --git a/src/mir_app/src/extraicons.cpp b/src/mir_app/src/extraicons.cpp index bcdeea5161..aae28f5ff2 100644 --- a/src/mir_app/src/extraicons.cpp +++ b/src/mir_app/src/extraicons.cpp @@ -395,7 +395,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterCallback(const char *name, const return 0;
ptrW tszDesc(mir_a2u(description));
- wchar_t *desc = TranslateTH(_hLang, tszDesc);
+ wchar_t *desc = TranslateW_LP(tszDesc, _hLang);
int id = registeredExtraIcons.getCount() + 1;
BaseExtraIcon *extra = new CallbackExtraIcon(id, name, desc, descIcon == NULL ? "" : descIcon, RebuildIcons, ApplyIcon, OnClick, onClickParam);
@@ -410,7 +410,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterIcolib(const char *name, const ch return 0;
ptrW tszDesc(mir_a2u(description));
- wchar_t *desc = TranslateTH(_hLang, tszDesc);
+ wchar_t *desc = TranslateW_LP(tszDesc, _hLang);
BaseExtraIcon *extra = GetExtraIconByName(name);
if (extra != NULL) {
@@ -419,7 +419,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterIcolib(const char *name, const ch // Found one, now merge it
if (mir_wstrcmpi(extra->getDescription(), desc)) {
- CMString newDesc = extra->getDescription();
+ CMStringW newDesc = extra->getDescription();
newDesc += L" / ";
newDesc += desc;
extra->setDescription(newDesc.c_str());
diff --git a/src/mir_app/src/findadd.cpp b/src/mir_app/src/findadd.cpp index cef250a96c..bf17091830 100644 --- a/src/mir_app/src/findadd.cpp +++ b/src/mir_app/src/findadd.cpp @@ -326,7 +326,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP dat->iLastColumnSortIndex = 1; dat->bSortAscending = 1; SendDlgItemMessage(hwndDlg, IDC_MOREOPTIONS, BUTTONSETARROW, 1, 0); - SendDlgItemMessage(hwndDlg, IDOK, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Ctrl+Search add contact"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDOK, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Ctrl+Search add contact"), BATF_UNICODE); ListView_SetExtendedListViewStyle(hwndList, LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP); @@ -364,7 +364,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetStatusBarSearchInfo(GetDlgItem(hwndDlg, IDC_STATUSBAR), dat); wchar_t *szProto = NULL; - ptrW tszLast(db_get_tsa(NULL, "FindAdd", "LastSearched")); + ptrW tszLast(db_get_wsa(NULL, "FindAdd", "LastSearched")); if (tszLast) szProto = NEWWSTR_ALLOCA(tszLast); @@ -765,7 +765,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP PROTOSEARCHRESULT psr = { 0 }; psr.cbSize = sizeof(psr); - psr.flags = PSR_TCHAR; + psr.flags = PSR_UNICODE; psr.id.w = str; acs.psr = &psr; @@ -854,7 +854,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP LVCOLUMN lvc = { 0 }; lvc.mask = LVCF_TEXT; for (int iColumn = 0; iColumn < csr->nFieldCount; iColumn++) { - lvc.pszText = TranslateTS(csr->pszFields[iColumn]); + lvc.pszText = TranslateW(csr->pszFields[iColumn]); ListView_InsertColumn(hwndList, iColumn + 1, &lvc); } } @@ -869,7 +869,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP lsr->psr.firstName.w = sttDecodeString(psr->flags, psr->firstName); lsr->psr.lastName.w = sttDecodeString(psr->flags, psr->lastName); lsr->psr.email.w = sttDecodeString(psr->flags, psr->email); - lsr->psr.flags = psr->flags & ~PSR_UNICODE | PSR_TCHAR; + lsr->psr.flags = psr->flags & ~PSR_UNICODE | PSR_UNICODE; LVITEM lvi = { 0 }; lvi.mask = LVIF_PARAM | LVIF_IMAGE; @@ -909,7 +909,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP lsr->psr.lastName.w = sttDecodeString(psr->flags, psr->lastName); lsr->psr.email.w = sttDecodeString(psr->flags, psr->email); lsr->psr.id.w = sttDecodeString(psr->flags, psr->id); - lsr->psr.flags = psr->flags & ~PSR_UNICODE | PSR_TCHAR; + lsr->psr.flags = psr->flags & ~PSR_UNICODE | PSR_UNICODE; LVITEM lvi = { 0 }; lvi.mask = LVIF_PARAM | LVIF_IMAGE; @@ -948,7 +948,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (szProto != NULL) { *szProto = '\0'; SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETLBTEXT, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), (LPARAM)szProto); - db_set_ts(NULL, "FindAdd", "LastSearched", szProto); + db_set_ws(NULL, "FindAdd", "LastSearched", szProto); } SaveColumnSizes(hwndList); diff --git a/src/mir_app/src/hotkey_opts.cpp b/src/mir_app/src/hotkey_opts.cpp index cb02b5496e..d85da9566e 100644 --- a/src/mir_app/src/hotkey_opts.cpp +++ b/src/mir_app/src/hotkey_opts.cpp @@ -311,8 +311,8 @@ static void sttOptionsAddHotkey(HWND hwndList, THotkeyItem *item) THotkeyItem *newItem = (THotkeyItem *)mir_alloc(sizeof(THotkeyItem)); newItem->pszName = NULL; newItem->pszService = item->pszService ? mir_strdup(item->pszService) : NULL; - newItem->ptszSection = mir_wstrdup(item->ptszSection); - newItem->ptszDescription = mir_wstrdup(item->ptszDescription); + newItem->pwszSection = mir_wstrdup(item->pwszSection); + newItem->pwszDescription = mir_wstrdup(item->pwszDescription); newItem->lParam = item->lParam; newItem->idHotkey = GlobalAddAtomA(buf); newItem->rootHotkey = item; @@ -393,7 +393,7 @@ static void sttBuildHotkeyList(HWND hwndList) if (item->OptDeleted) continue; - if (!i || mir_wstrcmp(item->ptszSection, hotkeys[i - 1]->ptszSection)) { + if (!i || mir_wstrcmp(item->pwszSection, hotkeys[i - 1]->pwszSection)) { lvi.mask = LVIF_TEXT | LVIF_PARAM; lvi.iItem = nItems++; lvi.iSubItem = 0; @@ -404,7 +404,7 @@ static void sttBuildHotkeyList(HWND hwndList) lvi.mask = LVIF_TEXT; lvi.iSubItem = 1; - lvi.pszText = item->ptszSection; + lvi.pszText = item->pwszSection; ListView_SetItem(hwndList, &lvi); lvi.iSubItem = 0; diff --git a/src/mir_app/src/hotkeys.cpp b/src/mir_app/src/hotkeys.cpp index 7ecb0b1c3a..e4884e26d7 100644 --- a/src/mir_app/src/hotkeys.cpp +++ b/src/mir_app/src/hotkeys.cpp @@ -29,9 +29,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static int sttCompareHotkeys(const THotkeyItem *p1, const THotkeyItem *p2)
{
int res;
- if (res = mir_wstrcmp(p1->ptszSection, p2->ptszSection))
+ if (res = mir_wstrcmp(p1->pwszSection, p2->pwszSection))
return res;
- if (res = mir_wstrcmp(p1->ptszDescription, p2->ptszDescription))
+ if (res = mir_wstrcmp(p1->pwszDescription, p2->pwszDescription))
return res;
if (!p1->rootHotkey && p2->rootHotkey)
return -1;
@@ -138,12 +138,12 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam) THotkeyItem *p = (THotkeyItem*)mir_alloc(sizeof(THotkeyItem));
DWORD dwFlags = (desc->cbSize >= sizeof(HOTKEYDESC)) ? desc->dwFlags : 0;
if (dwFlags & HKD_UNICODE) {
- p->ptszSection = mir_wstrdup(desc->ptszSection);
- p->ptszDescription = mir_wstrdup(desc->ptszDescription);
+ p->pwszSection = mir_wstrdup(desc->pwszSection);
+ p->pwszDescription = mir_wstrdup(desc->pwszDescription);
}
else {
- p->ptszSection = mir_a2u(desc->pszSection);
- p->ptszDescription = mir_a2u(desc->pszDescription);
+ p->pwszSection = mir_a2u(desc->pszSection);
+ p->pwszDescription = mir_a2u(desc->pszDescription);
}
p->hLangpack = (int)wParam;
@@ -161,8 +161,8 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam) p->rootHotkey->nSubHotkeys++;
}
else {
- mir_free(p->ptszSection);
- mir_free(p->ptszDescription);
+ mir_free(p->pwszSection);
+ mir_free(p->pwszDescription);
mir_free(p);
return 0;
}
@@ -264,7 +264,7 @@ static INT_PTR svcHotkeyCheck(WPARAM wParam, LPARAM lParam) for (i = 0; i < hotkeys.getCount(); i++) {
THotkeyItem *p = hotkeys[i];
- if ((p->type != HKT_MANUAL) || mir_wstrcmp(pszSection, p->ptszSection))
+ if ((p->type != HKT_MANUAL) || mir_wstrcmp(pszSection, p->pwszSection))
continue;
BYTE hkMod, hkVk;
@@ -290,8 +290,8 @@ void FreeHotkey(THotkeyItem *p) GlobalDeleteAtom(p->idHotkey);
mir_free(p->pszName);
mir_free(p->pszService);
- mir_free(p->ptszDescription);
- mir_free(p->ptszSection);
+ mir_free(p->pwszDescription);
+ mir_free(p->pwszSection);
mir_free(p);
}
diff --git a/src/mir_app/src/icolib.cpp b/src/mir_app/src/icolib.cpp index d2f8f34e24..692f695819 100644 --- a/src/mir_app/src/icolib.cpp +++ b/src/mir_app/src/icolib.cpp @@ -81,7 +81,7 @@ static IconSourceFile* IconSourceFile_Get(const wchar_t *file, bool isPath) IconSourceFile key;
if (isPath)
- PathToAbsoluteT(file, key.file); /// TODO: convert path to long - eliminate duplicate items
+ PathToAbsoluteW(file, key.file); /// TODO: convert path to long - eliminate duplicate items
else
wcsncpy_s(key.file, file, _TRUNCATE);
@@ -667,10 +667,10 @@ HICON IconItem_GetIcon(HANDLE hIcoLib, bool big) big = big && !item->cx;
IconSourceItem* &source = big ? item->source_big : item->source_small;
if (source == NULL) {
- ptrW tszCustomPath(db_get_tsa(NULL, "SkinIcons", item->name));
+ ptrW tszCustomPath(db_get_wsa(NULL, "SkinIcons", item->name));
if (tszCustomPath != NULL) {
wchar_t tszFullPath[MAX_PATH];
- PathToAbsoluteT(tszCustomPath, tszFullPath);
+ PathToAbsoluteW(tszCustomPath, tszFullPath);
int cx = item->cx ? item->cx : (big ? g_iIconX : g_iIconSX);
int cy = item->cy ? item->cy : (big ? g_iIconY : g_iIconSY);
source = GetIconSourceItemFromPath(tszFullPath, cx, cy);
diff --git a/src/mir_app/src/keyboard.cpp b/src/mir_app/src/keyboard.cpp index e71b72c9c9..fbda9d07bf 100644 --- a/src/mir_app/src/keyboard.cpp +++ b/src/mir_app/src/keyboard.cpp @@ -53,38 +53,38 @@ int InitClistHotKeys(void) CreateServiceFunction("CLIST/HK/Read", hkRead);
HOTKEYDESC shk = { sizeof(shk) };
- shk.dwFlags = HKD_TCHAR;
- shk.ptszDescription = LPGENW("Show/Hide contact list");
+ shk.dwFlags = HKD_UNICODE;
+ shk.pwszDescription = LPGENW("Show/Hide contact list");
shk.pszName = "ShowHide";
- shk.ptszSection = L"Main";
+ shk.pwszSection = L"Main";
shk.pszService = "CLIST/HK/SHOWHIDE";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'A');
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENW("Read message");
+ shk.pwszDescription = LPGENW("Read message");
shk.pszName = "ReadMessage";
- shk.ptszSection = L"Main";
+ shk.pwszSection = L"Main";
shk.pszService = "CLIST/HK/Read";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'I');
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENW("Open Options page");
+ shk.pwszDescription = LPGENW("Open Options page");
shk.pszName = "ShowOptions";
- shk.ptszSection = L"Main";
+ shk.pwszSection = L"Main";
shk.pszService = "CLIST/HK/Opts";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'O') | HKF_MIRANDA_LOCAL;
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENW("Open logging options");
+ shk.pwszDescription = LPGENW("Open logging options");
shk.pszName = "ShowLogOptions";
- shk.ptszSection = L"Main";
+ shk.pwszSection = L"Main";
shk.pszService = "Netlib/Log/Win";
shk.DefHotKey = 0;
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENW("Open 'Find user' dialog");
+ shk.pwszDescription = LPGENW("Open 'Find user' dialog");
shk.pszName = "FindUsers";
- shk.ptszSection = L"Main";
+ shk.pwszSection = L"Main";
shk.pszService = "FindAdd/FindAddCommand";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'F') | HKF_MIRANDA_LOCAL;
Hotkey_Register(&shk);
diff --git a/src/mir_app/src/langpack.cpp b/src/mir_app/src/langpack.cpp index 3a17d94307..b7f1bf02b0 100644 --- a/src/mir_app/src/langpack.cpp +++ b/src/mir_app/src/langpack.cpp @@ -34,10 +34,10 @@ BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam) BOOL res = FALSE;
/* language folder */
- ptrW langpack(db_get_tsa(NULL, "Langpack", "Current"));
+ ptrW langpack(db_get_wsa(NULL, "Langpack", "Current"));
wchar_t tszFullPath[MAX_PATH];
- PathToAbsoluteT(L"\\Languages\\langpack_*.txt", tszFullPath);
+ PathToAbsoluteW(L"\\Languages\\langpack_*.txt", tszFullPath);
BOOL fPackFound = FALSE;
WIN32_FIND_DATA wfd;
@@ -46,7 +46,7 @@ BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam) do {
if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue;
/* get data */
- PathToAbsoluteT(L"\\Languages\\", tszFullPath);
+ PathToAbsoluteW(L"\\Languages\\", tszFullPath);
mir_wstrcat(tszFullPath, wfd.cFileName);
LANGPACK_INFO pack;
diff --git a/src/mir_app/src/lpopts.cpp b/src/mir_app/src/lpopts.cpp index c8e7ed7602..ef319c03ac 100644 --- a/src/mir_app/src/lpopts.cpp +++ b/src/mir_app/src/lpopts.cpp @@ -43,7 +43,7 @@ static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack) /* add some note if its incompatible */
if (szLanguageName[0] && szContryName[0]) {
- mir_snwprintf(szLocaleName, L"%s (%s)", TranslateTS(szLanguageName), TranslateTS(szContryName));
+ mir_snwprintf(szLocaleName, L"%s (%s)", TranslateW(szLanguageName), TranslateW(szContryName));
if (!IsValidLocale(pack->Locale, LCID_INSTALLED)) {
wchar_t *pszIncompat;
pszIncompat = TranslateT("(incompatible)");
@@ -67,7 +67,7 @@ static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack) SetDlgItemText_CP(hwndDlg, IDC_LANGMODUSING, pack->szLastModifiedUsing);
SetDlgItemText_CP(hwndDlg, IDC_LANGAUTHORS, pack->szAuthors);
SetDlgItemText_CP(hwndDlg, IDC_LANGEMAIL, pack->szAuthorEmail);
- SetDlgItemText(hwndDlg, IDC_LANGINFOFRAME, TranslateTS(pack->tszLanguage));
+ SetDlgItemText(hwndDlg, IDC_LANGINFOFRAME, TranslateW(pack->tszLanguage));
}
static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack, WPARAM wParam, LPARAM)
@@ -78,7 +78,7 @@ static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack, WPARAM wParam, LPARAM) /* insert */
wchar_t tszName[512];
mir_snwprintf(tszName, L"%s [%s]",
- TranslateTS(pack->tszLanguage),
+ TranslateW(pack->tszLanguage),
pack->flags & LPF_DEFAULT ? TranslateT("built-in") : pack->tszFileName);
UINT message = pack->flags & LPF_DEFAULT ? CB_INSERTSTRING : CB_ADDSTRING;
int idx = SendMessage((HWND)wParam, message, 0, (LPARAM)tszName);
@@ -166,7 +166,7 @@ INT_PTR CALLBACK DlgLangpackOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP for (int i = 0; i < count; i++) {
LANGPACK_INFO *pack = (LANGPACK_INFO*)ComboBox_GetItemData(hwndList, i);
if (i == idx) {
- db_set_ts(NULL, "Langpack", "Current", pack->tszFileName);
+ db_set_ws(NULL, "Langpack", "Current", pack->tszFileName);
mir_wstrcpy(tszPath, pack->tszFullPath);
pack->flags |= LPF_ENABLED;
}
diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index 894c323e3b..524e19b75b 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -467,7 +467,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) if (reset || check) {
TMO_IntMenuItem *timiParent = MO_GetIntMenuItem(pimi->mi.root);
if (timiParent) {
- LPTSTR ptszName = TranslateTH(pimi->mi.hLangpack, pimi->mi.hIcolibItem ? pimi->mi.name.w : LPGENW("Custom status"));
+ LPTSTR ptszName = TranslateW_LP(pimi->mi.hIcolibItem ? pimi->mi.name.w : LPGENW("Custom status"), pimi->mi.hLangpack);
timiParent = MO_GetIntMenuItem(pimi->mi.root);
@@ -816,7 +816,7 @@ void RebuildMenuOrder(void) // adding root
CMenuItem mi;
- mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.position = pos++;
mi.hIcon = ic = (HICON)CallProtoServiceInt(NULL, pa->szModuleName, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
@@ -832,7 +832,7 @@ void RebuildMenuOrder(void) TMO_IntMenuItem *rootmenu = Menu_AddItem(hStatusMenuObject, &mi, smep);
memset(&mi, 0, sizeof(mi));
- mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.root = rootmenu;
mi.position = pos++;
mi.hIcon = ic;
@@ -873,7 +873,7 @@ void RebuildMenuOrder(void) // adding
memset(&mi, 0, sizeof(mi));
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
if (statusModeList[j] == ID_STATUS_OFFLINE)
mi.flags |= CMIF_CHECKED;
mi.root = rootmenu;
@@ -914,7 +914,7 @@ void RebuildMenuOrder(void) continue;
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
if (statusModeList[j] == ID_STATUS_OFFLINE)
mi.flags |= CMIF_CHECKED;
@@ -1145,14 +1145,14 @@ void InitCustomMenus(void) CreateServiceFunction(MS_CLIST_HKSTATUS, HotkeySetStatus);
HOTKEYDESC hkd = { sizeof(hkd) };
- hkd.ptszSection = L"Status";
- hkd.dwFlags = HKD_TCHAR;
+ hkd.pwszSection = L"Status";
+ hkd.dwFlags = HKD_UNICODE;
for (int i = 0; i < _countof(statusHotkeys); i++) {
char szName[30];
mir_snprintf(szName, "StatusHotKey_%d", i);
hkd.pszName = szName;
hkd.lParam = statusModeList[i];
- hkd.ptszDescription = fnGetStatusModeDescription(hkd.lParam, 0);
+ hkd.pwszDescription = fnGetStatusModeDescription(hkd.lParam, 0);
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, '0' + i) | HKF_MIRANDA_LOCAL;
hkd.pszService = MS_CLIST_HKSTATUS;
statusHotkeys[i] = Hotkey_Register(&hkd);
diff --git a/src/mir_app/src/menu_options.cpp b/src/mir_app/src/menu_options.cpp index a2acb5dfaa..c2d1bf2b5a 100644 --- a/src/mir_app/src/menu_options.cpp +++ b/src/mir_app/src/menu_options.cpp @@ -96,8 +96,8 @@ class CGenMenuOptionsPage : public CDlgBase else ptszCustomName = L""; - CMString tszValue(FORMAT, L"%d;%d;%S;%s", visible, runtimepos, pszParent, ptszCustomName); - db_set_ts(NULL, szModule, menuItemName, tszValue); + CMStringW tszValue(FORMAT, L"%d;%d;%S;%s", visible, runtimepos, pszParent, ptszCustomName); + db_set_ws(NULL, szModule, menuItemName, tszValue); if (pimi->mi.flags & CMIF_CUSTOM) db_set_s(NULL, szModule, CMStringA(FORMAT, "Custom%d", customOrder++), menuItemName); @@ -321,7 +321,7 @@ public: for (int i = 0; i < g_menus.getCount(); i++) { TIntMenuObject *p = g_menus[i]; if (p->id != (int)hStatusMenuObject && p->m_bUseUserDefinedItems) - m_menuObjects.AddString(TranslateTS(p->ptszDisplayName), p->id); + m_menuObjects.AddString(TranslateW(p->ptszDisplayName), p->id); } m_menuObjects.SetCurSel(0); diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp index 838eb24344..b301b8cac0 100644 --- a/src/mir_app/src/menu_utils.cpp +++ b/src/mir_app/src/menu_utils.cpp @@ -78,7 +78,7 @@ LPTSTR GetMenuItemText(TMO_IntMenuItem *pimi) if (pimi->mi.flags & CMIF_KEEPUNTRANSLATED)
return pimi->mi.name.w;
- return TranslateTH(pimi->mi.hLangpack, pimi->mi.name.w);
+ return TranslateW_LP(pimi->mi.name.w, pimi->mi.hLangpack);
}
///////////////////////////////////////////////////////////////////////////////
@@ -241,7 +241,7 @@ MIR_APP_DLL(HGENMENU) Menu_GetProtocolRoot(PROTO_INTERFACE *pThis) CMenuItem mi;
mi.name.w = pThis->m_tszUserName;
mi.position = 500090000;
- mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.hIcolibItem = pThis->m_hProtoIcon;
char szUid[33];
@@ -685,7 +685,7 @@ MIR_APP_DLL(HGENMENU) Menu_CreateRoot(int hMenuObject, LPCTSTR ptszName, int pos return oldroot;
CMenuItem mi;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = hIcoLib;
mi.hLangpack = _hLang;
mi.name.w = (wchar_t*)ptszName;
@@ -875,7 +875,7 @@ static int sttReadOldItem(TMO_IntMenuItem *pmi, void *szModule) // mi.name.w
mir_snprintf(szSetting, "%s_name", menuItemName);
- wchar_t *tszCustomName = db_get_tsa(NULL, (char*)szModule, szSetting);
+ wchar_t *tszCustomName = db_get_wsa(NULL, (char*)szModule, szSetting);
if (tszCustomName != NULL) {
mir_free(pmi->ptszCustomName);
pmi->ptszCustomName = tszCustomName;
@@ -906,8 +906,8 @@ static int sttDumpItem(TMO_IntMenuItem *pmi, void *szModule) else
bin2hex(&pmi->mi.root->mi.uid, sizeof(MUUID), szRootUid);
- CMString szNewValue(FORMAT, L"%d;%d;%S;%s", bVisible, pmi->mi.position, szRootUid, ptszName);
- db_set_ts(NULL, (char*)szModule, menuItemName, szNewValue);
+ CMStringW szNewValue(FORMAT, L"%d;%d;%S;%s", bVisible, pmi->mi.position, szRootUid, ptszName);
+ db_set_ws(NULL, (char*)szModule, menuItemName, szNewValue);
Netlib_Logf(NULL, "MENU[%s] => %s, %d, %d", menuItemName, pmi->pszUniqName, bVisible, pmi->mi.position);
}
@@ -989,7 +989,7 @@ int Menu_LoadFromDatabase(TMO_IntMenuItem *pimi, void *szModule) bin2hex(&pimi->mi.uid, sizeof(pimi->mi.uid), menuItemName);
TIntMenuObject *pmo = pimi->parent;
- ptrW szValue(db_get_tsa(NULL, (char*)szModule, menuItemName));
+ ptrW szValue(db_get_wsa(NULL, (char*)szModule, menuItemName));
if (szValue == NULL)
return 0;
@@ -1221,7 +1221,7 @@ static int MO_RegisterIcon(TMO_IntMenuItem *pmi, void*) HICON hIcon = ImageList_GetIcon(pmi->parent->m_hMenuIcons, pmi->iconId, 0);
wchar_t sectionName[256];
- mir_snwprintf(sectionName, LPGENW("Menu icons") L"/%s", TranslateTS(pmi->parent->ptszDisplayName));
+ mir_snwprintf(sectionName, LPGENW("Menu icons") L"/%s", TranslateW(pmi->parent->ptszDisplayName));
char iconame[256], uname[100];
bin2hex(&pmi->mi.uid, sizeof(pmi->mi.uid), uname);
@@ -1242,7 +1242,7 @@ static int MO_RegisterIcon(TMO_IntMenuItem *pmi, void*) }
SKINICONDESC sid = { 0 };
- sid.flags = SIDF_TCHAR;
+ sid.flags = SIDF_UNICODE;
sid.section.w = sectionName;
sid.pszName = iconame;
sid.description.w = descr;
diff --git a/src/mir_app/src/meta_addto.cpp b/src/mir_app/src/meta_addto.cpp index 41e4d349d9..2a65e52656 100644 --- a/src/mir_app/src/meta_addto.cpp +++ b/src/mir_app/src/meta_addto.cpp @@ -141,7 +141,7 @@ static INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wPa CheckDlgButton(hwndDlg, IDC_ONLYAVAIL, BST_CHECKED); // Initially checked; display all metacontacts is only an option
// Besides, we can check if there is at least one metacontact to add the contact to.
if (BuildList(GetDlgItem(hwndDlg, IDC_METALIST), FALSE) <= 0) {
- if (MessageBox(hwndDlg, TranslateTS(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
+ if (MessageBox(hwndDlg, TranslateW(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
Meta_Convert(lParam, 0);
DestroyWindow(hwndDlg);
return TRUE;
@@ -187,7 +187,7 @@ static INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wPa case IDC_CHK_SRT:
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_METALIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_METALIST), GWL_STYLE) ^ LBS_SORT);
if (BuildList(GetDlgItem(hwndDlg, IDC_METALIST), IsDlgButtonChecked(hwndDlg, IDC_CHK_SRT) ? TRUE : FALSE) <= 0) {
- if (MessageBox(hwndDlg, TranslateTS(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
+ if (MessageBox(hwndDlg, TranslateW(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
Meta_Convert(lParam, 0);
DestroyWindow(hwndDlg);
return TRUE;
diff --git a/src/mir_app/src/meta_edit.cpp b/src/mir_app/src/meta_edit.cpp index ecb690d268..67e593666e 100644 --- a/src/mir_app/src/meta_edit.cpp +++ b/src/mir_app/src/meta_edit.cpp @@ -169,7 +169,7 @@ static void ApplyChanges() ai.format = PA_FORMAT_UNKNOWN;
wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
- db_set_ts(g_data.hMeta, "ContactPhoto", "File", ai.filename);
+ db_set_ws(g_data.hMeta, "ContactPhoto", "File", ai.filename);
}
}
@@ -304,7 +304,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara switch (LOWORD(wParam)) {
case IDC_VALIDATE: // Apply changes, if there is still one contact attached to the metacontact.
if (g_data.num_contacts == 0) { // Otherwise, delete the metacontact.
- if (IDYES == MessageBox(hwndDlg, TranslateTS(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
+ if (IDYES == MessageBox(hwndDlg, TranslateW(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
Meta_Delete(g_data.hMeta, 0);
DestroyWindow(hwndDlg);
}
@@ -319,7 +319,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara case IDOK:
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_VALIDATE))) { // If there are changes that could be made,
if (g_data.num_contacts == 0) { // do the work that would have be done if the 'Apply' button was clicked.
- if (IDYES == MessageBox(hwndDlg, TranslateTS(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
+ if (IDYES == MessageBox(hwndDlg, TranslateW(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
Meta_Delete(g_data.hMeta, 0);
DestroyWindow(hwndDlg);
}
diff --git a/src/mir_app/src/meta_menu.cpp b/src/mir_app/src/meta_menu.cpp index 3929c057e8..cac1b4bdb2 100644 --- a/src/mir_app/src/meta_menu.cpp +++ b/src/mir_app/src/meta_menu.cpp @@ -49,7 +49,7 @@ static HGENMENU INT_PTR Meta_Convert(WPARAM wParam, LPARAM)
{
- ptrW tszGroup(db_get_tsa(wParam, "CList", "Group"));
+ ptrW tszGroup(db_get_wsa(wParam, "CList", "Group"));
// Create a new metacontact
MCONTACT hMetaContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
@@ -68,7 +68,7 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM) Proto_AddToContact(hMetaContact, META_PROTO);
if (tszGroup)
- db_set_ts(hMetaContact, "CList", "Group", tszGroup);
+ db_set_ws(hMetaContact, "CList", "Group", tszGroup);
// Assign the contact to the MetaContact just created (and make default).
if (!Meta_Assign(wParam, hMetaContact, TRUE)) {
@@ -167,7 +167,7 @@ void Meta_RemoveContactNumber(DBCachedContact *ccMeta, int number, bool bUpdateI wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
- db_set_ts(ccMeta->contactID, "ContactPhoto", "File", ai.filename);
+ db_set_ws(ccMeta->contactID, "ContactPhoto", "File", ai.filename);
}
}
}
@@ -207,7 +207,7 @@ INT_PTR Meta_Delete(WPARAM hContact, LPARAM bSkipQuestion) return 2;
if (cc->nSubs == 1) {
- if (IDYES == MessageBox(0, TranslateTS(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1))
+ if (IDYES == MessageBox(0, TranslateW(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1))
Meta_Delete(cc->contactID, 1);
return 0;
@@ -266,7 +266,7 @@ int Meta_ModifyMenu(WPARAM hMeta, LPARAM) Menu_ModifyItem(hMenuDelete, LPGENW("Remove from metacontact"));
// show subcontact menu items
- CMString tszNick;
+ CMStringW tszNick;
for (int i = 0; i < MAX_CONTACTS; i++) {
if (i >= cc->nSubs) {
Menu_ShowItem(hMenuContact[i], false);
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index ae59188348..f42d3de877 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -299,7 +299,7 @@ int Meta_HandleACK(WPARAM, LPARAM lParam) return 0;
if (!db_get(ack->hContact, "ContactPhoto", "File", &dbv)) {
- db_set_ts(cc->contactID, "ContactPhoto", "File", dbv.ptszVal);
+ db_set_ws(cc->contactID, "ContactPhoto", "File", dbv.ptszVal);
db_free(&dbv);
}
@@ -380,7 +380,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) mir_snprintf(buffer, "Nick%d", contact_number);
db_set(ccMeta->contactID, META_PROTO, buffer, &dcws->value);
- ptrW tszMyhandle(db_get_tsa(hContact, "CList", "MyHandle"));
+ ptrW tszMyhandle(db_get_wsa(hContact, "CList", "MyHandle"));
if (tszMyhandle == NULL) {
mir_snprintf(buffer, "CListName%d", contact_number);
db_set(ccMeta->contactID, META_PROTO, buffer, &dcws->value);
@@ -408,8 +408,8 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) mir_snprintf(buffer, "CListName%d", contact_number);
DBVARIANT dbv;
- if (proto && !db_get_ts(hContact, proto, "Nick", &dbv)) {
- db_set_ts(ccMeta->contactID, META_PROTO, buffer, dbv.ptszVal);
+ if (proto && !db_get_ws(hContact, proto, "Nick", &dbv)) {
+ db_set_ws(ccMeta->contactID, META_PROTO, buffer, dbv.ptszVal);
db_free(&dbv);
}
else db_unset(ccMeta->contactID, META_PROTO, buffer);
@@ -430,7 +430,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) db_set_w(ccMeta->contactID, META_PROTO, buffer, dcws->value.wVal);
mir_snprintf(buffer, "StatusString%d", contact_number);
- db_set_ts(ccMeta->contactID, META_PROTO, buffer, cli.pfnGetStatusModeDescription(dcws->value.wVal, 0));
+ db_set_ws(ccMeta->contactID, META_PROTO, buffer, cli.pfnGetStatusModeDescription(dcws->value.wVal, 0));
// set status to that of most online contact
MCONTACT hMostOnline = Meta_GetMostOnline(ccMeta);
@@ -448,7 +448,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) ai.format = PA_FORMAT_UNKNOWN;
wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
- db_set_ts(ccMeta->contactID, "ContactPhoto", "File", ai.filename);
+ db_set_ws(ccMeta->contactID, "ContactPhoto", "File", ai.filename);
}
}
@@ -607,7 +607,7 @@ static int Meta_SrmmIconClicked(WPARAM hMeta, LPARAM lParam) if (pa == NULL)
continue;
- CMString tszNick;
+ CMStringW tszNick;
if (options.menu_contact_label == DNT_DID)
tszNick = cli.pfnGetContactDisplayName(cc->pSubs[i], 0);
else
@@ -653,7 +653,7 @@ int Meta_ModulesLoaded(WPARAM, LPARAM) // create srmm icon
StatusIconData sid = { sizeof(sid) };
sid.szModule = META_PROTO;
- sid.flags = MBF_TCHAR;
+ sid.flags = MBF_UNICODE;
sid.tszTooltip = LPGENW("Select metacontact");
sid.hIcon = Skin_LoadProtoIcon(META_PROTO, ID_STATUS_ONLINE);
Srmm_AddIcon(&sid);
@@ -692,7 +692,7 @@ INT_PTR Meta_ContactMenuFunc(WPARAM hMeta, LPARAM lParam) // set default contact for sending/status and open message window
Meta_SetSrmmSub(hMeta, hContact);
db_mc_setDefaultNum(hMeta, lParam, false);
- CallService(MS_MSG_SENDMESSAGET, hMeta, 0);
+ CallService(MS_MSG_SENDMESSAGEW, hMeta, 0);
}
else // protocol does not support messaging - simulate double click
CallService(MS_CLIST_CONTACTDOUBLECLICKED, hContact, 0);
@@ -798,7 +798,7 @@ INT_PTR Meta_GetInfo(WPARAM, LPARAM lParam) ai.format = PA_FORMAT_UNKNOWN;
wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
- db_set_ts(ccs->hContact, "ContactPhoto", "File", ai.filename);
+ db_set_ws(ccs->hContact, "ContactPhoto", "File", ai.filename);
hMostOnline = Meta_GetMostOnline(cc);
Meta_CopyContactNick(cc, hMostOnline);
diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp index 8ef0a9876f..d15be199ec 100644 --- a/src/mir_app/src/meta_utils.cpp +++ b/src/mir_app/src/meta_utils.cpp @@ -44,7 +44,7 @@ int Meta_SetNick(char *szProto) if (tszNick == NULL)
return 1;
- db_set_ts(NULL, META_PROTO, "Nick", tszNick);
+ db_set_ws(NULL, META_PROTO, "Nick", tszNick);
return 0;
}
@@ -124,7 +124,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) // write the display name
mir_snprintf(buffer, "CListName%d", ccDest->nSubs);
- db_set_ts(hMeta, META_PROTO, buffer, cli.pfnGetContactDisplayName(hSub, 0));
+ db_set_ws(hMeta, META_PROTO, buffer, cli.pfnGetContactDisplayName(hSub, 0));
// Get the status
WORD status = db_get_w(hSub, szProto, "Status", ID_STATUS_OFFLINE);
@@ -141,7 +141,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) mir_snprintf(buffer, "StatusString%d", ccDest->nSubs);
wchar_t *szStatus = cli.pfnGetStatusModeDescription(status, 0);
- db_set_ts(hMeta, META_PROTO, buffer, szStatus);
+ db_set_ws(hMeta, META_PROTO, buffer, szStatus);
// Write the link in the contact
db_set_dw(hSub, META_PROTO, "ParentMeta", hMeta);
@@ -173,7 +173,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
- db_set_ts(hMeta, "ContactPhoto", "File", ai.filename);
+ db_set_ws(hMeta, "ContactPhoto", "File", ai.filename);
}
// merge sub's events to the meta-history
@@ -431,16 +431,16 @@ int Meta_CopyContactNick(DBCachedContact *ccMeta, MCONTACT hContact) return 1;
if (options.clist_contact_name == CNNT_NICK) {
- ptrW tszNick(db_get_tsa(hContact, szProto, "Nick"));
+ ptrW tszNick(db_get_wsa(hContact, szProto, "Nick"));
if (tszNick) {
- db_set_ts(ccMeta->contactID, META_PROTO, "Nick", tszNick);
+ db_set_ws(ccMeta->contactID, META_PROTO, "Nick", tszNick);
return 0;
}
}
else if (options.clist_contact_name == CNNT_DISPLAYNAME) {
wchar_t *name = cli.pfnGetContactDisplayName(hContact, 0);
if (name && mir_wstrcmp(name, TranslateT("(Unknown contact)")) != 0) {
- db_set_ts(ccMeta->contactID, META_PROTO, "Nick", name);
+ db_set_ws(ccMeta->contactID, META_PROTO, "Nick", name);
return 0;
}
}
@@ -499,7 +499,7 @@ int Meta_SwapContacts(DBCachedContact *cc, int n1, int n2) /////////////////////////////////////////////////////////////////////////////////////////
-void Meta_GetSubNick(MCONTACT hMeta, int i, CMString &tszDest)
+void Meta_GetSubNick(MCONTACT hMeta, int i, CMStringW &tszDest)
{
char idStr[50];
mir_snprintf(idStr, "Login%d", i);
diff --git a/src/mir_app/src/metacontacts.h b/src/mir_app/src/metacontacts.h index c47b419729..8aadcca5cb 100644 --- a/src/mir_app/src/metacontacts.h +++ b/src/mir_app/src/metacontacts.h @@ -55,7 +55,7 @@ int Meta_SuppressStatus(int suppress); int Meta_CopyContactNick(DBCachedContact *cc, MCONTACT hContact);
int Meta_SetAllNicks();
int Meta_SwapContacts(DBCachedContact *cc, int contact_number1, int contact_number2);
-void Meta_GetSubNick(MCONTACT hMeta, int i, CMString &tszDest);
+void Meta_GetSubNick(MCONTACT hMeta, int i, CMStringW &tszDest);
MCONTACT Meta_GetMostOnline(DBCachedContact *cc);
MCONTACT Meta_GetMostOnlineSupporting(DBCachedContact *cc, int pflagnum, unsigned long capability);
diff --git a/src/mir_app/src/movetogroup.cpp b/src/mir_app/src/movetogroup.cpp index 541404e28b..6f229c38d7 100644 --- a/src/mir_app/src/movetogroup.cpp +++ b/src/mir_app/src/movetogroup.cpp @@ -70,7 +70,7 @@ static void AddGroupItem(HGENMENU hRoot, wchar_t* name, int pos, WPARAM param, b mi.root = hRoot;
mi.position = pos;
mi.name.w = PrepareGroupName(name);
- mi.flags = CMIF_SYSTEM | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_SYSTEM | CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
if (checked)
mi.flags |= CMIF_CHECKED;
mi.pszService = MTG_MOVE;
@@ -92,7 +92,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) Menu_RemoveItem((HGENMENU)lphGroupsItems[i]);
lphGroupsItems.destroy();
- ptrW szContactGroup(db_get_tsa(wParam, "CList", "Group"));
+ ptrW szContactGroup(db_get_wsa(wParam, "CList", "Group"));
int pos = 1000;
@@ -105,7 +105,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) _itoa(i, intname, 10);
DBVARIANT dbv;
- if (db_get_ts(NULL, "CListGroups", intname, &dbv))
+ if (db_get_ws(NULL, "CListGroups", intname, &dbv))
break;
if (dbv.ptszVal[0])
diff --git a/src/mir_app/src/netliblog.cpp b/src/mir_app/src/netliblog.cpp index 7c78bf6561..300caa9684 100644 --- a/src/mir_app/src/netliblog.cpp +++ b/src/mir_app/src/netliblog.cpp @@ -42,7 +42,7 @@ struct { int showUser;
int dumpSent, dumpRecv, dumpProxy, dumpSsl;
int textDumps, autoDetectText;
- CMString tszFile, tszUserFile;
+ CMStringW tszFile, tszUserFile;
}
static logOptions = { 0 };
@@ -64,16 +64,16 @@ static void InitLog() hLogger = NULL;
}
- ptrW szBuf(db_get_tsa(NULL, "Netlib", "File"));
+ ptrW szBuf(db_get_wsa(NULL, "Netlib", "File"));
if (mir_wstrlen(szBuf)) {
logOptions.tszUserFile = szBuf.get();
wchar_t path[MAX_PATH];
- PathToAbsoluteT(VARST(szBuf), path);
+ PathToAbsoluteW(VARSW(szBuf), path);
logOptions.tszFile = path;
}
else {
- db_set_ts(NULL, "Netlib", "File", logOptions.tszUserFile = L"%miranda_logpath%\\netlog.txt");
+ db_set_ws(NULL, "Netlib", "File", logOptions.tszUserFile = L"%miranda_logpath%\\netlog.txt");
logOptions.tszFile = Utils_ReplaceVarsT(logOptions.tszUserFile);
}
@@ -105,7 +105,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa CheckDlgButton(hwndDlg, IDC_AUTODETECTTEXT, logOptions.autoDetectText ? BST_CHECKED : BST_UNCHECKED);
{
for (int i=0; i < _countof(szTimeFormats); i++)
- SendDlgItemMessage(hwndDlg, IDC_TIMEFORMAT, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szTimeFormats[i]));
+ SendDlgItemMessage(hwndDlg, IDC_TIMEFORMAT, CB_ADDSTRING, 0, (LPARAM)TranslateW(szTimeFormats[i]));
}
SendDlgItemMessage(hwndDlg, IDC_TIMEFORMAT, CB_SETCURSEL, logOptions.timeFormat, 0);
CheckDlgButton(hwndDlg, IDC_SHOWNAMES, logOptions.showUser ? BST_CHECKED : BST_UNCHECKED);
@@ -150,7 +150,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa wchar_t path[MAX_PATH];
GetWindowText((HWND)lParam, path, _countof(path));
- PathToAbsoluteT(VARST(path), path);
+ PathToAbsoluteW(VARSW(path), path);
SetDlgItemText(hwndDlg, IDC_PATH, path);
}
break;
@@ -202,12 +202,12 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa case IDOK:
GetDlgItemText(hwndDlg, IDC_RUNATSTART, str, _countof(str));
- db_set_ts(NULL, "Netlib", "RunAtStart", str);
+ db_set_ws(NULL, "Netlib", "RunAtStart", str);
db_set_b(NULL, "Netlib", "ShowLogOptsAtStart", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWTHISDLGATSTART));
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
logOptions.tszUserFile = rtrimw(str);
- db_set_ts(NULL, "Netlib", "File", str);
+ db_set_ws(NULL, "Netlib", "File", str);
GetDlgItemText(hwndDlg, IDC_PATH, str, _countof(str));
logOptions.tszFile = rtrimw(str);
@@ -515,7 +515,7 @@ void NetlibLogInit(void) if (db_get_b(NULL, "Netlib", "ShowLogOptsAtStart", 0))
NetlibLogShowOptions();
- ptrW szBuf(db_get_tsa(NULL, "Netlib", "RunAtStart"));
+ ptrW szBuf(db_get_wsa(NULL, "Netlib", "RunAtStart"));
if (szBuf) {
STARTUPINFO si = { sizeof(si) };
PROCESS_INFORMATION pi;
diff --git a/src/mir_app/src/netlibopts.cpp b/src/mir_app/src/netlibopts.cpp index 3a3c3512a5..aaa22b5887 100644 --- a/src/mir_app/src/netlibopts.cpp +++ b/src/mir_app/src/netlibopts.cpp @@ -87,7 +87,7 @@ static void EnableMultipleControls(HWND hwndDlg, const UINT *controls, int cCont static void AddProxyTypeItem(HWND hwndDlg, int type, int selectType)
{
- int i = SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_ADDSTRING, 0, (LPARAM)(type == 0 ? TranslateTS(szProxyTypes[type]) : szProxyTypes[type]));
+ int i = SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_ADDSTRING, 0, (LPARAM)(type == 0 ? TranslateW(szProxyTypes[type]) : szProxyTypes[type]));
SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_SETITEMDATA, i, type);
if (type == selectType)
SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_SETCURSEL, i, 0);
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index 51edc215b1..1f22c5e15e 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -569,7 +569,7 @@ bool LoadCorePlugin(MuuidReplacement &mr) pluginEntry* pPlug = OpenPlugin(tszPlugName, L"Core", exe);
if (pPlug->pclass & PCLASS_FAILED) {
LBL_Error:
- MessageBox(NULL, CMString(FORMAT, TranslateTS(tszCoreErr), mr.stdplugname), TranslateT("Fatal error"), MB_OK | MB_ICONSTOP);
+ MessageBox(NULL, CMStringW(FORMAT, TranslateW(tszCoreErr), mr.stdplugname), TranslateT("Fatal error"), MB_OK | MB_ICONSTOP);
Plugin_UnloadDyn(pPlug);
mr.pImpl = NULL;
@@ -862,7 +862,7 @@ int LoadNewPluginsModuleInfos(void) mirandaVersion = (DWORD)CallService(MS_SYSTEM_GETVERSION, 0, 0);
// remember where the mirandaboot.ini goes
- PathToAbsoluteT(L"mirandaboot.ini", mirandabootini);
+ PathToAbsoluteW(L"mirandaboot.ini", mirandabootini);
// look for all *.dll's
enumPlugins(scanPluginsDir, 0, 0);
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index 556fb50687..f572d9865a 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -130,7 +130,7 @@ struct OptionsPageData : public MZeroedObject {
if (flags & ODPF_DONTTRANSLATE)
return ptszStr;
- return TranslateTH(hLangpack, ptszStr);
+ return TranslateW_LP(ptszStr, hLangpack);
}
};
@@ -564,7 +564,7 @@ static void RebuildPageTree(HWND hdlg, OptionsDlgData *dat) HWND oldWnd = NULL;
HWND oldTab = NULL;
- CMString fullTitle;
+ CMStringW fullTitle;
OptionsPageData *opd = dat->getCurrent();
if (opd != NULL) {
@@ -588,9 +588,9 @@ static void RebuildPageTree(HWND hdlg, OptionsDlgData *dat) continue;
opd = dat->arOpd[i];
- wchar_t *ptszGroup = TranslateTH(opd->hLangpack, opd->ptszGroup);
+ wchar_t *ptszGroup = TranslateW_LP(opd->ptszGroup, opd->hLangpack);
wchar_t *ptszTitle = opd->getString(opd->ptszTitle), *useTitle;
- wchar_t *ptszTab = TranslateTH(opd->hLangpack, opd->ptszTab);
+ wchar_t *ptszTab = TranslateW_LP(opd->ptszTab, opd->hLangpack);
tvis.hParent = NULL;
useTitle = ptszTitle;
@@ -798,10 +798,10 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L ptrW lastPage, lastGroup, lastTab;
OPENOPTIONSDIALOG *ood = (OPENOPTIONSDIALOG*)psh->pStartPage;
if (ood->pszPage == NULL) {
- lastPage = db_get_tsa(NULL, "Options", "LastPage");
+ lastPage = db_get_wsa(NULL, "Options", "LastPage");
if (ood->pszGroup == NULL)
- lastGroup = db_get_tsa(NULL, "Options", "LastGroup");
+ lastGroup = db_get_wsa(NULL, "Options", "LastGroup");
else
lastGroup = mir_a2u(ood->pszGroup);
}
@@ -811,7 +811,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L }
if (ood->pszTab == NULL)
- lastTab = db_get_tsa(NULL, "Options", "LastTab");
+ lastTab = db_get_wsa(NULL, "Options", "LastTab");
else
lastTab = mir_a2u(ood->pszTab);
@@ -979,7 +979,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L if (mir_wstrcmp(opd->ptszTitle, p->ptszTitle) || mir_wstrcmp(opd->ptszGroup, p->ptszGroup))
continue;
- tie.pszText = TranslateTH(p->hLangpack, p->ptszTab);
+ tie.pszText = TranslateW_LP(p->ptszTab, p->hLangpack);
tie.lParam = i;
TabCtrl_InsertItem(hwndTab, pages, &tie);
if (!mir_wstrcmp(opd->ptszTab, p->ptszTab))
@@ -1107,14 +1107,14 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L opd = dat->getCurrent();
if (opd) {
if (opd->ptszTab)
- db_set_ts(NULL, "Options", "LastTab", opd->ptszTab);
+ db_set_ws(NULL, "Options", "LastTab", opd->ptszTab);
else
db_unset(NULL, "Options", "LastTab");
if (opd->ptszGroup)
- db_set_ts(NULL, "Options", "LastGroup", opd->ptszGroup);
+ db_set_ws(NULL, "Options", "LastGroup", opd->ptszGroup);
else
db_unset(NULL, "Options", "LastGroup");
- db_set_ts(NULL, "Options", "LastPage", opd->ptszTitle);
+ db_set_ws(NULL, "Options", "LastPage", opd->ptszTitle);
}
else {
db_unset(NULL, "Options", "LastTab");
@@ -1176,11 +1176,11 @@ static void OpenOptionsNow(int _hLang, const char *pszGroup, const char *pszPage HTREEITEM hItem = NULL;
if (pszGroup != NULL) {
ptrW ptszGroup(mir_a2u(pszGroup));
- hItem = FindNamedTreeItemAtRoot(GetDlgItem(hwndOptions, IDC_PAGETREE), TranslateTH(_hLang, ptszGroup));
+ hItem = FindNamedTreeItemAtRoot(GetDlgItem(hwndOptions, IDC_PAGETREE), TranslateW_LP(ptszGroup, _hLang));
if (hItem != NULL)
- hItem = FindNamedTreeItemAtChildren(GetDlgItem(hwndOptions, IDC_PAGETREE), hItem, TranslateTH(_hLang, ptszPage));
+ hItem = FindNamedTreeItemAtChildren(GetDlgItem(hwndOptions, IDC_PAGETREE), hItem, TranslateW_LP(ptszPage, _hLang));
}
- else hItem = FindNamedTreeItemAtRoot(GetDlgItem(hwndOptions, IDC_PAGETREE), TranslateTH(_hLang, ptszPage));
+ else hItem = FindNamedTreeItemAtRoot(GetDlgItem(hwndOptions, IDC_PAGETREE), TranslateW_LP(ptszPage, _hLang));
if (hItem != NULL)
TreeView_SelectItem(GetDlgItem(hwndOptions, IDC_PAGETREE), hItem);
diff --git a/src/mir_app/src/options_ei.cpp b/src/mir_app/src/options_ei.cpp index fb6f3778dd..060fa85b93 100644 --- a/src/mir_app/src/options_ei.cpp +++ b/src/mir_app/src/options_ei.cpp @@ -111,7 +111,7 @@ class CExtraIconOptsDlg : public CDlgBase HTREEITEM Tree_AddExtraIconGroup(intlist &group, bool selected, HTREEITEM hAfter = TVI_LAST)
{
intlist *ids = new intlist();
- CMString desc;
+ CMStringW desc;
int img = 0;
for (int i = 0; i < group.count; i++) {
BaseExtraIcon *extra = registeredExtraIcons[group.data[i] - 1];
@@ -254,7 +254,7 @@ public: int numSlots = GetNumberOfSlots();
if (numSlots < (int)registeredExtraIcons.getCount()) {
HWND label = GetDlgItem(m_hwnd, IDC_MAX_ICONS_L);
- SetWindowText(label, CMString(FORMAT, TranslateT("*only the first %d icons will be shown"), numSlots));
+ SetWindowText(label, CMStringW(FORMAT, TranslateT("*only the first %d icons will be shown"), numSlots));
ShowWindow(label, SW_SHOW);
}
diff --git a/src/mir_app/src/path.cpp b/src/mir_app/src/path.cpp index cc1986da61..60687a30e4 100644 --- a/src/mir_app/src/path.cpp +++ b/src/mir_app/src/path.cpp @@ -36,7 +36,7 @@ wchar_t* GetContactID(MCONTACT hContact) {
char *szProto = GetContactProto(hContact);
if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1)
- return db_get_tsa(hContact, szProto, "ChatRoomID");
+ return db_get_wsa(hContact, szProto, "ChatRoomID");
return Contact_GetInfo(CNF_UNIQUEID, hContact, szProto);
}
diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp index cc4e3132b5..42c20aabe3 100644 --- a/src/mir_app/src/pluginopts.cpp +++ b/src/mir_app/src/pluginopts.cpp @@ -32,7 +32,7 @@ extern MUUID miid_clist, miid_database, miid_protocol; HANDLE hevLoadModule, hevUnloadModule;
static bool bOldMode = false;
-static CMString szFilter;
+static CMStringW szFilter;
static UINT_PTR timerID;
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_app/src/profilemanager.cpp b/src/mir_app/src/profilemanager.cpp index bac436b91a..0c24f1738c 100644 --- a/src/mir_app/src/profilemanager.cpp +++ b/src/mir_app/src/profilemanager.cpp @@ -115,7 +115,7 @@ class CCreateProfileDlg : public CDlgBase // now the file should be gone! } // ask the database to create the profile - CreatePathToFileT(profile); + CreatePathToFileW(profile); if ((err = link->makeDatabase(profile)) != ERROR_SUCCESS) { mir_snwprintf(buf, TranslateT("Unable to create the profile '%s', the error was %x"), file, err); MessageBox(m_hwnd, buf, TranslateT("Problem creating profile"), MB_ICONERROR | MB_OK); @@ -154,7 +154,7 @@ public: else { for (int i = 0; i < arDbPlugins.getCount(); i++) { DATABASELINK *p = arDbPlugins[i]; - m_driverList.AddString(TranslateTS(p->szFullName), (LPARAM)p); + m_driverList.AddString(TranslateW(p->szFullName), (LPARAM)p); } } @@ -302,7 +302,7 @@ class CChooseProfileDlg : public CDlgBase if (bFileLocked) // file locked list.SetItemText(iItem, 1, TranslateT("<In use>")); else - list.SetItemText(iItem, 1, TranslateTS(dblink->szFullName)); + list.SetItemText(iItem, 1, TranslateW(dblink->szFullName)); } else list.SetItemText(iItem, 1, TranslateT("<Unknown format>")); @@ -615,7 +615,7 @@ public: for (int i = 0; i < servicePlugins.getCount(); i++) { pluginEntry *p = servicePlugins[i]; - m_servicePlugs.AddString(TranslateTS(p->pluginname), i); + m_servicePlugs.AddString(TranslateW(p->pluginname), i); } } } diff --git a/src/mir_app/src/proto_accs.cpp b/src/mir_app/src/proto_accs.cpp index c6fdab3704..8999e88f06 100644 --- a/src/mir_app/src/proto_accs.cpp +++ b/src/mir_app/src/proto_accs.cpp @@ -90,7 +90,7 @@ void LoadDbAccounts(void) if (ver >= 4) {
_itoa(OFFSET_NAME + i, buf, 10);
- pa->tszAccountName = db_get_tsa(NULL, "Protocols", buf);
+ pa->tszAccountName = db_get_wsa(NULL, "Protocols", buf);
_itoa(OFFSET_ENABLED + i, buf, 10);
pa->bIsEnabled = db_get_dw(NULL, "Protocols", buf, 1) != 0;
@@ -179,7 +179,7 @@ void WriteDbAccounts() db_set_dw(NULL, "Protocols", buf, pa->bIsEnabled);
_itoa(OFFSET_NAME + i, buf, 10);
- db_set_ts(NULL, "Protocols", buf, pa->tszAccountName);
+ db_set_ws(NULL, "Protocols", buf, pa->tszAccountName);
}
db_unset(0, "Protocols", "ProtoCount");
diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp index 4f1f1cde42..acbcf1c409 100644 --- a/src/mir_app/src/protocols.cpp +++ b/src/mir_app/src/protocols.cpp @@ -244,7 +244,7 @@ static INT_PTR Proto_ContactIsTyping(WPARAM wParam, LPARAM lParam) void Proto_SetStatus(const char *szProto, unsigned status)
{
if (CallProtoServiceInt(NULL, szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) {
- ptrW tszAwayMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, status, (LPARAM)szProto));
+ ptrW tszAwayMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGW, status, (LPARAM)szProto));
CallProtoServiceInt(NULL, szProto, PS_SETAWAYMSG, status, tszAwayMsg);
}
CallProtoServiceInt(NULL, szProto, PS_SETSTATUS, status, 0);
diff --git a/src/mir_app/src/searchresults.cpp b/src/mir_app/src/searchresults.cpp index 571712de7b..8f05b95e4d 100644 --- a/src/mir_app/src/searchresults.cpp +++ b/src/mir_app/src/searchresults.cpp @@ -71,7 +71,7 @@ void LoadColumnSizes(HWND hwndResults, const char *szProto) bool bNeedsFree = false;
lvc.mask = LVCF_TEXT | LVCF_WIDTH;
if (szColumnNames[i] != NULL)
- lvc.pszText = TranslateTS(szColumnNames[i]);
+ lvc.pszText = TranslateW(szColumnNames[i]);
else {
if (i == COLUMNID_HANDLE) {
lvc.pszText = L"ID";
@@ -243,7 +243,7 @@ int BeginSearch(HWND, struct FindAddDlgData *dat, const char *szProto, const cha void SetStatusBarSearchInfo(HWND hwndStatus, struct FindAddDlgData *dat)
{
- CMString str;
+ CMStringW str;
if (dat->searchCount != 0) {
str = TranslateT("Searching");
@@ -270,7 +270,7 @@ struct ProtoResultsSummary void SetStatusBarResultInfo(HWND hwndDlg)
{
HWND hwndResults = GetDlgItem(hwndDlg, IDC_RESULTS);
- CMString str;
+ CMStringW str;
int total = ListView_GetItemCount(hwndResults);
if (total != 0) {
diff --git a/src/mir_app/src/services.cpp b/src/mir_app/src/services.cpp index fc081a19ce..65b27c4862 100644 --- a/src/mir_app/src/services.cpp +++ b/src/mir_app/src/services.cpp @@ -142,7 +142,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORR strncpy_s(idstr, prefix, _TRUNCATE);
int retval = 0;
- ptrW tszGroup(db_get_tsa(NULL, settings_group, idstr));
+ ptrW tszGroup(db_get_wsa(NULL, settings_group, idstr));
if (tszGroup != NULL)
wcsncpy_s(lf->lfFaceName, tszGroup, _TRUNCATE);
else
@@ -196,7 +196,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORR return retval;
}
-int CreateFromFontSettings(FontSettingsT *fs, LOGFONT *lf)
+int CreateFromFontSettings(FontSettingsW *fs, LOGFONT *lf)
{
GetDefaultFontSetting(lf, 0);
@@ -217,7 +217,7 @@ int CreateFromFontSettings(FontSettingsT *fs, LOGFONT *lf) return 0;
}
-void UpdateFontSettings(FontIDW *font_id, FontSettingsT *fontsettings)
+void UpdateFontSettings(FontIDW *font_id, FontSettingsW *fontsettings)
{
LOGFONT lf;
COLORREF colour;
diff --git a/src/mir_app/src/skin.h b/src/mir_app/src/skin.h index 121169f8c3..2b78632534 100644 --- a/src/mir_app/src/skin.h +++ b/src/mir_app/src/skin.h @@ -38,7 +38,7 @@ struct THotkeyItem {
THotkeyType type;
char *pszService, *pszName; // pszName is valid _only_ for "root" hotkeys
- wchar_t *ptszSection, *ptszDescription;
+ wchar_t *pwszSection, *pwszDescription;
LPARAM lParam;
WORD DefHotkey, Hotkey;
bool Enabled;
@@ -56,8 +56,8 @@ struct THotkeyItem bool UnregisterHotkey; // valid only during WM_APP message in options UI, used to remove unregistered hotkeys from options
- __inline wchar_t* getSection() const { return TranslateTH(hLangpack, ptszSection); }
- __inline wchar_t* getDescr() const { return TranslateTH(hLangpack, ptszDescription); }
+ __inline wchar_t* getSection() const { return TranslateW_LP(pwszSection, hLangpack); }
+ __inline wchar_t* getDescr() const { return TranslateW_LP(pwszDescription, hLangpack); }
};
extern LIST<THotkeyItem> hotkeys;
diff --git a/src/mir_app/src/skin2opts.cpp b/src/mir_app/src/skin2opts.cpp index bfaf0c505e..7c240f1a6d 100644 --- a/src/mir_app/src/skin2opts.cpp +++ b/src/mir_app/src/skin2opts.cpp @@ -57,7 +57,7 @@ static HICON ExtractIconFromPath(const wchar_t *path, int cxIcon, int cyIcon) n = _wtoi(comma + 1);
*comma = 0;
}
- PathToAbsoluteT(file, fileFull);
+ PathToAbsoluteW(file, fileFull);
hIcon = NULL;
//SHOULD BE REPLACED WITH GOOD ENOUGH FUNCTION
@@ -681,7 +681,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM *sectionName = 0;
}
- pItemName = TranslateTS(pItemName);
+ pItemName = TranslateW(pItemName);
hItem = FindNamedTreeItemAt(hwndTree, hSection, pItemName);
if (!sectionName || !hItem) {
if (!hItem) {
@@ -908,7 +908,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
}
else if (item->temp_file) {
- db_set_ts(NULL, "SkinIcons", item->name, item->temp_file);
+ db_set_ws(NULL, "SkinIcons", item->name, item->temp_file);
item->source_small->release();
item->source_small = NULL;
SafeDestroyIcon(item->temp_icon);
diff --git a/src/mir_app/src/skinicons.cpp b/src/mir_app/src/skinicons.cpp index d653fb7aaf..f9c5a83088 100644 --- a/src/mir_app/src/skinicons.cpp +++ b/src/mir_app/src/skinicons.cpp @@ -282,7 +282,7 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) SKINICONDESC sid = { 0 };
sid.section.w = tszSection;
- sid.flags = SIDF_ALL_TCHAR;
+ sid.flags = SIDF_ALL_UNICODE;
str = wcsrchr(szPath, '\\');
if (str != NULL)
@@ -385,7 +385,7 @@ int LoadSkinIcons(void) char iconName[MAX_PATH];
SKINICONDESC sid = { 0 };
sid.defaultFile.w = modulePath;
- sid.flags = SIDF_PATH_TCHAR;
+ sid.flags = SIDF_PATH_UNICODE;
sid.pszName = iconName;
// Add main icons to list
diff --git a/src/mir_app/src/sounds.cpp b/src/mir_app/src/sounds.cpp index 847b456494..ebc1ea7cc6 100644 --- a/src/mir_app/src/sounds.cpp +++ b/src/mir_app/src/sounds.cpp @@ -29,19 +29,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct SoundItem
{
char* name;
- wchar_t* ptszSection;
- wchar_t* ptszDescription;
+ wchar_t* pwszSection;
+ wchar_t* pwszDescription;
wchar_t* ptszTempFile;
int hLangpack;
- __inline wchar_t* getSection() const { return TranslateTH(hLangpack, ptszSection); }
- __inline wchar_t* getDescr() const { return TranslateTH(hLangpack, ptszDescription); }
+ __inline wchar_t* getSection() const { return TranslateW_LP(pwszSection, hLangpack); }
+ __inline wchar_t* getDescr() const { return TranslateW_LP(pwszDescription, hLangpack); }
__inline void clear(void)
{
mir_free(name);
- mir_free(ptszSection);
- mir_free(ptszDescription);
+ mir_free(pwszSection);
+ mir_free(pwszDescription);
mir_free(ptszTempFile);
}
};
@@ -77,31 +77,31 @@ static INT_PTR ServiceSkinAddNewSound(WPARAM wParam, LPARAM lParam) if (ssd->cbSize != sizeof(SKINSOUNDDESCEX) || ssd->pszName == NULL || ssd->pszDescription == NULL)
return 1;
- SoundItem* item = new SoundItem; // due to OBJLIST
+ SoundItem *item = new SoundItem; // due to OBJLIST
item->name = mir_strdup(ssd->pszName);
item->ptszTempFile = NULL;
item->hLangpack = (int)wParam;
arSounds.insert(item);
- wchar_t* ptszDefaultFile;
+ wchar_t *pwszDefaultFile;
if (ssd->dwFlags & SSDF_UNICODE) {
- item->ptszDescription = mir_wstrdup(ssd->ptszDescription);
- item->ptszSection = mir_wstrdup((ssd->pszSection != NULL) ? ssd->ptszSection : L"Other");
- ptszDefaultFile = mir_wstrdup(ssd->ptszDefaultFile);
+ item->pwszDescription = mir_wstrdup(ssd->pwszDescription);
+ item->pwszSection = mir_wstrdup((ssd->pszSection != NULL) ? ssd->pwszSection : L"Other");
+ pwszDefaultFile = mir_wstrdup(ssd->pwszDefaultFile);
}
else {
- item->ptszDescription = mir_a2u(ssd->pszDescription);
- item->ptszSection = mir_a2u((ssd->pszSection != NULL) ? ssd->pszSection : "Other");
- ptszDefaultFile = mir_a2u(ssd->pszDefaultFile);
+ item->pwszDescription = mir_a2u(ssd->pszDescription);
+ item->pwszSection = mir_a2u((ssd->pszSection != NULL) ? ssd->pszSection : "Other");
+ pwszDefaultFile = mir_a2u(ssd->pszDefaultFile);
}
- if (ptszDefaultFile) {
+ if (pwszDefaultFile) {
DBVARIANT dbv;
if (db_get_s(NULL, "SkinSounds", item->name, &dbv))
- db_set_ts(NULL, "SkinSounds", item->name, ptszDefaultFile);
+ db_set_ws(NULL, "SkinSounds", item->name, pwszDefaultFile);
else
db_free(&dbv);
- mir_free(ptszDefaultFile);
+ mir_free(pwszDefaultFile);
}
return 0;
@@ -109,7 +109,7 @@ static INT_PTR ServiceSkinAddNewSound(WPARAM wParam, LPARAM lParam) static int SkinPlaySoundDefault(WPARAM wParam, LPARAM lParam)
{
- wchar_t* pszFile = (wchar_t*) lParam;
+ wchar_t *pszFile = (wchar_t*) lParam;
if (pszFile && (db_get_b(NULL, "Skin", "UseSound", 0) || (int)wParam == 1))
PlaySound(pszFile, NULL, SND_ASYNC | SND_FILENAME | SND_NOSTOP);
@@ -123,7 +123,7 @@ static INT_PTR ServiceSkinPlaySoundFile(WPARAM, LPARAM lParam) return 1;
wchar_t tszFull[MAX_PATH];
- PathToAbsoluteT(ptszFileName, tszFull);
+ PathToAbsoluteW(ptszFileName, tszFull);
NotifyEventHooks(hPlayEvent, 0, (LPARAM)tszFull);
return 0;
}
@@ -143,7 +143,7 @@ static INT_PTR ServiceSkinPlaySound(WPARAM, LPARAM lParam) return 1;
DBVARIANT dbv;
- if ( db_get_ts(NULL, "SkinSounds", pszSoundName, &dbv) == 0) {
+ if ( db_get_ws(NULL, "SkinSounds", pszSoundName, &dbv) == 0) {
ServiceSkinPlaySoundFile(0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
return 0;
@@ -265,9 +265,9 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM NotifyEventHooks(hPlayEvent, 1, (LPARAM)arSounds[tvi.lParam].ptszTempFile);
else {
DBVARIANT dbv;
- if (!db_get_ts(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
+ if (!db_get_ws(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
wchar_t szPathFull[MAX_PATH];
- PathToAbsoluteT(dbv.ptszVal, szPathFull);
+ PathToAbsoluteW(dbv.ptszVal, szPathFull);
NotifyEventHooks(hPlayEvent, 1, (LPARAM)szPathFull);
db_free(&dbv);
}
@@ -296,13 +296,13 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM else {
if (db_get_b(NULL, "SkinSoundsOff", snd.name, 0) == 0) {
DBVARIANT dbv;
- if (db_get_ts(NULL, "SkinSounds", snd.name, &dbv) == 0) {
- PathToAbsoluteT(dbv.ptszVal, strdir);
+ if (db_get_ws(NULL, "SkinSounds", snd.name, &dbv) == 0) {
+ PathToAbsoluteW(dbv.ptszVal, strdir);
db_free(&dbv);
} } }
wcsncpy_s(strFull, (snd.ptszTempFile ? snd.ptszTempFile : L""), _TRUNCATE);
- PathToAbsoluteT(strFull, strdir);
+ PathToAbsoluteW(strFull, strdir);
OPENFILENAME ofn;
memset(&ofn, 0, sizeof(ofn));
@@ -352,7 +352,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM for (int i=0; i < arSounds.getCount(); i++)
if (arSounds[i].ptszTempFile)
- db_set_ts(NULL, "SkinSounds", arSounds[i].name, arSounds[i].ptszTempFile);
+ db_set_ws(NULL, "SkinSounds", arSounds[i].name, arSounds[i].ptszTempFile);
TVITEM tvi, tvic;
tvi.hItem = TreeView_GetRoot(hwndTree);
@@ -394,7 +394,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SetDlgItemText(hwndDlg, IDC_LOCATION, arSounds[tvi.lParam].ptszTempFile);
else {
DBVARIANT dbv;
- if (!db_get_ts(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
+ if (!db_get_ws(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
SetDlgItemText(hwndDlg, IDC_LOCATION, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/src/mir_app/src/srmm_statusicon.cpp b/src/mir_app/src/srmm_statusicon.cpp index bcf7a8a0b7..dbc6daff65 100644 --- a/src/mir_app/src/srmm_statusicon.cpp +++ b/src/mir_app/src/srmm_statusicon.cpp @@ -180,7 +180,7 @@ static INT_PTR GetNthIcon(WPARAM wParam, LPARAM lParam) if (pc->tszTooltip) res.tszTooltip = pc->tszTooltip;
res.flags = pc->flags;
}
- res.tszTooltip = TranslateTH(p.hLangpack, res.tszTooltip);
+ res.tszTooltip = TranslateW_LP(res.tszTooltip, p.hLangpack);
return (INT_PTR)&res;
}
nVis++;
diff --git a/src/mir_core/src/bitmaps.cpp b/src/mir_core/src/bitmaps.cpp index 5a06bb50ff..42db450952 100644 --- a/src/mir_core/src/bitmaps.cpp +++ b/src/mir_core/src/bitmaps.cpp @@ -28,13 +28,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. MIR_CORE_DLL(HBITMAP) Bitmap_Load(const wchar_t *ptszFileName)
{
wchar_t szFilename[MAX_PATH];
- if (!PathToAbsoluteT(ptszFileName, szFilename))
+ if (!PathToAbsoluteW(ptszFileName, szFilename))
wcsncpy_s(szFilename, ptszFileName, _TRUNCATE);
if (!ServiceExists(MS_IMG_LOAD))
return NULL;
- return (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFilename, IMGL_TCHAR);
+ return (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFilename, IMGL_WCHAR);
}
MIR_CORE_DLL(void) Bitmap_GetFilter(wchar_t *dest, size_t destLen)
diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp index 0e028bb398..8bac3b89bb 100644 --- a/src/mir_core/src/db.cpp +++ b/src/mir_core/src/db.cpp @@ -351,7 +351,7 @@ extern "C" MIR_CORE_DLL(void) db_setCurrent(MIDatabase *_db) currDb = _db;
// try to get the langpack's name from a profile
- ptrW langpack(db_get_tsa(NULL, "Langpack", "Current"));
+ ptrW langpack(db_get_wsa(NULL, "Langpack", "Current"));
if (langpack && langpack[0] != '\0')
LoadLangPack(langpack);
else
diff --git a/src/mir_core/src/icons.cpp b/src/mir_core/src/icons.cpp index 9b2ee4a65c..a5c310d6b8 100644 --- a/src/mir_core/src/icons.cpp +++ b/src/mir_core/src/icons.cpp @@ -31,7 +31,7 @@ MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconIte SKINICONDESC sid = { 0 };
sid.defaultFile.w = szFile;
sid.section.a = (char*)szSection;
- sid.flags = SIDF_PATH_TCHAR;
+ sid.flags = SIDF_PATH_UNICODE;
for (unsigned i = 0; i < iCount; i++) {
char szSetting[100];
@@ -56,7 +56,7 @@ MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const wchar_t *szSection, Ico SKINICONDESC sid = { 0 };
sid.defaultFile.w = szFile;
sid.section.w = (wchar_t*)szSection;
- sid.flags = SIDF_ALL_TCHAR;
+ sid.flags = SIDF_ALL_UNICODE;
for (unsigned i = 0; i < iCount; i++) {
char szSetting[100];
diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp index 9c29fc24da..a59aa89b0d 100644 --- a/src/mir_core/src/langpack.cpp +++ b/src/mir_core/src/langpack.cpp @@ -379,7 +379,7 @@ MIR_CORE_DLL(int) LoadLangPack(const wchar_t *ptszLangPack) // ensure that a lang's name is a full file name
wchar_t tszFullPath[MAX_PATH];
- if (!PathIsAbsoluteT(ptszLangPack))
+ if (!PathIsAbsoluteW(ptszLangPack))
mir_snwprintf(tszFullPath, L"%s\\%s", g_tszRoot, ptszLangPack);
else
wcsncpy_s(tszFullPath, ptszLangPack, _TRUNCATE);
@@ -503,7 +503,7 @@ MIR_CORE_DLL(wchar_t*) Langpack_PcharToTchar(const char *pszStr) wchar_t *result = (wchar_t*)alloca((len + 1)*sizeof(wchar_t));
MultiByteToWideChar(Langpack_GetDefaultCodePage(), 0, pszStr, -1, result, len);
result[len] = 0;
- return mir_wstrdup(TranslateTS(result));
+ return mir_wstrdup(TranslateW(result));
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -632,21 +632,21 @@ MIR_CORE_DLL(void) Langpack_SortDuplicates(void) void GetDefaultLang()
{
// calculate the langpacks' root
- PathToAbsoluteT(L"\\Languages", g_tszRoot);
+ PathToAbsoluteW(L"\\Languages", g_tszRoot);
if (_waccess(g_tszRoot, 0) != 0) // directory Languages exists
- PathToAbsoluteT(L".", g_tszRoot);
+ PathToAbsoluteW(L".", g_tszRoot);
// look into mirandaboot.ini
wchar_t tszPath[MAX_PATH], tszLangName[256];
- PathToAbsoluteT(L"\\mirandaboot.ini", tszPath);
+ PathToAbsoluteW(L"\\mirandaboot.ini", tszPath);
GetPrivateProfileString(L"Language", L"DefaultLanguage", L"", tszLangName, _countof(tszLangName), tszPath);
if (tszLangName[0]) {
if (!mir_wstrcmpi(tszLangName, L"default")) {
- db_set_ts(NULL, "Langpack", "Current", L"default");
+ db_set_ws(NULL, "Langpack", "Current", L"default");
return;
}
if (!LoadLangPack(tszLangName)) {
- db_set_ts(NULL, "Langpack", "Current", tszLangName);
+ db_set_ws(NULL, "Langpack", "Current", tszLangName);
return;
}
}
@@ -655,7 +655,7 @@ void GetDefaultLang() if (GetLocaleInfo(MAKELCID(GetUserDefaultUILanguage(), SORT_DEFAULT), LOCALE_SENGLANGUAGE, tszLangName, _countof(tszLangName))) {
mir_snwprintf(tszPath, L"langpack_%s.txt", wcslwr(tszLangName));
if (!LoadLangPack(tszPath)) {
- db_set_ts(NULL, "Langpack", "Current", tszPath);
+ db_set_ws(NULL, "Langpack", "Current", tszPath);
return;
}
}
@@ -672,13 +672,13 @@ void GetDefaultLang() continue;
if (!LoadLangPack(fd.cFileName)) {
- db_set_ts(NULL, "Langpack", "Current", fd.cFileName);
+ db_set_ws(NULL, "Langpack", "Current", fd.cFileName);
break;
}
} while (FindNextFile(hFind, &fd));
FindClose(hFind);
}
- else db_set_ts(NULL, "Langpack", "Current", L"default");
+ else db_set_ws(NULL, "Langpack", "Current", L"default");
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_core/src/logger.cpp b/src/mir_core/src/logger.cpp index a2e526a6a2..5dbc758b2e 100644 --- a/src/mir_core/src/logger.cpp +++ b/src/mir_core/src/logger.cpp @@ -112,7 +112,7 @@ MIR_CORE_DLL(HANDLE) mir_createLog(const char* pszName, const wchar_t *ptszDescr if (fp == NULL) {
wchar_t tszPath[MAX_PATH];
wcsncpy_s(tszPath, ptszFile, _TRUNCATE);
- CreatePathToFileT(tszPath);
+ CreatePathToFileW(tszPath);
}
else fclose(fp);
diff --git a/src/mir_core/src/miranda.cpp b/src/mir_core/src/miranda.cpp index c2b4208b54..596d8c7b25 100644 --- a/src/mir_core/src/miranda.cpp +++ b/src/mir_core/src/miranda.cpp @@ -57,7 +57,7 @@ static INT_PTR RestartMiranda(WPARAM wParam, LPARAM lParam) GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath));
if (wParam) {
- VARST profilename(L"%miranda_profilename%");
+ VARSW profilename(L"%miranda_profilename%");
mir_snwprintf(cmdLine, L"\"%s\" /restart:%d /profile=%s", mirandaPath, GetCurrentProcessId(), (wchar_t*)profilename);
}
else mir_snwprintf(cmdLine, L"\"%s\" /restart:%d", mirandaPath, GetCurrentProcessId());
diff --git a/src/mir_core/src/mstring.cpp b/src/mir_core/src/mstring.cpp index eaef7b0d8a..47875a439e 100644 --- a/src/mir_core/src/mstring.cpp +++ b/src/mir_core/src/mstring.cpp @@ -121,7 +121,7 @@ MIR_CORE_DLL(void) mirstr_unlock(CMStringData* pThis) /////////////////////////////////////////////////////////////////////////////////////////
// don't remove it
-// this code just instantiates templates for CMString[A/W]
+// this code just instantiates templates for CMStringW[A/W]
template CMStringW;
template MIR_CORE_EXPORT CMStringW CALLBACK operator + (const CMStringW& str1, const CMStringW& str2);
diff --git a/src/mir_core/src/openurl.cpp b/src/mir_core/src/openurl.cpp index 93aab27ec2..49b2f57309 100644 --- a/src/mir_core/src/openurl.cpp +++ b/src/mir_core/src/openurl.cpp @@ -41,7 +41,7 @@ static void OpenURLThread(void *arg) TOpenUrlInfo *hUrlInfo = (TOpenUrlInfo*)arg;
// wack a protocol on it
- CMString tszUrl;
+ CMStringW tszUrl;
if ((isalpha(hUrlInfo->szUrl[0]) && hUrlInfo->szUrl[1] == ':') || hUrlInfo->szUrl[0] == '\\')
tszUrl.Format(L"file:///%s", hUrlInfo->szUrl);
else {
@@ -56,7 +56,7 @@ static void OpenURLThread(void *arg) }
// check user defined browser for opening urls
- ptrW tszBrowser(db_get_tsa(NULL, "Miranda", "OpenUrlBrowser"));
+ ptrW tszBrowser(db_get_wsa(NULL, "Miranda", "OpenUrlBrowser"));
if (tszBrowser)
ShellExecute(NULL, L"open", tszBrowser, tszUrl, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT);
else
diff --git a/src/mir_core/src/timezones.cpp b/src/mir_core/src/timezones.cpp index e8f0e05356..bb12b1e673 100644 --- a/src/mir_core/src/timezones.cpp +++ b/src/mir_core/src/timezones.cpp @@ -86,7 +86,7 @@ void FormatTime(const SYSTEMTIME *st, const wchar_t *szFormat, wchar_t *szDest, {
if (szDest == NULL || cbDest == 0) return;
- CMString tszTemp;
+ CMStringW tszTemp;
for (const wchar_t* pFormat = szFormat; *pFormat; ++pFormat) {
DWORD fmt = 0;
@@ -242,7 +242,7 @@ MIR_CORE_DLL(HANDLE) TimeZone_CreateByContact(MCONTACT hContact, LPCSTR szModule if (szModule == NULL) szModule = "UserInfo";
DBVARIANT dbv;
- if (!db_get_ts(hContact, szModule, "TzName", &dbv)) {
+ if (!db_get_ws(hContact, szModule, "TzName", &dbv)) {
HANDLE res = TimeZone_CreateByName(dbv.ptszVal, dwFlags);
db_free(&dbv);
if (res) return res;
@@ -251,7 +251,7 @@ MIR_CORE_DLL(HANDLE) TimeZone_CreateByContact(MCONTACT hContact, LPCSTR szModule signed char timezone = (signed char)db_get_b(hContact, szModule, "Timezone", -1);
if (timezone == -1) {
char *szProto = GetContactProto(hContact);
- if (!db_get_ts(hContact, szProto, "TzName", &dbv)) {
+ if (!db_get_ws(hContact, szProto, "TzName", &dbv)) {
HANDLE res = TimeZone_CreateByName(dbv.ptszVal, dwFlags);
db_free(&dbv);
if (res) return res;
@@ -293,7 +293,7 @@ MIR_CORE_DLL(void) TimeZone_StoreByContact(MCONTACT hContact, LPCSTR szModule, H MIM_TIMEZONE *tz = (MIM_TIMEZONE*)hTZ;
if (tz) {
- db_set_ts(hContact, szModule, "TzName", tz->tszName);
+ db_set_ws(hContact, szModule, "TzName", tz->tszName);
db_set_b(hContact, szModule, "Timezone", (char)((tz->tzi.Bias + tz->tzi.StandardBias) / 30));
}
else {
@@ -405,7 +405,7 @@ MIR_CORE_DLL(int) TimeZone_SelectListItem(MCONTACT hContact, LPCSTR szModule, HW if (szModule == NULL) szModule = "UserInfo";
int iSelection = 0;
- ptrW tszName(db_get_tsa(hContact, szModule, "TzName"));
+ ptrW tszName(db_get_wsa(hContact, szModule, "TzName"));
if (tszName != NULL) {
unsigned hash = mir_hashstrT(tszName);
for (int i = 0; i < g_timezonesBias.getCount(); i++) {
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp index 8de4a148e7..307298a86d 100644 --- a/src/mir_core/src/ui_utils.cpp +++ b/src/mir_core/src/ui_utils.cpp @@ -308,7 +308,7 @@ void CCtrlCombo::OnApply() {
CSuper::OnApply();
- if (GetDataType() == DBVT_TCHAR) {
+ if (GetDataType() == DBVT_WCHAR) {
int len = GetWindowTextLength(m_hwnd) + 1;
wchar_t *buf = (wchar_t *)_alloca(sizeof(wchar_t) * len);
GetWindowText(m_hwnd, buf, len);
@@ -321,7 +321,7 @@ void CCtrlCombo::OnApply() void CCtrlCombo::OnReset()
{
- if (GetDataType() == DBVT_TCHAR)
+ if (GetDataType() == DBVT_WCHAR)
SetText(LoadText());
else if (GetDataType() != DBVT_DELETED)
SetInt(LoadInt());
@@ -573,7 +573,7 @@ void CCtrlEdit::OnApply() {
CSuper::OnApply();
- if (GetDataType() == DBVT_TCHAR) {
+ if (GetDataType() == DBVT_WCHAR) {
int len = GetWindowTextLength(m_hwnd) + 1;
wchar_t *buf = (wchar_t *)_alloca(sizeof(wchar_t) * len);
GetWindowText(m_hwnd, buf, len);
@@ -586,7 +586,7 @@ void CCtrlEdit::OnApply() void CCtrlEdit::OnReset()
{
- if (GetDataType() == DBVT_TCHAR)
+ if (GetDataType() == DBVT_WCHAR)
SetText(LoadText());
else if (GetDataType() != DBVT_DELETED)
SetInt(LoadInt());
@@ -619,7 +619,7 @@ void CCtrlData::CreateDbLink(const char* szModuleName, const char* szSetting, BY void CCtrlData::CreateDbLink(const char* szModuleName, const char* szSetting, wchar_t* szValue)
{
- m_dbLink = new CDbLink(szModuleName, szSetting, DBVT_TCHAR, szValue);
+ m_dbLink = new CDbLink(szModuleName, szSetting, DBVT_WCHAR, szValue);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -1632,7 +1632,7 @@ void CCtrlTreeView::TranslateItem(HTREEITEM hItem) TVITEMEX tvi;
wchar_t buf[128];
GetItem(hItem, &tvi, buf, _countof(buf));
- tvi.pszText = TranslateTS(tvi.pszText);
+ tvi.pszText = TranslateW(tvi.pszText);
SetItem(&tvi);
}
@@ -2067,7 +2067,7 @@ void CCtrlPages::OnInit() TCITEM tci = { 0 };
tci.mask = TCIF_PARAM | TCIF_TEXT;
tci.lParam = (LPARAM)p;
- tci.pszText = TranslateTS(p->m_ptszHeader);
+ tci.pszText = TranslateW(p->m_ptszHeader);
if (p->m_hIcon) {
if (!m_hIml) {
m_hIml = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 1);
@@ -2504,8 +2504,8 @@ void CDbLink::SaveInt(DWORD value) wchar_t* CDbLink::LoadText()
{
if (dbv.type != DBVT_DELETED) db_free(&dbv);
- if (!db_get_ts(NULL, m_szModule, m_szSetting, &dbv)) {
- if (dbv.type == DBVT_TCHAR)
+ if (!db_get_ws(NULL, m_szModule, m_szSetting, &dbv)) {
+ if (dbv.type == DBVT_WCHAR)
return dbv.ptszVal;
return m_szDefault;
}
@@ -2516,5 +2516,5 @@ wchar_t* CDbLink::LoadText() void CDbLink::SaveText(wchar_t *value)
{
- db_set_ts(NULL, m_szModule, m_szSetting, value);
+ db_set_ws(NULL, m_szModule, m_szSetting, value);
}
diff --git a/src/mir_core/src/winver.cpp b/src/mir_core/src/winver.cpp index 8c7d73e98a..6e86300372 100644 --- a/src/mir_core/src/winver.cpp +++ b/src/mir_core/src/winver.cpp @@ -220,7 +220,7 @@ MIR_CORE_DLL(BOOL) GetOSDisplayString(wchar_t *buf, size_t bufSize) SYSTEM_INFO sysInfo = { 0 };
GetNativeSystemInfo(&sysInfo);
- CMString ret(L"Microsoft ");
+ CMStringW ret(L"Microsoft ");
// Test for the specific product.
if (osvi.dwMajorVersion >= 6) {
diff --git a/utils/mir_fonts.cpp b/utils/mir_fonts.cpp index cb0dba3571..9b8c32cb23 100644 --- a/utils/mir_fonts.cpp +++ b/utils/mir_fonts.cpp @@ -8,7 +8,7 @@ int FontService_RegisterFont(const char *pszDbModule, const char *pszDbName, const wchar_t *pszSection, const wchar_t *pszDescription, const wchar_t *pszBackgroundGroup, const wchar_t *pszBackgroundName, int position, BOOL bAllowEffects, LOGFONT *plfDefault, COLORREF clrDefault) { - FontIDT fid = { 0 }; + FontIDW fid = { 0 }; fid.cbSize = sizeof(fid); mir_strncpy(fid.dbSettingsGroup, pszDbModule, sizeof(fid.dbSettingsGroup)); /* buffer safe */ mir_strncpy(fid.prefix, pszDbName, sizeof(fid.prefix)); /* buffer safe */ @@ -30,38 +30,38 @@ int FontService_RegisterFont(const char *pszDbModule, const char *pszDbName, con fid.deffontsettings.charset = plfDefault->lfCharSet; mir_wstrncpy(fid.deffontsettings.szFace, plfDefault->lfFaceName, _countof(fid.deffontsettings.szFace)); /* buffer safe */ } - FontRegisterT(&fid); + FontRegisterW(&fid); return 0; } int FontService_GetFont(const wchar_t *pszSection, const wchar_t *pszDescription, COLORREF *pclr, LOGFONT *plf) { - FontIDT fid = { 0 }; + FontIDW fid = { 0 }; mir_wstrncpy(fid.group, pszSection, _countof(fid.group)); /* buffer sfae */ mir_wstrncpy(fid.name, pszDescription, _countof(fid.name)); /* buffer safe */ - *pclr = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)plf); /* uses fallback font on error */ + *pclr = (COLORREF)CallService(MS_FONT_GETW, (WPARAM)&fid, (LPARAM)plf); /* uses fallback font on error */ return (int)*pclr == -1; } int FontService_RegisterColor(const char *pszDbModule, const char *pszDbName, const wchar_t *pszSection, const wchar_t *pszDescription, COLORREF clrDefault) { - ColourIDT cid = { 0 }; + ColourIDW cid = { 0 }; cid.cbSize = sizeof(cid); cid.defcolour = clrDefault; mir_strncpy(cid.dbSettingsGroup, pszDbModule, sizeof(cid.dbSettingsGroup)); /* buffer safe */ mir_strncpy(cid.setting, pszDbName, sizeof(cid.setting)); /* buffer safe */ mir_wstrncpy(cid.group, pszSection, _countof(cid.group)); /* buffer safe */ mir_wstrncpy(cid.name, pszDescription, _countof(cid.name)); /* buffer safe */ - ColourRegisterT(&cid); + ColourRegisterW(&cid); return 0; } int FontService_GetColor(const wchar_t *pszSection, const wchar_t *pszDescription, COLORREF *pclr) { - ColourIDT cid = { 0 }; + ColourIDW cid = { 0 }; cid.cbSize = sizeof(cid); wcsncpy_s(cid.group, pszSection, _TRUNCATE); wcsncpy_s(cid.name, pszDescription, _TRUNCATE); - *pclr = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, 0); + *pclr = (COLORREF)CallService(MS_COLOUR_GETW, (WPARAM)&cid, 0); return (int)*pclr == -1; } diff --git a/utils/mir_options.cpp b/utils/mir_options.cpp index dcba3e6b26..71f9ae0ea9 100644 --- a/utils/mir_options.cpp +++ b/utils/mir_options.cpp @@ -37,7 +37,7 @@ static wchar_t* MyDBGetContactSettingTString(MCONTACT hContact, char* module, ch out[0] = '\0'; - if (!db_get_ts(hContact, module, setting, &dbv)) { + if (!db_get_ws(hContact, module, setting, &dbv)) { mir_wstrncpy(out, dbv.ptszVal, (int)len); db_free(&dbv); } @@ -126,7 +126,7 @@ static void LoadOpt(OptPageControl *ctrl, char *module) break; case CONTROL_TEXT: - MyDBGetContactSettingTString(NULL, module, ctrl->setting, ((wchar_t *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), ctrl->tszDefValue == NULL ? NULL : TranslateTS(ctrl->tszDefValue)); + MyDBGetContactSettingTString(NULL, module, ctrl->setting, ((wchar_t *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), ctrl->tszDefValue == NULL ? NULL : TranslateW(ctrl->tszDefValue)); break; case CONTROL_INT: @@ -140,7 +140,7 @@ static void LoadOpt(OptPageControl *ctrl, char *module) case CONTROL_COMBO_TEXT: case CONTROL_COMBO_ITEMDATA: - MyDBGetContactSettingTString(NULL, module, ctrl->setting, ((wchar_t *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), ctrl->tszDefValue == NULL ? NULL : TranslateTS(ctrl->tszDefValue)); + MyDBGetContactSettingTString(NULL, module, ctrl->setting, ((wchar_t *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), ctrl->tszDefValue == NULL ? NULL : TranslateW(ctrl->tszDefValue)); break; } } @@ -236,7 +236,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha break; case CONTROL_TEXT: - SetDlgItemText(hwndDlg, ctrl->nID, MyDBGetContactSettingTString(NULL, module, ctrl->setting, tmp, 1024, ctrl->tszDefValue == NULL ? NULL : TranslateTS(ctrl->tszDefValue))); + SetDlgItemText(hwndDlg, ctrl->nID, MyDBGetContactSettingTString(NULL, module, ctrl->setting, tmp, 1024, ctrl->tszDefValue == NULL ? NULL : TranslateW(ctrl->tszDefValue))); SendDlgItemMessage(hwndDlg, ctrl->nID, EM_LIMITTEXT, min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), 0); break; @@ -256,12 +256,12 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha break; case CONTROL_COMBO_TEXT: - MyDBGetContactSettingTString(NULL, module, ctrl->setting, tmp, 1024, ctrl->tszDefValue == NULL ? NULL : TranslateTS(ctrl->tszDefValue)); + MyDBGetContactSettingTString(NULL, module, ctrl->setting, tmp, 1024, ctrl->tszDefValue == NULL ? NULL : TranslateW(ctrl->tszDefValue)); SendDlgItemMessage(hwndDlg, ctrl->nID, CB_SELECTSTRING, 0, (WPARAM)tmp); break; case CONTROL_COMBO_ITEMDATA: - MyDBGetContactSettingTString(NULL, module, ctrl->setting, tmp, 1024, ctrl->tszDefValue == NULL ? NULL : TranslateTS(ctrl->tszDefValue)); + MyDBGetContactSettingTString(NULL, module, ctrl->setting, tmp, 1024, ctrl->tszDefValue == NULL ? NULL : TranslateW(ctrl->tszDefValue)); { int count = SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETCOUNT, 0, 0); int k; @@ -357,7 +357,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha case CONTROL_TEXT: GetDlgItemText(hwndDlg, ctrl->nID, tmp, _countof(tmp)); - db_set_ts(NULL, module, ctrl->setting, tmp); + db_set_ws(NULL, module, ctrl->setting, tmp); break; case CONTROL_INT: @@ -379,18 +379,18 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha { wchar_t rel[1024]; PathToRelative(rel, 1024, tmp); - db_set_ts(NULL, module, ctrl->setting, rel); + db_set_ws(NULL, module, ctrl->setting, rel); } break; case CONTROL_COMBO_TEXT: GetDlgItemText(hwndDlg, ctrl->nID, tmp, _countof(tmp)); - db_set_ts(NULL, module, ctrl->setting, tmp); + db_set_ws(NULL, module, ctrl->setting, tmp); break; case CONTROL_COMBO_ITEMDATA: int sel = SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETCURSEL, 0, 0); - db_set_ts(NULL, module, ctrl->setting, (wchar_t *)SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETITEMDATA, (WPARAM)sel, 0)); + db_set_ws(NULL, module, ctrl->setting, (wchar_t *)SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETITEMDATA, (WPARAM)sel, 0)); break; } |