summaryrefslogtreecommitdiff
path: root/protocols/Skype/src
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2012-09-27 16:31:32 +0000
committerAlexander Lantsev <aunsane@gmail.com>2012-09-27 16:31:32 +0000
commit7b20bdca3b22c66a58b2ecf2735cb32417496681 (patch)
tree9653fe495a2338586cdaec8ce2aee167ca631608 /protocols/Skype/src
parent93b1c035da40df23e3eef4a1efd10dfe9c451375 (diff)
- fixed previous commit issues
git-svn-id: http://svn.miranda-ng.org/main/trunk@1684 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src')
-rw-r--r--protocols/Skype/src/resource.hbin1256 -> 676 bytes
-rw-r--r--protocols/Skype/src/skype.h4
-rw-r--r--protocols/Skype/src/skype_dialogs.cpp32
-rw-r--r--protocols/Skype/src/skype_events.cpp8
-rw-r--r--protocols/Skype/src/skype_proto.cpp15
-rw-r--r--protocols/Skype/src/skype_proto.h22
-rw-r--r--protocols/Skype/src/skype_utils.cpp9
7 files changed, 59 insertions, 31 deletions
diff --git a/protocols/Skype/src/resource.h b/protocols/Skype/src/resource.h
index 55bc8b8b3f..dd62507289 100644
--- a/protocols/Skype/src/resource.h
+++ b/protocols/Skype/src/resource.h
Binary files differ
diff --git a/protocols/Skype/src/skype.h b/protocols/Skype/src/skype.h
index e71506b49b..49f0f59234 100644
--- a/protocols/Skype/src/skype.h
+++ b/protocols/Skype/src/skype.h
@@ -18,10 +18,10 @@
#include <m_database.h>
//#include <m_history.h>
//#include <m_idle.h>
-//#include <m_langpack.h>
+#include <m_langpack.h>
//#include <m_message.h>
#include <m_netlib.h>
-//#include <m_options.h>
+#include <m_options.h>
//#include <m_popup.h>
#include <m_protocols.h>
#include <m_protomod.h>
diff --git a/protocols/Skype/src/skype_dialogs.cpp b/protocols/Skype/src/skype_dialogs.cpp
index e22e50d7aa..4410d91364 100644
--- a/protocols/Skype/src/skype_dialogs.cpp
+++ b/protocols/Skype/src/skype_dialogs.cpp
@@ -71,27 +71,17 @@ INT_PTR CALLBACK CSkypeProto::SkypeAccountProc(HWND hwnd, UINT message, WPARAM w
return FALSE;
}
-INT_PTR __cdecl CSkypeProto::SvcCreateAccMgrUI(WPARAM wParam, LPARAM lParam)
-{
- return (int)CreateDialogParam(
- g_hInstance,
- MAKEINTRESOURCE(IDD_SKYPEACCOUNT),
- (HWND)lParam,
- &CSkypeProto::SkypeAccountProc, (LPARAM)this);
-}
-
-INT_PTR CALLBACK SkypeOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
+INT_PTR CALLBACK CSkypeProto::SkypeOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
{
CSkypeProto *proto;
switch (message)
{
-
case WM_INITDIALOG:
{
TranslateDialogDefault(hwnd);
- proto = reinterpret_cast<FacebookProto*>(lparam);
+ proto = reinterpret_cast<CSkypeProto*>(lparam);
SetWindowLongPtr(hwnd, GWLP_USERDATA, lparam);
DBVARIANT dbv;
@@ -119,7 +109,8 @@ INT_PTR CALLBACK SkypeOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM
}
return TRUE;
- case WM_COMMAND: {
+ case WM_COMMAND:
+ {
if (HIWORD(wparam) == EN_CHANGE && reinterpret_cast<HWND>(lparam) == GetFocus())
{
switch(LOWORD(wparam))
@@ -146,14 +137,23 @@ INT_PTR CALLBACK SkypeOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM
return TRUE;
}
- break;
-
+ }
+ break;
}
return FALSE;
}
-int CSkypeProto::OnOptionsInit(WPARAM wParam, LPARAM lParam)
+int __cdecl CSkypeProto::OnAccountManagerInit(WPARAM wParam, LPARAM lParam)
+{
+ return (int)CreateDialogParam(
+ g_hInstance,
+ MAKEINTRESOURCE(IDD_SKYPEACCOUNT),
+ (HWND)lParam,
+ &CSkypeProto::SkypeAccountProc, (LPARAM)this);
+}
+
+int __cdecl CSkypeProto::OnOptionsInit(WPARAM wParam, LPARAM lParam)
{
OPTIONSDIALOGPAGE odp = {0};
odp.cbSize = sizeof(odp);
diff --git a/protocols/Skype/src/skype_events.cpp b/protocols/Skype/src/skype_events.cpp
index 65d33fa4c4..d899e593b8 100644
--- a/protocols/Skype/src/skype_events.cpp
+++ b/protocols/Skype/src/skype_events.cpp
@@ -1,18 +1,18 @@
#include "skype_proto.h"
-void IconsLoad();
+//void IconsLoad();
int CSkypeProto::OnModulesLoaded(WPARAM, LPARAM)
{
- IconsLoad();
- HookEvent(ME_OPT_INITIALISE, &CSkypeProto::OnOptionsInit);
+ //IconsLoad();
+ this->HookEvent(ME_OPT_INITIALISE, &CSkypeProto::OnOptionsInit);
return 0;
}
int CSkypeProto::OnPreShutdown(WPARAM, LPARAM)
{
- SetStatus(ID_STATUS_OFFLINE);
+ this->SetStatus(ID_STATUS_OFFLINE);
return 0;
}
diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp
index 297a372cbb..ba3635274c 100644
--- a/protocols/Skype/src/skype_proto.cpp
+++ b/protocols/Skype/src/skype_proto.cpp
@@ -23,7 +23,7 @@ CSkypeProto::CSkypeProto(const char* protoName, const TCHAR* userName)
this->Log("Setting protocol/module name to '%s/%s'", m_szProtoName, m_szModuleName);
- this->CreateProtoService(PS_CREATEACCMGRUI, &CSkypeProto::SvcCreateAccMgrUI);
+ this->CreateService(PS_CREATEACCMGRUI, &CSkypeProto::OnAccountManagerInit);
}
CSkypeProto::~CSkypeProto()
@@ -107,12 +107,17 @@ int __cdecl CSkypeProto::SetAwayMsg( int m_iStatus, const TCHAR* msg ) { retu
int __cdecl CSkypeProto::UserIsTyping( HANDLE hContact, int type ) { return 0; }
-int __cdecl CSkypeProto::OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam )
+int __cdecl CSkypeProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
{
- switch ( eventType ) {
- case EV_PROTO_ONLOAD: return OnModulesLoaded( 0, 0 );
- case EV_PROTO_ONEXIT: return OnPreShutdown( 0, 0 );
+ switch (eventType)
+ {
+ case EV_PROTO_ONLOAD:
+ return this->OnModulesLoaded(0, 0);
+
+ case EV_PROTO_ONEXIT:
+ return this->OnPreShutdown(0, 0);
}
+
return 1;
}
diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h
index 7d25d5dd49..43a430c153 100644
--- a/protocols/Skype/src/skype_proto.h
+++ b/protocols/Skype/src/skype_proto.h
@@ -5,7 +5,11 @@
struct CSkypeProto;
+typedef void (__cdecl CSkypeProto::*SkypeThreadFunc) (void*);
typedef INT_PTR (__cdecl CSkypeProto::*SkypeServiceFunc)(WPARAM, LPARAM);
+typedef int (__cdecl CSkypeProto::*SkypeEventFunc)(WPARAM, LPARAM);
+typedef INT_PTR (__cdecl CSkypeProto::*SkypeServiceFuncParam)(WPARAM, LPARAM, LPARAM);
+
struct CSkypeProto : public PROTO_INTERFACE, public MZeroedObject
{
@@ -64,6 +68,7 @@ public:
int __cdecl OnModulesLoaded(WPARAM, LPARAM);
int __cdecl OnPreShutdown(WPARAM, LPARAM);
int __cdecl OnOptionsInit(WPARAM, LPARAM);
+ int __cdecl OnAccountManagerInit(WPARAM wParam, LPARAM lParam);
char* ModuleName();
bool IsOffline();
@@ -75,8 +80,19 @@ protected:
HANDLE hNetlibUser;
void Log( const char* fmt, ... );
- INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM wParam, LPARAM lParam);
- void CreateProtoService(const char* szService, SkypeServiceFunc serviceProc);
+
+
+
+ void CreateService(const char* szService, SkypeServiceFunc serviceProc);
+ //void CreateServiceParam(const char* szService, SkypeServiceFunc serviceProc, LPARAM lParam);
+
+ //HANDLE CreateHookableEvent(const char* szService);
+ void HookEvent(const char*, SkypeEventFunc);
+ //int SendBroadcast(HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam);
+
+ //void ForkThread(SkypeThreadFunc, void*);
+ //HANDLE ForkThreadEx(SkypeThreadFunc, void*, UINT* threadID = NULL);
+
TCHAR* GetSettingString(const char *szSetting, TCHAR* defVal = NULL);
TCHAR* GetSettingString(HANDLE hContact, const char *szSetting, TCHAR* defVal = NULL);
@@ -84,5 +100,7 @@ protected:
TCHAR* GetDecodeSettingString(const char *szSetting, TCHAR* defVal = NULL);
TCHAR* GetDecodeSettingString(HANDLE hContact, const char *szSetting, TCHAR* defVal = NULL);
+
static INT_PTR CALLBACK SkypeAccountProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
+ static INT_PTR CALLBACK SkypeOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
}; \ No newline at end of file
diff --git a/protocols/Skype/src/skype_utils.cpp b/protocols/Skype/src/skype_utils.cpp
index be141b3e75..1f218dfc08 100644
--- a/protocols/Skype/src/skype_utils.cpp
+++ b/protocols/Skype/src/skype_utils.cpp
@@ -9,10 +9,15 @@ void CSkypeProto::Log(const char* fmt, ...)
mir_vsnprintf(msg, sizeof(msg), fmt, va);
va_end(va);
- CallService(MS_NETLIB_LOG, ( WPARAM )this->hNetlibUser, (LPARAM)msg);
+ CallService(MS_NETLIB_LOG, (WPARAM)this->hNetlibUser, (LPARAM)msg);
}
-void CSkypeProto::CreateProtoService(const char* szService, SkypeServiceFunc serviceProc)
+void CSkypeProto::HookEvent(const char* szEvent, SkypeEventFunc handler)
+{
+ HookEventObj(szEvent, (MIRANDAHOOKOBJ)*( void**)&handler, this);
+}
+
+void CSkypeProto::CreateService(const char* szService, SkypeServiceFunc serviceProc)
{
char temp[MAX_PATH*2];