From fe95e19dc7743834b53c82afcf04c233e40db8db Mon Sep 17 00:00:00 2001 From: Alexey Kulakov Date: Wed, 21 Nov 2012 19:42:22 +0000 Subject: xstatus api fixes mradio frame button fix api updates git-svn-id: http://svn.miranda-ng.org/main/trunk@2420 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- include/delphi/m_api.pas | 14 +++-- include/delphi/m_clc.inc | 18 +++--- include/delphi/m_clistint.inc | 27 ++++++--- include/delphi/m_clui.inc | 1 - include/delphi/m_cluiframes.inc | 57 ------------------- include/delphi/m_db_int.inc | 123 ++++++++++++++++++++++++++++------------ include/delphi/m_extraicons.inc | 118 ++++++++++++++++++++++++++++++++++++++ include/delphi/m_icq.inc | 79 -------------------------- include/delphi/m_protocols.inc | 7 +-- include/delphi/m_skin.inc | 3 + include/delphi/m_utils.inc | 14 ++++- include/delphi/m_xstatus.inc | 86 ++++++++++++++++++++++++++++ 12 files changed, 347 insertions(+), 200 deletions(-) create mode 100644 include/delphi/m_extraicons.inc create mode 100644 include/delphi/m_xstatus.inc (limited to 'include/delphi') diff --git a/include/delphi/m_api.pas b/include/delphi/m_api.pas index 09b84c6a33..9aca7006a8 100644 --- a/include/delphi/m_api.pas +++ b/include/delphi/m_api.pas @@ -67,7 +67,7 @@ type // delphi 64 must have these types anyway int_ptr = integer; uint_ptr = cardinal; - + {$ENDIF} long = longint; plong = ^long; @@ -111,6 +111,7 @@ const type PMUUID = ^TMUUID; MUUID = System.TGUID; + TMUUID = MUUID; { MUUID = record @@ -134,8 +135,10 @@ type authorEmail:PAnsiChar; copyright :PAnsiChar; homepage :PAnsiChar; - flags :Integer; // right now the only flag, UNICODE_AWARE, is recognized here - uuid :MUUID; // plugin's unique identifier + flags :byte; // right now the only flag, UNICODE_AWARE, is recognized here + case boolean of + false: (dummy:longword); + true : (uuid :MUUID); // plugin's unique identifier end; //----- Fork enchancement ----- @@ -157,7 +160,7 @@ const ME_SYSTEM_MODULEUNLOAD:pAnsiChar = 'Miranda/System/UnloadModule'; { - Each service mode plugin must implement MS_SERVICEMODE_LAUNCH + Each service mode plugin must implement MS_SERVICEMODE_LAUNCH This service might return one of the following values: SERVICE_CONTINUE - load Miranda normally, like there's no service plugins at all SERVICE_ONLYDB - load database and then execute service plugin only @@ -201,7 +204,6 @@ var {$include m_protosvc.inc} {$include m_options.inc} {$include m_ssl.inc} - {$include m_zlib.inc} {$include m_icq.inc} {$include m_protoint.inc} {$include m_protocols.inc} @@ -239,6 +241,8 @@ var {$include m_toptoolbar.inc} {$include m_msg_buttonsbar.inc} {$include m_json.inc} + {$include m_xstatus.inc} + {$include m_zlib.inc} {$define M_API_UNIT} {$include m_helpers.inc} {$include m_clistint.inc} diff --git a/include/delphi/m_clc.inc b/include/delphi/m_clc.inc index 5c00e6ab22..c86315c9ac 100644 --- a/include/delphi/m_clc.inc +++ b/include/delphi/m_clc.inc @@ -81,7 +81,7 @@ const CLM_GETEDITCONTROL = (CLM_FIRST+13); // returns the HWND, or NULL CLM_GETEXPAND = (CLM_FIRST+14); // wParam=hItem, returns a CLE_, CLE_INVALID if not a group CLM_GETEXTRACOLUMNS = (CLM_FIRST+15); // returns number of extra columns - CLM_GETEXTRAIMAGE = (CLM_FIRST+16); // wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),0), returns iImage or $FF + CLM_GETEXTRAIMAGE = (CLM_FIRST+16); // wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),0), returns iImage or EMPTY_EXTRA_ICON CLM_GETEXTRAIMAGELIST = (CLM_FIRST+17); // returns HIMAGELIST CLM_GETFONT = (CLM_FIRST+18); // wParam=fontId, see clm_setfont. returns hFont. CLM_GETINDENT = (CLM_FIRST+19); // wParam=new group indent @@ -89,6 +89,7 @@ const CLM_GETITEMTEXT = (CLM_FIRST+21); // wParam=hItem, lParam=(TChar*)pszStr, max 120 bytes CLM_GETSCROLLTIME = (CLM_FIRST+22); // returns time in ms CLM_GETSELECTION = (CLM_FIRST+23); // returns hItem + CLM_SETEXTRASPACE = (CLM_FIRST+24); // wParam=extra space between icons CLCHT_ABOVE = $0001; // above client area CLCHT_BELOW = $0002; // below client area @@ -121,9 +122,9 @@ const CLM_SETBKBITMAP = (CLM_FIRST+27); // wParam=mode, lParam=hBitmap (don't delete it), NULL for none CLM_SETBKCOLOR = (CLM_FIRST+28); // wParam=a COLORREF, default is GetSysColor(COLOR_3DFACE) CLM_SETCHECKMARK = (CLM_FIRST+29); // wParam=hItem, lParam=1 or 0 - CLM_SETEXTRACOLUMNS = (CLM_FIRST+30); // wParam=number of extra columns (zero to MAXEXTRACOLUMNS from clc.h, currently 16) - CLM_SETEXTRAIMAGE = (CLM_FIRST+31); // wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),iImage). iImage=$FF is a blank - CLM_SETEXTRAIMAGELIST = (CLM_FIRST+32); // lParam=HIMAGELIST, wParam=WideImageList + CLM_SETEXTRACOLUMNS = (CLM_FIRST+30); // wParam = number of extra columns (zero to EXTRA_ICON_COUNT from clc.h, currently 16) + CLM_SETEXTRAIMAGE = (CLM_FIRST+31); // wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),iImage). iImage=EMPTY_EXTRA_ICON is a blank + CLM_SETEXTRAIMAGELIST = (CLM_FIRST+32); // lParam=HIMAGELIST FONTID_CONTACTS = 0; FONTID_INVIS = 1; @@ -171,11 +172,6 @@ const CLM_ADDINFOITEMW = (CLM_FIRST+53); // lParam=&TCLCINFOITEM, returns hItem CLM_ADDINFOITEM = CLM_ADDINFOITEMW; -//DO NOT USE IT EXTERNALLY CAN BE NOT SUPPORTED BY CLIST - CLM_SETWIDEEXTRAIMAGE = CLM_FIRST+60; // wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),iImage). iImage=0xFFFF is a blank - CLM_GETWIDEEXTRAIMAGE = CLM_FIRST+61; // wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),0), returns iImage or 0xFF - CLM_GETWIDEEXTRAIMAGELIST = CLM_FIRST+62; // returns HWIDEIMAGELIST - CLCIIF_BELOWGROUPS = 1; // put it between groups and contacts, default is at top CLCIIF_BELOWCONTACTS = 2; // put it at the bottom CLCIIF_CHECKBOX = $40; // give this item a check box @@ -213,6 +209,10 @@ const CLN_CONTACTMOVED = (CLN_FIRST-9); // hItem,flags valid. sent when contact is moved without a full list rebuild CLN_CHECKCHANGED = (CLN_FIRST-10); // hItem,flags valid. sent when any check mark is changed, but only for one change if there are many +// clist window tree messages + M_CREATECLC = WM_USER+1; + M_SETALLEXTRAICONS = WM_USER+2; + type PCLCINFOITEM = ^TCLCINFOITEM; TCLCINFOITEM = record diff --git a/include/delphi/m_clistint.inc b/include/delphi/m_clistint.inc index 8d312d31e6..e889f79355 100644 --- a/include/delphi/m_clistint.inc +++ b/include/delphi/m_clistint.inc @@ -32,6 +32,7 @@ PClcProtoStatus = ^ClcProtoStatus; PCLIST_INTERFACE = ^CLIST_INTERFACE; PCListEvent = ^CListEvent; + PCLCCacheEntry = ^CLCCacheEntry; PContactList = ^ContactList; PEventList = ^EventList; PMenuProto = ^MenuProto; @@ -42,8 +43,8 @@ const HCONTACT_ISGROUP = $80000000; HCONTACT_ISINFO = $FFFF0000; - MAXEXTRACOLUMNS = 16; MAX_TIP_SIZE = 2048; + EXTRA_ICON_COUNT = 10; function IsHContactGroup (h:THANDLE):bool; function IsHContactInfo (h:THANDLE):bool; @@ -131,7 +132,7 @@ type tCLCCB = record case boolean of false: ( - iImage:word; + iImage:int; hContact:THANDLE); true : ( groupId:word; @@ -142,8 +143,8 @@ type _type :byte; flags :byte; data :tCLCCB; - iExtraImage:array [0..MAXEXTRACOLUMNS-1] of byte; - szText :array [0..120-MAXEXTRACOLUMNS-1] of WideChar; + iExtraImage:array [0..EXTRA_ICON_COUNT-1] of word; + szText :array [0..120-EXTRA_ICON_COUNT-1] of WideChar; proto :pAnsiChar; // MS_PROTO_GETBASEPROTO end; @@ -296,6 +297,10 @@ type isHidden:int; end; + PCLCCacheEntry = ^CLCCacheEntry; + CLCCacheEntry = record + end; + type PCLIST_INTERFACE = ^CLIST_INTERFACE; CLIST_INTERFACE = record @@ -403,10 +408,10 @@ type pfnGetStatusModeDescription : function (mode:int; flags:int):TChar; cdecl; (* clistsettings.c *) - pfnGetCacheEntry : function (hContact:THANDLE):PClcCacheEntryBase; cdecl; - pfnCreateCacheItem : function (hContact:THANDLE):PClcCacheEntryBase; cdecl; - pfnCheckCacheItem : procedure (_para1:PClcCacheEntryBase); cdecl; - pfnFreeCacheItem : procedure (_para1:PClcCacheEntryBase); cdecl; + pfnGetCacheEntry : function (hContact:THANDLE):PClcCacheEntry; cdecl; + pfnCreateCacheItem : function (hContact:THANDLE):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; @@ -530,6 +535,12 @@ type *************************************************************************************) pfnGetAccountIndexByPos : function (pos:int):int; cdecl; pfnConvertMenu: function( clitem:PCLISTMENUITEM; moitem:PMO_MenuItem):int; cdecl; + + (************************************************************************************* + * version 7 additions (0.11.0.x) - extra images + *************************************************************************************) + pfnReloadExtraIcons: procedure; + pfnSetAllExtraIcons: procedure(hwndList:HWND; hContact:THANDLE); end; { diff --git a/include/delphi/m_clui.inc b/include/delphi/m_clui.inc index 1edd114e53..00a2e80cde 100644 --- a/include/delphi/m_clui.inc +++ b/include/delphi/m_clui.inc @@ -201,7 +201,6 @@ const // (assuming classic, mw, meta, nicer1, modern1, nicer++, modernLayered) // +0x0100 for unicode CLUIF2_EXTRACOLUMNCOUNT = 3; // return max number of extra icon available to be set in main window - CLUIF2_USEREXTRASTART = 4; // return index of first 'advanced' image except Adv1 and Adv2 MS_CLUI_GETCAPS:PAnsiChar = 'CLUI/GetCaps'; diff --git a/include/delphi/m_cluiframes.inc b/include/delphi/m_cluiframes.inc index 29178a66da..1507543124 100644 --- a/include/delphi/m_cluiframes.inc +++ b/include/delphi/m_cluiframes.inc @@ -17,72 +17,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. } -//////////////////////////////////// -//Extra Image Column Support +0.5.0.0 - -//Extra columns type. -//column arranged in this way -// -// [statusicon] ContactName [ADV1][ADV2][SMS][EMAIL][PROTO] -// {$IFNDEF M_CLUIFRAMES} {$DEFINE M_CLUIFRAMES} const - EXTRA_ICON_RES0 = 0; // only used by nicer - EXTRA_ICON_EMAIL = 1; - EXTRA_ICON_PROTO = 2; // used by mwclist and modern - EXTRA_ICON_RES1 = 2; // only used by nicer - EXTRA_ICON_SMS = 3; - EXTRA_ICON_ADV1 = 4; - EXTRA_ICON_ADV2 = 5; - EXTRA_ICON_WEB = 6; - EXTRA_ICON_CLIENT = 7; - EXTRA_ICON_VISMODE = 8; // only used by modern - EXTRA_ICON_RES2 = 8; // only used by nicer - EXTRA_ICON_ADV3 = 9; - EXTRA_ICON_ADV4 = 10; - - EXTRA_ICON_COUNT = 10; - // DEFAULT_TITLEBAR_HEIGHT = 18; //this control will be the main contact list (v. 0.3.4.3+ 2004/11/02) CLS_SKINNEDFRAME = $0800; -type - PIconExtraColumn = ^TIconExtraColumn; - TIconExtraColumn = record - cbSize :int; //must be sizeof(IconExtraColumn) - ColumnType:int; - hImage :THANDLE; //return value from MS_CLIST_EXTRA_ADD_ICON - end; - -const -//Set icon for contact at needed column -//wparam=hContact -//lparam=pIconExtraColumn -//return 0 on success,-1 on failure -// -//See above for supported columns - MS_CLIST_EXTRA_SET_ICON:PAnsiChar = 'CListFrames/SetIconForExraColumn'; - -//Adding icon to extra image list. -//Call this in ME_CLIST_EXTRA_LIST_REBUILD event -// -//wparam=hIcon -//lparam=0 -//return hImage on success,-1 on failure - MS_CLIST_EXTRA_ADD_ICON:PAnsiChar = 'CListFrames/AddIconToExtraImageList'; - - ME_CLIST_EXTRA_LIST_REBUILD:PAnsiChar = 'CListFrames/OnExtraListRebuild'; - -//called with wparam=hContact - ME_CLIST_EXTRA_IMAGE_APPLY:PAnsiChar = 'CListFrames/OnExtraImageApply'; - -//called with wparam=hContact lparam=extra - ME_CLIST_EXTRA_CLICK:PAnsiChar = 'CListFrames/OnExtraClick'; - //adds a frame window //wParam=(CLISTFrame*) //lParam=0 diff --git a/include/delphi/m_db_int.inc b/include/delphi/m_db_int.inc index f00489ac5d..6849d5e358 100644 --- a/include/delphi/m_db_int.inc +++ b/include/delphi/m_db_int.inc @@ -26,43 +26,79 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////// // basic database interface +type + TDBCachedGlobalValue = record + name : pAnsiChar; + value:TDBVARIANT; + end; +type + PDBCachedContactValue = ^TDBCachedContactValue; + TDBCachedContactValue = record + name:pAnsiChar; + value:TDBVARIANT; + next: PDBCachedContactValue; + end; + + PDBCachedContact = ^TDBCachedContact; + TDBCachedContact = record + hContact:THANDLE; + hNext :THANDLE; + szProto :PAnsiChar; + first :PDBCachedContactValue; + last :PDBCachedContactValue; + end; + + PMIDatabaseCache = ^MIDatabaseCache; + MIDatabaseCache = interface + function AddContactToCache(hContact:THANDLE):PDBCachedContact; stdcall; + function GetCachedContact(hContact:THANDLE):PDBCachedContact; stdcall; + procedure FreeCachedContact(hContact:THANDLE); stdcall; + + function InsertCachedSetting(szName:pAnsiChar; param:int):pAnsiChar; stdcall; + function GetCachedSetting(szModuleName:pAnsiChar; szSettingName:pAnsiChar; param1:int; param2:int):pAnsiChar; stdcall; + procedure SetCachedVariant(s:PDBVARIANT; d:PDBVARIANT); stdcall; + function GetCachedValuePtr(hContact:THANDLE; szSetting:pAnsiChar; bAllocate:int):PDBVARIANT; stdcall; + end; + type PMIDatabase = ^TMIDatabase; - TMIDatabase = interface - procedure SetCacheSafetyMode(val:bool); stdcall; - - function GetContactCount():long; stdcall; - function FindFirstContact(const szProto:PAnsiChar = NIL):THANDLE; stdcall; - function FindNextContact(hContact:THANDLE; const szProto:PAnsiChar = NIL):THANDLE; stdcall; - - function DeleteContact(hContact:THANDLE):long; stdcall; - function AddContact():THANDLE; stdcall; - function IsDbContact(hContact:THANDLE):bool; stdcall; - - function GetEventCount(hContact:THANDLE):long; stdcall; - function AddEvent(hContact:THANDLE; dbe:PDBEVENTINFO):THANDLE; stdcall; - function DeleteEvent(hContact:THANDLE; hDbEvent:THANDLE):bool; stdcall; - function GetBlobSize(hDbEvent:THANDLE):long; stdcall; - function GetEvent(hDbEvent:THANDLE; dbe:PDBEVENTINFO):bool; stdcall; - function MarkEventRead(hContact:THANDLE; hDbEvent:THANDLE):bool; stdcall; - function GetEventContact(hDbEvent:THANDLE):THANDLE; stdcall; - function FindFirstEvent(hContact:THANDLE):THANDLE; stdcall; - function FindFirstUnreadEvent(hContact:THANDLE):THANDLE; stdcall; - function FindLastEvent(hContact:THANDLE):THANDLE; stdcall; - function FindNextEvent(hDbEvent:THANDLE):THANDLE; stdcall; - function FindPrevEvent(hDbEvent:THANDLE):THANDLE; stdcall; - - function EnumModuleNames(pFunc:TDBMODULEENUMPROC; pParam:pointer):bool; stdcall; - - function GetContactSetting (hContact:THANDLE; dbcgs:PDBCONTACTGETSETTING):bool; stdcall; - function GetContactSettingStr (hContact:THANDLE; dbcgs:PDBCONTACTGETSETTING):bool; stdcall; - function GetContactSettingStatic(hContact:THANDLE; dbcgs:PDBCONTACTGETSETTING):bool; stdcall; - function FreeVariant(dbv:PDBVARIANT):bool; stdcall; - function WriteContactSetting (hContact:THANDLE; dbcws:PDBCONTACTWRITESETTING):bool; stdcall; - function DeleteContactSetting(hContact:THANDLE; dbcgs:PDBCONTACTGETSETTING):bool; stdcall; - function EnumContactSettings (hContact:THANDLE; dbces:PDBCONTACTENUMSETTINGS):bool; stdcall; - function SetSettingResident (bIsResident:bool; const pszSettingName:PAnsiChar):bool; stdcall; - function EnumResidentSettings(pFunc:TDBMODULEENUMPROC; pParam:pointer):bool; stdcall; + TMIDatabase = record + m_cache: PMIDatabaseCache; + + SetCacheSafetyMode:procedure(val:bool); stdcall; + + GetContactCount:function():long; stdcall; + FindFirstContact:function(const szProto:PAnsiChar = NIL):THANDLE; stdcall; + FindNextContact:function(hContact:THANDLE; const szProto:PAnsiChar = NIL):THANDLE; stdcall; + + DeleteContact:function(hContact:THANDLE):long; stdcall; + AddContact:function():THANDLE; stdcall; + IsDbContact:function(hContact:THANDLE):bool; stdcall; + + GetEventCount:function(hContact:THANDLE):long; stdcall; + AddEvent:function(hContact:THANDLE; dbe:PDBEVENTINFO):THANDLE; stdcall; + DeleteEvent:function(hContact:THANDLE; hDbEvent:THANDLE):bool; stdcall; + GetBlobSize:function(hDbEvent:THANDLE):long; stdcall; + GetEvent:function(hDbEvent:THANDLE; dbe:PDBEVENTINFO):bool; stdcall; + MarkEventRead:function(hContact:THANDLE; hDbEvent:THANDLE):bool; stdcall; + GetEventContact:function(hDbEvent:THANDLE):THANDLE; stdcall; + FindFirstEvent:function(hContact:THANDLE):THANDLE; stdcall; + FindFirstUnreadEvent:function(hContact:THANDLE):THANDLE; stdcall; + FindLastEvent:function(hContact:THANDLE):THANDLE; stdcall; + FindNextEvent:function(hDbEvent:THANDLE):THANDLE; stdcall; + FindPrevEvent:function(hDbEvent:THANDLE):THANDLE; stdcall; + + EnumModuleNames:function(pFunc:TDBMODULEENUMPROC; pParam:pointer):bool; stdcall; + + GetContactSetting :function(hContact:THANDLE; dbcgs:PDBCONTACTGETSETTING):bool; stdcall; + GetContactSettingStr :function(hContact:THANDLE; dbcgs:PDBCONTACTGETSETTING):bool; stdcall; + GetContactSettingStatic:function(hContact:THANDLE; dbcgs:PDBCONTACTGETSETTING):bool; stdcall; + FreeVariant:function(dbv:PDBVARIANT):bool; stdcall; + WriteContactSetting :function(hContact:THANDLE; dbcws:PDBCONTACTWRITESETTING):bool; stdcall; + DeleteContactSetting:function(hContact:THANDLE; dbcgs:PDBCONTACTGETSETTING):bool; stdcall; + EnumContactSettings :function(hContact:THANDLE; dbces:PDBCONTACTENUMSETTINGS):bool; stdcall; + SetSettingResident :function(bIsResident:bool; const pszSettingName:PAnsiChar):bool; stdcall; + EnumResidentSettings:function(pFunc:TDBMODULEENUMPROC; pParam:pointer):bool; stdcall; end; /////////////////////////////////////////////////////////////////////////////// @@ -187,4 +223,21 @@ const } MS_DB_GET_CURRENT:PAnsiChar = 'DB/GetCurrentDb'; +{ + MS_DB_INIT_INSTANCE : initializes a database instance + wParam : 0 (unused) + lParam : MIDatabase* = pointer to a database instance + returns 0 +} + MS_DB_INIT_INSTANCE:pAnsiChar = 'DB/InitDbInstance'; + + +{ + MS_DB_DESTROY_INSTANCE : destroys a database instance + wParam : 0 (unused) + lParam : MIDatabase* = pointer to a database instance + returns 0 +} + MS_DB_DESTROY_INSTANCE:pAnsiChar = 'DB/DestroyDbInstance'; + {$ENDIF} diff --git a/include/delphi/m_extraicons.inc b/include/delphi/m_extraicons.inc new file mode 100644 index 0000000000..ad64e83c33 --- /dev/null +++ b/include/delphi/m_extraicons.inc @@ -0,0 +1,118 @@ +{ + Copyright (C) 2009 Ricardo Pescuma Domenecci + + This is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this file; see the file license.txt. If + not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +} + +{$IFNDEF M_EXTRAICONS} +{$DEFINE M_EXTRAICONS} + +const + EMPTY_EXTRA_ICON = $FFFF; + +const +// Adding icon to extra image list. +// Used for EXTRAICON_TYPE_CALLBACK extra icons +// +// wparam = (HICON)hIcon +// lparam = 0 (unused) +// return HANDLE hImage on success or INVALID_HANDLE_VALUE on failure + MS_CLIST_EXTRA_ADD_ICON:PansiChar = 'CListFrames/AddIconToExtraImageList'; + +//called with wparam=hContact + ME_CLIST_EXTRA_IMAGE_APPLY:PansiChar = 'CListFrames/OnExtraImageApply'; + +//called with wparam=hContact lparam=extra + ME_CLIST_EXTRA_CLICK:PansiChar = 'CListFrames/OnExtraClick'; + +//called with wparam=lparam=0 + ME_CLIST_EXTRA_LIST_REBUILD:PansiChar = 'CListFrames/OnExtraListRebuild'; + +const + EXTRAICON_TYPE_CALLBACK = 0; // Similar to old clist callbacks, it fires 2 notifications + EXTRAICON_TYPE_ICOLIB = 1; // This extra icon will use only icons registered with icolib. + // No callbacks needed. Just call MS_EXTRAICON_SET_ICON passing the name of the + // extraicon to set one. + +type + TEXTRAICON_INFO = record + cbSize:int; + _type :int; // One of EXTRAICON_TYPE_* + name :PAnsiChar; // Internal name. More than one plugin can register extra icons + // with the same name if both have the same type. In this case, + // both will be handled as one. This is usefull for ex for extra + // status, where icq and jabber can share the same slot. + // If the types are different the second one will be denied. + description:PAnsiChar; // [Translated by plugin] Description to be used in GUI + descIcon :PAnsiChar; // [Optional] Name of an icon registered with icolib to be used in GUI. + + // If type == EXTRAICON_TYPE_CALLBACK this two must be set + + // Callback to add icons to clist, calling MS_CLIST_EXTRA_ADD_ICON + // wParam=lParam=0 + RebuildIcons:TMIRANDAHOOK; + + // Callback to set the icon to clist, calling MS_CLIST_EXTRA_SET_ICON or MS_EXTRAICON_SET_ICON + // wParam = HANDLE hContact + // lParam = int slot + ApplyIcon:TMIRANDAHOOK; + + // Other optional callbacks + + // [Optional] Callback called when extra icon was clicked + // wParam = HANDLE hContact + // lParam = int slot + // param = onClickParam + OnClick:TMIRANDAHOOKPARAM; + + onClickParam:LPARAM; + end; + +const +// Register an extra icon +// wParam = (EXTRAICON_INFO *) Extra icon info +// lParam = 0 +// Return: (HANDLE) id of extra icon on success, 0 on error + MS_EXTRAICON_REGISTER:PAnsiChar = 'ExtraIcon/Register'; + +type + TEXTRAICON = record + cbSize :int; + hExtraIcon:THANDLE; // Value returned by MS_EXTRAICON_REGISTER + hContact :THANDLE; // 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) + // or the icolib icon handle (if EXTRAICON_TYPE_ICOLIB) + true :(icoName:PAnsiChar); // Name of the icon registered with icolib (if EXTRAICON_TYPE_ICOLIB) + end; + +const +{ + Set an extra icon icon + wParam = (EXTRAICON *) Extra icon + Return: 0 on success +} + MS_EXTRAICON_SET_ICON:PAnsiChar = 'ExtraIcon/SetIcon'; + +{ + Set an extra icon by icolib icon's name + wParam = (EXTRAICON *) Extra icon + Return: 0 on success +} + MS_EXTRAICON_SET_ICON_BY_NAME:PAnsiChar = 'ExtraIcon/SetIconByName'; + +{$ENDIF} diff --git a/include/delphi/m_icq.inc b/include/delphi/m_icq.inc index 6932ff6e8a..322a342195 100644 --- a/include/delphi/m_icq.inc +++ b/include/delphi/m_icq.inc @@ -273,77 +273,6 @@ an XML parser in the protocol module. Here's one I got: } PS_ICQ_ISAVATARFORMATSUPPORTED = '/IsAvatarFormatSupported'; -{ Custom Status helper API * - - to set custom status message & title use PS_ICQ_GETCUSTOMSTATUS to obtain - DB settings and write values to them (UTF-8 strings best). - - use PS_ICQ_GETCUSTOMSTATUSEX and PS_ICQ_SETCUSTOMSTATUSEX for controling Custom Status - - custom messages for each user supported - ME_ICQ_STATUSMSGREQ with type MTYPE_SCRIPT_NOTIFY -} - - CSSF_MASK_STATUS = $0001; // status member valid for set/get - CSSF_MASK_NAME = $0002; // pszName member valid for set/get - CSSF_MASK_MESSAGE = $0004; // pszMessage member valid for set/get - CSSF_DISABLE_MENU = $0020; // disable default custom status menu, wParam = bEnable - CSSF_DISABLE_UI = $0040; // disable default custom status UI, wParam = bEnable - CSSF_DEFAULT_NAME = $0080; // only with CSSF_MASK_NAME and get API to get default custom status name (wParam = status) - CSSF_STATUSES_COUNT = $0100; // returns number of custom statuses in wParam, only get API - CSSF_STR_SIZES = $0200; // returns sizes of custom status name & message (wParam & lParam members) in chars - CSSF_UNICODE = $1000; // strings are in UCS-2 - -type - PICQ_CUSTOM_STATUS = ^TICQ_CUSTOM_STATUS; - TICQ_CUSTOM_STATUS = record - cbSize :int; // size of the structure - flags :int; // combination of CSSF_* - status :^int; // custom status id - szName :TChar; // buffer for custom status name - szMessage:TChar; // buffer for custom status message - wParam :^WPARAM; // extra params, see flags - lParam :^LPARAM; - end; - -const -{ - Sets owner current custom status - wParam = (int)N // custom status id (1-29) - lParam = 0 - return = N (id of status set) or 0 (failed - probably bad params) -} - PS_ICQ_SETCUSTOMSTATUS = '/SetXStatus'; - -{ - Sets owner current custom status - wParam = 0 // reserved - lParam = (ICQ_CUSTOM_STATUS*)pData // contains what to set and new values - return = 0 (for success) -} - PS_ICQ_SETCUSTOMSTATUSEX = '/SetXStatusEx'; - -{ - Retrieves custom status details for specified hContact - wParam = (HANDLE)hContact - lParam = (ICQ_CUSTOM_STATUS*)pData // receives details (members must be prepared) - return = 0 (for success) -} - PS_ICQ_GETCUSTOMSTATUSEX = '/GetXStatusEx'; - -const - LR_BIGICON = $40; -{ - Retrieves specified custom status icon - wParam = (int)N // custom status id (1-32), 0 = my current custom status - lParam = flags // use LR_SHARED for shared HICON, LR_BIGICON for 32x32 icon - return = HICON // custom status icon (use DestroyIcon to release resources) -} - PS_ICQ_GETCUSTOMSTATUSICON = '/GetXStatusIcon'; - -{ - Get Custom status DB field names & current owner custom status - wParam = (AnsiChar**)szDBTitle // will receive title DB setting name (do not free) - lParam = (AnsiChar**)szDBMsg // will receive message DB setting name - Return = N // current custom status id if successful, 0 otherwise -} - PS_ICQ_GETCUSTOMSTATUS = '/GetXStatus'; { Request Custom status details (messages) for specified contact @@ -369,13 +298,5 @@ const } ME_ICQ_CUSTOMSTATUS_CHANGED = '/XStatusChanged'; -{ - Called from contact list in order to get index of custom status icon in list - wParam = hContact - lParam = 0 - return = (int) index of extra contact icon shifted <<16 - (the low word will be normal status icon, the high will be xStatus Icon) -} - PS_ICQ_GETADVANCEDSTATUSICON = '/GetAdvancedStatusIcon'; {$ENDIF} diff --git a/include/delphi/m_protocols.inc b/include/delphi/m_protocols.inc index 26137e8a8c..67c4b1f427 100644 --- a/include/delphi/m_protocols.inc +++ b/include/delphi/m_protocols.inc @@ -149,7 +149,7 @@ type program's lifetime. Do not use this list in the global context, copy protocols names otherwise. IMPORTANT NOTE #2: in version 0.8 this service is mapped to the MS_PROTO_ENUMACCOUNTS - service to provide the compatibility with old plugins (first three members of + service to provide the compatibility with old plugins (first three members of PROTOACCOUNT are equal to the old PROTOCOLDESCRIPTOR format). If you declare the MIRANDA_VER macro with value greater or equal to 0x800, use MS_PROTO_ENUMPROTOS service instead to obtain the list of running protocols instead of accounts. @@ -194,7 +194,6 @@ const PROTOTYPE_FILTER = 3000; PROTOTYPE_TRANSLATION = 4000; PROTOTYPE_OTHER = 10000; // avoid using this if at all possible - PROTOTYPE_DISPROTO = 20000; { determines if a protocol module is loaded or not wParam=0 @@ -252,7 +251,7 @@ const lParam=(LPARAM)(int)typing state } ME_PROTO_CONTACTISTYPING:PAnsiChar = 'Proto/ContactIsTypingEvent'; -// -------------- accounts support --------------------- 0.8.0+ +// -------------- accounts support --------------------- 0.8.0+ type PPROTOACCOUNT = ^TPROTOACCOUNT; @@ -280,7 +279,7 @@ const MS_PROTO_ENUMACCOUNTS:PAnsiChar = 'Proto/EnumAccounts'; MS_PROTO_ENUMPROTOS :PAnsiChar = 'Proto/EnumProtos'; // MIRANDA_VER >= $800 - MS_PROTO_ENUMPROTOCOLS:PAnsiChar = 'Proto/EnumProtocols';// MIRANDA_VER < $800 +// MS_PROTO_ENUMPROTOCOLS:PAnsiChar = 'Proto/EnumProtocols';// MIRANDA_VER < $800 (* __inline int ProtoEnumAccounts( int* accNumber, PROTOACCOUNT*** accArray ) diff --git a/include/delphi/m_skin.inc b/include/delphi/m_skin.inc index 3aa3503ea3..5311e27195 100644 --- a/include/delphi/m_skin.inc +++ b/include/delphi/m_skin.inc @@ -74,6 +74,9 @@ const SKINICON_OTHER_OFF = 241; // v0.9.0.9+ SKINICON_OTHER_LOADEDGRAY = 242; // v0.10.3.1+ SKINICON_OTHER_NOTLOADEDGRAY = 243; // v0.10.3.1+ + SKINICON_OTHER_VISIBLE_ALL = 244; // v0.93.4+ + SKINICON_OTHER_INVISIBLE_ALL = 245; // v0.93.4+ + { SKINICON_EVENT_MESSAGE_BIG = 300; SKINICON_EVENT_URL_BIG = 301; diff --git a/include/delphi/m_utils.inc b/include/delphi/m_utils.inc index eac9de22bb..3556f4e578 100644 --- a/include/delphi/m_utils.inc +++ b/include/delphi/m_utils.inc @@ -69,8 +69,9 @@ type PCountryListEntry = ^TCountryListEntry; TCountryListEntry = record - id : int; - szName: PAnsiChar; + id : int; + szName : PAnsiChar; + ISOcode: array [0..2] of AnsiChar; end; PWINDOWLISTENTRY = ^TWINDOWLISTENTRY; @@ -127,6 +128,15 @@ const } MS_UTILS_GETCOUNTRYBYNUMBER:PAnsiChar = 'Utils/GetCountryByNumber'; + { + Gets the name of a country given its ISO code v0.1.2.0+ + wParam = (char*)ISOcode + lParam = 0 + Returns a pointer to the string containing the country name on success, + or NULL on failure + } + MS_UTILS_GETCOUNTRYBYISOCODE:PAnsiChar = 'Utils/GetCountryByISOCode'; + { wParam : Pointer to an int to be filled with count -- !TODO! test. lParam : Pointer to an PCountryListEntry, see notes diff --git a/include/delphi/m_xstatus.inc b/include/delphi/m_xstatus.inc new file mode 100644 index 0000000000..b619caf034 --- /dev/null +++ b/include/delphi/m_xstatus.inc @@ -0,0 +1,86 @@ +{ +Miranda NG: the free IM client for Microsoft* Windows* + +Copyright 2012 Miranda NG project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +} + + +{$IFNDEF M_XSTATUS} +{$DEFINE M_XSTATUS} + +// Custom Status info + +const + CSSF_MASK_STATUS = $0001; // status member valid for set/get + CSSF_MASK_NAME = $0002; // pszName member valid for set/get + CSSF_MASK_MESSAGE = $0004; // pszMessage member valid for set/get + CSSF_DISABLE_MENU = $0020; // disable default custom status menu, wParam = bEnable + CSSF_DISABLE_UI = $0040; // disable default custom status UI, wParam = bEnable + CSSF_DEFAULT_NAME = $0080; // only with CSSF_MASK_NAME and get API to get default custom status name (wParam = status) + CSSF_STATUSES_COUNT = $0100; // returns number of custom statuses in wParam, only get API + CSSF_STR_SIZES = $0200; // returns sizes of custom status name & message (wParam & lParam members) in chars + CSSF_UNICODE = $1000; // strings are in UCS-2 + +type + TCUSTOM_STATUS = record + cbSize :int; // size of the structure + flags :int; // combination of CSSF_* + status :^int; // custom status id + szName :TChar; + szMessage:TChar; + wParam :^WPARAM; // extra params, see flags + lParam :^LPARAM; + end; + +const +{ + Retrieves custom status details for specified hContact + wParam = (HANDLE)hContact + lParam = (CUSTOM_STATUS*)pData // receives details (members must be prepared) + return = 0 (for success) +} + PS_GETCUSTOMSTATUSEX = '/GetXStatusEx'; + +{ + Sets owner current custom status + wParam = 0 // reserved + lParam = (CUSTOM_STATUS*)pData // contains what to set and new values + return = 0 (for success) +} + PS_SETCUSTOMSTATUSEX = '/SetXStatusEx'; + + LR_BIGICON = $40; + +{ + Retrieves specified custom status icon + wParam = (int)N // custom status id (1-32), 0 = my current custom status + lParam = flags // use LR_SHARED for shared HICON, LR_BIGICON for 32x32 icon + return = HICON // custom status icon (use DestroyIcon to release resources if not LR_SHARED) +} + PS_GETCUSTOMSTATUSICON = '/GetXStatusIcon'; + +{ + Called from contact list in order to get index of custom status icon in list + wParam = hContact + lParam = 0 + return = (int)index of extra contact icon shifted <<16 (the low word will be normal status icon, the high will be xStatus Icon +} + PS_GETADVANCEDSTATUSICON = '/GetAdvancedStatusIcon'; + +{$ENDIF} -- cgit v1.2.3