summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
commitddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch)
tree5d74f37a7013d13b92c182628d6b68a58e148ae4 /include
parentc39340bf493a1745a41317bbf937fc7eb6cbb26a (diff)
- HANDLE hContact => HCONTACT
- GCF_* prefix was added to chat constants to avoid name conflicts git-svn-id: http://svn.miranda-ng.org/main/trunk@8078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include')
-rw-r--r--include/m_addcontact.h8
-rw-r--r--include/m_avatars.h22
-rw-r--r--include/m_chat.h20
-rw-r--r--include/m_chat_int.h12
-rw-r--r--include/m_clist.h4
-rw-r--r--include/m_clistint.h36
-rw-r--r--include/m_contacts.h2
-rw-r--r--include/m_core.h72
-rw-r--r--include/m_database.h11
-rw-r--r--include/m_db_int.h2
-rw-r--r--include/m_extraicons.h12
-rw-r--r--include/m_jabber.h4
-rw-r--r--include/m_message.h14
-rw-r--r--include/m_popup.h11
-rw-r--r--include/m_protocols.h12
-rw-r--r--include/m_protoint.h70
-rw-r--r--include/m_protomod.h6
-rw-r--r--include/m_protosvc.h4
-rw-r--r--include/m_timezones.h22
-rw-r--r--include/m_utils.h20
20 files changed, 187 insertions, 177 deletions
diff --git a/include/m_addcontact.h b/include/m_addcontact.h
index ffba5c2ca2..383d9e48e8 100644
--- a/include/m_addcontact.h
+++ b/include/m_addcontact.h
@@ -26,10 +26,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define M_ADDCONTACT_H__ 1
typedef struct{
- int handleType; //one of the HANDLE_ constants
- HANDLE handle; //hDbEvent if acs.handleType == HANDLE_EVENT, hContact if acs.handleType == HANDLE_CONTACT, ignored if acs.handleType == HANDLE_SEARCHRESULT
- const char *szProto; //ignored if acs.handleType != HANDLE_SEARCHRESULT
- PROTOSEARCHRESULT *psr; //ignored if acs.handleType != HANDLE_SEARCHRESULT
+ int handleType; // one of the HANDLE_ constants
+ HANDLE handle; // hDbEvent if acs.handleType == HANDLE_EVENT, hContact if acs.handleType == HANDLE_CONTACT, ignored if acs.handleType == HANDLE_SEARCHRESULT
+ const char *szProto; // ignored if acs.handleType != HANDLE_SEARCHRESULT
+ PROTOSEARCHRESULT *psr; // ignored if acs.handleType != HANDLE_SEARCHRESULT
}ADDCONTACTSTRUCT;
/*
diff --git a/include/m_avatars.h b/include/m_avatars.h
index a91ca7ffb4..ce1e6eab69 100644
--- a/include/m_avatars.h
+++ b/include/m_avatars.h
@@ -56,6 +56,8 @@ unless AF_FETCHIFPROTONOTVISIBLE is set.
#ifndef _M_AVATARS_H
#define _M_AVATARS_H
+#include <m_core.h>
+
#define AVS_BITMAP_VALID 1
#define AVS_BITMAP_EXPIRED 2 // the bitmap has been expired from the cache. (unused, currently.
#define AVS_HIDEONCLIST 4
@@ -65,20 +67,20 @@ unless AF_FETCHIFPROTONOTVISIBLE is set.
#define AVS_PROTOPIC 16 // picture is a protocol picture
#define AVS_CUSTOMTRANSPBKG 32 // Bitmap was changed to set the background color transparent
#define AVS_HASTRANSPARENCY 64 // Bitmap has at least one pixel transparent
-#define AVS_OWNAVATAR 128 // is own avatar entry
+#define AVS_OWNAVATAR 128 // is own avatar entry
#define AVS_NOTREADY 4096
typedef struct avatarCacheEntry {
- DWORD cbSize; // set to sizeof(struct)
- HANDLE hContact; // contacts handle, 0, if it is a protocol avatar
- HBITMAP hbmPic; // bitmap handle of the picutre itself
- DWORD dwFlags; // see above for flag values
- LONG bmHeight, bmWidth; // bitmap dimensions
- DWORD t_lastAccess; // last access time (currently unused, but plugins should still
+ DWORD cbSize; // set to sizeof(struct)
+ HCONTACT hContact; // contacts handle, 0, if it is a protocol avatar
+ HBITMAP hbmPic; // bitmap handle of the picutre itself
+ DWORD dwFlags; // see above for flag values
+ LONG bmHeight, bmWidth; // bitmap dimensions
+ DWORD t_lastAccess; // last access time (currently unused, but plugins should still
// use it whenever they access the avatar. may be used in the future
- // to implement cache expiration
- LPVOID lpDIBSection; // unused field
- TCHAR szFilename[MAX_PATH]; // filename of the avatar (absolute path)
+ // to implement cache expiration
+ LPVOID lpDIBSection; // unused field
+ TCHAR szFilename[MAX_PATH]; // filename of the avatar (absolute path)
} AVATARCACHEENTRY;
#define AVDRQ_FALLBACKPROTO 0x0001 // use the protocol picture as fallback (currently not used)
diff --git a/include/m_chat.h b/include/m_chat.h
index 0845defe19..7f02c687e1 100644
--- a/include/m_chat.h
+++ b/include/m_chat.h
@@ -492,15 +492,15 @@ struct GCEVENT
*/
// Flags
-#define BYINDEX 0x0001 // iItem is valid and should contain the index of the session to get
-#define BYID 0x0002 // pszID is valid and should contain the ID of the session to get. This is the default if no
-#define HCONTACT 0x0004 // hContact is valid
-#define DATA 0x0008 // wItemData is valid
-#define ID 0x0010 // pszID is valid.
-#define NAME 0x0020 // pszName is valid
-#define TYPE 0x0040 // iType is valid
-#define COUNT 0x0080 // iCount is valid
-#define USERS 0x0100 // pszUsers is valid
+#define GCF_BYINDEX 0x0001 // iItem is valid and should contain the index of the session to get
+#define GCF_BYID 0x0002 // pszID is valid and should contain the ID of the session to get. This is the default if no
+#define GCF_HCONTACT 0x0004 // hContact is valid
+#define GCF_DATA 0x0008 // wItemData is valid
+#define GCF_ID 0x0010 // pszID is valid.
+#define GCF_NAME 0x0020 // pszName is valid
+#define GCF_TYPE 0x0040 // iType is valid
+#define GCF_COUNT 0x0080 // iCount is valid
+#define GCF_USERS 0x0100 // pszUsers is valid
// The GC_INFO structure
struct GC_INFO
@@ -515,7 +515,7 @@ struct GC_INFO
int iCount; // count of users in the nicklist
LPSTR pszUsers; // space separated string containing the UID's of the users in the user list.
// NOTE. Use Mirandas mmi_free() on the returned string.
- HANDLE hContact; // hContact for the session (can be NULL)
+ HCONTACT hContact; // hContact for the session (can be NULL)
};
#define MS_GC_GETINFO "GChat/GetInfo"
diff --git a/include/m_chat_int.h b/include/m_chat_int.h
index 98e14d30f7..a3b3c49548 100644
--- a/include/m_chat_int.h
+++ b/include/m_chat_int.h
@@ -209,7 +209,7 @@ struct GCSessionInfoBase
WORD wCommandsNum;
DWORD dwItemData;
DWORD dwFlags;
- HANDLE hContact;
+ HCONTACT hContact;
HWND hwndStatus;
time_t LastTime;
@@ -369,11 +369,11 @@ struct CHAT_MANAGER
BOOL (*LM_TrimLog)(LOGINFO** ppLogListStart, LOGINFO** ppLogListEnd, int iCount);
BOOL (*LM_RemoveAll)(LOGINFO** ppLogListStart, LOGINFO** ppLogListEnd);
- HANDLE (*AddRoom)(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisplayName, int iType);
- BOOL (*SetOffline)(HANDLE hContact, BOOL bHide);
+ HCONTACT (*AddRoom)(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisplayName, int iType);
+ BOOL (*SetOffline)(HCONTACT hContact, BOOL bHide);
BOOL (*SetAllOffline)(BOOL bHide, const char *pszModule);
- BOOL (*AddEvent)(HANDLE hContact, HICON hIcon, HANDLE hEvent, int type, TCHAR* fmt, ...);
- HANDLE (*FindRoom)(const char *pszModule, const TCHAR *pszRoom);
+ BOOL (*AddEvent)(HCONTACT hContact, HICON hIcon, HANDLE hEvent, int type, TCHAR* fmt, ...);
+ HCONTACT (*FindRoom)(const char *pszModule, const TCHAR *pszRoom);
char* (*Log_CreateRTF)(LOGSTREAMDATA *streamData);
char* (*Log_CreateRtfHeader)(MODULEINFO *mi);
@@ -386,7 +386,7 @@ struct CHAT_MANAGER
BOOL (*DoSoundsFlashPopupTrayStuff)(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight, int bManyFix);
BOOL (*DoTrayIcon)(SESSION_INFO *si, GCEVENT *gce);
BOOL (*DoPopup)(SESSION_INFO *si, GCEVENT *gce);
- int (*ShowPopup)(HANDLE hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...);
+ int (*ShowPopup)(HCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...);
BOOL (*LogToFile)(SESSION_INFO *si, GCEVENT *gce);
TCHAR* (*GetChatLogsFilename)(SESSION_INFO *si, time_t tTime);
char* (*Log_SetStyle)(int style);
diff --git a/include/m_clist.h b/include/m_clist.h
index 5b198fd9b4..31df4f723d 100644
--- a/include/m_clist.h
+++ b/include/m_clist.h
@@ -31,6 +31,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "statusmodes.h"
+#include <m_core.h>
+
extern int hLangpack;
#if defined _STATIC
@@ -283,7 +285,7 @@ sense to store all this information in memory, etc.
//bypasses the double-click.
typedef struct {
int cbSize; //size in bytes of this structure
- HANDLE hContact; //handle to the contact to put the icon by
+ HCONTACT hContact; //handle to the contact to put the icon by
HICON hIcon; //icon to flash
DWORD flags; //...of course
union
diff --git a/include/m_clistint.h b/include/m_clistint.h
index 8cda5111f7..d72c6738e3 100644
--- a/include/m_clistint.h
+++ b/include/m_clistint.h
@@ -107,7 +107,7 @@ struct ClcContactBase
union {
struct {
int iImage;
- HANDLE hContact;
+ HCONTACT hContact;
};
struct {
WORD groupId;
@@ -244,7 +244,7 @@ typedef struct {
typedef struct
{
- HANDLE hContact;
+ HCONTACT hContact;
TCHAR* tszName;
TCHAR* tszGroup;
int bIsHidden;
@@ -290,9 +290,9 @@ typedef struct
int (*pfnAddInfoItemToGroup)(ClcGroup *group, int flags, const TCHAR *pszText);
int (*pfnAddItemToGroup)(ClcGroup *group, int iAboveItem);
- int (*pfnAddContactToGroup)(struct ClcData *dat, ClcGroup *group, HANDLE hContact);
- void (*pfnAddContactToTree)(HWND hwnd, struct ClcData *dat, HANDLE hContact, int updateTotalCount, int checkHideOffline);
- void (*pfnDeleteItemFromTree)(HWND hwnd, HANDLE hItem);
+ int (*pfnAddContactToGroup)(struct ClcData *dat, ClcGroup *group, HCONTACT hContact);
+ void (*pfnAddContactToTree)(HWND hwnd, struct ClcData *dat, HCONTACT hContact, int updateTotalCount, int checkHideOffline);
+ void (*pfnDeleteItemFromTree)(HWND hwnd, HCONTACT hItem);
void (*pfnRebuildEntireList)(HWND hwnd, struct ClcData *dat);
int (*pfnGetGroupContentsCount)(ClcGroup *group, int visibleOnly);
void (*pfnSortCLC)(HWND hwnd, struct ClcData *dat, int useInsertionSort);
@@ -321,7 +321,7 @@ typedef struct
int (*pfnClcStatusToPf2)(int status);
int (*pfnIsHiddenMode)(struct ClcData *dat, int status);
void (*pfnHideInfoTip)(HWND hwnd, struct ClcData *dat);
- void (*pfnNotifyNewContact)(HWND hwnd, HANDLE hContact);
+ void (*pfnNotifyNewContact)(HWND hwnd, HCONTACT hContact);
DWORD (*pfnGetDefaultExStyle)(void);
void (*pfnGetDefaultFontSetting)(int i, LOGFONT* lf, COLORREF* colour);
void (*pfnGetFontSetting)(int i, LOGFONT* lf, COLORREF* colour);
@@ -337,22 +337,22 @@ typedef struct
int (*pfnRowHitTest)(struct ClcData *dat, int y);
/* clistevents.c */
- int (*pfnEventsProcessContactDoubleClick)(HANDLE hContact);
+ int (*pfnEventsProcessContactDoubleClick)(HCONTACT hContact);
int (*pfnEventsProcessTrayDoubleClick)(int);
/* clistmod.c */
- int (*pfnIconFromStatusMode)(const char *szProto, int status, HANDLE hContact);
+ int (*pfnIconFromStatusMode)(const char *szProto, int status, HCONTACT hContact);
int (*pfnShowHide)(WPARAM, LPARAM);
TCHAR* (*pfnGetStatusModeDescription)(int mode, int flags);
/* clistsettings.c */
- ClcCacheEntry* (*pfnGetCacheEntry)(HANDLE hContact);
- ClcCacheEntry* (*pfnCreateCacheItem)(HANDLE hContact);
+ ClcCacheEntry* (*pfnGetCacheEntry)(HCONTACT hContact);
+ ClcCacheEntry* (*pfnCreateCacheItem)(HCONTACT hContact);
void (*pfnCheckCacheItem)(ClcCacheEntry*);
void (*pfnFreeCacheItem)(ClcCacheEntry*);
- TCHAR* (*pfnGetContactDisplayName)(HANDLE hContact, int mode);
- void (*pfnInvalidateDisplayNameCacheEntry)(HANDLE hContact);
+ TCHAR* (*pfnGetContactDisplayName)(HCONTACT hContact, int mode);
+ void (*pfnInvalidateDisplayNameCacheEntry)(HCONTACT hContact);
/* clisttray.c */
void (*pfnTrayIconUpdateWithImageList)(int iImage, const TCHAR *szNewTip, char *szPreferredProto);
@@ -373,7 +373,7 @@ typedef struct
void (*pfnOnCreateClc)(void);
/* contact.c */
- void (*pfnChangeContactIcon)(HANDLE hContact, int iIcon, int add);
+ void (*pfnChangeContactIcon)(HCONTACT hContact, int iIcon, int add);
void (*pfnLoadContactTree)(void);
int (*pfnCompareContacts)(const ClcContact *contact1, const ClcContact *contact2);
void (*pfnSortContacts)(void);
@@ -402,9 +402,9 @@ typedef struct
void (*pfnFreeEvent)(struct CListEvent*);
struct CListEvent* (*pfnAddEvent)(CLISTEVENT*);
- CLISTEVENT* (*pfnGetEvent)(HANDLE hContact, int idx);
+ CLISTEVENT* (*pfnGetEvent)(HCONTACT hContact, int idx);
- int (*pfnRemoveEvent)(HANDLE hContact, HANDLE hDbEvent);
+ int (*pfnRemoveEvent)(HCONTACT hContact, HANDLE hDbEvent);
int (*pfnGetImlIconIndex)(HICON hIcon);
/*************************************************************************************
@@ -443,7 +443,7 @@ typedef struct
TCHAR* szTip;
BOOL bTrayMenuOnScreen;
- HICON (*pfnGetIconFromStatusMode)(HANDLE hContact, const char *szProto, int status);
+ HICON (*pfnGetIconFromStatusMode)(HCONTACT hContact, const char *szProto, int status);
void (*pfnInitTray)(void);
int (*pfnTrayIconAdd)(HWND hwnd, const char *szProto, const char *szIconProto, int status);
@@ -471,12 +471,12 @@ typedef struct
* version 7 additions (0.11.0.x) - extra images
*************************************************************************************/
void (*pfnReloadExtraIcons)(void);
- void (*pfnSetAllExtraIcons)(HANDLE hContact);
+ void (*pfnSetAllExtraIcons)(HCONTACT hContact);
/*************************************************************************************
* Miranda NG additions
*************************************************************************************/
- int (*pfnGetContactIcon)(HANDLE hContact);
+ int (*pfnGetContactIcon)(HCONTACT hContact);
int (*pfnTrayCalcChanged)(const char *szChangedProto, int averageMode, int iProtoCount);
int (*pfnGetAverageMode)(int *pNetProtoCount);
diff --git a/include/m_contacts.h b/include/m_contacts.h
index 1e57e90ab2..c77f18e446 100644
--- a/include/m_contacts.h
+++ b/include/m_contacts.h
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
typedef struct {
int cbSize;
BYTE dwFlag;
- HANDLE hContact;
+ HCONTACT hContact;
char *szProto;
BYTE type;
union {
diff --git a/include/m_core.h b/include/m_core.h
index 4f77e965a5..803185233a 100644
--- a/include/m_core.h
+++ b/include/m_core.h
@@ -48,6 +48,8 @@ MIR_CORE_DLL(LPCTSTR) CmdLine_GetOption(LPCTSTR ptszParameter);
///////////////////////////////////////////////////////////////////////////////
// database functions
+DECLARE_HANDLE(HCONTACT);
+
typedef UINT32 MCONTACT;
#define INVALID_CONTACT_ID (MCONTACT(-1))
@@ -125,9 +127,9 @@ are no contacts in the db.
*/
#if defined(__cplusplus)
- MIR_CORE_DLL(HANDLE) db_find_first(const char *szProto = NULL);
+ MIR_CORE_DLL(HCONTACT) db_find_first(const char *szProto = NULL);
#else
- MIR_CORE_DLL(HANDLE) db_find_first(const char *szProto);
+ MIR_CORE_DLL(HCONTACT) db_find_first(const char *szProto);
#endif
/*
@@ -139,9 +141,9 @@ hContact was the last contact in the db or hContact was invalid.
*/
#if defined(__cplusplus)
- MIR_CORE_DLL(HANDLE) db_find_next(HANDLE hContact, const char *szProto = NULL);
+ MIR_CORE_DLL(HCONTACT) db_find_next(HCONTACT hContact, const char *szProto = NULL);
#else
- MIR_CORE_DLL(HANDLE) db_find_next(HANDLE hContact, const char *szProto);
+ MIR_CORE_DLL(HCONTACT) db_find_next(HCONTACT hContact, const char *szProto);
#endif
/******************************************************************************
@@ -170,7 +172,7 @@ db/time/x below with useful stuff for dealing with it.
#define EVENTTYPE_AUTHREQUEST 1001 //specific codes, hence the module-
#define EVENTTYPE_FILE 1002 //specific limit has been raised to 2000
-MIR_CORE_DLL(HANDLE) db_event_add(HANDLE hContact, DBEVENTINFO *dbei);
+MIR_CORE_DLL(HANDLE) db_event_add(HCONTACT hContact, DBEVENTINFO *dbei);
/*
Gets the number of events in the chain belonging to a contact in the database.
@@ -178,7 +180,7 @@ Returns the number of events in the chain owned by hContact or -1 if hContact
is invalid. They can be retrieved using the db_event_first/last() services.
*/
-MIR_CORE_DLL(int) db_event_count(HANDLE hContact);
+MIR_CORE_DLL(int) db_event_count(HCONTACT hContact);
/*
Removes a single event from the database
@@ -187,7 +189,7 @@ Returns 0 on success, or nonzero if hDbEvent was invalid
Triggers a db/event/deleted event just *before* the event is deleted
*/
-MIR_CORE_DLL(int) db_event_delete(HANDLE hContact, HANDLE hDbEvent);
+MIR_CORE_DLL(int) db_event_delete(HCONTACT hContact, HANDLE hDbEvent);
/*
Retrieves a handle to the first event in the chain for hContact
@@ -195,7 +197,7 @@ Returns the handle, or NULL if hContact is invalid or has no events
Events in a chain are sorted chronologically automatically
*/
-MIR_CORE_DLL(HANDLE) db_event_first(HANDLE hContact);
+MIR_CORE_DLL(HANDLE) db_event_first(HCONTACT hContact);
/*
Retrieves a handle to the first unread event in the chain for hContact
@@ -209,7 +211,7 @@ This service is designed for startup, reloading all the events that remained
unread from last time
*/
-MIR_CORE_DLL(HANDLE) db_event_firstUnread(HANDLE hContact);
+MIR_CORE_DLL(HANDLE) db_event_firstUnread(HCONTACT hContact);
/*
Retrieves all the information stored in hDbEvent
@@ -246,7 +248,7 @@ This service is exceptionally slow. Use only when you have no other choice at
all.
*/
-MIR_CORE_DLL(HANDLE) db_event_getContact(HANDLE hDbEvent);
+MIR_CORE_DLL(HCONTACT) db_event_getContact(HANDLE hDbEvent);
/*
Retrieves a handle to the last event in the chain for hContact
@@ -254,7 +256,7 @@ Returns the handle, or NULL if hContact is invalid or has no events
Events in a chain are sorted chronologically automatically
*/
-MIR_CORE_DLL(HANDLE) db_event_last(HANDLE hDbEvent);
+MIR_CORE_DLL(HANDLE) db_event_last(HCONTACT hContact);
/*
Changes the flags for an event to mark it as read.
@@ -265,7 +267,7 @@ This is the one database write operation that does not trigger an event.
Modules should not save flags states for any length of time.
*/
-MIR_CORE_DLL(int) db_event_markRead(HANDLE hContact, HANDLE hDbEvent);
+MIR_CORE_DLL(int) db_event_markRead(HCONTACT hContact, HANDLE hDbEvent);
/*
Retrieves a handle to the next event in a chain after hDbEvent
@@ -287,33 +289,33 @@ MIR_CORE_DLL(HANDLE) db_event_prev(HANDLE hDbEvent);
* DATABASE SETTINGS
*/
-MIR_CORE_DLL(INT_PTR) db_get(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
-MIR_CORE_DLL(int) db_get_b(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, int errorValue);
-MIR_CORE_DLL(int) db_get_w(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, int errorValue);
-MIR_CORE_DLL(DWORD) db_get_dw(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, DWORD errorValue);
-MIR_CORE_DLL(char*) db_get_sa(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting);
-MIR_CORE_DLL(WCHAR*) db_get_wsa(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting);
+MIR_CORE_DLL(INT_PTR) db_get(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
+MIR_CORE_DLL(int) db_get_b(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, int errorValue);
+MIR_CORE_DLL(int) db_get_w(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, int errorValue);
+MIR_CORE_DLL(DWORD) db_get_dw(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, DWORD errorValue);
+MIR_CORE_DLL(char*) db_get_sa(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting);
+MIR_CORE_DLL(WCHAR*) db_get_wsa(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting);
-MIR_CORE_DLL(int) db_get_static(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, char *pDest, int cbDest);
-MIR_CORE_DLL(int) db_get_static_utf(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, char *pDest, int cbDest);
-MIR_CORE_DLL(int) db_get_wstatic(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, WCHAR *pDest, int cbDest);
+MIR_CORE_DLL(int) db_get_static(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, char *pDest, int cbDest);
+MIR_CORE_DLL(int) db_get_static_utf(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, char *pDest, int cbDest);
+MIR_CORE_DLL(int) db_get_wstatic(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, WCHAR *pDest, int cbDest);
#if defined(__cplusplus)
- MIR_CORE_DLL(INT_PTR) db_get_s(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv, const int nType=DBVT_ASCIIZ);
+ MIR_CORE_DLL(INT_PTR) db_get_s(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv, const int nType=DBVT_ASCIIZ);
#else
- MIR_CORE_DLL(INT_PTR) db_get_s(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv, const int nType);
+ MIR_CORE_DLL(INT_PTR) db_get_s(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv, const int nType);
#endif
-MIR_CORE_DLL(INT_PTR) db_set(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
-MIR_CORE_DLL(INT_PTR) db_set_b(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, BYTE val);
-MIR_CORE_DLL(INT_PTR) db_set_w(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, WORD val);
-MIR_CORE_DLL(INT_PTR) db_set_dw(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, DWORD val);
-MIR_CORE_DLL(INT_PTR) db_set_s(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, LPCSTR val);
-MIR_CORE_DLL(INT_PTR) db_set_ws(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, LPCWSTR val);
-MIR_CORE_DLL(INT_PTR) db_set_utf(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, LPCSTR val);
-MIR_CORE_DLL(INT_PTR) db_set_blob(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, void *val, unsigned len);
+MIR_CORE_DLL(INT_PTR) db_set(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
+MIR_CORE_DLL(INT_PTR) db_set_b(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, BYTE val);
+MIR_CORE_DLL(INT_PTR) db_set_w(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, WORD val);
+MIR_CORE_DLL(INT_PTR) db_set_dw(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, DWORD val);
+MIR_CORE_DLL(INT_PTR) db_set_s(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, LPCSTR val);
+MIR_CORE_DLL(INT_PTR) db_set_ws(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, LPCWSTR val);
+MIR_CORE_DLL(INT_PTR) db_set_utf(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, LPCSTR val);
+MIR_CORE_DLL(INT_PTR) db_set_blob(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting, void *val, unsigned len);
-MIR_CORE_DLL(INT_PTR) db_unset(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting);
+MIR_CORE_DLL(INT_PTR) db_unset(HCONTACT hContact, LPCSTR szModule, LPCSTR szSetting);
#if defined(__cplusplus)
MIR_CORE_DLL(BOOL) db_set_resident(LPCSTR szModule, const char *szService, BOOL bEnable=TRUE);
@@ -388,10 +390,10 @@ MIR_CORE_DLL(void) KillModuleServices(HINSTANCE hInst);
MIR_CORE_DLL(void) KillObjectServices(void* pObject);
#if defined(_STATIC)
-__declspec(dllexport) INT_PTR CallContactService(HANDLE, const char *, WPARAM, LPARAM);
+__declspec(dllexport) INT_PTR CallContactService(HCONTACT, const char *, WPARAM, LPARAM);
__declspec(dllexport) INT_PTR CallProtoService(LPCSTR szModule, const char *szService, WPARAM wParam, LPARAM lParam);
#else
-MIR_C_CORE_DLL(INT_PTR) CallContactService(HANDLE, const char *, WPARAM, LPARAM);
+MIR_C_CORE_DLL(INT_PTR) CallContactService(HCONTACT, const char *, WPARAM, LPARAM);
MIR_C_CORE_DLL(INT_PTR) CallProtoService(LPCSTR szModule, const char *szService, WPARAM wParam, LPARAM lParam);
#endif
@@ -614,7 +616,7 @@ MIR_CORE_DLL(int) mir_vsnwprintf(WCHAR *buffer, size_t count, const WCHAR* fm
MIR_CORE_DLL(INT_PTR) ProtoCallService(LPCSTR szModule, const char *szService, WPARAM wParam, LPARAM lParam);
MIR_CORE_DLL(int) ProtoServiceExists(LPCSTR szModule, const char *szService);
-MIR_CORE_DLL(INT_PTR) ProtoBroadcastAck(LPCSTR szModule, HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam);
+MIR_CORE_DLL(INT_PTR) ProtoBroadcastAck(LPCSTR szModule, HCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam);
// Call it in the very beginning of your proto's constructor
MIR_CORE_DLL(void) ProtoConstructor(struct PROTO_INTERFACE *pThis, const char *pszModuleName, const TCHAR *ptszUserName);
diff --git a/include/m_database.h b/include/m_database.h
index b69663387e..a4891d6a4f 100644
--- a/include/m_database.h
+++ b/include/m_database.h
@@ -264,8 +264,9 @@ Returns DBEVENTTYPEDESCR* or NULL, if an event isn't found.
#define MS_DB_EVENT_GETTYPE "DB/EventType/Get"
-__forceinline HANDLE DbGetAuthEventContact(DBEVENTINFO* dbei)
-{ return (HANDLE)(*(DWORD*)&dbei->pBlob[sizeof(DWORD)]);
+__forceinline HCONTACT DbGetAuthEventContact(DBEVENTINFO* dbei)
+{
+ return (HCONTACT)(*(DWORD*)&dbei->pBlob[sizeof(DWORD)]);
}
/* DB/Event/GetText (0.7.0+)
@@ -530,19 +531,19 @@ don't change any of the members.
/* inlined range tolerate versions */
-__inline BYTE DBGetContactSettingRangedByte(HANDLE hContact, const char *szModule, const char *szSetting, BYTE errorValue, BYTE minValue, BYTE maxValue)
+__inline BYTE DBGetContactSettingRangedByte(HCONTACT hContact, const char *szModule, const char *szSetting, BYTE errorValue, BYTE minValue, BYTE maxValue)
{
BYTE bVal = db_get_b(hContact, szModule, szSetting, errorValue);
return (bVal < minValue || bVal > maxValue) ? errorValue : bVal;
}
-__inline WORD DBGetContactSettingRangedWord(HANDLE hContact, const char *szModule, const char *szSetting, WORD errorValue, WORD minValue, WORD maxValue)
+__inline WORD DBGetContactSettingRangedWord(HCONTACT hContact, const char *szModule, const char *szSetting, WORD errorValue, WORD minValue, WORD maxValue)
{
WORD wVal = db_get_w(hContact, szModule, szSetting, errorValue);
return (wVal < minValue || wVal > maxValue) ? errorValue : wVal;
}
-__inline DWORD DBGetContactSettingRangedDword(HANDLE hContact, const char *szModule, const char *szSetting, DWORD errorValue, DWORD minValue, DWORD maxValue)
+__inline DWORD DBGetContactSettingRangedDword(HCONTACT hContact, const char *szModule, const char *szSetting, DWORD errorValue, DWORD minValue, DWORD maxValue)
{
DWORD dwVal = db_get_dw(hContact, szModule, szSetting, errorValue);
return (dwVal < minValue || dwVal > maxValue) ? errorValue : dwVal;
diff --git a/include/m_db_int.h b/include/m_db_int.h
index 81a6c3a433..1a0ee644ed 100644
--- a/include/m_db_int.h
+++ b/include/m_db_int.h
@@ -86,7 +86,7 @@ interface MIDatabase
STDMETHOD_(LONG,GetBlobSize)(HANDLE hDbEvent) PURE;
STDMETHOD_(BOOL,GetEvent)(HANDLE hDbEvent, DBEVENTINFO *dbe) PURE;
STDMETHOD_(BOOL,MarkEventRead)(MCONTACT contactID, HANDLE hDbEvent) PURE;
- STDMETHOD_(HANDLE,GetEventContact)(HANDLE hDbEvent) PURE;
+ STDMETHOD_(MCONTACT,GetEventContact)(HANDLE hDbEvent) PURE;
STDMETHOD_(HANDLE,FindFirstEvent)(MCONTACT contactID) PURE;
STDMETHOD_(HANDLE,FindFirstUnreadEvent)(MCONTACT contactID) PURE;
STDMETHOD_(HANDLE,FindLastEvent)(MCONTACT contactID) PURE;
diff --git a/include/m_extraicons.h b/include/m_extraicons.h
index f6feb26397..e67eec4905 100644
--- a/include/m_extraicons.h
+++ b/include/m_extraicons.h
@@ -95,14 +95,14 @@ typedef struct {
MIRANDAHOOK RebuildIcons;
// Callback to set the icon to clist, calling MS_CLIST_EXTRA_SET_ICON or MS_EXTRAICON_SET_ICON
- // wParam = HANDLE hContact
+ // wParam = HCONTACT hContact
// lParam = 0
MIRANDAHOOK ApplyIcon;
// Other optional callbacks
// [Optional] Callback called when extra icon was clicked
- // wParam = HANDLE hContact
+ // wParam = HCONTACT hContact
// lParam = int slot
// param = onClickParam
MIRANDAHOOKPARAM OnClick;
@@ -122,7 +122,7 @@ typedef struct {
typedef struct {
int cbSize;
HANDLE hExtraIcon; // Value returned by MS_EXTRAICON_REGISTER
- HANDLE hContact; // Contact to set the extra icon
+ HCONTACT hContact; // Contact to set the extra icon
union { // The icon to be set. This depends on the type of the extra icon:
HANDLE hImage; // Value returned by MS_CLIST_EXTRA_ADD_ICON (if EXTRAICON_TYPE_CALLBACK)
// or the icolib icon handle (if EXTRAICON_TYPE_ICOLIB)
@@ -185,7 +185,7 @@ static HANDLE ExtraIcon_Register(
return (HANDLE) CallService(MS_EXTRAICON_REGISTER, (WPARAM) &ei, hLangpack);
}
-static int ExtraIcon_SetIcon(HANDLE hExtraIcon, HANDLE hContact, HANDLE hImage)
+static int ExtraIcon_SetIcon(HANDLE hExtraIcon, HCONTACT hContact, HANDLE hImage)
{
EXTRAICON ei = { sizeof(ei) };
ei.hExtraIcon = hExtraIcon;
@@ -195,7 +195,7 @@ static int ExtraIcon_SetIcon(HANDLE hExtraIcon, HANDLE hContact, HANDLE hImage)
return CallService(MS_EXTRAICON_SET_ICON, (WPARAM) &ei, 0);
}
-static int ExtraIcon_SetIcon(HANDLE hExtraIcon, HANDLE hContact, const char *icoName)
+static int ExtraIcon_SetIcon(HANDLE hExtraIcon, HCONTACT hContact, const char *icoName)
{
EXTRAICON ei = { sizeof(ei) };
ei.hExtraIcon = hExtraIcon;
@@ -205,7 +205,7 @@ static int ExtraIcon_SetIcon(HANDLE hExtraIcon, HANDLE hContact, const char *ico
return CallService(MS_EXTRAICON_SET_ICON_BY_NAME, (WPARAM) &ei, 0);
}
-static int ExtraIcon_Clear(HANDLE hExtraIcon, HANDLE hContact)
+static int ExtraIcon_Clear(HANDLE hExtraIcon, HCONTACT hContact)
{
EXTRAICON ei = { sizeof(ei) };
ei.hExtraIcon = hExtraIcon;
diff --git a/include/m_jabber.h b/include/m_jabber.h
index 4484baa87e..97489b0d39 100644
--- a/include/m_jabber.h
+++ b/include/m_jabber.h
@@ -105,10 +105,10 @@ struct IJabberInterface
virtual int STDMETHODCALLTYPE CompareJIDs(LPCTSTR jid1, LPCTSTR jid2) = 0;
// Returns contact handle for given JID, or NULL on error.
- virtual HANDLE STDMETHODCALLTYPE ContactFromJID(LPCTSTR jid) = 0;
+ virtual HCONTACT STDMETHODCALLTYPE ContactFromJID(LPCTSTR jid) = 0;
// Returns JID of hContact, or NULL on error. You must free the result using mir_free().
- virtual LPTSTR STDMETHODCALLTYPE ContactToJID(HANDLE hContact) = 0;
+ virtual LPTSTR STDMETHODCALLTYPE ContactToJID(HCONTACT hContact) = 0;
// Returns best resource name for given JID, or NULL on error. You must free the result using mir_free().
virtual LPTSTR STDMETHODCALLTYPE GetBestResourceName(LPCTSTR jid) = 0;
diff --git a/include/m_message.h b/include/m_message.h
index 3fd5188fce..277084e113 100644
--- a/include/m_message.h
+++ b/include/m_message.h
@@ -62,7 +62,7 @@ extern int hLangpack;
typedef struct {
int cbSize;
- HANDLE hContact;
+ HCONTACT hContact;
HWND hwndWindow; // top level window for the contact
const char* szModule; // used to get plugin type (which means you could use local if needed)
unsigned int uType; // see event types above
@@ -90,7 +90,7 @@ typedef struct {
typedef struct {
int cbSize;
- HANDLE hContact;
+ HCONTACT hContact;
int uFlags; // see uflags above
} MessageWindowInputData;
@@ -101,7 +101,7 @@ typedef struct {
typedef struct {
int cbSize;
- HANDLE hContact;
+ HCONTACT hContact;
int uFlags; // should be same as input data unless 0, then it will be the actual type
HWND hwndWindow; //top level window for the contact or NULL if no window exists
int uState; // see window states
@@ -121,7 +121,7 @@ typedef struct {
typedef struct {
int cbSize;
int seq; // number returned by PSS_MESSAGE
- HANDLE hContact;
+ HCONTACT hContact;
DBEVENTINFO *dbei; // database event written on the basis of message sent
} MessageWindowEvent;
@@ -146,7 +146,7 @@ typedef struct {
int cbSize;
unsigned int uType; // see popup types above
unsigned int uFlags; // used to indicate in which window the popup was requested
- HANDLE hContact;
+ HCONTACT hContact;
HWND hwnd; // window where the popup was requested
HMENU hMenu; // The handle to the menu
POINT pt; // The point, in screen coords
@@ -213,7 +213,7 @@ __forceinline void Srmm_RemoveIcon(StatusIconData *sid)
// if either hIcon, hIconDisabled or szTooltip is null, they will not be modified
#define MS_MSG_MODIFYICON "MessageAPI/ModifyIcon"
-__forceinline void Srmm_ModifyIcon(HANDLE hContact, StatusIconData *sid)
+__forceinline void Srmm_ModifyIcon(HCONTACT hContact, StatusIconData *sid)
{ CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)sid);
}
@@ -222,7 +222,7 @@ __forceinline void Srmm_ModifyIcon(HANDLE hContact, StatusIconData *sid)
// returns (StatusIconData*)icon description filled for the required contact
// don't free this memory.
-__forceinline StatusIconData* Srmm_GetNthIcon(HANDLE hContact, int index)
+__forceinline StatusIconData* Srmm_GetNthIcon(HCONTACT hContact, int index)
{ return (StatusIconData*)CallService("MessageAPI/GetNthIcon", (WPARAM)hContact, index);
}
diff --git a/include/m_popup.h b/include/m_popup.h
index 9109dd33bb..72f3d11b62 100644
--- a/include/m_popup.h
+++ b/include/m_popup.h
@@ -32,7 +32,7 @@ mi.position = 0; //You don't need it and it's better if you put it to zero.
// Extended popup data
typedef struct
{
- HANDLE lchContact;
+ HCONTACT lchContact;
HICON lchIcon;
union
{
@@ -55,7 +55,7 @@ typedef struct
// Unicode version of POPUPDATA
typedef struct
{
- HANDLE lchContact;
+ HCONTACT lchContact;
HICON lchIcon;
union
{
@@ -130,8 +130,9 @@ lParam = 0;
Returns: the HANDLE of the contact. Can return NULL, meaning it's the main contact. -1 means failure.
*/
#define MS_POPUP_GETCONTACT "Popup/GetContact"
-static HANDLE __inline PUGetContact(HWND hPopupWindow) {
- return (HANDLE)CallService(MS_POPUP_GETCONTACT, (WPARAM)hPopupWindow, 0);
+static HCONTACT __inline PUGetContact(HWND hPopupWindow)
+{
+ return (HCONTACT)CallService(MS_POPUP_GETCONTACT, (WPARAM)hPopupWindow, 0);
}
/* Popup/GetPluginData
@@ -374,7 +375,7 @@ typedef struct {
const TCHAR *ptszText;
};
void *PluginData;
- HANDLE hContact;
+ HCONTACT hContact;
} POPUPDATACLASS;
// wParam = 0
diff --git a/include/m_protocols.h b/include/m_protocols.h
index b34b8d8f50..6907f5197e 100644
--- a/include/m_protocols.h
+++ b/include/m_protocols.h
@@ -37,7 +37,7 @@ struct PROTO_INTERFACE;
//returns the value as documented in the PS_ definition (m_protosvc.h)
typedef struct {
- HANDLE hContact;
+ HCONTACT hContact;
const char *szProtoService; //a PS_ constant
WPARAM wParam;
LPARAM lParam;
@@ -54,7 +54,7 @@ typedef struct {
typedef struct {
int cbSize;
const char *szModule; //the name of the protocol module which initiated this ack
- HANDLE hContact;
+ HCONTACT hContact;
int type; //an ACKTYPE_ constant
int result; //an ACKRESULT_ constant
HANDLE hProcess; //a caller-defined process code
@@ -120,7 +120,7 @@ typedef struct {
typedef struct tagPROTOFILETRANSFERSTATUS
{
size_t cbSize;
- HANDLE hContact;
+ HCONTACT hContact;
DWORD flags; // one of PFTS_* constants
union {
@@ -232,7 +232,7 @@ typedef struct {
//contact.
#define MS_PROTO_GETCONTACTBASEPROTO "Proto/GetContactBaseProto"
-__forceinline char* GetContactProto(HANDLE hContact)
+__forceinline char* GetContactProto(HCONTACT hContact)
{ return (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
}
@@ -404,7 +404,7 @@ ProtoBroadcastAck(), listeners must hook ME_PROTO_ACK, note that lParam = ACKDAT
typedef struct {
int cbSize; // sizeof()
- HANDLE hContact; // this might have to be set by the caller too
+ HCONTACT hContact; // this might have to be set by the caller too
int format; // PA_FORMAT_*
char filename[MAX_PATH]; // full path to filename which contains the avatar
} PROTO_AVATAR_INFORMATION;
@@ -412,7 +412,7 @@ typedef struct {
#ifdef _UNICODE
typedef struct {
int cbSize; // sizeof()
- HANDLE hContact; // this might have to be set by the caller too
+ HCONTACT hContact; // this might have to be set by the caller too
int format; // PA_FORMAT_*
WCHAR filename[MAX_PATH]; // full path to filename which contains the avatar
} PROTO_AVATAR_INFORMATIONW;
diff --git a/include/m_protoint.h b/include/m_protoint.h
index 93103629fa..7f1230b06b 100644
--- a/include/m_protoint.h
+++ b/include/m_protoint.h
@@ -72,68 +72,68 @@ struct PROTO_INTERFACE : public MZeroedObject
ProtoLogW(this, wszFormat, args);
}
- __forceinline INT_PTR ProtoBroadcastAck(HANDLE hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam) {
+ __forceinline INT_PTR ProtoBroadcastAck(HCONTACT hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam) {
return ::ProtoBroadcastAck(m_szModuleName, hContact, type, hResult, hProcess, lParam); }
__forceinline INT_PTR delSetting(const char *name) { return db_unset(NULL, m_szModuleName, name); }
- __forceinline INT_PTR delSetting(HANDLE hContact, const char *name) { return db_unset(hContact, m_szModuleName, name); }
+ __forceinline INT_PTR delSetting(HCONTACT hContact, const char *name) { return db_unset(hContact, m_szModuleName, name); }
__forceinline bool getBool(const char *name, bool defaultValue) {
return db_get_b(NULL, m_szModuleName, name, defaultValue) != 0; }
- __forceinline bool getBool(HANDLE hContact, const char *name, bool defaultValue) {
+ __forceinline bool getBool(HCONTACT hContact, const char *name, bool defaultValue) {
return db_get_b(hContact, m_szModuleName, name, defaultValue) != 0; }
- __forceinline bool isChatRoom(HANDLE hContact) { return getBool(hContact, "ChatRoom", false); }
+ __forceinline bool isChatRoom(HCONTACT hContact) { return getBool(hContact, "ChatRoom", false); }
__forceinline int getByte(const char *name, BYTE defaultValue) {
return db_get_b(NULL, m_szModuleName, name, defaultValue); }
- __forceinline int getByte(HANDLE hContact, const char *name, BYTE defaultValue) {
+ __forceinline int getByte(HCONTACT hContact, const char *name, BYTE defaultValue) {
return db_get_b(hContact, m_szModuleName, name, defaultValue); }
__forceinline int getWord(const char *name, WORD defaultValue) {
return db_get_w(NULL, m_szModuleName, name, defaultValue); }
- __forceinline int getWord(HANDLE hContact, const char *name, WORD defaultValue) {
+ __forceinline int getWord(HCONTACT hContact, const char *name, WORD defaultValue) {
return db_get_w(hContact, m_szModuleName, name, defaultValue); }
__forceinline DWORD getDword(const char *name, DWORD defaultValue) {
return db_get_dw(NULL, m_szModuleName, name, defaultValue); }
- __forceinline DWORD getDword(HANDLE hContact, const char *name, DWORD defaultValue) {
+ __forceinline DWORD getDword(HCONTACT hContact, const char *name, DWORD defaultValue) {
return db_get_dw(hContact, m_szModuleName, name, defaultValue); }
__forceinline INT_PTR getString(const char *name, DBVARIANT *result) {
return db_get_s(NULL, m_szModuleName, name, result); }
- __forceinline INT_PTR getString(HANDLE hContact, const char *name, DBVARIANT *result) {
+ __forceinline INT_PTR getString(HCONTACT hContact, const char *name, DBVARIANT *result) {
return db_get_s(hContact, m_szModuleName, name, result); }
__forceinline INT_PTR getWString(const char *name, DBVARIANT *result) {
return db_get_ws(NULL, m_szModuleName, name, result); }
- __forceinline INT_PTR getWString(HANDLE hContact, const char *name, DBVARIANT *result) {
+ __forceinline INT_PTR getWString(HCONTACT hContact, const char *name, DBVARIANT *result) {
return db_get_ws(hContact, m_szModuleName, name, result); }
__forceinline char* getStringA(const char *name) {
return db_get_sa(NULL, m_szModuleName, name); }
- __forceinline char* getStringA(HANDLE hContact, const char *name) {
+ __forceinline char* getStringA(HCONTACT hContact, const char *name) {
return db_get_sa(hContact, m_szModuleName, name); }
__forceinline WCHAR* getWStringA(const char *name) {
return db_get_wsa(NULL, m_szModuleName, name); }
- __forceinline WCHAR* getWStringA(HANDLE hContact, const char *name) {
+ __forceinline WCHAR* getWStringA(HCONTACT hContact, const char *name) {
return db_get_wsa(hContact, m_szModuleName, name); }
__forceinline void setByte(const char *name, BYTE value) { db_set_b(NULL, m_szModuleName, name, value); }
- __forceinline void setByte(HANDLE hContact, const char *name, BYTE value) { db_set_b(hContact, m_szModuleName, name, value); }
+ __forceinline void setByte(HCONTACT hContact, const char *name, BYTE value) { db_set_b(hContact, m_szModuleName, name, value); }
__forceinline void setWord(const char *name, WORD value) { db_set_w(NULL, m_szModuleName, name, value); }
- __forceinline void setWord(HANDLE hContact, const char *name, WORD value) { db_set_w(hContact, m_szModuleName, name, value); }
+ __forceinline void setWord(HCONTACT hContact, const char *name, WORD value) { db_set_w(hContact, m_szModuleName, name, value); }
__forceinline void setDword(const char *name, DWORD value) { db_set_dw(NULL, m_szModuleName, name, value); }
- __forceinline void setDword(HANDLE hContact, const char *name, DWORD value) { db_set_dw(hContact, m_szModuleName, name, value); }
+ __forceinline void setDword(HCONTACT hContact, const char *name, DWORD value) { db_set_dw(hContact, m_szModuleName, name, value); }
__forceinline void setString(const char *name, const char* value) { db_set_s(NULL, m_szModuleName, name, value); }
- __forceinline void setString(HANDLE hContact, const char *name, const char* value) { db_set_s(hContact, m_szModuleName, name, value); }
+ __forceinline void setString(HCONTACT hContact, const char *name, const char* value) { db_set_s(hContact, m_szModuleName, name, value); }
__forceinline void setWString(const char *name, const WCHAR* value) { db_set_ws(NULL, m_szModuleName, name, value); }
- __forceinline void setWString(HANDLE hContact, const char *name, const WCHAR* value) { db_set_ws(hContact, m_szModuleName, name, value); }
+ __forceinline void setWString(HCONTACT hContact, const char *name, const WCHAR* value) { db_set_ws(hContact, m_szModuleName, name, value); }
#if defined(_UNICODE)
#define debugLog debugLogW
@@ -155,18 +155,18 @@ struct PROTO_INTERFACE : public MZeroedObject
virtual int __cdecl Authorize(HANDLE hDbEvent) = 0;
virtual int __cdecl AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason) = 0;
- virtual int __cdecl AuthRecv(HANDLE hContact, PROTORECVEVENT*) = 0;
- virtual int __cdecl AuthRequest(HANDLE hContact, const PROTOCHAR* szMessage) = 0;
+ virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*) = 0;
+ virtual int __cdecl AuthRequest(HCONTACT hContact, const PROTOCHAR* szMessage) = 0;
virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData) = 0;
- virtual HANDLE __cdecl FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath) = 0;
- virtual int __cdecl FileCancel(HANDLE hContact, HANDLE hTransfer) = 0;
- virtual int __cdecl FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason) = 0;
+ virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath) = 0;
+ virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer) = 0;
+ virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason) = 0;
virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const PROTOCHAR** szFilename) = 0;
- virtual DWORD_PTR __cdecl GetCaps(int type, HANDLE hContact = NULL) = 0;
- virtual int __cdecl GetInfo(HANDLE hContact, int infoType) = 0;
+ virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL) = 0;
+ virtual int __cdecl GetInfo(HCONTACT hContact, int infoType) = 0;
virtual HANDLE __cdecl SearchBasic(const PROTOCHAR* id) = 0;
virtual HANDLE __cdecl SearchByEmail(const PROTOCHAR* email) = 0;
@@ -174,24 +174,24 @@ struct PROTO_INTERFACE : public MZeroedObject
virtual HWND __cdecl SearchAdvanced(HWND owner) = 0;
virtual HWND __cdecl CreateExtendedSearchUI(HWND owner) = 0;
- virtual int __cdecl RecvContacts(HANDLE hContact, PROTORECVEVENT*) = 0;
- virtual int __cdecl RecvFile(HANDLE hContact, PROTOFILEEVENT*) = 0;
- virtual int __cdecl RecvMsg(HANDLE hContact, PROTORECVEVENT*) = 0;
- virtual int __cdecl RecvUrl(HANDLE hContact, PROTORECVEVENT*) = 0;
+ virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*) = 0;
+ virtual int __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT*) = 0;
+ virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*) = 0;
+ virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*) = 0;
- virtual int __cdecl SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList) = 0;
- virtual HANDLE __cdecl SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles) = 0;
- virtual int __cdecl SendMsg(HANDLE hContact, int flags, const char* msg) = 0;
- virtual int __cdecl SendUrl(HANDLE hContact, int flags, const char* url) = 0;
+ virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) = 0;
+ virtual HANDLE __cdecl SendFile(HCONTACT hContact, const PROTOCHAR *szDescription, PROTOCHAR **ppszFiles) = 0;
+ virtual int __cdecl SendMsg(HCONTACT hContact, int flags, const char *msg) = 0;
+ virtual int __cdecl SendUrl(HCONTACT hContact, int flags, const char *url) = 0;
- virtual int __cdecl SetApparentMode(HANDLE hContact, int mode) = 0;
+ virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode) = 0;
virtual int __cdecl SetStatus(int iNewStatus) = 0;
- virtual HANDLE __cdecl GetAwayMsg(HANDLE hContact) = 0;
- virtual int __cdecl RecvAwayMsg(HANDLE hContact, int mode, PROTORECVEVENT* evt) = 0;
+ virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact) = 0;
+ virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt) = 0;
virtual int __cdecl SetAwayMsg(int iStatus, const PROTOCHAR* msg) = 0;
- virtual int __cdecl UserIsTyping(HANDLE hContact, int type) = 0;
+ virtual int __cdecl UserIsTyping(HCONTACT hContact, int type) = 0;
virtual int __cdecl OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam) = 0;
};
diff --git a/include/m_protomod.h b/include/m_protomod.h
index efa76d729f..cc10b2707a 100644
--- a/include/m_protomod.h
+++ b/include/m_protomod.h
@@ -101,17 +101,17 @@ __forceinline HANDLE CreateProtoServiceFunction(const char *szModule, const char
//differences between threads the functions are in.
#define MS_PROTO_CHAINRECV "Proto/ChainRecv"
-__forceinline INT_PTR ProtoChainRecv(HANDLE hContact, char *szService, WPARAM wParam, LPARAM lParam)
+__forceinline INT_PTR ProtoChainRecv(HCONTACT hContact, char *szService, WPARAM wParam, LPARAM lParam)
{ CCSDATA ccs = { hContact, szService, wParam, lParam };
return CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
}
-__forceinline INT_PTR ProtoChainRecvMsg(HANDLE hContact, PROTORECVEVENT *pre)
+__forceinline INT_PTR ProtoChainRecvMsg(HCONTACT hContact, PROTORECVEVENT *pre)
{ CCSDATA ccs = { hContact, PSR_MESSAGE, 0, (LPARAM)pre };
return CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
}
-__forceinline INT_PTR ProtoChainRecvFile(HANDLE hContact, PROTORECVFILET *pre)
+__forceinline INT_PTR ProtoChainRecvFile(HCONTACT hContact, PROTORECVFILET *pre)
{ CCSDATA ccs = { hContact, PSR_FILE, 0, (LPARAM)pre };
return CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
}
diff --git a/include/m_protosvc.h b/include/m_protosvc.h
index 1d29112910..292be2be1e 100644
--- a/include/m_protosvc.h
+++ b/include/m_protosvc.h
@@ -740,7 +740,7 @@ Returns the result of db_event_add()
#define MS_PROTO_RECVMSG "Proto/RecvMessage"
-__forceinline INT_PTR Proto_RecvMessage(HANDLE hContact, PROTORECVEVENT *pcre)
+__forceinline INT_PTR Proto_RecvMessage(HCONTACT hContact, PROTORECVEVENT *pcre)
{
CCSDATA ccs = { hContact, PSR_MESSAGE, 0, (LPARAM)pcre };
return CallService(MS_PROTO_RECVMSG, 0, (LPARAM)&ccs );
@@ -777,7 +777,7 @@ typedef struct {
#define MS_PROTO_RECVFILET "Proto/RecvFileT"
-__forceinline INT_PTR Proto_RecvFile(HANDLE hContact, PROTORECVFILET *pcre)
+__forceinline INT_PTR Proto_RecvFile(HCONTACT hContact, PROTORECVFILET *pcre)
{
CCSDATA ccs = { hContact, PSR_FILE, 0, (LPARAM)pcre };
return CallService(MS_PROTO_RECVFILET, 0, ( LPARAM )&ccs);
diff --git a/include/m_timezones.h b/include/m_timezones.h
index 3be1c57602..8bfb425a73 100644
--- a/include/m_timezones.h
+++ b/include/m_timezones.h
@@ -25,6 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef __M_TIMEZONES_H
#define __M_TIMEZONES_H
+#include <m_core.h>
+
#define MIM_TZ_NAMELEN 64
#define TZF_PLF_CB 1 // UI element is assumed to be a combo box
@@ -42,15 +44,15 @@ typedef struct
size_t cbSize;
HANDLE (*createByName)(LPCTSTR tszName, DWORD dwFlags);
- HANDLE (*createByContact)(HANDLE hContact, DWORD dwFlags);
- void (*storeByContact)(HANDLE hContact, HANDLE hTZ);
+ HANDLE (*createByContact)(HCONTACT hContact, DWORD dwFlags);
+ void (*storeByContact)(HCONTACT hContact, HANDLE hTZ);
int (*printDateTime)(HANDLE hTZ, LPCTSTR szFormat, LPTSTR szDest, int cbDest, DWORD dwFlags);
int (*printTimeStamp)(HANDLE hTZ, mir_time ts, LPCTSTR szFormat, LPTSTR szDest, int cbDest, DWORD dwFlags);
- int (*prepareList)(HANDLE hContact, HWND hWnd, DWORD dwFlags);
- int (*selectListItem)(HANDLE hContact, HWND hWnd, DWORD dwFlags);
- void (*storeListResults)(HANDLE hContact, HWND hWnd, DWORD dwFlags);
+ int (*prepareList)(HCONTACT hContact, HWND hWnd, DWORD dwFlags);
+ int (*selectListItem)(HCONTACT hContact, HWND hWnd, DWORD dwFlags);
+ void (*storeListResults)(HCONTACT hContact, HWND hWnd, DWORD dwFlags);
int (*getTimeZoneTime)(HANDLE hTZ, SYSTEMTIME *st);
mir_time (*timeStampToTimeZoneTimeStamp)(HANDLE hTZ, mir_time ts);
@@ -60,19 +62,19 @@ typedef struct
LPCTSTR (*getTzDescription)(LPCTSTR TZname);
#ifdef __cplusplus
- int printDateTimeByContact (HANDLE hContact, LPCTSTR szFormat, LPTSTR szDest, int cbDest, DWORD dwFlags)
+ int printDateTimeByContact (HCONTACT hContact, LPCTSTR szFormat, LPTSTR szDest, int cbDest, DWORD dwFlags)
{ return printDateTime(createByContact(hContact, dwFlags), szFormat, szDest, cbDest, dwFlags); }
- int printTimeStampByContact(HANDLE hContact, mir_time ts, LPCTSTR szFormat, LPTSTR szDest, int cbDest, DWORD dwFlags)
+ int printTimeStampByContact(HCONTACT hContact, mir_time ts, LPCTSTR szFormat, LPTSTR szDest, int cbDest, DWORD dwFlags)
{ return printTimeStamp(createByContact(hContact, dwFlags), ts, szFormat, szDest, cbDest, dwFlags); }
- LPTIME_ZONE_INFORMATION getTziByContact(HANDLE hContact)
+ LPTIME_ZONE_INFORMATION getTziByContact(HCONTACT hContact)
{ return getTzi(createByContact(hContact, 0)); }
- int getTimeZoneTimeByContact(HANDLE hContact, SYSTEMTIME *st)
+ int getTimeZoneTimeByContact(HCONTACT hContact, SYSTEMTIME *st)
{ return getTimeZoneTime(createByContact(hContact, 0), st); }
- mir_time timeStampToTimeZoneTimeStampByContact(HANDLE hContact, mir_time ts)
+ mir_time timeStampToTimeZoneTimeStampByContact(HCONTACT hContact, mir_time ts)
{ return timeStampToTimeZoneTimeStamp(createByContact(hContact, 0), ts); }
#endif
diff --git a/include/m_utils.h b/include/m_utils.h
index b23cd1cdf2..10f498609c 100644
--- a/include/m_utils.h
+++ b/include/m_utils.h
@@ -160,10 +160,10 @@ __forceinline HANDLE WindowList_Destroy(HANDLE hList)
typedef struct {
HANDLE hList;
HWND hwnd;
- HANDLE hContact;
+ HCONTACT hContact;
} WINDOWLISTENTRY;
#define MS_UTILS_ADDTOWINDOWLIST "Utils/AddToWindowList"
-__forceinline INT_PTR WindowList_Add(HANDLE hList, HWND hwnd, HANDLE hContact) {
+__forceinline INT_PTR WindowList_Add(HANDLE hList, HWND hwnd, HCONTACT hContact) {
WINDOWLISTENTRY wle;
wle.hList = hList; wle.hwnd = hwnd; wle.hContact = hContact;
return CallService(MS_UTILS_ADDTOWINDOWLIST, 0, (LPARAM)&wle);
@@ -183,7 +183,7 @@ __forceinline INT_PTR WindowList_Remove(HANDLE hList, HWND hwnd) {
// lParam = (WPARAM)(HANDLE)hContact
// returns the window handle on success, or NULL on failure
#define MS_UTILS_FINDWINDOWINLIST "Utils/FindWindowInList"
-__forceinline HWND WindowList_Find(HANDLE hList, HANDLE hContact) {
+__forceinline HWND WindowList_Find(HANDLE hList, HCONTACT hContact) {
return (HWND)CallService(MS_UTILS_FINDWINDOWINLIST, (WPARAM)hList, (LPARAM)hContact);
}
@@ -236,12 +236,12 @@ __forceinline INT_PTR WindowList_BroadcastAsync(HANDLE hList, UINT message, WPAR
//returns 0 on success, nonzero on failure
typedef struct {
HWND hwnd;
- HANDLE hContact;
+ HCONTACT hContact;
const char *szModule; //module name to store the setting in
const char *szNamePrefix; //text to prefix on "x", "width", etc, to form setting names
} SAVEWINDOWPOS;
#define MS_UTILS_SAVEWINDOWPOSITION "Utils/SaveWindowPos"
-__forceinline INT_PTR Utils_SaveWindowPosition(HWND hwnd, HANDLE hContact, const char *szModule, const char *szNamePrefix) {
+__forceinline INT_PTR Utils_SaveWindowPosition(HWND hwnd, HCONTACT hContact, const char *szModule, const char *szNamePrefix) {
SAVEWINDOWPOS swp;
swp.hwnd = hwnd; swp.hContact = hContact; swp.szModule = szModule; swp.szNamePrefix = szNamePrefix;
return CallService(MS_UTILS_SAVEWINDOWPOSITION, 0, (LPARAM)&swp);
@@ -260,18 +260,18 @@ __forceinline INT_PTR Utils_SaveWindowPosition(HWND hwnd, HANDLE hContact, const
#define RWPF_NOACTIVATE 4 //show but don't activate v0.3.3.0+
#define RWPF_HIDDEN 8 //make it hidden
#define MS_UTILS_RESTOREWINDOWPOSITION "Utils/RestoreWindowPos"
-__forceinline INT_PTR Utils_RestoreWindowPositionEx(HWND hwnd, int flags, HANDLE hContact, const char *szModule, const char *szNamePrefix) {
+__forceinline INT_PTR Utils_RestoreWindowPositionEx(HWND hwnd, int flags, HCONTACT hContact, const char *szModule, const char *szNamePrefix) {
SAVEWINDOWPOS swp;
swp.hwnd = hwnd; swp.hContact = hContact; swp.szModule = szModule; swp.szNamePrefix = szNamePrefix;
return CallService(MS_UTILS_RESTOREWINDOWPOSITION, flags, (LPARAM)&swp);
}
-__forceinline INT_PTR Utils_RestoreWindowPosition(HWND hwnd, HANDLE hContact, const char *szModule, const char *szNamePrefix) {
+__forceinline INT_PTR Utils_RestoreWindowPosition(HWND hwnd, HCONTACT hContact, const char *szModule, const char *szNamePrefix) {
return Utils_RestoreWindowPositionEx(hwnd, 0, hContact, szModule, szNamePrefix);
}
-__forceinline INT_PTR Utils_RestoreWindowPositionNoSize(HWND hwnd, HANDLE hContact, const char *szModule, const char *szNamePrefix) {
+__forceinline INT_PTR Utils_RestoreWindowPositionNoSize(HWND hwnd, HCONTACT hContact, const char *szModule, const char *szNamePrefix) {
return Utils_RestoreWindowPositionEx(hwnd, RWPF_NOSIZE, hContact, szModule, szNamePrefix);
}
-__forceinline INT_PTR Utils_RestoreWindowPositionNoMove(HWND hwnd, HANDLE hContact, const char *szModule, const char *szNamePrefix) {
+__forceinline INT_PTR Utils_RestoreWindowPositionNoMove(HWND hwnd, HCONTACT hContact, const char *szModule, const char *szNamePrefix) {
return Utils_RestoreWindowPositionEx(hwnd, RWPF_NOMOVE, hContact, szModule, szNamePrefix);
}
@@ -409,7 +409,7 @@ typedef struct
{
int cbSize;
DWORD dwFlags;
- HANDLE hContact;
+ HCONTACT hContact;
REPLACEVARSARRAY *variables;
} REPLACEVARSDATA;