From 34353afa23f23d9bc3470896248b8c387465a4b2 Mon Sep 17 00:00:00 2001 From: Alexey Kulakov Date: Mon, 10 Feb 2014 17:25:36 +0000 Subject: Miranda API sync with small compilation fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@8083 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- include/delphi/m_avatars.inc | 18 ++--- include/delphi/m_chat.inc | 20 +++--- include/delphi/m_clist.inc | 14 ++-- include/delphi/m_clistint.inc | 36 +++++----- include/delphi/m_contacts.inc | 2 +- include/delphi/m_core.inc | 97 +++++++++++++------------- include/delphi/m_database.inc | 4 +- include/delphi/m_db_int.inc | 2 +- include/delphi/m_extraicons.inc | 8 +-- include/delphi/m_helpers.inc | 65 +++++++++--------- include/delphi/m_message.inc | 40 +++++------ include/delphi/m_msg_buttonsbar.inc | 2 +- include/delphi/m_popup.inc | 8 +-- include/delphi/m_protocols.inc | 28 ++++---- include/delphi/m_protoint.inc | 133 +++++++++++++++++++++++++++++------- include/delphi/m_timezones.inc | 32 ++++++--- include/delphi/m_utils.inc | 6 +- 17 files changed, 309 insertions(+), 206 deletions(-) (limited to 'include/delphi') diff --git a/include/delphi/m_avatars.inc b/include/delphi/m_avatars.inc index 74526af386..dc203c110b 100644 --- a/include/delphi/m_avatars.inc +++ b/include/delphi/m_avatars.inc @@ -71,7 +71,7 @@ type PavatarCacheEntryW = ^TavatarCacheEntryW; TavatarCacheEntryW = record cbSize : DWORD; // set to sizeof(struct) - hContact : THANDLE; // contacts handle, 0, if it is a protocol avatar + hContact : HCONTACT; // contacts handle, 0, if it is a protocol avatar hbmPic : HBITMAP; // bitmap handle of the picture itself dwFlags : DWORD; // see above for flag values bmHeight : long; // bitmap dimensions @@ -86,7 +86,7 @@ type PavatarCacheEntry = ^TavatarCacheEntry; TavatarCacheEntry = record cbSize : DWORD; // set to sizeof(struct) - hContact : THANDLE; // contacts handle, 0, if it is a protocol avatar + hContact : HCONTACT; // contacts handle, 0, if it is a protocol avatar hbmPic : HBITMAP; // bitmap handle of the picture itself dwFlags : DWORD; // see above for flag values bmHeight : long; // bitmap dimensions @@ -120,7 +120,7 @@ type TavatarDrawRequest = record cbSize : DWORD; // set this to sizeof(AVATARDRAWREQUEST) - mandatory, // service will return failure code if cbSize is wrong - hContact : THANDLE; // the contact for which the avatar should be drawn. + hContact : HCONTACT; // the contact for which the avatar should be drawn. // set it to 0 to draw a protocol picture hTargetDC : HDC; // target device context rcDraw : TRECT; // target rectangle. The avatar will be centered @@ -242,17 +242,17 @@ const type TContactAvatarChangedNotificationW = record - cbSize :int; // sizeof() - hContact:THANDLE; // this might have to be set by the caller too - format :int; // PA_FORMAT_* + cbSize :int; // sizeof() + hContact:HCONTACT; // this might have to be set by the caller too + format :int; // PA_FORMAT_* filename:array [0..MAX_PATH-1] of WideChar; // full path to filename which contains the avatar hash :array [0..127] of WideChar; // avatar hash (always an empty string by now) end; TContactAvatarChangedNotification = record - cbSize :int; // sizeof() - hContact:THANDLE; // this might have to be set by the caller too - format :int; // PA_FORMAT_* + cbSize :int; // sizeof() + hContact:HCONTACT; // this might have to be set by the caller too + format :int; // PA_FORMAT_* filename:array [0..MAX_PATH-1] of AnsiChar; // full path to filename which contains the avatar hash :array [0..127] of AnsiChar; // avatar hash (always an empty string by now) end; diff --git a/include/delphi/m_chat.inc b/include/delphi/m_chat.inc index f4e080287d..1705b659a3 100644 --- a/include/delphi/m_chat.inc +++ b/include/delphi/m_chat.inc @@ -493,15 +493,15 @@ const } // Flags - GCI_BYINDEX = $0001; // iItem is valid and should contain the index of the session to get - GCI_BYID = $0002; // pszID is valid and should contain the ID of the session to get. This is the default if no - GCI_HCONTACT = $0004; // hContact is valid - GCI_DATA = $0008; // wItemData is valid - GCI_ID = $0010; // pszID is valid. - GCI_NAME = $0020; // pszName is valid - GCI_ITYPE = $0040; // iType is valid - GCI_COUNT = $0080; // iCount is valid - GCI_USERS = $0100; // pszUsers is valid + GCF_BYINDEX = $0001; // iItem is valid and should contain the index of the session to get + GCF_BYID = $0002; // pszID is valid and should contain the ID of the session to get. This is the default if no + GCF_HCONTACT = $0004; // hContact is valid + GCF_DATA = $0008; // wItemData is valid + GCF_ID = $0010; // pszID is valid. + GCF_NAME = $0020; // pszName is valid + GCF_ITYPE = $0040; // iType is valid + GCF_COUNT = $0080; // iCount is valid + GCF_USERS = $0100; // pszUsers is valid // The GC_INFO structure type @@ -516,7 +516,7 @@ type iCount :int; // count of users in the nicklist pszUsers :PAnsiChar; // space separated string containing the UID's of the users in the user list. // NOTE. Use Mirandas mmi_free() on the returned string. - hContact :THANDLE; // hContact for the session (can be NULL) + hContact :HCONTACT; // hContact for the session (can be NULL) end; const diff --git a/include/delphi/m_clist.inc b/include/delphi/m_clist.inc index e8d95269ac..ed2672d04e 100644 --- a/include/delphi/m_clist.inc +++ b/include/delphi/m_clist.inc @@ -226,15 +226,15 @@ const type PCLISTEVENT = ^TCLISTEVENT; TCLISTEVENT = record - cbSize : int; // size in bytes - hContact : THANDLE; // handle to the contact to put the icon by - hIcon : HICON; // icon to flash! + cbSize : int; // size in bytes + hContact : HCONTACT; // handle to the contact to put the icon by + hIcon : HICON; // icon to flash! flags : DWORD; - hDBEvent : THANDLE; // caller defined, but should be unique for hContact - // or pszProtocol:PAnsiChar + hDBEvent : THANDLE; // caller defined, but should be unique for hContact + // or pszProtocol:PAnsiChar lParam : LPARAM; - pszService: PAnsiChar; // name of service to call on activation - szTooltip : TChar; // short description of the event to display as a tooltip on the systray + pszService: PAnsiChar; // name of service to call on activation + szTooltip : TChar; // short description of the event to display as a tooltip on the systray end; const diff --git a/include/delphi/m_clistint.inc b/include/delphi/m_clistint.inc index 8c6b089879..61d4d48e4c 100644 --- a/include/delphi/m_clistint.inc +++ b/include/delphi/m_clistint.inc @@ -133,7 +133,7 @@ type case boolean of false: ( iImage:int; - hContact:THANDLE); + hContact:HCONTACT); true : ( groupId:word; group :pClcGroup;); @@ -292,7 +292,7 @@ type type PClcCacheEntryBase = ^ClcCacheEntryBase; ClcCacheEntryBase = record - hContact:THANDLE; + hContact:HCONTACT; name :TCHAR; group :TCHAR; isHidden:int; @@ -349,10 +349,10 @@ type pfnAddInfoItemToGroup : function (var group:ClcGroup; flags:int; pszText:TChar):int; cdecl; pfnAddItemToGroup : function (var group:ClcGroup; iAboveItem:int):int; cdecl; pfnAddContactToGroup : function (var dat:ClcData; var group:ClcGroup; - hContact:THANDLE):int; cdecl; - pfnAddContactToTree : procedure (hwnd:HWND; var dat:ClcData; hContact:THANDLE; + hContact:HCONTACT):int; cdecl; + pfnAddContactToTree : procedure (hwnd:HWND; var dat:ClcData; hContact:HCONTACT; updateTotalCount:int; checkHideOffline:int); cdecl; - pfnDeleteItemFromTree : procedure (hwnd:HWND; hItem:THANDLE); cdecl; + pfnDeleteItemFromTree : procedure (hwnd:HWND; hItem:HCONTACT); cdecl; pfnRebuildEntireList : procedure (hwnd:HWND; var dat:ClcData); cdecl; pfnGetGroupContentsCount : function (var group:ClcGroup; visibleOnly:int):int; cdecl; pfnSortCLC : procedure (hwnd:HWND; var dat:ClcData; useInsertionSort:int); cdecl; @@ -384,7 +384,7 @@ type pfnClcStatusToPf2 : function (status:int):int; cdecl; pfnIsHiddenMode : function (var dat:ClcData; status:int):int; cdecl; pfnHideInfoTip : procedure (hwnd:HWND; var dat:ClcData); cdecl; - pfnNotifyNewContact : procedure (hwnd:HWND; hContact:THANDLE); cdecl; + pfnNotifyNewContact : procedure (hwnd:HWND; hContact:HCONTACT); cdecl; pfnGetDefaultExStyle : function :DWORD; cdecl; pfnGetDefaultFontSetting : procedure (i:int; var lf:LOGFONT; var colour:COLORREF); cdecl; pfnGetFontSetting : procedure (i:int; var lf:LOGFONT; var colour:COLORREF); cdecl; @@ -400,22 +400,22 @@ type pfnRowHitTest : function (var dat:ClcData; y:int):int; cdecl; (* clistevents.c *) - pfnEventsProcessContactDoubleClick : function (hContact:THANDLE):int; cdecl; + pfnEventsProcessContactDoubleClick : function (hContact:HCONTACT):int; cdecl; pfnEventsProcessTrayDoubleClick : function (_para1:int):int; cdecl; (* clistmod.c *) - pfnIconFromStatusMode : function (szProto:PAnsiChar; status:int; hContact:THANDLE):int; cdecl; + pfnIconFromStatusMode : function (szProto:PAnsiChar; status:int; hContact:HCONTACT):int; cdecl; pfnShowHide : function (_para1:WPARAM; _para2:LPARAM):int; cdecl; pfnGetStatusModeDescription : function (mode:int; flags:int):TChar; cdecl; (* clistsettings.c *) - pfnGetCacheEntry : function (hContact:THANDLE):PClcCacheEntry; cdecl; - pfnCreateCacheItem : function (hContact:THANDLE):PClcCacheEntry; cdecl; + pfnGetCacheEntry : function (hContact:HCONTACT):PClcCacheEntry; cdecl; + pfnCreateCacheItem : function (hContact:HCONTACT):PClcCacheEntry; cdecl; pfnCheckCacheItem : procedure (_para1:PClcCacheEntry); cdecl; pfnFreeCacheItem : procedure (_para1:PClcCacheEntry); cdecl; - pfnGetContactDisplayName : function (hContact:THANDLE; mode:int):TChar; cdecl; - pfnInvalidateDisplayNameCacheEntry : procedure (hContact:THANDLE); cdecl; + pfnGetContactDisplayName : function (hContact:HCONTACT; mode:int):TChar; cdecl; + pfnInvalidateDisplayNameCacheEntry : procedure (hContact:HCONTACT); cdecl; (* clisttray.c *) pfnTrayIconUpdateWithImageList : procedure (iImage:int; szNewTip:TChar; @@ -438,7 +438,7 @@ type pfnOnCreateClc : procedure ; cdecl; (* contact.c *) - pfnChangeContactIcon : procedure (hContact:THANDLE; iIcon:int; add:int); cdecl; + pfnChangeContactIcon : procedure (hContact:HCONTACT; iIcon:int; add:int); cdecl; pfnLoadContactTree : procedure ; cdecl; pfnCompareContacts : function (var contact1:ClcContact; var contact2:ClcContact):int; cdecl; pfnSortContacts : procedure ; cdecl; @@ -467,9 +467,9 @@ type pfnFreeEvent : procedure (_para1:PCListEvent); cdecl; pfnAddEvent : function (_para1:PCLISTEVENT):PCListEvent; cdecl; - pfnGetEvent : function (hContact:THANDLE; idx:int):PCLISTEVENT; cdecl; + pfnGetEvent : function (hContact:HCONTACT; idx:int):PCLISTEVENT; cdecl; - pfnRemoveEvent : function (hContact:THANDLE; hDbEvent:THANDLE):int; cdecl; + pfnRemoveEvent : function (hContact:HCONTACT; hDbEvent:THANDLE):int; cdecl; pfnGetImlIconIndex : function (hIcon:HICON):int; cdecl; (************************************************************************************* @@ -510,7 +510,7 @@ type szTip : TChar; bTrayMenuOnScreen : BOOL; - pfnGetIconFromStatusMode : function (hContact:THANDLE; szProto:PAnsiChar; + pfnGetIconFromStatusMode : function (hContact:HCONTACT; szProto:PAnsiChar; status:int):HICON; cdecl; pfnInitTray : procedure ; cdecl; @@ -541,13 +541,13 @@ type * version 7 additions (0.11.0.x) - extra images *************************************************************************************) pfnReloadExtraIcons: procedure; cdecl; - pfnSetAllExtraIcons: procedure(hContact:THANDLE); cdecl; + pfnSetAllExtraIcons: procedure(hContact:HCONTACT); cdecl; (************************************************************************************* * Miranda NG additions *************************************************************************************) - pfnGetContactIcon: function(hContact:THANDLE):int; cdecl; + pfnGetContactIcon: function(hContact:HCONTACT):int; cdecl; pfnTrayCalcChanged:function(szChangedProto:pAnsiChar; averageMode:int; iProtoCount:int):int; cdecl; pfnGetAverageMode:function(pNetProtoCount:pint):int; cdecl; end; diff --git a/include/delphi/m_contacts.inc b/include/delphi/m_contacts.inc index cef88c4b38..930574d3cd 100644 --- a/include/delphi/m_contacts.inc +++ b/include/delphi/m_contacts.inc @@ -23,7 +23,7 @@ type TCONTACTINFO = record cbSize : int; dwFlag : Byte; - hContact: THandle; + hContact: HCONTACT; szProto : PAnsiChar; _type : Byte; retval: record // in C this is a nameless union diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc index 7ee88e52c0..1383fbf9cf 100644 --- a/include/delphi/m_core.inc +++ b/include/delphi/m_core.inc @@ -53,7 +53,10 @@ const DBVTF_VARIABLELENGTH = $80; // ? type - MCONTACT = DWORD; + HCONTACT = THANDLE; + THCONTACT = HCONTACT; + MCONTACT = DWORD; +type HDBEVENT = THANDLE; PDBVARIANT = ^TDBVARIANT; TDBVARIANT = record @@ -124,7 +127,7 @@ modules are free to define their own, beginning at 2000 DBEVENTINFO.timestamp is in GMT, as returned by time(). There are services db/time/x below with useful stuff for dealing with it. } -function db_event_add(hContact:THANDLE; dbei:PDBEVENTINFO):THANDLE; stdcall; +function db_event_add(hContact:HCONTACT; dbei:PDBEVENTINFO):THANDLE; stdcall; external CoreDLL name 'db_event_add'; { @@ -132,7 +135,7 @@ Gets the number of events in the chain belonging to a contact in the database. 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. } -function db_event_count(hContact:THANDLE):int; stdcall; +function db_event_count(hContact:HCONTACT):int; stdcall; external CoreDLL name 'db_event_count'; { @@ -141,7 +144,7 @@ hDbEvent should have been returned by db_event_add/first/last/next/prev() Returns 0 on success, or nonzero if hDbEvent was invalid Triggers a db/event/deleted event just *before* the event is deleted } -function db_event_delete(hContact:THANDLE; hDbEvent:THANDLE):int; stdcall; +function db_event_delete(hContact:HCONTACT; hDbEvent:THANDLE):int; stdcall; external CoreDLL name 'db_event_delete'; { @@ -149,7 +152,7 @@ Retrieves a handle to the first event in the chain for hContact Returns the handle, or NULL if hContact is invalid or has no events Events in a chain are sorted chronologically automatically } -function db_event_first(hContact:THANDLE):THANDLE; stdcall; +function db_event_first(hContact:HCONTACT):THANDLE; stdcall; external CoreDLL name 'db_event_first'; { @@ -163,7 +166,7 @@ should be checked individually with db_event_next() and db_event_get() This service is designed for startup, reloading all the events that remained unread from last time } -function db_event_firstUnread(hContact:THANDLE):THANDLE; stdcall; +function db_event_firstUnread(hContact:HCONTACT):THANDLE; stdcall; external CoreDLL name 'db_event_firstUnread'; { @@ -200,7 +203,7 @@ success This service is exceptionally slow. Use only when you have no other choice at all. } -function db_event_getContact(hDbEvent:THANDLE):THANDLE; stdcall; +function db_event_getContact(hDbEvent:THANDLE):HCONTACT; stdcall; external CoreDLL name 'db_event_getContact'; { @@ -208,7 +211,7 @@ Retrieves a handle to the last event in the chain for hContact Returns the handle, or NULL if hContact is invalid or has no events Events in a chain are sorted chronologically automatically } -function db_event_last(hDbEvent:THANDLE):THANDLE; stdcall; +function db_event_last(hContact:HCONTACT):THANDLE; stdcall; external CoreDLL name 'db_event_last'; { @@ -219,7 +222,7 @@ is invalid. This is the one database write operation that does not trigger an event. Modules should not save flags states for any length of time. } -function db_event_markRead(hContact, hDbEvent:THANDLE):int; stdcall; +function db_event_markRead(hContact:HCONTACT; hDbEvent:THANDLE):int; stdcall; external CoreDLL name 'db_event_markRead'; { @@ -252,7 +255,7 @@ You can specify szProto to find only its contacts Returns a handle to the first contact in the db on success, or NULL if there are no contacts in the db. } -function db_find_first(const szModule:pAnsiChar=nil):THANDLE; stdcall; +function db_find_first(const szModule:pAnsiChar=nil):HCONTACT; stdcall; external CoreDLL name 'db_find_first'; { @@ -262,53 +265,53 @@ You can specify szProto to find only its contacts Returns a handle to the contact after hContact in the db on success or NULL if hContact was the last contact in the db or hContact was invalid. } -function db_find_next(hContact:THANDLE; const szModule:pAnsiChar=nil):THANDLE; stdcall; +function db_find_next(hContact:HCONTACT; const szModule:pAnsiChar=nil):HCONTACT; stdcall; external CoreDLL name 'db_find_next'; (****************************************************************************** * DATABASE SETTINGS *) -function db_get(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; dbv:PDBVARIANT):int_ptr; stdcall; +function db_get(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; dbv:PDBVARIANT):int_ptr; stdcall; external CoreDLL name 'db_get'; -function db_get_b(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:int):int; stdcall; +function db_get_b(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:int):int; stdcall; external CoreDLL name 'db_get_b'; -function db_get_w(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:int):int; stdcall; +function db_get_w(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:int):int; stdcall; external CoreDLL name 'db_get_w'; -function db_get_dw(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:dword):dword; stdcall; +function db_get_dw(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:dword):dword; stdcall; external CoreDLL name 'db_get_dw'; -function db_get_s(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; dbv:PDBVARIANT; const nType:int=DBVT_ASCIIZ):int_ptr; stdcall; +function db_get_s(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; dbv:PDBVARIANT; const nType:int=DBVT_ASCIIZ):int_ptr; stdcall; external CoreDLL name 'db_get_s'; -function db_get_sa(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar):pAnsiChar; stdcall; +function db_get_sa(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar):pAnsiChar; stdcall; external CoreDLL name 'db_get_sa'; -function db_get_wsa(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar):pWideChar; stdcall; +function db_get_wsa(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar):pWideChar; stdcall; external CoreDLL name 'db_get_wsa'; -function db_get_static(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; szDest:pAnsiChar; destLen:int):int; stdcall; +function db_get_static(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; szDest:pAnsiChar; destLen:int):int; stdcall; external CoreDLL name 'db_get_static'; -function db_get_static_utf(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; szDest:pAnsiChar; destLen:int):int; stdcall; +function db_get_static_utf(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; szDest:pAnsiChar; destLen:int):int; stdcall; external CoreDLL name 'db_get_static_utf'; -function db_get_wstatic(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; szDest:pWideChar; destLen:int):int; stdcall; +function db_get_wstatic(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; szDest:pWideChar; destLen:int):int; stdcall; external CoreDLL name 'db_get_wstatic'; -function db_set(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; dbv:PDBVARIANT):int_ptr; stdcall; +function db_set(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; dbv:PDBVARIANT):int_ptr; stdcall; external CoreDLL name 'db_set'; -function db_set_b(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:byte):int_ptr; stdcall; +function db_set_b(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:byte):int_ptr; stdcall; external CoreDLL name 'db_set_b'; -function db_set_w(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:word):int_ptr; stdcall; +function db_set_w(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:word):int_ptr; stdcall; external CoreDLL name 'db_set_w'; -function db_set_dw(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:dword):int_ptr; stdcall; +function db_set_dw(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:dword):int_ptr; stdcall; external CoreDLL name 'db_set_dw'; -function db_set_s(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pAnsiChar):int_ptr; stdcall; +function db_set_s(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pAnsiChar):int_ptr; stdcall; external CoreDLL name 'db_set_s'; -function db_set_ws(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pWideChar):int_ptr; stdcall; +function db_set_ws(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pWideChar):int_ptr; stdcall; external CoreDLL name 'db_set_ws'; -function db_set_utf(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pAnsiChar):int_ptr; stdcall; +function db_set_utf(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pAnsiChar):int_ptr; stdcall; external CoreDLL name 'db_set_utf'; -function db_set_blob(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:pointer; len:uint):int_ptr; stdcall; +function db_set_blob(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:pointer; len:uint):int_ptr; stdcall; external CoreDLL name 'db_set_blob'; -function db_unset(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar):int_ptr; stdcall; +function db_unset(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar):int_ptr; stdcall; external CoreDLL name 'db_unset'; function db_set_resident(const szModule:pAnsiChar; const szSetting:pAnsiChar; bEnable:int):int; stdcall; @@ -317,36 +320,36 @@ function db_set_resident(const szModule:pAnsiChar; const szSetting:pAnsiChar; bE // deprecated Aliases function DBFreeVariant(dbv:PDBVARIANT):int_ptr; stdcall; external CoreDLL name 'db_free'; -function DBDeleteContactSetting(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar):int_ptr; stdcall; +function DBDeleteContactSetting(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar):int_ptr; stdcall; external CoreDLL name 'db_unset'; -function DBGetContactSettingByte(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:int):int; stdcall; +function DBGetContactSettingByte(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:int):int; stdcall; external CoreDLL name 'db_get_b'; -function DBGetContactSettingWord(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:int):int; stdcall; +function DBGetContactSettingWord(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:int):int; stdcall; external CoreDLL name 'db_get_w'; -function DBGetContactSettingDWord(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:dword):dword; stdcall; +function DBGetContactSettingDWord(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:dword):dword; stdcall; external CoreDLL name 'db_get_dw'; -function DBGetContactSetting(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; dbv:PDBVARIANT):int_ptr; stdcall; +function DBGetContactSetting(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; dbv:PDBVARIANT):int_ptr; stdcall; external CoreDLL name 'db_get'; -function DBGetContactSettingStr(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; dbv:PDBVARIANT; const nType:int=DBVT_ASCIIZ):int_ptr; stdcall; +function DBGetContactSettingStr(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; dbv:PDBVARIANT; const nType:int=DBVT_ASCIIZ):int_ptr; stdcall; external CoreDLL name 'db_get_s'; -function DBGetContactSettingString(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar):pAnsiChar; stdcall; +function DBGetContactSettingString(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar):pAnsiChar; stdcall; external CoreDLL name 'db_get_sa'; -function DBGetContactSettingWString(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar):pWideChar; stdcall; +function DBGetContactSettingWString(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar):pWideChar; stdcall; external CoreDLL name 'db_get_wsa'; -function DBWriteContactSettingByte(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:byte):int_ptr; stdcall; +function DBWriteContactSettingByte(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:byte):int_ptr; stdcall; external CoreDLL name 'db_set_b'; -function DBWriteContactSettingWord(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:word):int_ptr; stdcall; +function DBWriteContactSettingWord(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:word):int_ptr; stdcall; external CoreDLL name 'db_set_w'; -function DBWriteContactSettingDWord(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:dword):int_ptr; stdcall; +function DBWriteContactSettingDWord(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:dword):int_ptr; stdcall; external CoreDLL name 'db_set_dw'; -function DBWriteContactSettingString(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pAnsiChar):int_ptr; stdcall; +function DBWriteContactSettingString(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pAnsiChar):int_ptr; stdcall; external CoreDLL name 'db_set_s'; -function DBWriteContactSettingWString(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pWideChar):int_ptr; stdcall; +function DBWriteContactSettingWString(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pWideChar):int_ptr; stdcall; external CoreDLL name 'db_set_ws'; -function DBWriteContactSettingUTF8String(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pAnsiChar):int_ptr; stdcall; +function DBWriteContactSettingUTF8String(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pAnsiChar):int_ptr; stdcall; external CoreDLL name 'db_set_utf'; -function DBWriteContactSettingBlob(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:pointer; len:uint):int_ptr; stdcall; +function DBWriteContactSettingBlob(hContact:HCONTACT; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:pointer; len:uint):int_ptr; stdcall; external CoreDLL name 'db_set_blob'; /////////////////////////////////////////////////////////////////////////////// @@ -428,7 +431,7 @@ procedure KillModuleServices(hInst:HINST); stdcall; procedure KillObjectServices(var ptr); stdcall; external CoreDLL name 'KillObjectServices'; -function CallContactService(hContact:THANDLE;const name:PAnsiChar;wParam:WPARAM;lParam:LPARAM):int_ptr; cdecl; +function CallContactService(hContact:HCONTACT;const name:PAnsiChar;wParam:WPARAM;lParam:LPARAM):int_ptr; cdecl; external CoreDLL name 'CallContactService'; function CallProtoService(const szModule:PAnsiChar;const szService:PAnsiChar;wParam:WPARAM;lParam:LPARAM):int_ptr; cdecl; external CoreDLL name 'CallProtoService'; @@ -678,7 +681,7 @@ function mir_vsnwprintf(buffer:pWideChar;count:size_t;fmt:pWideChar;va:va_list): /////////////////////////////////////////////////////////////////////////////// // protocol functions -function ProtoBroadcastAck(const szModule: PAnsiChar; hContact: THandle; type_: int; result_: int; hProcess: THandle; lParam: LPARAM): int_ptr; stdcall; +function ProtoBroadcastAck(const szModule:PAnsiChar; hContact:HCONTACT; type_:int; result_:int; hProcess:THANDLE; lParam:LPARAM): int_ptr; stdcall; external CoreDLL name 'ProtoBroadcastAck'; function ProtoServiceExists(const szModule, szName:PAnsiChar):int; stdcall; diff --git a/include/delphi/m_database.inc b/include/delphi/m_database.inc index 82744a43d6..eefe7657d8 100644 --- a/include/delphi/m_database.inc +++ b/include/delphi/m_database.inc @@ -51,7 +51,7 @@ type value : TDBVARIANT; // variant containing value to set end; - { +{ wParam : Handle of a contact to enum settings for lParam : Pointer to a TDBCONTACTENUMSETTINGS structure, must be initalised affect : Enumerates all settings for a given contact under a module, @@ -69,7 +69,7 @@ type it is unclear how you stop the enumeration once it is started, maybe possible to return -1 to stop it. vesion : only valid for 0.1.0.1+ - } +} type TDBSETTINGENUMPROC = function(const szSetting: PAnsiChar; lParam: LPARAM): int; cdecl; diff --git a/include/delphi/m_db_int.inc b/include/delphi/m_db_int.inc index 106cc3bbfe..4cebeae11c 100644 --- a/include/delphi/m_db_int.inc +++ b/include/delphi/m_db_int.inc @@ -83,7 +83,7 @@ type GetBlobSize:function(hDbEvent:THANDLE):long; stdcall; GetEvent:function(hDbEvent:THANDLE; dbe:PDBEVENTINFO):bool; stdcall; MarkEventRead:function(contactID:MCONTACT; hDbEvent:THANDLE):bool; stdcall; - GetEventContact:function(hDbEvent:THANDLE):THANDLE; stdcall; + GetEventContact:function(hDbEvent:THANDLE):MCONTACT; stdcall; FindFirstEvent:function(contactID:MCONTACT):THANDLE; stdcall; FindFirstUnreadEvent:function(contactID:MCONTACT):THANDLE; stdcall; FindLastEvent:function(contactID:MCONTACT):THANDLE; stdcall; diff --git a/include/delphi/m_extraicons.inc b/include/delphi/m_extraicons.inc index ad64e83c33..92351cf8f6 100644 --- a/include/delphi/m_extraicons.inc +++ b/include/delphi/m_extraicons.inc @@ -66,14 +66,14 @@ type RebuildIcons:TMIRANDAHOOK; // Callback to set the icon to clist, calling MS_CLIST_EXTRA_SET_ICON or MS_EXTRAICON_SET_ICON - // wParam = HANDLE hContact + // wParam = hContact // lParam = int slot ApplyIcon:TMIRANDAHOOK; // Other optional callbacks // [Optional] Callback called when extra icon was clicked - // wParam = HANDLE hContact + // wParam = hContact // lParam = int slot // param = onClickParam OnClick:TMIRANDAHOOKPARAM; @@ -91,8 +91,8 @@ const type TEXTRAICON = record cbSize :int; - hExtraIcon:THANDLE; // Value returned by MS_EXTRAICON_REGISTER - hContact :THANDLE; // Contact to set the extra icon + hExtraIcon:THANDLE; // Value returned by MS_EXTRAICON_REGISTER + hContact :HCONTACT; // Contact to set the extra icon // The icon to be set. This depends on the type of the extra icon: case boolean of false:(hImage :THANDLE); // Value returned by MS_CLIST_EXTRA_ADD_ICON (if EXTRAICON_TYPE_CALLBACK) diff --git a/include/delphi/m_helpers.inc b/include/delphi/m_helpers.inc index 8d59327c2e..966bf0577d 100644 --- a/include/delphi/m_helpers.inc +++ b/include/delphi/m_helpers.inc @@ -16,22 +16,22 @@ function Netlib_Send(hConn: THandle; const buf: PAnsiChar; len: int; flags: int) function Netlib_Recv(hConn: THandle; const buf: PAnsiChar; len: int; flags: int): int_ptr; procedure Netlib_Log(hNetLib: THandle; const sz: PAnsiChar); -function WindowList_Add(hList: THandle; hWnd: HWND; hContact: THandle): int_ptr; -function WindowList_Remove(hList: THandle; hWnd: THandle): int_ptr; -function WindowList_Find(hList: THandle; hContact: THandle): int_ptr; -function WindowList_Broadcast(hList: THandle; message: int; wParam: WPARAM; lParam: LPARAM): int_ptr; -function Utils_SaveWindowPosition(hWnd: THandle; hContact: THandle; const szModule, szNamePrefix: PAnsiChar): int_ptr; -function Utils_RestoreWindowPosition(hWnd: THandle; hContact: THandle; Flags: int; const szModule, szNamePrefix: PAnsiChar): int_ptr; - -function mir_hashstr(const key:pAnsiChar):uint; {inline;} +function WindowList_Add (hList:THandle; hWnd:HWND; hContact:HCONTACT): int_ptr; +function WindowList_Remove (hList:THandle; hWnd:THandle): int_ptr; +function WindowList_Find (hList:THandle; hContact:HCONTACT): int_ptr; +function WindowList_Broadcast(hList:THandle; message: int; wParam: WPARAM; lParam: LPARAM): int_ptr; +function Utils_SaveWindowPosition (hWnd:THandle; hContact:HCONTACT; const szModule, szNamePrefix: PAnsiChar): int_ptr; +function Utils_RestoreWindowPosition(hWnd:THandle; hContact:HCONTACT; Flags: int; const szModule, szNamePrefix: PAnsiChar): int_ptr; + +function mir_hashstr (const key:pAnsiChar):uint; {inline;} function mir_hashstrW(const key:pWideChar):uint; {inline;} -function lrtrim(str:pAnsiChar):pAnsiChar; {inline} +function lrtrim (str:pAnsiChar):pAnsiChar; {inline} function lrtrimp(str:pAnsiChar):pAnsiChar; {inline} function mir_utf8decodeA(const src:pAnsiChar):pAnsiChar; {inline} -function Translate(sz: PAnsiChar): PAnsiChar; +function Translate (sz: PAnsiChar): PAnsiChar; function Translatew(sz: PWideChar): PWideChar; -function TranslateString(const sz: AnsiString): AnsiString; +function TranslateString (const sz:AnsiString):AnsiString; function TranslateWideString(const sz:WideString):WideString; function TranslateUnicodeString(sz: UnicodeString): UnicodeString; procedure TranslateDialogDefault(hwndDlg: THandle); @@ -42,8 +42,8 @@ function CreateProtoServiceFunction(const szModule, szService: PAnsiChar; servic function Srmm_AddIcon (sid: PStatusIconData):int_ptr; procedure Srmm_RemoveIcon(sid: PStatusIconData); -procedure Srmm_ModifyIcon(hContact:THANDLE; sid:PStatusIconData); -function Srmm_GetNthIcon(hContact:THANDLE; index:int):pStatusIconData; +procedure Srmm_ModifyIcon(hContact:HCONTACT; sid:PStatusIconData); +function Srmm_GetNthIcon(hContact:HCONTACT; index:int):pStatusIconData; function LoadSkinnedIcon (id: int): HICON; function LoadSkinnedIconHandle(id: int): THandle; @@ -52,37 +52,37 @@ function LoadSkinnedIconName (id: int): PAnsiChar; function LoadSkinnedProtoIcon(const szProto: PAnsiChar; status: int): THandle; function SkinAddNewSound(const name, description, defaultFile: PAnsiChar): int_ptr; -function SkinPlaySound (const name: PAnsiChar): int_ptr; +function SkinPlaySound (const name: PAnsiChar): int_ptr; function Menu_AddContextFrameMenuItem(mi:PCLISTMENUITEM):HGENMENU; -function Menu_AddMainMenuItem(mi:PCLISTMENUITEM):HGENMENU; -function Menu_AddContactMenuItem(mi:PCLISTMENUITEM):HGENMENU; -function Menu_AddStatusMenuItem(mi:PCLISTMENUITEM):HGENMENU; -function Menu_AddProtoMenuItem(mi:PCLISTMENUITEM):HGENMENU; -function Menu_AddSubGroupMenuItem(mi:PCLISTMENUITEM):HGENMENU; -function Menu_AddGroupMenuItem(mi:PCLISTMENUITEM):HGENMENU; -function Menu_AddTrayMenuItem(mi:PCLISTMENUITEM):HGENMENU; +function Menu_AddMainMenuItem (mi:PCLISTMENUITEM):HGENMENU; +function Menu_AddContactMenuItem (mi:PCLISTMENUITEM):HGENMENU; +function Menu_AddStatusMenuItem (mi:PCLISTMENUITEM):HGENMENU; +function Menu_AddProtoMenuItem (mi:PCLISTMENUITEM):HGENMENU; +function Menu_AddSubGroupMenuItem (mi:PCLISTMENUITEM):HGENMENU; +function Menu_AddGroupMenuItem (mi:PCLISTMENUITEM):HGENMENU; +function Menu_AddTrayMenuItem (mi:PCLISTMENUITEM):HGENMENU; function UserInfo_AddPage(wParam:WPARAM; odp:POPTIONSDIALOGPAGE):int_ptr; -function Options_AddPage(wParam:WPARAM; odp:POPTIONSDIALOGPAGE):int_ptr; +function Options_AddPage (wParam:WPARAM; odp:POPTIONSDIALOGPAGE):int_ptr; function Hotkey_Register(hk:PHOTKEYDESC):int_ptr; function Skin_AddIcon(si:PSKINICONDESC):THANDLE; procedure Icon_Register (hInst:HINST; const szSection:pAnsiChar; pIcons:pIconItem ; iCount:size_t; prefix:PAnsiChar); procedure Icon_RegisterW(hInst:HINST; const szSection:pWideChar; pIcons:pIconItemW; iCount:size_t; prefix:PAnsiChar); -procedure FontRegister(pFontID:pFontID); +procedure FontRegister (pFontID:pFontID); procedure FontRegisterW(pFontID:pFontIDW); -procedure ColourRegister(pColorID:pColourID); +procedure ColourRegister (pColorID:pColourID); procedure ColourRegisterW(pColorID:pColourIDW); -procedure EffectRegister(pEffectID:pEffectID); +procedure EffectRegister (pEffectID:pEffectID); procedure EffectRegisterW(pEffectID:pEffectIDW); function TopToolbar_AddButton(pButton:PTTBButton):THANDLE; -function Options_Open(ood:POPENOPTIONSDIALOG):int_ptr; +function Options_Open (ood:POPENOPTIONSDIALOG):int_ptr; function Options_OpenPage(ood:POPENOPTIONSDIALOG):HWND; {$ELSE} @@ -185,7 +185,7 @@ begin end; -function WindowList_Add(hList: THandle; hWnd: hWnd; hContact: THandle): int_ptr; +function WindowList_Add(hList: THandle; hWnd: hWnd; hContact: HCONTACT): int_ptr; var wle: TWINDOWLISTENTRY; begin @@ -201,7 +201,7 @@ begin Result := CallService(MS_UTILS_REMOVEFROMWINDOWLIST, hList, hWnd); end; -function WindowList_Find(hList: THandle; hContact: THandle): int_ptr; +function WindowList_Find(hList: THandle; hContact: HCONTACT): int_ptr; {$IFDEF AllowInline}inline;{$ENDIF} begin Result := CallService(MS_UTILS_FINDWINDOWINLIST, hList, hContact); @@ -217,7 +217,7 @@ begin Result := CallService(MS_UTILS_BROADCASTTOWINDOWLIST, hList, tLparam(@Msg)); end; -function Utils_SaveWindowPosition(hWnd: THandle; hContact: THandle; const szModule, szNamePrefix: PAnsiChar): int_ptr; +function Utils_SaveWindowPosition(hWnd:THandle; hContact:HCONTACT; const szModule, szNamePrefix: PAnsiChar): int_ptr; var swp: TSAVEWINDOWPOS; begin @@ -228,7 +228,7 @@ begin Result := CallService(MS_UTILS_SAVEWINDOWPOSITION, 0, lParam(@swp)); end; -function Utils_RestoreWindowPosition(hWnd: THandle; hContact: THandle; Flags: int; const szModule, szNamePrefix: PAnsiChar): int_ptr; +function Utils_RestoreWindowPosition(hWnd:THandle; hContact:HCONTACT; Flags:int; const szModule, szNamePrefix: PAnsiChar): int_ptr; var swp: TSAVEWINDOWPOS; begin @@ -329,6 +329,7 @@ begin result:=CallService(MS_LANGPACK_REGISTER,WPARAM(@hLangpack),LPARAM(@PluginInfo)); end; + function CreateProtoServiceFunction(const szModule, szService: PAnsiChar; serviceProc: TMIRANDASERVICE): int_ptr; var szStr: array[0..MAXMODULELABELLENGTH*2] of AnsiChar; @@ -355,13 +356,13 @@ begin CallService(MS_MSG_REMOVEICON, 0, LPARAM(sid)); end; -procedure Srmm_ModifyIcon(hContact:THANDLE; sid:PStatusIconData); +procedure Srmm_ModifyIcon(hContact:HCONTACT; sid:PStatusIconData); {$IFDEF AllowInline}inline;{$ENDIF} begin CallService(MS_MSG_GETNTHICON, hContact, LPARAM(sid)); end; -function Srmm_GetNthIcon(hContact:THANDLE; index:int):PStatusIconData; +function Srmm_GetNthIcon(hContact:HCONTACT; index:int):PStatusIconData; {$IFDEF AllowInline}inline;{$ENDIF} begin result:=PStatusIconData(CallService(MS_MSG_GETNTHICON, hContact, index)); diff --git a/include/delphi/m_message.inc b/include/delphi/m_message.inc index 73577802d5..19ae286e38 100644 --- a/include/delphi/m_message.inc +++ b/include/delphi/m_message.inc @@ -57,16 +57,16 @@ type PMessageWindowEventData = ^TMessageWindowEventData; TMessageWindowEventData = record cbSize : int; - hContact : THANDLE; - hwndWindow: HWND; // top level window for the contact - szModule : PAnsiChar; // used to get plugin type (which means you could use - // local if needed) - uType : uint; // see event types above - uFlags : uint; // used to indicate message direction for all event - // types except custom - local : pointer; // used to store pointer to custom data - hwndInput : HWND; // input area window for the contact (or NULL if there is none) - hwndLog : HWND; // log area window for the contact (or NULL if there is none) + hContact : HCONTACT; + hwndWindow: HWND; // top level window for the contact + szModule : PAnsiChar; // used to get plugin type (which means you could use + // local if needed) + uType : uint; // see event types above + uFlags : uint; // used to indicate message direction for all event + // types except custom + local : pointer; // used to store pointer to custom data + hwndInput : HWND; // input area window for the contact (or NULL if there is none) + hwndLog : HWND; // log area window for the contact (or NULL if there is none) end; const @@ -87,7 +87,7 @@ type PMessageWindowInputData = ^TMessageWindowInputData; TMessageWindowInputData = record cbSize : int; - hContact: THANDLE; + hContact: HCONTACT; uFlags : int; // see uflags above end; @@ -102,7 +102,7 @@ type PMessageWindowOutputData = ^TMessageWindowOutputData; TMessageWindowOutputData = record cbSize : int; - hContact : THANDLE; + hContact : HCONTACT; uFlags : int; // should be same as input data unless 0, then it // will be the actual type hwndWindow: HWND; // top level window for the contact or NULL if no window exists @@ -131,7 +131,7 @@ type MessageWindowEvent = record cbSize :int; seq :int; // number returned by PSS_MESSAGE - hContact :THANDLE; + hContact :HCONTACT; dbei :PDBEVENTINFO; // database event written on the basis of message sent end; @@ -159,13 +159,13 @@ const type MessageWindowPopupData = record cbSize :int; - uType :uint; // see popup types above - uFlags :uint; // used to indicate in which window the popup was requested - hContact :THANDLE; - hwnd :HWND; // window where the popup was requested - hMenu :HMENU; // The handle to the menu - pt :TPOINT; // The point, in screen coords - selection:int; // The menu control id or 0 if no one was selected + uType :uint; // see popup types above + uFlags :uint; // used to indicate in which window the popup was requested + hContact :HCONTACT; + hwnd :HWND; // window where the popup was requested + hMenu :HMENU; // The handle to the menu + pt :TPOINT; // The point, in screen coords + selection:int; // The menu control id or 0 if no one was selected end; // status icons diff --git a/include/delphi/m_msg_buttonsbar.inc b/include/delphi/m_msg_buttonsbar.inc index 223c48e331..cc982b9f92 100644 --- a/include/delphi/m_msg_buttonsbar.inc +++ b/include/delphi/m_msg_buttonsbar.inc @@ -80,7 +80,7 @@ type pszModule :PAnsiChar; // button owners name dwButtonId:DWORD; // registered button ID hwndFrom :HWND; // button parents HWND - hContact :THANDLE; // + hContact :HCONTACT; flags :DWORD; // BBCF_ flags end; diff --git a/include/delphi/m_popup.inc b/include/delphi/m_popup.inc index 77c5d481dd..804140f6d6 100644 --- a/include/delphi/m_popup.inc +++ b/include/delphi/m_popup.inc @@ -56,7 +56,7 @@ type type PPOPUPDATA = ^TPOPUPDATA; TPOPUPDATA = record - lchContact : THANDLE; + lchContact : HCONTACT; lchIcon : HICON; lpszContactName : array [0..MAX_CONTACTNAME-1] of AnsiChar; lpszText : array [0..MAX_SECONDLINE -1] of AnsiChar; @@ -81,7 +81,7 @@ type type PPOPUPDATAW = ^TPOPUPDATAW; TPOPUPDATAW = record - lchContact : THANDLE; + lchContact : HCONTACT; lchIcon : HICON; lpwzContactName : array [0..MAX_CONTACTNAME-1] of WideChar; lpwzText : array [0..MAX_SECONDLINE -1] of WideChar; @@ -344,7 +344,7 @@ const // wParam = 0 // lParam = (POPUPCLASS *)&pc - MS_POPUP_REGISTERCLASS = 'Popup/RegisterClass'; + MS_POPUP_REGISTERCLASS = 'Popup/RegisterClass'; MS_POPUP_UNREGISTERCLASS = 'Popup/UnregisterClass'; type @@ -354,7 +354,7 @@ type szTitle :TChar; szText :TChar; PluginData :pointer; - hContact :THANDLE; + hContact :HCONTACT; end; POPUPDATACLASS = TPOPUPDATACLASS; diff --git a/include/delphi/m_protocols.inc b/include/delphi/m_protocols.inc index 3f1fea9cc1..70b8465012 100644 --- a/include/delphi/m_protocols.inc +++ b/include/delphi/m_protocols.inc @@ -32,7 +32,7 @@ type PCCSDATA = ^TCCSDATA; TCCSDATA = record - hContact : THANDLE; + hContact : HCONTACT; szProtoService: PAnsiChar; // a PS_* constant wParam : WPARAM; lParam : LPARAM; @@ -51,12 +51,12 @@ type PACKDATA = ^TACKDATA; TACKDATA = record cbSize : int; - szModule: PAnsiChar; // the name of the protocol module which initiated this ack - hContact: THANDLE; - _type : int; // an ACKTYPE_* constant - _result : int; // an ACKRESULT_* constant - hProcess: THANDLE; // caller defined seq, I mean process code - lParam : LPARAM; // caller defined data + szModule: PAnsiChar; // the name of the protocol module which initiated this ack + hContact: HCONTACT; + _type : int; // an ACKTYPE_* constant + _result : int; // an ACKRESULT_* constant + hProcess: THANDLE; // caller defined seq, I mean process code + lParam : LPARAM; // caller defined data end; const @@ -123,7 +123,7 @@ type PPROTOFILETRANSFERSTATUS = ^TPROTOFILETRANSFERSTATUS; TPROTOFILETRANSFERSTATUS = record cbSize : size_t; - hContact : THANDLE; + hContact : HCONTACT; flags : dword; // one of PFTS_* constants files : ^TCHAR; totalFiles : int; @@ -388,18 +388,18 @@ const type PPROTO_AVATAR_INFORMATIONW = ^TPROTO_AVATAR_INFORMATIONW; TPROTO_AVATAR_INFORMATIONW = record - cbSize : int; // sizeof() - hContact: THANDLE; // this might have to be set by the caller too - format : int; // PA_FORMAT_* + cbSize : int; // sizeof() + hContact: HCONTACT; // this might have to be set by the caller too + format : int; // PA_FORMAT_* // full path to filename which contains the avatar filename: array[0..(MAX_PATH)-1] of WideChar; end; PPROTO_AVATAR_INFORMATION = ^TPROTO_AVATAR_INFORMATION; TPROTO_AVATAR_INFORMATION = record - cbSize : int; // sizeof() - hContact: THANDLE; // this might have to be set by the caller too - format : int; // PA_FORMAT_* + cbSize : int; // sizeof() + hContact: HCONTACT; // this might have to be set by the caller too + format : int; // PA_FORMAT_* // full path to filename which contains the avatar filename: array[0..(MAX_PATH)-1] of AnsiChar; end; diff --git a/include/delphi/m_protoint.inc b/include/delphi/m_protoint.inc index dbb7a3665d..da781bc43d 100644 --- a/include/delphi/m_protoint.inc +++ b/include/delphi/m_protoint.inc @@ -46,28 +46,111 @@ type iDesiredStatus:int; iXStatus :int; iVersion :int; // version 2 or higher designate support of Unicode services + tszUserName :TChar; szModuleName :PAnsiChar; hProtoIcon :THandle; hNetlibUser :THandle; - - AddToList :function(intf:PPROTO_INTERFACE;flags:int; var psr:TPROTOSEARCHRESULT):THANDLE; cdecl; - AddToListByEvent:function(intf:PPROTO_INTERFACE;flags:int; iContact:int; hDbEvent:THANDLE):THANDLE; cdecl; - - Authorize :function(intf:PPROTO_INTERFACE;hContact:THANDLE):int; cdecl; - AuthDeny :function(intf:PPROTO_INTERFACE;hContact:THANDLE;const szReason:TChar):int; cdecl; - AuthRecv :function(intf:PPROTO_INTERFACE;hContact:THANDLE;var ptr:TPROTORECVEVENT):int; cdecl; - AuthRequest:function(intf:PPROTO_INTERFACE;hContact:THANDLE;szMessage:TChar):int; cdecl; + ////////////////////////////////////////////////////////////////////////////////////// + // Helpers +(*!! + __forceinline void debugLogA(LPCSTR szFormat, ...) + { + va_list args; + va_start(args, szFormat); + ProtoLogA(this, szFormat, args); + } + __forceinline void debugLogW(LPCWSTR wszFormat, ...) + { + va_list args; + va_start(args, wszFormat); + ProtoLogW(this, wszFormat, args); + } + + __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(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(HCONTACT hContact, const char *name, bool defaultValue) { + return db_get_b(hContact, m_szModuleName, name, defaultValue) != 0; } + + __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(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(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(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(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(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(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(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(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(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(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(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(HCONTACT hContact, const char *name, const WCHAR* value) { db_set_ws(hContact, m_szModuleName, name, value); } + +*) + ////////////////////////////////////////////////////////////////////////////////////// + // Virtual functions + + AddToList :function(intf:PPROTO_INTERFACE;flags:int; var psr:TPROTOSEARCHRESULT):HCONTACT; cdecl; + AddToListByEvent:function(intf:PPROTO_INTERFACE;flags:int; iContact:int; hDbEvent:THANDLE):HCONTACT; cdecl; + + Authorize :function(intf:PPROTO_INTERFACE;hDbEvent:THANDLE):int; cdecl; + AuthDeny :function(intf:PPROTO_INTERFACE;hDbEvent:THANDLE;const szReason:TChar):int; cdecl; + AuthRecv :function(intf:PPROTO_INTERFACE;hContact:HCONTACT;var ptr:TPROTORECVEVENT):int; cdecl; + AuthRequest:function(intf:PPROTO_INTERFACE;hContact:HCONTACT;szMessage:TChar):int; cdecl; ChangeInfo:function(intf:PPROTO_INTERFACE;iInfoType:int; var pInfoData:pointer):THANDLE; cdecl; - FileAllow :function(intf:PPROTO_INTERFACE;hContact:THANDLE;hTransfer:THANDLE; szPath:PROTOCHAR):THANDLE; cdecl; - FileCancel:function(intf:PPROTO_INTERFACE;hContact:THANDLE;hTransfer:THANDLE):int; cdecl; - FileDeny :function(intf:PPROTO_INTERFACE;hContact:THANDLE;hTransfer:THANDLE; var szReason:PROTOCHAR):int; cdecl; + FileAllow :function(intf:PPROTO_INTERFACE;hContact:HCONTACT;hTransfer:THANDLE; szPath:PROTOCHAR):THANDLE; cdecl; + FileCancel:function(intf:PPROTO_INTERFACE;hContact:HCONTACT;hTransfer:THANDLE):int; cdecl; + FileDeny :function(intf:PPROTO_INTERFACE;hContact:HCONTACT;hTransfer:THANDLE; var szReason:PROTOCHAR):int; cdecl; FileResume:function(intf:PPROTO_INTERFACE;hTransfer:THANDLE;var action:Integer; var szFilename:PROTOCHAR):int; cdecl; - GetCaps:function(intf:PPROTO_INTERFACE;_type:int):dword_ptr; cdecl; - GetInfo:function(intf:PPROTO_INTERFACE;hContact:THANDLE;infoType:int):int; cdecl; + GetCaps:function(intf:PPROTO_INTERFACE;_type:int;hContact:HCONTACT=0):dword_ptr; cdecl; + GetInfo:function(intf:PPROTO_INTERFACE;hContact:HCONTACT;infoType:int):int; cdecl; SearchBasic :function(intf:PPROTO_INTERFACE;id:PAnsiChar):THANDLE; cdecl; SearchByEmail :function(intf:PPROTO_INTERFACE;email:PAnsiChar):THANDLE; cdecl; @@ -75,24 +158,24 @@ type SearchAdvanced :function(intf:PPROTO_INTERFACE;owner:HWND):HWND; cdecl; CreateExtendedSearchUI:function(intf:PPROTO_INTERFACE;owner:HWND):HWND; cdecl; - RecvContacts:function(intf:PPROTO_INTERFACE;hContact:THANDLE;var ptr:TPROTORECVEVENT):int; cdecl; - RecvFile :function(intf:PPROTO_INTERFACE;hContact:THANDLE;var ptr:TPROTORECVEVENT):int; cdecl; - RecvMessage :function(intf:PPROTO_INTERFACE;hContact:THANDLE;var ptr:TPROTORECVEVENT):int; cdecl; - RecvUrl :function(intf:PPROTO_INTERFACE;hContact:THANDLE;var ptr:TPROTORECVEVENT):int; cdecl; + RecvContacts:function(intf:PPROTO_INTERFACE;hContact:HCONTACT;var ptr:TPROTORECVEVENT):int; cdecl; + RecvFile :function(intf:PPROTO_INTERFACE;hContact:HCONTACT;var ptr:TPROTORECVEVENT):int; cdecl; + RecvMessage :function(intf:PPROTO_INTERFACE;hContact:HCONTACT;var ptr:TPROTORECVEVENT):int; cdecl; + RecvUrl :function(intf:PPROTO_INTERFACE;hContact:HCONTACT;var ptr:TPROTORECVEVENT):int; cdecl; - SendContacts:function(intf:PPROTO_INTERFACE;hContact:THANDLE;flags:int; nContacts:int; var hContactsList:THANDLE):int; cdecl; - SendFile :function(intf:PPROTO_INTERFACE;hContact:THANDLE;szDescription:PROTOCHAR; var ppszFiles:PROTOCHAR):THANDLE; cdecl; - SendMessage :function(intf:PPROTO_INTERFACE;hContact:THANDLE;flags:int; const msg:PAnsiChar):int; cdecl; - SendUrl :function(intf:PPROTO_INTERFACE;hContact:THANDLE;flags:int; const url:PAnsiChar):int; cdecl; + SendContacts:function(intf:PPROTO_INTERFACE;hContact:HCONTACT;flags:int; nContacts:int; var hContactsList:THANDLE):int; cdecl; + SendFile :function(intf:PPROTO_INTERFACE;hContact:HCONTACT;szDescription:PROTOCHAR; var ppszFiles:PROTOCHAR):THANDLE; cdecl; + SendMessage :function(intf:PPROTO_INTERFACE;hContact:HCONTACT;flags:int; const msg:PAnsiChar):int; cdecl; + SendUrl :function(intf:PPROTO_INTERFACE;hContact:HCONTACT;flags:int; const url:PAnsiChar):int; cdecl; - SetApparentMode:function(intf:PPROTO_INTERFACE;hContact:THANDLE;mode:int):int; cdecl; + SetApparentMode:function(intf:PPROTO_INTERFACE;hContact:HCONTACT;mode:int):int; cdecl; SetStatus :function(intf:PPROTO_INTERFACE;iNewStatus:int):int; cdecl; - GetAwayMsg :function(intf:PPROTO_INTERFACE;hContact:THANDLE):THANDLE; cdecl; - RecvAwayMsg:function(intf:PPROTO_INTERFACE;hContact:THANDLE;mode:int;var evt:TPROTORECVEVENT):int; cdecl; + GetAwayMsg :function(intf:PPROTO_INTERFACE;hContact:HCONTACT):THANDLE; cdecl; + RecvAwayMsg:function(intf:PPROTO_INTERFACE;hContact:HCONTACT;mode:int;var evt:TPROTORECVEVENT):int; cdecl; SetAwayMsg :function(intf:PPROTO_INTERFACE;iStatus:int; const msg:PAnsiChar):int; cdecl; - UserIsTyping:function(intf:PPROTO_INTERFACE;hContact:THANDLE; _type:int):int; cdecl; + UserIsTyping:function(intf:PPROTO_INTERFACE;hContact:HCONTACT; _type:int):int; cdecl; OnEvent:function(intf:PPROTO_INTERFACE;iEventType:TPROTOEVENTTYPE;wParam:WPARAM;lParam:LPARAM):int; cdecl; end; diff --git a/include/delphi/m_timezones.inc b/include/delphi/m_timezones.inc index 8ee937d4ed..927d24c277 100644 --- a/include/delphi/m_timezones.inc +++ b/include/delphi/m_timezones.inc @@ -42,25 +42,41 @@ type TIME_API = record cbSize:size_t; - createByName:function(tszName:TChar; dwFlags:dword):THANDLE; cdecl; - createByContact:function(hContact:THANDLE; dwFlags:dword):THANDLE; - storeByContact:procedure(hContact:THANDLE; hTZ:THANDLE); cdecl; + createByName :function (tszName:TChar; dwFlags:dword):THANDLE; cdecl; + createByContact:function (hContact:HCONTACT; dwFlags:dword):THANDLE; + storeByContact :procedure(hContact:HCONTACT; hTZ:THANDLE); cdecl; printDateTime:function(hTZ:THANDLE; szFormat:TChar; szDest:TChar; cbDest:int; dwFlags:dword):int; cdecl; printTimeStamp:function(hTZ:THANDLE; ts:mir_time; szFormat:TChar; szDest:TChar; cbDest:int; dwFlags:dword):int; cdecl; - prepareList :function (hContact:THANDLE; hWnd:HWND; dwFlags:dword):int; cdecl; - selectListItem :function (hContact:THANDLE; hWnd:HWND; dwFlags:dword):int; cdecl; - storeListResults:procedure(hContact:THANDLE; hWnd:HWND; dwFlags:dword); cdecl; + prepareList :function (hContact:HCONTACT; hWnd:HWND; dwFlags:dword):int; cdecl; + selectListItem :function (hContact:HCONTACT; hWnd:HWND; dwFlags:dword):int; cdecl; + storeListResults:procedure(hContact:HCONTACT; hWnd:HWND; dwFlags:dword); cdecl; getTimeZoneTime:function(hTZ:THANDLE; var st:SYSTEMTIME):int; cdecl; timeStampToTimeZoneTimeStamp:function(hTZ:THANDLE; ts:mir_time):time_t; cdecl; - getTzi:function(hTZ:THANDLE):PTimeZoneInformation; cdecl; - getTzName:function(hTZ:THANDLE):TChar; cdecl; + getTzi :function(hTZ:THANDLE):PTimeZoneInformation; cdecl; + getTzName :function(hTZ:THANDLE):TChar; cdecl; getTzDescription:function(TZName:TChar):TChar; cdecl; +(* + int printDateTimeByContact (HCONTACT hContact, LPCTSTR szFormat, LPTSTR szDest, int cbDest, DWORD dwFlags) + { return printDateTime(createByContact(hContact, dwFlags), szFormat, szDest, cbDest, 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(HCONTACT hContact) + { return getTzi(createByContact(hContact, 0)); } + + int getTimeZoneTimeByContact(HCONTACT hContact, SYSTEMTIME *st) + { return getTimeZoneTime(createByContact(hContact, 0), st); } + + mir_time timeStampToTimeZoneTimeStampByContact(HCONTACT hContact, mir_time ts) + { return timeStampToTimeZoneTimeStamp(createByContact(hContact, 0), ts); } +*) end; // every protocol should declare this variable to use the Time API diff --git a/include/delphi/m_utils.inc b/include/delphi/m_utils.inc index 5b67bffb2b..effcad304d 100644 --- a/include/delphi/m_utils.inc +++ b/include/delphi/m_utils.inc @@ -78,13 +78,13 @@ type TWINDOWLISTENTRY = record hList : THANDLE; hWnd : HWND; - hContact: THANDLE; + hContact: HCONTACT; end; PSAVEWINDOWPOS = ^TSAVEWINDOWPOS; TSAVEWINDOWPOS = record hWnd : HWND; - hContact : THANDLE; + hContact : HCONTACT; szModule : PAnsiChar; // module name eto store the settings in szNamePrefix: PAnsiChar; // text to prefix on 'x', 'width', etc end; @@ -349,7 +349,7 @@ type TREPLACEVARSDATA = record cbSize :int; dwFlags :dword; - hContact :THANDLE; + hContact :HCONTACT; variables:PREPLACEVARSARRAY; end; -- cgit v1.2.3