diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-19 14:24:12 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-19 14:24:12 +0000 |
commit | 83310365c69bd40365ee0ae0e16c99c28e24cd0b (patch) | |
tree | 10ac18bfdc3fcf0fd62a5aba3ccb5dedffa2e410 /include/delphi | |
parent | d68cd04d6f7b997692476b531bdc30f546a50efd (diff) |
- all static protocol services replaced with functions;
- m_protomod.h removed as useless
git-svn-id: http://svn.miranda-ng.org/main/trunk@14260 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/delphi')
-rw-r--r-- | include/delphi/m_protocols.inc | 46 | ||||
-rw-r--r-- | include/delphi/m_protomod.inc | 130 |
2 files changed, 86 insertions, 90 deletions
diff --git a/include/delphi/m_protocols.inc b/include/delphi/m_protocols.inc index 8e3bd4d455..a7d5d545e7 100644 --- a/include/delphi/m_protocols.inc +++ b/include/delphi/m_protocols.inc @@ -168,6 +168,7 @@ type type
PPROTOCOLDESCRIPTOR = ^TPROTOCOLDESCRIPTOR;
+ PPPROTOCOLDESCRIPTOR = ^PPROTOCOLDESCRIPTOR;
TPROTOCOLDESCRIPTOR = record
cbSize : size_t;
szName : PAnsiChar; // unique name of the module
@@ -202,24 +203,26 @@ const Returns a pointer to the PROTOCOLDESCRIPTOR if the protocol is loaded, or
NULL if it isn't.
}
- MS_PROTO_ISPROTOCOLLOADED:PAnsiChar = 'Proto/IsProtocolLoaded';
+
+function Proto_IsProtocolLoaded(protoName:PAnsiCHar) : PPROTOCOLDESCRIPTOR; stdcall;
+ external AppDLL name 'Proto_IsProtocolLoaded';
{ gets the network-level protocol associated with a contact
- wParam=(WPARAM)(HANDLE)hContact
- lParam=0
Returns a AnsiChar* pointing to the asciiz name of the protocol or NULL if the
contact has no protocol. There is no need to free() it or anything.
This is the name of the module that actually accesses the network for that
contact. }
- MS_PROTO_GETCONTACTBASEPROTO = 'Proto/GetContactBaseProto';
+
+function Proto_GetProtoName(hContact:TMCONTACT) : PAnsiChar; stdcall;
+ external AppDLL name 'GetContactProto';
{ determines whether the specified contact has the given protocol in its chain
wParam=(WPARAM)(HANDLE)hContact
lParam=(LPARAM)(const AnsiChar*)szName
Returns -1 if it is base protocol, positive number if it is filter and 0 if it doesn't }
+const
MS_PROTO_ISPROTOONCONTACT:PAnsiChar = 'Proto/IsProtoOnContact';
-const
PROTOTYPE_SELFTYPING_OFF = 0;
PROTOTYPE_SELFTYPING_ON = 1;
{ This service is for notifying protocols that the user is typing a message v0.3.3+
@@ -256,6 +259,7 @@ const type
PPROTOACCOUNT = ^TPROTOACCOUNT;
+ PPPROTOACCOUNT = ^PPROTOACCOUNT;
TPROTOACCOUNT = record
cbSize :int; // sizeof this structure
szModuleName :PAnsiChar; // unique physical account name (matches database module name)
@@ -273,13 +277,12 @@ type end;
tagACCOUNT = TPROTOACCOUNT;
-const
//account enumeration service
-//wParam=(WPARAM)(int)piNumAccounts
-//lParam=(LPARAM)(PROTOACCOUNT**)paAccounts
- MS_PROTO_ENUMACCOUNTS:PAnsiChar = 'Proto/EnumAccounts';
+procedure Proto_EnumAccounts(var nAccs:int; var pAccs:PPPROTOACCOUNT); stdcall;
+ external AppDLL name 'Proto_EnumAccounts';
- MS_PROTO_ENUMPROTOS :PAnsiChar = 'Proto/EnumProtos'; // MIRANDA_VER >= $800
+procedure Proto_EnumProtocols(var nProtos:int; var pProtos:PPPROTOCOLDESCRIPTOR); stdcall;
+ external AppDLL name 'Proto_EnumProtocols';
type
PACC_CREATE = ^TACC_CREATE;
@@ -300,7 +303,10 @@ const //wParam=0
//lParam=(LPARAM)(AnsiChar*)szAccountName
//return value = PROTOACCOUNT* or NULL
- MS_PROTO_GETACCOUNT:PAnsiChar = 'Proto/GetAccount';
+
+function Proto_GetAccount(proto:PAnsiChar) : PPROTOACCOUNT; stdcall;
+ external AppDLL name 'Proto_GetAccount';
+
(*
__inline PROTOACCOUNT* ProtoGetAccount( const AnsiChar* accName )
{ return (PROTOACCOUNT* )CallService( MS_PROTO_GETACCOUNT, 0, (LPARAM)accName );
@@ -311,6 +317,7 @@ __inline PROTOACCOUNT* ProtoGetAccount( const AnsiChar* accName ) //wParam = event type (1 - added, 2 - changed, 3 - deleted, 5 - enabled/disabled)
//lParam = (LPARAM)(PROTOACCOUNT*) - account being changed
+const
PRAC_ADDED = 1;
PRAC_CHANGED = 2;
PRAC_REMOVED = 3;
@@ -329,11 +336,11 @@ __inline PROTOACCOUNT* ProtoGetAccount( const AnsiChar* accName ) {
determines if an account is enabled or not
- wParam = 0
- lParam = PPROTOACCOUNT
Returns 1 if an account is valid and enabled, 0 otherwise
}
- MS_PROTO_ISACCOUNTENABLED:PAnsiChar = 'Proto/IsAccountEnabled';
+
+function Proto_IsAccountEnabled(proto:PPROTOACCOUNT) : byte; stdcall;
+ external AppDLL name 'Proto_IsAccountEnabled';
{
determines if an account is locked or not
@@ -341,17 +348,19 @@ __inline PROTOACCOUNT* ProtoGetAccount( const AnsiChar* accName ) lParam = PAnsiChar szAccountName
Returns 1 if an account is locked and not supposed to change status, 0 otherwise
}
- MS_PROTO_ISACCOUNTLOCKED:PAnsiChar = 'Proto/IsAccountLocked';
+
+function Proto_IsAccountLocked(proto:PAnsiChar) : byte; stdcall;
+ external AppDLL name 'Proto_IsAccountLocked';
{
gets the account associated with a contact
- wParam=(WPARAM)(HANDLE)hContact
- lParam=0
Returns a PAnsiChar pointing to the asciiz name of the protocol or NULL if the
contact has no protocol. There is no need to mir_free() it or anything.
This is the name of the module that actually accesses the network for that contact.
}
- MS_PROTO_GETCONTACTBASEACCOUNT:PAnsiChar = 'Proto/GetContactBaseAccount';
+
+function Proto_GetBaseAccountName(hContact:TMCONTACT) : PAnsiChar; stdcall;
+ external AppDLL name 'Proto_GetBaseAccountName';
// -------------- avatar support ---------------------
{
@@ -384,6 +393,7 @@ __inline PROTOACCOUNT* ProtoGetAccount( const AnsiChar* accName ) When ACKRESULT_STATUS, hProcess is the result code - the value of this is protocol dependent,
See protocol documentation to do with avatars for what codes are defined and what they mean.
}
+
const
PA_FORMAT_UNKNOWN = 0; // the protocol can not determine much about the "bitmap"
PA_FORMAT_PNG = 1; // the image is PNG
diff --git a/include/delphi/m_protomod.inc b/include/delphi/m_protomod.inc index aab9706e37..416d5758e5 100644 --- a/include/delphi/m_protomod.inc +++ b/include/delphi/m_protomod.inc @@ -27,78 +27,64 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. {$INCLUDE m_protocols.inc}
{$ENDIF}
-const
- {
- wParam : 0
- lParam : Pointer to a initalised TPROTOCOLDESCRIPTOR structure
- Affect : Register a protocol module, see notes
- Returns: 0 on success, [non zero] on failure
- Notes : This service MUST be called from your module's Load() function
- TPROTOCOLDESCRIPTOR.type can be a value other than PROTOTYPE_*
- which are used to provide a more precise positioning information
- for the contact protocol lists.
- -
- Relative values to the constants can be given, but this MUST NOT
- be done for PROTOTYPE_PROTOCOL.
- }
- MS_PROTO_REGISTERMODULE:PAnsiChar = 'Proto/RegisterModule';
-
- {
- wParam : TMCONTACT
- lParam : protocol_name_string
- Affect : Add the given protocol module to the chain for a contact, see notes
- Returns: 0 success, [non zero] on failure
- Notes : The module is added to the correct positioning according to it's
- registered type.
- }
- MS_PROTO_ADDTOCONTACT:PAnsiChar = 'Proto/AddToContact';
-
- {
- wParam : TMCONTACT
- lParam : protocol_name_string
- Affect : Remove the given protocol name from the chain for the given contact
- Returns: 0 on success, [non zero] on failure
- }
- MS_PROTO_REMOVEFROMCONTACT:PAnsiChar = 'Proto/RemoveFromContact';
-
- { see m_globaldefs.pas for CreateProtoServiceFunction }
-
- {
- wParam : wParam [arg]
- lParam : lParam [arg]
- Affect : Call the next service in the chain for the send operation, see notes
- Return : Return value should be returned by CallService(MS_PROTO_CHAINSEND,wParam,lParam)
- Notes : wParam MUST remain untouched, lParam is a pointer to a CSSDATA structure
- and can be modified or copid if needed.
- wParam and lParam should be the values passed to your service,
- typically your service should return ASAP.
- }
- MS_PROTO_CHAINSEND:PAnsiChar = 'Proto/ChainSend';
-
- {
- wParam : wParam [arg]
- lParam : lParam [arg]
- Affect : Call the next service in the chain in this receive operation, see notes
- Return : Return value should be returned by CallService(MS_PROTO_CHAINRECV,wParam,lParam)
- Notes : wParam MUST remain untouched, lParam is a pointer to a CSSDATA structure
- and can be modified or copied if needed.
- wParam and lParam should be the values passed to your service,
- typically your service should return ASAP.
- -
- MS_PROTO_CHAINRECV is thread safe since 0.1.2.0 -- calls
- are translated to the main thread and passed from there.
- }
- MS_PROTO_CHAINRECV:PAnsiChar = 'Proto/ChainRecv';
-
- {
- wParam : 0
- lParam : Pointer to an initalised ACKDATA
- Affect : Broadcast a ME_PROTO_ACK event, see notes
- Returns: The return value of the NotifyEventHooks() call
- Notes : ME_PROTO_ACK is completely thread safe since 01.2.0
- see notes in core/modules.h under NotifyEventHooks()
- }
- MS_PROTO_BROADCASTACK:PAnsiChar = 'Proto/BroadcastAck';
+{
+ Affect : Register a protocol module, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : This service MUST be called from your module's Load() function
+ TPROTOCOLDESCRIPTOR.type can be a value other than PROTOTYPE_*
+ which are used to provide a more precise positioning information
+ for the contact protocol lists.
+ -
+ Relative values to the constants can be given, but this MUST NOT
+ be done for PROTOTYPE_PROTOCOL.
+}
+
+function Proto_RegisterModule(descr:pPROTOCOLDESCRIPTOR) : int; stdcall;
+ external AppDLL name 'Proto_RegisterModule';
+
+{
+ Affect : Add the given protocol module to the chain for a contact, see notes
+ Returns: 0 success, [non zero] on failure
+ Notes : The module is added to the correct positioning according to it's
+ registered type.
+}
+
+function Proto_AddToContact(hContact:TMCONTACT; proto:PAnsiChar) : int; stdcall;
+ external AppDLL name 'Proto_AddToContact';
+
+{
+ Affect : Remove the given protocol name from the chain for the given contact
+ Returns: 0 on success, [non zero] on failure
+}
+
+function Proto_RemoveFromContact(hContact:TMCONTACT; proto:PAnsiChar) : int; stdcall;
+ external AppDLL name 'Proto_RemoveFromContact';
+
+{
+ Affect : Call the next service in the chain for the send operation, see notes
+ Return : Return value should be returned by CallService(MS_PROTO_CHAINSEND,wParam,lParam)
+ Notes : wParam MUST remain untouched, lParam is a pointer to a CSSDATA structure
+ and can be modified or copid if needed.
+ wParam and lParam should be the values passed to your service,
+ typically your service should return ASAP.
+}
+
+function Proto_ChainSend(order:int; ccs:pCCSDATA) : INT_PTR; stdcall;
+ external AppDLL name 'Proto_ChainSend';
+
+{
+ Affect : Call the next service in the chain in this receive operation, see notes
+ Return : Return value should be returned by CallService(MS_PROTO_CHAINRECV,wParam,lParam)
+ Notes : wParam MUST remain untouched, lParam is a pointer to a CSSDATA structure
+ and can be modified or copied if needed.
+ wParam and lParam should be the values passed to your service,
+ typically your service should return ASAP.
+ -
+ MS_PROTO_CHAINRECV is thread safe since 0.1.2.0 -- calls
+ are translated to the main thread and passed from there.
+}
+function Proto_ChainRecv(order:int; ccs:pCCSDATA) : INT_PTR; stdcall;
+ external AppDLL name 'Proto_ChainRecv';
{$ENDIF}
|