From d9cd01de6dd3458ad806fdbe1d29108eda55b3e4 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Wed, 26 Sep 2012 18:24:48 +0000 Subject: git-svn-id: http://svn.miranda-ng.org/main/trunk@1665 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/Skype.vcxproj | 15 ++++++++------- protocols/Skype/src/skype.cpp | 14 +++++++------- protocols/Skype/src/skype.h | 1 + protocols/Skype/src/skype_proto.cpp | 10 +++++++++- protocols/Skype/src/skype_proto.h | 12 +++++------- 5 files changed, 30 insertions(+), 22 deletions(-) (limited to 'protocols') diff --git a/protocols/Skype/Skype.vcxproj b/protocols/Skype/Skype.vcxproj index 175735e458..9f95fbf52a 100644 --- a/protocols/Skype/Skype.vcxproj +++ b/protocols/Skype/Skype.vcxproj @@ -45,7 +45,7 @@ - NotUsing + Use Level3 Disabled WIN32;_DEBUG;_WINDOWS;_USRDLL;SKYPE_EXPORTS;%(PreprocessorDefinitions) @@ -72,13 +72,12 @@ Level3 - NotUsing + Use Full true true WIN32;NDEBUG;_WINDOWS;_USRDLL;SKYPE_EXPORTS;%(PreprocessorDefinitions) - -..\..\include;..\..\plugins\ExternalAPI;..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\api;..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\ipc;..\..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\types;..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\platform\threading;..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\platform\threading\win;..\..\SkypeKit\SDK\ipc\cpp;..\..\SkypeKit\SDK\ipc\cpp\VideoBuffers;..\..\SkypeKit\SDK\ipc\cpp\platform\se;..\..\SkypeKit\SDK\ipc\cpp\ssl\cyassl\include;..\..\SkypeKit\SDK\ipc\cpp\ssl\cyassl\include\openssl;..\..\SkypeKit\SDK\ipc\cpp\ssl\cyassl\ctaocrypt\include;%(AdditionalIncludeDirectories) + ..\..\include;..\..\plugins\ExternalAPI;..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\api;..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\ipc;..\..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\types;..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\platform\threading;..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\platform\threading\win;..\..\SkypeKit\SDK\ipc\cpp;..\..\SkypeKit\SDK\ipc\cpp\VideoBuffers;..\..\SkypeKit\SDK\ipc\cpp\platform\se;..\..\SkypeKit\SDK\ipc\cpp\ssl\cyassl\include;..\..\SkypeKit\SDK\ipc\cpp\ssl\cyassl\include\openssl;..\..\SkypeKit\SDK\ipc\cpp\ssl\cyassl\ctaocrypt\include;%(AdditionalIncludeDirectories) skype.h 4996;%(DisableSpecificWarnings) @@ -89,8 +88,7 @@ true false /PDBALTPATH:%_PDB% - -$(SolutionDir)..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\build\skypekit-cyassl_lib.lib;$(SolutionDir)..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\build\skypekit-cppwrapper_2_lib.lib;%(AdditionalDependencies) + $(SolutionDir)..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\build\skypekit-cyassl_lib.lib;$(SolutionDir)..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\build\skypekit-cppwrapper_2_lib.lib;%(AdditionalDependencies) NDEBUG;%(PreprocessorDefinitions) @@ -104,7 +102,10 @@ - + + Create + Create + diff --git a/protocols/Skype/src/skype.cpp b/protocols/Skype/src/skype.cpp index 47e9ea0c5e..82df6a8da4 100644 --- a/protocols/Skype/src/skype.cpp +++ b/protocols/Skype/src/skype.cpp @@ -40,10 +40,9 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCO static CSkypeProto* SkypeProtoInit(const char* pszProtoName, const TCHAR* tszUserName) { - //CSkypeProto *ppro = new CSkypeProto(pszProtoName, tszUserName); - //g_Instances.insert(ppro); - //return ppro; - return 0; + CSkypeProto *ppro = new CSkypeProto(pszProtoName, tszUserName); + g_Instances.insert(ppro); + return ppro; } static int SkypeProtoUninit(CSkypeProto* ppro) @@ -55,14 +54,15 @@ static int SkypeProtoUninit(CSkypeProto* ppro) extern "C" int __declspec(dllexport) Load(void) { - //mir_getLP(&pluginInfo); + mir_getLP(&pluginInfo); - PROTOCOLDESCRIPTOR pd = { sizeof(pd) }; + PROTOCOLDESCRIPTOR pd = {0}; + pd.cbSize = sizeof(pd); pd.szName = "Skype"; pd.type = PROTOTYPE_PROTOCOL; pd.fnInit = (pfnInitProto)SkypeProtoInit; pd.fnUninit = (pfnUninitProto)SkypeProtoUninit; - CallService(MS_PROTO_REGISTERMODULE, 0, reinterpret_cast(&pd)); + CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); return 0; } diff --git a/protocols/Skype/src/skype.h b/protocols/Skype/src/skype.h index bc9dc36372..df4c355ef6 100644 --- a/protocols/Skype/src/skype.h +++ b/protocols/Skype/src/skype.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp index b01329ca4e..97ebdc4f8c 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -43,4 +43,12 @@ void CSkypeProto::Log( const char* fmt, ... ) va_end(va); CallService(MS_NETLIB_LOG, ( WPARAM )m_hNetlibUser, (LPARAM)msg); -} \ No newline at end of file +} + +void CSkypeProto::CreateProtoService(const char *szService, ServiceFunc serviceProc) +{ + char str[ MAXMODULELABELLENGTH ]; + strcpy( str, m_szModuleName ); + strcat( str, szService ); + ::CreateServiceFunctionObj( str, ( MIRANDASERVICEOBJ )*( void** )&serviceProc, this ); +} diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h index a4613fcb3b..405d2fa907 100644 --- a/protocols/Skype/src/skype_proto.h +++ b/protocols/Skype/src/skype_proto.h @@ -1,7 +1,5 @@ -#pragma once - -#include "skype.h" -#include +struct CSkypeProto; +typedef INT_PTR (__cdecl CSkypeProto::*ServiceFunc)(WPARAM, LPARAM); struct CSkypeProto : public PROTO_INTERFACE, public MZeroedObject { @@ -10,7 +8,7 @@ public: ~CSkypeProto(); // PROTO_INTERFACE - /*virtual HANDLE __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); + virtual HANDLE __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ); virtual HANDLE __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ); virtual int __cdecl Authorize( HANDLE hDbEvent ); @@ -55,10 +53,10 @@ public: virtual int __cdecl UserIsTyping( HANDLE hContact, int type ); - virtual int __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam );*/ + virtual int __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam ); -protected: HANDLE m_hNetlibUser; void Log( const char* fmt, ... ); + void CreateProtoService(const char* szService, ServiceFunc serviceProc); }; \ No newline at end of file -- cgit v1.2.3