summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_utils.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2012-09-27 17:23:10 +0000
committerAlexander Lantsev <aunsane@gmail.com>2012-09-27 17:23:10 +0000
commit89c883cf565ac91bf21d1711f7c3972fb6281bf7 (patch)
tree89315d0fd74187b4cce86332c0a250fa9b13b51a /protocols/Skype/src/skype_utils.cpp
parent795fd3b5c0a366bd1455d4c0ae8a7d9bb474c348 (diff)
-- added proto caps
- added service function (creating and hoking services, events, threads) - some minir issues and code review git-svn-id: http://svn.miranda-ng.org/main/trunk@1687 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_utils.cpp')
-rw-r--r--protocols/Skype/src/skype_utils.cpp57
1 files changed, 53 insertions, 4 deletions
diff --git a/protocols/Skype/src/skype_utils.cpp b/protocols/Skype/src/skype_utils.cpp
index 1f218dfc08..66529fb097 100644
--- a/protocols/Skype/src/skype_utils.cpp
+++ b/protocols/Skype/src/skype_utils.cpp
@@ -12,15 +12,64 @@ void CSkypeProto::Log(const char* fmt, ...)
CallService(MS_NETLIB_LOG, (WPARAM)this->hNetlibUser, (LPARAM)msg);
}
+void CSkypeProto::CreateService(const char* szService, SkypeServiceFunc serviceProc)
+{
+ char moduleName[MAXMODULELABELLENGTH];
+
+ mir_snprintf(moduleName, sizeof(moduleName), "%s%s", this->m_szModuleName, szService);
+ CreateServiceFunctionObj(moduleName, (MIRANDASERVICEOBJ)*(void**)&serviceProc, this);
+}
+
+void CSkypeProto::CreateServiceParam(const char* szService, SkypeServiceFunc serviceProc, LPARAM lParam)
+{
+ char moduleName[MAXMODULELABELLENGTH];
+
+ mir_snprintf(moduleName, sizeof(moduleName), "%s%s", this->m_szModuleName, szService);
+ CreateServiceFunctionObjParam(moduleName, (MIRANDASERVICEOBJPARAM)*(void**)&serviceProc, this, lParam);
+}
+
+HANDLE CSkypeProto::CreateHookableEvent(const char* szService)
+{
+ char moduleName[MAXMODULELABELLENGTH];
+
+ mir_snprintf(moduleName, sizeof(moduleName), "%s%s", this->m_szModuleName, szService);
+ return CreateHookableEvent(moduleName);
+}
+
void CSkypeProto::HookEvent(const char* szEvent, SkypeEventFunc handler)
{
HookEventObj(szEvent, (MIRANDAHOOKOBJ)*( void**)&handler, this);
}
-void CSkypeProto::CreateService(const char* szService, SkypeServiceFunc serviceProc)
+int CSkypeProto::SendBroadcast(HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
{
- char temp[MAX_PATH*2];
+ ACKDATA ack = {0};
+ ack.cbSize = sizeof(ACKDATA);
+ ack.szModule = m_szModuleName;
+ ack.hContact = hContact;
+ ack.type = type;
+ ack.result = result;
+ ack.hProcess = hProcess;
+ ack.lParam = lParam;
+ return CallService(MS_PROTO_BROADCASTACK, 0, (LPARAM)&ack);
+}
- mir_snprintf(temp, sizeof(temp), "%s%s", this->m_szModuleName, szService);
- CreateServiceFunctionObj(temp, (MIRANDASERVICEOBJ)*(void**)&serviceProc, this);
+void CSkypeProto::ForkThread(SkypeThreadFunc pFunc, void *param)
+{
+ UINT threadID;
+ CloseHandle((HANDLE)mir_forkthreadowner(
+ (pThreadFuncOwner)*(void**)&pFunc,
+ this,
+ param,
+ &threadID));
+}
+
+HANDLE CSkypeProto::ForkThreadEx(SkypeThreadFunc pFunc, void *param, UINT* threadID)
+{
+ UINT lthreadID;
+ return (HANDLE)mir_forkthreadowner(
+ (pThreadFuncOwner)*(void**)&pFunc,
+ this,
+ param,
+ threadID ? threadID : &lthreadID);
} \ No newline at end of file