summaryrefslogtreecommitdiff
path: root/include/m_core.h
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-08-11 10:41:37 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-08-11 10:41:37 +0000
commit94dcc72f13094157f344f284aec4edf0c0f5faa1 (patch)
tree74c078daadd4abe5aea9e9e0a73b4dd7c4a7fde1 /include/m_core.h
parent42ff2169dbddd25d06404623dba2fff222d17c73 (diff)
ProtoGetAvatarFormat, ProtoGetAvatarFileFormat, ProtoGetBufferFormat, ProtoGetAvatarExtension - standard helpers for protocol avatars' processing instead of the zoo that existed previously
git-svn-id: http://svn.miranda-ng.org/main/trunk@5645 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/m_core.h')
-rw-r--r--include/m_core.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/include/m_core.h b/include/m_core.h
index b99bbbafb1..9c4461b407 100644
--- a/include/m_core.h
+++ b/include/m_core.h
@@ -615,10 +615,29 @@ MIR_CORE_DLL(void) ProtoHookEvent(struct PROTO_INTERFACE *pThis, const char* s
MIR_CORE_DLL(HANDLE) ProtoCreateHookableEvent(struct PROTO_INTERFACE *pThis, const char* szService);
typedef INT_PTR (__cdecl PROTO_INTERFACE::*ProtoServiceFunc)(WPARAM, LPARAM);
-MIR_CORE_DLL(void) ProtoCreateService(struct PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFunc);
+MIR_CORE_DLL(void) ProtoCreateService(struct PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFunc);
typedef INT_PTR (__cdecl PROTO_INTERFACE::*ProtoServiceFuncParam)(WPARAM, LPARAM, LPARAM);
-MIR_CORE_DLL(void) ProtoCreateServiceParam(struct PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFuncParam, LPARAM);
+MIR_CORE_DLL(void) ProtoCreateServiceParam(struct PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFuncParam, LPARAM);
+#endif
+
+// avatar support functions
+
+// returns image extension by a PA_* constant or empty string for PA_FORMAT_UNKNOWN
+MIR_CORE_DLL(const TCHAR*) ProtoGetAvatarExtension(int format);
+
+// detects image format by extension
+MIR_CORE_DLL(int) ProtoGetAvatarFormat(const TCHAR *ptszFileName);
+
+// detects image format by its contents
+MIR_CORE_DLL(int) ProtoGetAvatarFileFormat(const TCHAR *ptszFileName);
+
+// returns the image format and extension by the first bytes of picture
+// ptszExtension might be NULL
+#if defined( __cplusplus )
+ MIR_CORE_DLL(int) ProtoGetBufferFormat(const void *buf, const TCHAR **ptszExtension = NULL);
+#else
+ MIR_CORE_DLL(int) ProtoGetBufferFormat(const void *buf, const TCHAR **ptszExtension);
#endif
///////////////////////////////////////////////////////////////////////////////