diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
commit | 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch) | |
tree | 2e8bb660c908b54914abd562af8aafa4a486c846 /protocols/Omegle | |
parent | a61c8728b379057fe7f0a0d86fe0b037598229dd (diff) |
less TCHARs:
- TCHAR is replaced with wchar_t everywhere;
- LPGENT replaced with either LPGENW or LPGEN;
- fixes for ANSI plugins that improperly used _t functions;
- TCHAR *t removed from MAllStrings;
- ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz*
git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Omegle')
-rw-r--r-- | protocols/Omegle/src/chat.cpp | 10 | ||||
-rw-r--r-- | protocols/Omegle/src/communication.cpp | 12 | ||||
-rw-r--r-- | protocols/Omegle/src/dialogs.cpp | 2 | ||||
-rw-r--r-- | protocols/Omegle/src/main.cpp | 2 | ||||
-rw-r--r-- | protocols/Omegle/src/messages.cpp | 2 | ||||
-rw-r--r-- | protocols/Omegle/src/proto.cpp | 20 | ||||
-rw-r--r-- | protocols/Omegle/src/proto.h | 12 |
7 files changed, 30 insertions, 30 deletions
diff --git a/protocols/Omegle/src/chat.cpp b/protocols/Omegle/src/chat.cpp index 6fe46e57b4..b3db982704 100644 --- a/protocols/Omegle/src/chat.cpp +++ b/protocols/Omegle/src/chat.cpp @@ -21,10 +21,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h"
-void OmegleProto::UpdateChat(const TCHAR *name, const TCHAR *message, bool addtolog)
+void OmegleProto::UpdateChat(const wchar_t *name, const wchar_t *message, bool addtolog)
{
// replace % to %% to not interfere with chat color codes
- std::tstring smessage = message;
+ std::wstring smessage = message;
utils::text::treplace_all(&smessage, L"%", L"%%");
GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_MESSAGE };
@@ -226,7 +226,7 @@ GCEVENT gce = { sizeof(gce), &gcd }; CallServiceSync(MS_GC_EVENT,WINDOW_CLEARLOG,reinterpret_cast<LPARAM>(&gce));
}*/
-void OmegleProto::AddChatContact(const TCHAR *name)
+void OmegleProto::AddChatContact(const wchar_t *name)
{
GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_JOIN };
GCEVENT gce = { sizeof(gce), &gcd };
@@ -248,7 +248,7 @@ void OmegleProto::AddChatContact(const TCHAR *name) CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast<LPARAM>(&gce));
}
-void OmegleProto::DeleteChatContact(const TCHAR *name)
+void OmegleProto::DeleteChatContact(const wchar_t *name)
{
GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_PART };
GCEVENT gce = { sizeof(gce), &gcd };
@@ -296,7 +296,7 @@ INT_PTR OmegleProto::OnJoinChat(WPARAM, LPARAM suppress) return 0;
}
-void OmegleProto::SetTopic(const TCHAR *topic)
+void OmegleProto::SetTopic(const wchar_t *topic)
{
GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_TOPIC };
GCEVENT gce = { sizeof(gce), &gcd };
diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp index db1391ba82..27370cb1f4 100644 --- a/protocols/Omegle/src/communication.cpp +++ b/protocols/Omegle/src/communication.cpp @@ -365,7 +365,7 @@ bool Omegle_client::start() char str[255]; mir_snprintf(str, Translate("Connected to server %s. There are %s users online now."), server_.c_str(), count.c_str()); - TCHAR *msg = mir_a2t(str); + wchar_t *msg = mir_a2t(str); parent->UpdateChat(NULL, msg); mir_free(msg); } @@ -374,7 +374,7 @@ bool Omegle_client::start() char str[255]; mir_snprintf(str, Translate("Connected to server %s."), server_.c_str()); - TCHAR *msg = mir_a2t(str); + wchar_t *msg = mir_a2t(str); parent->UpdateChat(NULL, msg); mir_free(msg); } @@ -506,7 +506,7 @@ bool Omegle_client::events() // We got info about count of connected people there ptrT count(json_as_string(json_get(data, "count"))); - TCHAR strT[255]; + wchar_t strT[255]; mir_sntprintf(strT, TranslateT("On whole Omegle are %s strangers online now."), count); parent->UpdateChat(NULL, strT); @@ -531,7 +531,7 @@ bool Omegle_client::events() waiting = false; } else if (name == "commonLikes") { - std::tstring likes = TranslateT("You and the Stranger both like: "); + std::wstring likes = TranslateT("You and the Stranger both like: "); JSONNode *items = json_at(item, 1); size_t size = json_size(items); @@ -614,7 +614,7 @@ bool Omegle_client::events() ptrT stranger(json_as_string(json_at(item, 1))); - TCHAR strT[255]; + wchar_t strT[255]; mir_sntprintf(strT, TranslateT("%s disconnected."), TranslateTS(stranger)); parent->UpdateChat(NULL, strT); @@ -639,7 +639,7 @@ bool Omegle_client::events() else if (name == "error") { ptrT error(json_as_string(json_at(item, 1))); - TCHAR strT[255]; + wchar_t strT[255]; mir_sntprintf(strT, TranslateT("Error: %s"), TranslateTS(error)); parent->UpdateChat(NULL, strT); } diff --git a/protocols/Omegle/src/dialogs.cpp b/protocols/Omegle/src/dialogs.cpp index 7ff7b76097..9868c51c57 100644 --- a/protocols/Omegle/src/dialogs.cpp +++ b/protocols/Omegle/src/dialogs.cpp @@ -45,7 +45,7 @@ static void LoadDBText(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* szS static void StoreDBText(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* szSetting)
{
- TCHAR tstr[250 + 1];
+ wchar_t tstr[250 + 1];
GetDlgItemText(hwnd, idCtrl, tstr, _countof(tstr));
if (tstr[0] != '\0') {
diff --git a/protocols/Omegle/src/main.cpp b/protocols/Omegle/src/main.cpp index fbde3bf512..309d0fe897 100644 --- a/protocols/Omegle/src/main.cpp +++ b/protocols/Omegle/src/main.cpp @@ -74,7 +74,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC /////////////////////////////////////////////////////////////////////////////////////////
// Load
-static PROTO_INTERFACE* protoInit(const char *proto_name, const TCHAR *username)
+static PROTO_INTERFACE* protoInit(const char *proto_name, const wchar_t *username)
{
OmegleProto *proto = new OmegleProto(proto_name, username);
g_Instances.insert(proto);
diff --git a/protocols/Omegle/src/messages.cpp b/protocols/Omegle/src/messages.cpp index 8cabb89dcb..2a8f16b95e 100644 --- a/protocols/Omegle/src/messages.cpp +++ b/protocols/Omegle/src/messages.cpp @@ -34,7 +34,7 @@ void OmegleProto::SendMsgWorker(void *p) if (facy.state_ == STATE_ACTIVE && data.length() && facy.send_message(data)) { - TCHAR *msg = mir_a2t_cp(data.c_str(), CP_UTF8); + wchar_t *msg = mir_a2t_cp(data.c_str(), CP_UTF8); UpdateChat(facy.nick_, msg); mir_free(msg); } diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp index 42d0249c1d..aff30158c6 100644 --- a/protocols/Omegle/src/proto.cpp +++ b/protocols/Omegle/src/proto.cpp @@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h"
-OmegleProto::OmegleProto(const char* proto_name, const TCHAR* username) :
+OmegleProto::OmegleProto(const char* proto_name, const wchar_t* username) :
PROTO<OmegleProto>(proto_name, username)
{
this->facy.parent = this;
@@ -42,7 +42,7 @@ PROTO<OmegleProto>(proto_name, username) HookProtoEvent(ME_GC_EVENT, &OmegleProto::OnChatEvent);
// Create standard network connection
- TCHAR descr[512];
+ wchar_t descr[512];
NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
nlu.szSettingsModule = m_szModuleName;
@@ -50,17 +50,17 @@ PROTO<OmegleProto>(proto_name, username) nlu.ptszDescriptiveName = descr;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
if (m_hNetlibUser == NULL) {
- TCHAR error[200];
+ wchar_t error[200];
mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
MessageBox(NULL, error, L"Miranda NG", MB_OK | MB_ICONERROR);
}
facy.set_handle(m_hNetlibUser);
- SkinAddNewSoundExT("StrangerTyp", m_tszUserName, LPGENT("Stranger is typing"));
- SkinAddNewSoundExT("StrangerTypStop", m_tszUserName, LPGENT("Stranger stopped typing"));
- SkinAddNewSoundExT("StrangerChange", m_tszUserName, LPGENT("Changing stranger"));
- SkinAddNewSoundExT("StrangerMessage", m_tszUserName, LPGENT("Receive message"));
+ 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"));
}
OmegleProto::~OmegleProto()
@@ -181,13 +181,13 @@ int OmegleProto::OnOptionsInit(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_hInstance;
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.dwInitParam = LPARAM(this);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
odp.position = 271828;
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTab = LPGENT("Account");
+ odp.pwszGroup = LPGENW("Network");
+ odp.pwszTab = LPGENW("Account");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.pfnDlgProc = OmegleOptionsProc;
Options_AddPage(wParam, &odp);
diff --git a/protocols/Omegle/src/proto.h b/protocols/Omegle/src/proto.h index 522f060991..5b0362b240 100644 --- a/protocols/Omegle/src/proto.h +++ b/protocols/Omegle/src/proto.h @@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. class OmegleProto : public PROTO < OmegleProto >
{
public:
- OmegleProto(const char *proto_name, const TCHAR *username);
+ OmegleProto(const char *proto_name, const wchar_t *username);
~OmegleProto();
inline const char* ModuleName() const
@@ -88,14 +88,14 @@ public: //bool IsMyContact(HANDLE, bool include_chat = false);
// Chat handling
- void AddChat(const TCHAR *id, const TCHAR *name);
- void UpdateChat(const TCHAR *name, const TCHAR *message, bool addtochat = true);
+ void AddChat(const wchar_t *id, const wchar_t *name);
+ void UpdateChat(const wchar_t *name, const wchar_t *message, bool addtochat = true);
void SendChatMessage(std::string message);
- void AddChatContact(const TCHAR *nick);
- void DeleteChatContact(const TCHAR *name);
+ void AddChatContact(const wchar_t *nick);
+ void DeleteChatContact(const wchar_t *name);
void SetChatStatus(int);
void ClearChat();
- void SetTopic(const TCHAR *topic = NULL);
+ void SetTopic(const wchar_t *topic = NULL);
MCONTACT GetChatHandle();
// Connection client
|