From f4db128b96bf38991a3dea70ef568a1248665a2c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 30 Apr 2015 19:46:58 +0000 Subject: unified project for Steam protocol git-svn-id: http://svn.miranda-ng.org/main/trunk@13316 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Steam/src/common.h | 58 ---------------------------- protocols/Steam/src/stdafx.cpp | 67 --------------------------------- protocols/Steam/src/stdafx.cxx | 67 +++++++++++++++++++++++++++++++++ protocols/Steam/src/stdafx.h | 58 ++++++++++++++++++++++++++++ protocols/Steam/src/steam_account.cpp | 2 +- protocols/Steam/src/steam_avatars.cpp | 2 +- protocols/Steam/src/steam_contacts.cpp | 2 +- protocols/Steam/src/steam_dialogs.cpp | 2 +- protocols/Steam/src/steam_events.cpp | 2 +- protocols/Steam/src/steam_instances.cpp | 2 +- protocols/Steam/src/steam_menus.cpp | 2 +- protocols/Steam/src/steam_messages.cpp | 2 +- protocols/Steam/src/steam_pooling.cpp | 2 +- protocols/Steam/src/steam_proto.cpp | 2 +- protocols/Steam/src/steam_queue.cpp | 2 +- protocols/Steam/src/steam_utils.cpp | 6 ++- protocols/Steam/src/steam_xstatus.cpp | 6 +-- 17 files changed, 143 insertions(+), 141 deletions(-) delete mode 100644 protocols/Steam/src/common.h delete mode 100644 protocols/Steam/src/stdafx.cpp create mode 100644 protocols/Steam/src/stdafx.cxx create mode 100644 protocols/Steam/src/stdafx.h (limited to 'protocols/Steam/src') diff --git a/protocols/Steam/src/common.h b/protocols/Steam/src/common.h deleted file mode 100644 index d39881dbd2..0000000000 --- a/protocols/Steam/src/common.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef _COMMON_H_ -#define _COMMON_H_ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "resource.h" -#include "version.h" - -#define MODULE "Steam" - -#define STEAM_API_TIMEOUT 30 -#define STEAM_API_IDLEOUT_AWAY 600 -#define STEAM_API_IDLEOUT_SNOOZE 8000 - -class CSteamProto; -extern HINSTANCE g_hInstance; - -extern HANDLE hExtraXStatus; - -#include "Steam\steam.h" - -#include "steam_dialogs.h" -#include "steam_proto.h" - -#endif //_COMMON_H_ \ No newline at end of file diff --git a/protocols/Steam/src/stdafx.cpp b/protocols/Steam/src/stdafx.cpp deleted file mode 100644 index 7c6793d8cb..0000000000 --- a/protocols/Steam/src/stdafx.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "common.h" - -int hLangpack; -HINSTANCE g_hInstance; - -HANDLE hExtraXStatus; - -PLUGININFOEX pluginInfo = -{ - sizeof(PLUGININFOEX), - __PLUGIN_NAME, - PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), - __DESCRIPTION, - __AUTHOR, - __AUTHOREMAIL, - __COPYRIGHT, - __AUTHORWEB, - UNICODE_AWARE, - // {68F5A030-BA32-48EC-9507-5C2FBDEA5217} - { 0x68f5a030, 0xba32, 0x48ec, { 0x95, 0x7, 0x5c, 0x2f, 0xbd, 0xea, 0x52, 0x17 }} -}; - -DWORD WINAPI DllMain(HINSTANCE hInstance, DWORD, LPVOID) -{ - g_hInstance = hInstance; - - return TRUE; -} - -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) -{ - return &pluginInfo; -} - -extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST}; - -extern "C" int __declspec(dllexport) Load(void) -{ - mir_getLP(&pluginInfo); - - PROTOCOLDESCRIPTOR pd = { sizeof(pd) }; - pd.szName = "STEAM"; - pd.type = PROTOTYPE_PROTOCOL; - pd.fnInit = (pfnInitProto)CSteamProto::InitProtoInstance; - pd.fnUninit = (pfnUninitProto)CSteamProto::UninitProtoInstance; - CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); - - char iconName[100]; - mir_snprintf(iconName, SIZEOF(iconName), "%s_%s", MODULE, "gaming"); - - // extra statuses - HookEvent(ME_SKIN2_ICONSCHANGED, OnReloadIcons); - hExtraXStatus = ExtraIcon_Register("steam_game", LPGEN("Steam game"), iconName); - - CSteamProto::InitMenus(); - - return 0; -} - -extern "C" int __declspec(dllexport) Unload(void) -{ - CSteamProto::UninitProtoInstances(); - - CSteamProto::UninitMenus(); - - return 0; -} \ No newline at end of file diff --git a/protocols/Steam/src/stdafx.cxx b/protocols/Steam/src/stdafx.cxx new file mode 100644 index 0000000000..6fe8317684 --- /dev/null +++ b/protocols/Steam/src/stdafx.cxx @@ -0,0 +1,67 @@ +#include "stdafx.h" + +int hLangpack; +HINSTANCE g_hInstance; + +HANDLE hExtraXStatus; + +PLUGININFOEX pluginInfo = +{ + sizeof(PLUGININFOEX), + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESCRIPTION, + __AUTHOR, + __AUTHOREMAIL, + __COPYRIGHT, + __AUTHORWEB, + UNICODE_AWARE, + // {68F5A030-BA32-48EC-9507-5C2FBDEA5217} + { 0x68f5a030, 0xba32, 0x48ec, { 0x95, 0x7, 0x5c, 0x2f, 0xbd, 0xea, 0x52, 0x17 }} +}; + +DWORD WINAPI DllMain(HINSTANCE hInstance, DWORD, LPVOID) +{ + g_hInstance = hInstance; + + return TRUE; +} + +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +{ + return &pluginInfo; +} + +extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST}; + +extern "C" int __declspec(dllexport) Load(void) +{ + mir_getLP(&pluginInfo); + + PROTOCOLDESCRIPTOR pd = { sizeof(pd) }; + pd.szName = "STEAM"; + pd.type = PROTOTYPE_PROTOCOL; + pd.fnInit = (pfnInitProto)CSteamProto::InitProtoInstance; + pd.fnUninit = (pfnUninitProto)CSteamProto::UninitProtoInstance; + CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); + + char iconName[100]; + mir_snprintf(iconName, SIZEOF(iconName), "%s_%s", MODULE, "gaming"); + + // extra statuses + HookEvent(ME_SKIN2_ICONSCHANGED, OnReloadIcons); + hExtraXStatus = ExtraIcon_Register("steam_game", LPGEN("Steam game"), iconName); + + CSteamProto::InitMenus(); + + return 0; +} + +extern "C" int __declspec(dllexport) Unload(void) +{ + CSteamProto::UninitProtoInstances(); + + CSteamProto::UninitMenus(); + + return 0; +} \ No newline at end of file diff --git a/protocols/Steam/src/stdafx.h b/protocols/Steam/src/stdafx.h new file mode 100644 index 0000000000..d39881dbd2 --- /dev/null +++ b/protocols/Steam/src/stdafx.h @@ -0,0 +1,58 @@ +#ifndef _COMMON_H_ +#define _COMMON_H_ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "resource.h" +#include "version.h" + +#define MODULE "Steam" + +#define STEAM_API_TIMEOUT 30 +#define STEAM_API_IDLEOUT_AWAY 600 +#define STEAM_API_IDLEOUT_SNOOZE 8000 + +class CSteamProto; +extern HINSTANCE g_hInstance; + +extern HANDLE hExtraXStatus; + +#include "Steam\steam.h" + +#include "steam_dialogs.h" +#include "steam_proto.h" + +#endif //_COMMON_H_ \ No newline at end of file diff --git a/protocols/Steam/src/steam_account.cpp b/protocols/Steam/src/steam_account.cpp index 9ea391ad95..a01bc51e38 100644 --- a/protocols/Steam/src/steam_account.cpp +++ b/protocols/Steam/src/steam_account.cpp @@ -1,4 +1,4 @@ -#include "common.h" +#include "stdafx.h" bool CSteamProto::IsOnline() { diff --git a/protocols/Steam/src/steam_avatars.cpp b/protocols/Steam/src/steam_avatars.cpp index b0d2cb0bbc..ec2694b878 100644 --- a/protocols/Steam/src/steam_avatars.cpp +++ b/protocols/Steam/src/steam_avatars.cpp @@ -1,4 +1,4 @@ -#include "common.h" +#include "stdafx.h" TCHAR* CSteamProto::GetAvatarFilePath(MCONTACT hContact) { diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 8fca50265a..64c98467de 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -1,4 +1,4 @@ -#include "common.h" +#include "stdafx.h" void CSteamProto::SetContactStatus(MCONTACT hContact, WORD status) { diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp index c071c7cc84..e75d1a913f 100644 --- a/protocols/Steam/src/steam_dialogs.cpp +++ b/protocols/Steam/src/steam_dialogs.cpp @@ -1,4 +1,4 @@ -#include "common.h" +#include "stdafx.h" CSteamPasswordEditor::CSteamPasswordEditor(CSteamProto *proto) : CSuper(proto, IDD_PASSWORD_EDITOR, false), m_ok(this, IDOK), diff --git a/protocols/Steam/src/steam_events.cpp b/protocols/Steam/src/steam_events.cpp index 2da994ebfc..ee4669ca5b 100644 --- a/protocols/Steam/src/steam_events.cpp +++ b/protocols/Steam/src/steam_events.cpp @@ -1,4 +1,4 @@ -#include "common.h" +#include "stdafx.h" int CSteamProto::OnModulesLoaded(WPARAM, LPARAM) { diff --git a/protocols/Steam/src/steam_instances.cpp b/protocols/Steam/src/steam_instances.cpp index 82b62f9654..c2113d3c6c 100644 --- a/protocols/Steam/src/steam_instances.cpp +++ b/protocols/Steam/src/steam_instances.cpp @@ -1,4 +1,4 @@ -#include "common.h" +#include "stdafx.h" int CSteamProto::CompareProtos(const CSteamProto *p1, const CSteamProto *p2) { diff --git a/protocols/Steam/src/steam_menus.cpp b/protocols/Steam/src/steam_menus.cpp index 4ec5f32339..b4507db158 100644 --- a/protocols/Steam/src/steam_menus.cpp +++ b/protocols/Steam/src/steam_menus.cpp @@ -1,4 +1,4 @@ -#include "common.h" +#include "stdafx.h" HANDLE CSteamProto::hChooserMenu; HGENMENU CSteamProto::contactMenuItems[CMI_MAX]; diff --git a/protocols/Steam/src/steam_messages.cpp b/protocols/Steam/src/steam_messages.cpp index f2f2c51c8a..48f59b0ce6 100644 --- a/protocols/Steam/src/steam_messages.cpp +++ b/protocols/Steam/src/steam_messages.cpp @@ -1,4 +1,4 @@ -#include "common.h" +#include "stdafx.h" //void CSteamProto::SendTypingThread(void *arg) //{ diff --git a/protocols/Steam/src/steam_pooling.cpp b/protocols/Steam/src/steam_pooling.cpp index 1bf9f8314e..e1dcb1ff28 100644 --- a/protocols/Steam/src/steam_pooling.cpp +++ b/protocols/Steam/src/steam_pooling.cpp @@ -1,4 +1,4 @@ -#include "common.h" +#include "stdafx.h" #define POLLING_ERRORS_LIMIT 3 diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index d144abd8f5..1b005a628d 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -1,4 +1,4 @@ -#include "common.h" +#include "stdafx.h" CSteamProto::CSteamProto(const char* protoName, const TCHAR* userName) : PROTO(protoName, userName), diff --git a/protocols/Steam/src/steam_queue.cpp b/protocols/Steam/src/steam_queue.cpp index d0bd54ad61..dd51f4caee 100644 --- a/protocols/Steam/src/steam_queue.cpp +++ b/protocols/Steam/src/steam_queue.cpp @@ -1,4 +1,4 @@ -#include "common.h" +#include "stdafx.h" void CSteamProto::InitQueue() { diff --git a/protocols/Steam/src/steam_utils.cpp b/protocols/Steam/src/steam_utils.cpp index 40fd27d888..ea924eac86 100644 --- a/protocols/Steam/src/steam_utils.cpp +++ b/protocols/Steam/src/steam_utils.cpp @@ -1,4 +1,6 @@ -#include "common.h" +#include "stdafx.h" + +#pragma comment(lib, "crypt32.lib") WORD CSteamProto::SteamToMirandaStatus(int state) { @@ -116,7 +118,7 @@ int CSteamProto::RsaEncrypt(const char *pszModulus, const char *data, BYTE *encr goto exit; } - DWORD dataSize = strlen(data); + DWORD dataSize = (DWORD)strlen(data); // if data is not allocated just renurn size if (encryptedData == NULL) diff --git a/protocols/Steam/src/steam_xstatus.cpp b/protocols/Steam/src/steam_xstatus.cpp index ca20df452a..eee37f824a 100644 --- a/protocols/Steam/src/steam_xstatus.cpp +++ b/protocols/Steam/src/steam_xstatus.cpp @@ -1,4 +1,4 @@ -#include "common.h" +#include "stdafx.h" #define STATUS_TITLE_MAX 64 #define STATUS_DESC_MAX 250 @@ -6,7 +6,7 @@ static std::vector xstatusIconsValid; static std::map xstatusIcons; -int OnReloadIcons(WPARAM wParam, LPARAM lParam) +int OnReloadIcons(WPARAM, LPARAM) { xstatusIconsValid.clear(); return 0; @@ -113,7 +113,7 @@ INT_PTR CSteamProto::OnGetXStatusIcon(WPARAM wParam, LPARAM lParam) return (INT_PTR)GetXStatusIcon(wParam, lParam); } -INT_PTR CSteamProto::OnRequestAdvStatusIconIdx(WPARAM wParam, LPARAM lParam) +INT_PTR CSteamProto::OnRequestAdvStatusIconIdx(WPARAM wParam, LPARAM) { int status = GetContactXStatus(wParam); if (status) -- cgit v1.2.3