summaryrefslogtreecommitdiff
path: root/include/m_protoint.h
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-18 18:29:39 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-18 18:29:39 +0000
commitae30cd958593fae5c4d385045f5ba669b9dd4b50 (patch)
treef5e9c6afa5230fe971d07ad1d8d306028baf43e3 /include/m_protoint.h
parentb43b50d64b57b2f41ffebe2f50eb5976152b9ad1 (diff)
protocol platform-independent code moved back to mir_app
git-svn-id: http://svn.miranda-ng.org/main/trunk@14247 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/m_protoint.h')
-rw-r--r--include/m_protoint.h40
1 files changed, 39 insertions, 1 deletions
diff --git a/include/m_protoint.h b/include/m_protoint.h
index 1e75d08e15..fc2171ad32 100644
--- a/include/m_protoint.h
+++ b/include/m_protoint.h
@@ -30,6 +30,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_database.h>
#include <m_utils.h>
+/////////////////////////////////////////////////////////////////////////////////////////
+// data types
+
typedef enum
{
EV_PROTO_ONLOAD,
@@ -44,7 +47,42 @@ typedef enum
}
PROTOEVENTTYPE;
-struct MIR_CORE_EXPORT PROTO_INTERFACE : public MZeroedObject
+/////////////////////////////////////////////////////////////////////////////////////////
+// protocol helpers
+
+struct PROTO_INTERFACE;
+
+// Call it in the very beginning of your proto's constructor
+EXTERN_C MIR_APP_DLL(void) ProtoConstructor(PROTO_INTERFACE *pThis, const char *pszModuleName, const TCHAR *ptszUserName);
+
+// Call it in the very end of your proto's destructor
+EXTERN_C MIR_APP_DLL(void) ProtoDestructor(PROTO_INTERFACE *pThis);
+
+#if defined( __cplusplus )
+typedef void (__cdecl PROTO_INTERFACE::*ProtoThreadFunc)(void*);
+EXTERN_C MIR_APP_DLL(void) ProtoForkThread(PROTO_INTERFACE *pThis, ProtoThreadFunc, void *param);
+EXTERN_C MIR_APP_DLL(HANDLE) ProtoForkThreadEx(PROTO_INTERFACE *pThis, ProtoThreadFunc, void *param, UINT* threadID);
+EXTERN_C MIR_APP_DLL(void) ProtoWindowAdd(PROTO_INTERFACE *pThis, HWND hwnd);
+EXTERN_C MIR_APP_DLL(void) ProtoWindowRemove(PROTO_INTERFACE *pThis, HWND hwnd);
+
+typedef int (__cdecl PROTO_INTERFACE::*ProtoEventFunc)(WPARAM, LPARAM);
+EXTERN_C MIR_APP_DLL(void) ProtoHookEvent(PROTO_INTERFACE *pThis, const char* szName, ProtoEventFunc pFunc);
+EXTERN_C MIR_APP_DLL(HANDLE) ProtoCreateHookableEvent(PROTO_INTERFACE *pThis, const char* szService);
+
+typedef INT_PTR (__cdecl PROTO_INTERFACE::*ProtoServiceFunc)(WPARAM, LPARAM);
+EXTERN_C MIR_APP_DLL(void) ProtoCreateService(PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFunc);
+
+typedef INT_PTR (__cdecl PROTO_INTERFACE::*ProtoServiceFuncParam)(WPARAM, LPARAM, LPARAM);
+EXTERN_C MIR_APP_DLL(void) ProtoCreateServiceParam(PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFuncParam, LPARAM);
+#endif
+
+EXTERN_C MIR_APP_DLL(void) ProtoLogA(PROTO_INTERFACE *pThis, LPCSTR szFormat, va_list args);
+EXTERN_C MIR_APP_DLL(void) ProtoLogW(PROTO_INTERFACE *pThis, LPCWSTR wszFormat, va_list args);
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// interface declaration
+
+struct MIR_APP_EXPORT PROTO_INTERFACE : public MZeroedObject
{
int m_iStatus, // current protocol status
m_iDesiredStatus, // status to be set after logging in