diff options
author | Alexey Kulakov <panda75@bk.ru> | 2012-11-21 19:42:22 +0000 |
---|---|---|
committer | Alexey Kulakov <panda75@bk.ru> | 2012-11-21 19:42:22 +0000 |
commit | fe95e19dc7743834b53c82afcf04c233e40db8db (patch) | |
tree | f571518f1c40cd4b945e64a675ee2a7a29335f16 | |
parent | a8f0df159c82d4e1b7d610f302dbc2a09479c341 (diff) |
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
28 files changed, 328 insertions, 668 deletions
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 @@ -27,42 +27,78 @@ 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/plugins/ExternalAPI/delphi/m_extraicons.inc b/include/delphi/m_extraicons.inc index b6c1a028df..ad64e83c33 100644 --- a/plugins/ExternalAPI/delphi/m_extraicons.inc +++ b/include/delphi/m_extraicons.inc @@ -21,6 +21,27 @@ {$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
@@ -75,13 +96,23 @@ type // 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
+{
+ 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;
@@ -128,6 +129,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
Affect : Get the full list of country IDs, 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}
diff --git a/plugins/Actman/i_contact.inc b/plugins/Actman/i_contact.inc index 40cd6f18f7..afbbcd6800 100644 --- a/plugins/Actman/i_contact.inc +++ b/plugins/Actman/i_contact.inc @@ -64,7 +64,7 @@ begin else
begin
uid:=pAnsiChar(CallProtoService(acc,PS_GETCAPS,PFLAG_UNIQUEIDSETTING,0));
- if uint_ptr(uid)<>CALLSERVICE_NOTFOUND then
+ if int_ptr(uid)<>CALLSERVICE_NOTFOUND then
begin
if DBReadSetting(hContact,acc,uid,@ldbv)=0 then
begin
diff --git a/plugins/QuickSearch/qs.rc b/plugins/QuickSearch/qs.rc index d22a32c57d..0f4e27d46a 100644 --- a/plugins/QuickSearch/qs.rc +++ b/plugins/QuickSearch/qs.rc @@ -163,12 +163,12 @@ BEGIN VALUE "CompanyName",""
VALUE "Comments", "Plugin to quick search for nickname, firstname, lastname, email, uin in your contact list"0
VALUE "FileDescription", "Quick info search plugin for Miranda NG"0
- VALUE "FileVersion", "1, 4, 1, 18 "0
- VALUE "InternalName", "QuickSearchMod"0
+ VALUE "FileVersion", "1, 4, 1, 19 "0
+ VALUE "InternalName", "QuickSearch"0
VALUE "OriginalFilename", "quicksearch.dll"0
- VALUE "ProductName", "QuickSearchMod Dynamic Link Library (DLL)"0
+ VALUE "ProductName", "QuickSearch Dynamic Link Library (DLL)"0
VALUE "ProductVersion", "0, 8, 0, 0 "0
- VALUE "SpecialBuild", "2.07.2010 "0
+ VALUE "SpecialBuild", "12.09.2012 "0
END
END
BLOCK "VarFileInfo"
diff --git a/plugins/QuickSearch/quicksearch.dpr b/plugins/QuickSearch/quicksearch.dpr index 699472b7b1..80901724d6 100644 --- a/plugins/QuickSearch/quicksearch.dpr +++ b/plugins/QuickSearch/quicksearch.dpr @@ -36,7 +36,7 @@ function MirandaPluginInfoEx(mirandaVersion:DWORD):PPLUGININFOEX; cdecl; begin
result:=@PluginInfo;
PluginInfo.cbSize :=SizeOf(TPLUGININFOEX);
- PluginInfo.shortName :='Quick Search Mod';
+ PluginInfo.shortName :='Quick Search';
PluginInfo.version :=$01040112;
PluginInfo.description:=
'This Plugin allow you to quick search for nickname,'+
diff --git a/plugins/QuickSearch/sr_window.pas b/plugins/QuickSearch/sr_window.pas index 5df340f575..517ab736ad 100644 --- a/plugins/QuickSearch/sr_window.pas +++ b/plugins/QuickSearch/sr_window.pas @@ -527,7 +527,7 @@ begin if wparam._type=ptCurrent then wparam.n:=hContact;
if lparam._type=ptCurrent then lparam.n:=hContact;
tmp:=CallService(protov,wparam.n,lparam.n);
- if int_ptr(tmp)=int_ptr(CALLSERVICE_NOTFOUND) then exit;
+ if tmp=CALLSERVICE_NOTFOUND then exit;
case setting_cnftype of
ptString: begin
AnsiToWide(PAnsiChar(tmp),res.text);
@@ -1464,7 +1464,7 @@ var i,num,cnt:integer;
pinfo:LV_HITTESTINFO;
TI:TToolInfoW;
- ics:TICQ_CUSTOM_STATUS;
+ ics:TCUSTOM_STATUS;
info:TCLCINFOTIP;
// qsr:tQSRec;
@@ -1686,7 +1686,7 @@ end; StrCopyW(buf,MainBuf[i,OldHSubItem].text);
ics.flags:=CSSF_DEFAULT_NAME or CSSF_MASK_NAME or CSSF_UNICODE;
- StrCopy(StrCopyE(buf1,GetProtoName(FlagBuf[i].proto)),PS_ICQ_GETCUSTOMSTATUSEX);
+ StrCopy(StrCopyE(buf1,GetProtoName(FlagBuf[i].proto)),PS_GETCUSTOMSTATUSEX);
i:=StrToInt(buf);
ics.wParam:=@i;
@@ -1926,7 +1926,7 @@ begin j:=StrToInt(MainBuf[i,sub].text);
if j>0 then
begin
- StrCopy(StrCopyE(buf,GetProtoName(FlagBuf[i].proto)),PS_ICQ_GETCUSTOMSTATUSICON);
+ StrCopy(StrCopyE(buf,GetProtoName(FlagBuf[i].proto)),PS_GETCUSTOMSTATUSICON);
if ServiceExists(buf)<>0 then
begin
h:=CallService(buf,j,LR_SHARED);
diff --git a/plugins/Utils.pas/cbex.pas b/plugins/Utils.pas/cbex.pas index 1c683dd3b8..9805b76634 100644 --- a/plugins/Utils.pas/cbex.pas +++ b/plugins/Utils.pas/cbex.pas @@ -19,11 +19,11 @@ var icon:HICON;
buf,buf1:array [0..127] of AnsiChar;
b:array [0..63] of WideChar;
- ics:TICQ_CUSTOM_STATUS;
+ ics:TCUSTOM_STATUS;
begin
result:=0;
SendMessage(wnd,CB_RESETCONTENT,0,0);
- StrCopy(StrCopyE(buf,proto),PS_ICQ_GETCUSTOMSTATUSICON);
+ StrCopy(StrCopyE(buf,proto),PS_GETCUSTOMSTATUSICON);
if ServiceExists(@buf)=0 then
exit;
@@ -32,7 +32,7 @@ begin if il=0 then exit;
cnt:=0;
- StrCopy(StrCopyE(buf1,proto),PS_ICQ_GETCUSTOMSTATUSEX);
+ StrCopy(StrCopyE(buf1,proto),PS_GETCUSTOMSTATUSEX);
cbei.mask:=CBEIF_IMAGE or CBEIF_SELECTEDIMAGE or CBEIF_TEXT; //!!
ics.cbSize :=SizEOf(ics);
diff --git a/plugins/Utils.pas/protocols.pas b/plugins/Utils.pas/protocols.pas index 8b585c39b4..842eb53e85 100644 --- a/plugins/Utils.pas/protocols.pas +++ b/plugins/Utils.pas/protocols.pas @@ -415,7 +415,6 @@ begin end;
for i:=1 to protoCount do
begin
- // active and switched off (but not deleted)
inc(NumProto);
with protos^[NumProto] do
begin
@@ -424,7 +423,7 @@ begin enabled:=psf_all;//psf_enabled;
status :=0;
-// xstat :=-1;
+// xstat :=-1;
flag:=CallProtoService(name,PS_GETCAPS,PFLAGNUM_2,0);
if (flag and PF2_ONLINE) <>0 then status:=status or psf_online;
if (flag and PF2_INVISIBLE) <>0 then status:=status or psf_invisible;
@@ -440,18 +439,19 @@ begin if ((flag and PF1_CHAT)<>0) or
(DBReadByte(0,name,'CtcpChatAccept',13)<>13) or // IRC
(DBReadByte(0,name,'Jud',13)<>13) then // Jabber
-// flag:=CallProtoService(name,PS_GETCAPS,PFLAGNUM_1,0);
-// if (flag and PF1_CHAT)<>0 then
+// flag:=CallProtoService(name,PS_GETCAPS,PFLAGNUM_1,0);
+// if (flag and PF1_CHAT)<>0 then
status:=status or psf_chat;
+
p:=StrCopyE(buf,name);
- StrCopy(p,PS_ICQ_GETCUSTOMSTATUS);
+ StrCopy(p,PS_GETCUSTOMSTATUSEX);
if ServiceExists(buf)<>0 then
status:=status or psf_icq;
StrCopy(p,PS_SET_LISTENINGTO);
if ServiceExists(buf)<>0 then
status:=status or psf_tunes;
-
+
end;
inc(proto);
end;
@@ -519,7 +519,7 @@ end; function SetXStatus(proto:PAnsiChar;newstatus:integer;
txt:pWideChar=nil;title:pWideChar=nil):integer;
var
- ics:TICQ_CUSTOM_STATUS;
+ ics:TCUSTOM_STATUS;
begin
result:=0;
if IsXStatusSupported(uint_ptr(proto)) then
@@ -544,23 +544,24 @@ begin szMessage.w:=txt;
end;
end;
- result:=CallProtoService(proto,PS_ICQ_SETCUSTOMSTATUSEX,0,lparam(@ics));
+ result:=CallProtoService(proto,PS_SETCUSTOMSTATUSEX,0,lparam(@ics));
end;
end;
function GetXStatus(proto:PAnsiChar;txt:pointer=nil;title:pointer=nil):integer;
var
+{
buf:array [0..127] of AnsiChar;
pc:PAnsiChar;
param:array [0..63] of AnsiChar;
-
-// ics:TICQ_CUSTOM_STATUS;
-// i,j:integer;
+}
+ ics:TCUSTOM_STATUS;
+ i,j:integer;
begin
result:=0;
if IsXStatusSupported(uint_ptr(proto)) then
begin
-{
+
with ics do
begin
cbSize:=SizeOf(ics);
@@ -568,7 +569,7 @@ begin wParam:=@i;
lParam:=@j;
end;
- CallProtoService(0,PS_ICQ_GETCUSTOMSTATUSEX,0,dword(@ics));
+ CallProtoService(proto,PS_GETCUSTOMSTATUSEX,0,dword(@ics));
if title<>nil then
mGetMem(title^,(i+1)*SizeOf(WideChar));
if txt<>nil then
@@ -579,14 +580,14 @@ begin cbSize:=SizeOf(ics);
flags:=CSSF_MASK_STATUS or CSSF_MASK_NAME or CSSF_MASK_MESSAGE or CSSF_UNICODE;
status:=@result;
- szName.w :=pdword(title)^;
- szMessage.w:=pdword(txt)^;
+ szName.w :=pWideChar(title);
+ szMessage.w:=pWideChar(txt);
end;
- CallProtoService(0,PS_ICQ_GETCUSTOMSTATUSEX,0,dword(@ics));
-}
+ CallProtoService(proto,PS_GETCUSTOMSTATUSEX,0,dword(@ics));
+{
StrCopy(buf,proto);
- StrCat (buf,PS_ICQ_GETCUSTOMSTATUS);
+ StrCat (buf,PS_GETCUSTOMSTATUS);
result:=CallService(buf,0,0);
if (txt<>nil) or (title<>nil) then
begin
@@ -603,7 +604,7 @@ begin StrCopy(pc,'Name'); pWideChar(title^):=DBReadUnicode(0,proto,param,nil);
end;
end;
-
+}
end;
end;
diff --git a/plugins/Watrack/status/i_opt_11.inc b/plugins/Watrack/status/i_opt_11.inc index 55279d3156..1e6e3ab8e9 100644 --- a/plugins/Watrack/status/i_opt_11.inc +++ b/plugins/Watrack/status/i_opt_11.inc @@ -141,7 +141,7 @@ begin // ListView_GetItemTextA(wnd,CurProto,0,@buf,SizeOf(buf));
StrCopy(buf,GetProtoName(CurProto));
- StrCat(buf,PS_ICQ_GETCUSTOMSTATUSICON);
+ StrCat(buf,PS_GETCUSTOMSTATUSICON);
endis:=ServiceExists(buf)<>0;
EnableWindow(GetDlgItem(Dialog,IDC_CBEX ),endis);
diff --git a/protocols/mRadio/i_frame.inc b/protocols/mRadio/i_frame.inc deleted file mode 100644 index 89de119d0e..0000000000 --- a/protocols/mRadio/i_frame.inc +++ /dev/null @@ -1,242 +0,0 @@ -{mRadio frame}
-const
- frm_back:pAnsiChar = 'Frame background';
-const
- FrameWnd:HWND = 0;
- FrameId:integer = -1;
- OldEditProc:pointer=nil;
- pattern:pWideChar=nil;
- current: THANDLE = 0;
-var
- FrameCtrl:PControl;
- colorhook:THANDLE;
- hbr:HBRUSH;
- frm_bkg:TCOLORREF;
-
-function RadioFrameProc( Sender: PControl; var Msg: TMsg; var Rslt:Integer ): boolean;
-begin
- result:=false;
- rslt:=0;
-
- case Msg.message of
-
- WM_DESTROY: begin
- hVolFrmCtrl:=0;
- DeleteObject(hbr);
- end;
-
- WM_SHOWWINDOW: begin
- Rslt:=1;
- with Sender^ do
- hVolFrmCtrl:=Children[1].Handle;
- end;
-
- WM_CTLCOLORSTATIC: begin
-// SetBkColor(msg.wParam, frm_bkg);
- Rslt:=hbr;
- result:=True;
- end;
-
- WM_CONTEXTMENU: begin
- CallService('mRadio/Settings',0,0);
- end;
-
- WM_HSCROLL: begin
- case loword(msg.wParam) of
- SB_THUMBTRACK: begin
-// gVolume:=Hiword(msg.wParam);
- Service_RadioSetVolume(Hiword(msg.wParam){gVolume},2);
- end;
- SB_ENDSCROLL: begin
-// gVolume:=SendMessage(msg.lParam,TBM_GETPOS,0,0);
- Service_RadioSetVolume({Hiword(msg.wParam)}SendMessage(msg.lParam,TBM_GETPOS,0,0){gVolume},2)
- end;
- end;
- end;
-
- end;
-end;
-
-function DoAction(action:integer):integer;
-begin
- result:=Service_RadioMute(0,1);
-end;
-
-function ColorReload(wParam:WPARAM;lParam:LPARAM):int;cdecl;
-var
- cid:TColourID;
-// wnd:HWND;
-// i:integer;
-begin
- result:=0;
- cid.cbSize:=SizeOf(cid);
- StrCopy(cid.group,cPluginName);
- StrCopy(cid.name ,frm_back);
- frm_bkg:=CallService(MS_COLOUR_GETA,dword(@cid),0);
- if hbr<>0 then DeleteObject(hbr);
- hbr:=CreateSolidBrush(frm_bkg);
-
- FrameCtrl.Children[1].Width := FrameCtrl.Children[1].Width-1;
- FrameCtrl.Children[1].Width := FrameCtrl.Children[1].Width+1;
-
- FrameCtrl.InvalidateEx;
- FrameCtrl.Update;
-end;
-
-function GetIcon(action:integer;stat:integer=AST_NORMAL):cardinal;
-begin
- case stat of
- AST_NORMAL : result:=CallService(MS_SKIN2_GETICON,0,dword(IcoBtnOn));
- AST_PRESSED: result:=CallService(MS_SKIN2_GETICON,0,dword(IcoBtnOff));
- else
- result:=0;
- end;
-end;
-
-procedure MyErase(DummySelf, Sender:PControl; DC:HDC);
-begin
-end;
-
-procedure MyEraseFrame(DummySelf, Sender:PControl; DC:HDC);
-var
- rc:TRECT;
-begin
- GetClientRect(Sender.Handle, rc);
- Sender.Canvas.Brush.Color := frm_bkg;
- Sender.Canvas.FillRect(rc);
-end;
-
-function CreateFrameWindow(parent:HWND):THANDLE;
-var
- TB:PTrackbar;
-begin
- result:=0;
-
- FrameCtrl:=NewAlienPanel(parent,esNone);
- if FrameCtrl<>nil then
- begin
- result:=FrameCtrl.GetWindowHandle;
- with FrameCtrl^ do
- begin
- // Button
- btnMute:=CreateIcoButton(FrameCtrl,GetIcon,DoAction,IDC_RADIO_MUTE);
- with btnMute^ do
- begin
- SetSize(16,16);
- SetPosition(FrameCtrl.Width-18,0);
- Anchor(false,true,true,false);
-
- AsCheckbox:=true;
- end;
-
- // Trackbar
- TB:=NewTrackbar(FrameCtrl,[trbTooltips,trbNoTicks,trbBoth,trbNoBorder],nil);
- with TB^ do
- begin
- SetSize(FrameCtrl.Width-24,18);
- SetPosition(2,0);
- Anchor(true,true,true,false);
-
- RangeMin:=0;
- RangeMax:=100;
- PageSize:=20;
-
- OnEraseBkGnd:=TOnPaint(MakeMethod(nil, @MyErase));
- end;
-
- AttachProc(@RadioFrameProc);
- end;
-
- with FrameCtrl^ do
- begin
- MinWidth :=80;
- MinHeight:=20;
- Height:=18;
- Anchor(true,true,true,true);
-// OnMessage:=TOnMessage(MakeMethod(nil, @MyEraseFrame));
- OnEraseBkGnd:=TOnPaint(MakeMethod(nil, @MyEraseFrame));
-{
- OnPaint :=FrameCtrl.Paint;
- OnResize :=FrameCtrl.FrameResize;
- OnMouseDown:=FrameCtrl.MouseDown;
-}
- end;
- end;
-end;
-
-procedure CreateFrame(parent:HWND);
-var
- Frame:TCLISTFrame;
-// wnd:HWND;
-// tmp:cardinal;
- tr:TRECT;
- cid:TColourID;
-begin
- if ServiceExists(MS_CLIST_FRAMES_ADDFRAME)=0 then
- exit;
- if parent=0 then
- parent:=CallService(MS_CLUI_GETHWND,0,0);
-
- FrameWnd:=CreateFrameWindow(parent);
-
- if FrameWnd<>0 then
- begin
- GetWindowRect(FrameWnd,tr);
- FillChar(Frame,SizeOf(Frame),0);
- with Frame do
- begin
- cbSize :=SizeOf(Frame);
- hWnd :=FrameWnd;
- hIcon :=0;
- align :=alTop;
- height :=tr.bottom-tr.top+2;
- if IsAnsi then
- begin
- Flags :=F_VISIBLE or F_NOBORDER;
- name.a :=cPluginName;
- TBName.a:=cPluginName + ' volume control';
- end
- else
- begin
- Flags :=F_VISIBLE or F_NOBORDER or F_UNICODE;
- name.w :=cPluginName;
- TBName.w:=cPluginName + ' volume control';
- end;
- end;
-
- FrameId:=CallService(MS_CLIST_FRAMES_ADDFRAME,dword(@Frame),0);
- if FrameId>=0 then
- begin
- CallService(MS_CLIST_FRAMES_UPDATEFRAME,FrameId, FU_FMPOS);
-
- cid.cbSize:=SizeOf(cid);
- cid.flags :=0;
- StrCopy(cid.group,cPluginName);
- StrCopy(cid.dbSettingsGroup,cPluginName);
-
- StrCopy(cid.name ,frm_back);
- StrCopy(cid.setting,'frame_back');
- cid.defcolour:=COLOR_3DFACE;
- cid.order :=0;
- ColourRegister(@cid);
-
- hbr:=0;
- colorhook:=HookEvent(ME_COLOUR_RELOAD,@ColorReload);
- ColorReload(0,0);
- Service_RadioSetVolume(gVolume,0);
- end;
- end;
-end;
-
-procedure DestroyFrame;
-begin
- if FrameId>=0 then
- begin
- UnhookEvent(colorhook);
- CallService(MS_CLIST_FRAMES_REMOVEFRAME,FrameId,0);
- FrameId:=-1;
- end;
- FrameCtrl.Free;
- // DestroyWindow(FrameWnd);
- FrameWnd:=0;
-end;
diff --git a/protocols/mRadio/i_frameapi.inc b/protocols/mRadio/i_frameapi.inc index 002e2fc142..baca5d885f 100644 --- a/protocols/mRadio/i_frameapi.inc +++ b/protocols/mRadio/i_frameapi.inc @@ -8,7 +8,6 @@ var colorhook:THANDLE;
hbr:HBRUSH;
frm_bkg:TCOLORREF;
- OldBtnWndProc:pointer;
OldSliderWndProc:pointer;
function QSDlgResizer(Dialog:HWND;lParam:LPARAM;urc:PUTILRESIZECONTROL):int; cdecl;
@@ -29,20 +28,13 @@ begin result:=CallWindowProc(OldSliderWndProc, Dialog, hMessage, wParam, lParam);
end;
-function BtnWndProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
-begin
- if hMessage=WM_ERASEBKGND then
- result:=1
- else
- result:=CallWindowProc(OldBtnWndProc, Dialog, hMessage, wParam, lParam);
-end;
-
function RadioFrameProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
var
urd:TUTILRESIZEDIALOG;
rc:TRECT;
ti:TTOOLINFOW;
hwndTooltip:HWND;
+ tmp:pAnsiChar;
begin
result:=0;
case hMessage of
@@ -77,7 +69,6 @@ begin SendMessage(hVolFrmCtrl,TBM_SETPOS,1,gVolume);
OldSliderWndProc:=pointer(SetWindowLongPtrW(hVolFrmCtrl,GWL_WNDPROC,LONG_PTR(@SliderWndProc)));
- OldBtnWndProc :=pointer(SetWindowLongPtrW(hVolFrmCtrl,GWL_WNDPROC,LONG_PTR(@BtnWndProc)));
end;
WM_SIZE: begin
@@ -97,6 +88,28 @@ begin result:=1;
end;
+ WM_DRAWITEM: begin
+ if wParam=IDC_RADIO_MUTE then
+ begin
+ result:=1;
+ if gVolume<0 then
+ tmp:=IcoBtnOff
+ else
+ tmp:=IcoBtnOn;
+ DrawIconEx(PDRAWITEMSTRUCT(lParam)^.hDC,0,0,
+ CallService(MS_SKIN2_GETICON,0,TLPARAM(tmp)),
+ 16,16,0,hbr,DI_NORMAL);
+ end;
+ end;
+
+ WM_CTLCOLORBTN: begin
+ if THANDLE(lParam)=hMuteFrmCtrl then
+ begin
+ SetBkColor(wParam, frm_bkg);
+ result:=hbr;
+ end;
+ end;
+
WM_CTLCOLORSTATIC: begin
if THANDLE(lParam)=hVolFrmCtrl then
begin
@@ -179,18 +192,9 @@ begin hIcon :=0;
align :=alTop;
height :=tr.bottom-tr.top+2;
- if IsAnsi then
- begin
- Flags :=F_VISIBLE or F_NOBORDER;
- name.a :=cPluginName;
- TBName.a:=cPluginName + ' volume control';
- end
- else
- begin
- Flags :=F_VISIBLE or F_NOBORDER or F_UNICODE;
- name.w :=cPluginName;
- TBName.w:=cPluginName + ' volume control';
- end;
+ Flags :=F_VISIBLE or F_NOBORDER or F_UNICODE;
+ name.w :=cPluginName;
+ TBName.w:=cPluginName + ' volume control';
end;
FrameId:=CallService(MS_CLIST_FRAMES_ADDFRAME,wparam(@Frame),0);
diff --git a/protocols/mRadio/i_myservice.inc b/protocols/mRadio/i_myservice.inc index b8338a0d81..e4e76ba10f 100644 --- a/protocols/mRadio/i_myservice.inc +++ b/protocols/mRadio/i_myservice.inc @@ -116,12 +116,6 @@ begin end;
function Service_RadioMute(wParam:WPARAM;lParam:LPARAM):int;cdecl;
-var
-{$IFDEF KOL_MCK}
- med:TMouseEventData;
-{$ELSE}
- tmp:pAnsiChar;
-{$ENDIF}
begin
if gVolume=0 then
gVolume:=-1
@@ -131,30 +125,6 @@ begin if hVolFrmCtrl<>0 then
EnableWindow(hVolFrmCtrl,gVolume>=0);
-{$IFDEF KOL_MCK}
- if lParam=0 then // 0 - from Service, not frame
- begin
- if btnMute<>nil then
- begin
- FillChar(med,SizeOf(med),0);
- med.Button:=mbLeft;
- med.StopHandling:=true;
- btnMute.OnMouseDown(btnMute,med);
- // btnMute.Click; // without click processing
- btnMute.OnMouseUp (btnMute,med);
- btnMute.Invalidate;
- end
- end;
-{$ELSE}
- if hMuteFrmCtrl<>0 then
- begin
- if gVolume<0 then
- tmp:=IcoBtnOff
- else
- tmp:=IcoBtnOn;
- SetButtonIcon(hMuteFrmCtrl,tmp);
- end;
-{$ENDIF}
end;
function Service_EqOnOff(wParam:WPARAM;lParam:LPARAM):int;cdecl;
diff --git a/protocols/mRadio/i_tray.inc b/protocols/mRadio/i_tray.inc index 096e288691..fa63acc720 100644 --- a/protocols/mRadio/i_tray.inc +++ b/protocols/mRadio/i_tray.inc @@ -21,7 +21,7 @@ type function MyStrSort(para1:pointer; para2:pointer):int; cdecl;
begin
- result:=StrCmpW(pTrayRadioStation(para1).name,pTrayRadioStation(para2).name);
+ result:=lstrcmpiW{StrCmpW}(pTrayRadioStation(para1).name,pTrayRadioStation(para2).name);
end;
function ChooseStation(wParam:WPARAM;lParam,lParam1:LPARAM):int; cdecl;
diff --git a/protocols/mRadio/i_tray_api.inc b/protocols/mRadio/i_tray_api.inc deleted file mode 100644 index 9339a10613..0000000000 --- a/protocols/mRadio/i_tray_api.inc +++ /dev/null @@ -1,125 +0,0 @@ -{}
-type
- pTrayRadioStation = ^tTrayRadioStation;
- tTrayRadioStation = record
- name:pWideChar;
- handle:THANDLE;
- end;
-
-function MyStrSort(para1:pointer; para2:pointer):int; cdecl;
-begin
- result:=StrCmpW(pTrayRadioStation(para1).name,pTrayRadioStation(para2).name);
-end;
-
-function MakeStationsMenu:HMENU;
-var
- hContact:Cardinal;
- sl:TSortedList;
- p:pWideChar;
- i:integer;
- flag:integer;
- tmp:pTrayRadioStation;
-begin
- result:=CreatePopupMenu;
- if result<>0 then
- begin
- FillChar(sl,SizeOf(sl),0);
- sl.increment:=16;
- sl.sortFunc:=@MyStrSort;
- hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0);
- while hContact<>0 do
- begin
- if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0)),cPluginName)=0 then
- begin
- p:=DBReadUnicode(hContact,strCList,'MyHandle',nil);
- if p<>nil then
- begin
- mGetMem(tmp,SizeOf(tTrayRadioStation));
- tmp.name:=p;
- tmp.handle:=hContact;
- List_InsertPtr(@sl,tmp);
- end;
- end;
- hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0);
- end;
-
- for i:=0 to sl.realCount-1 do
- begin
- if (i=0) or ((i mod 20)<>0) then
- flag:=MF_STRING
- else
- flag:=MF_STRING or MF_MENUBARBREAK;
- tmp:=sl.Items[i];
- AppendMenuW(result,flag,tmp.handle,tmp.name);
- mFreeMem(tmp.name);
- mFreeMem(tmp);
- end;
- List_Destroy(@sl);
- end;
-end;
-
-function CreateTrayMenu(wParam:WPARAM;lParam:LPARAM):int; cdecl;
-const
- startid = 100;
-var
- menu:HMENU;
- flag,id:integer;
- pt:TPOINT;
- playstr:pWideChar;
-begin
- id:=0;
- menu:=CreatePopupMenu;
- if menu<>0 then
- begin
- if gVolume<0 then
- flag:=MF_STRING+MF_CHECKED
- else
- flag:=MF_STRING+MF_UNCHECKED;
-
- if CallService(MS_RADIO_COMMAND,MRC_STATUS,RD_STATUS_GET)<>RD_STATUS_PAUSED then
- playstr:='Pause'
- else
- playstr:='Play';
-
- AppendMenuW(menu,flag ,startid+1,TranslateW('Mute'));
- AppendMenuW(menu,MF_STRING,startid+2,TranslateW(playstr));
- AppendMenuW(menu,MF_STRING,startid+3,TranslateW('Stop'));
- AppendMenuW(menu,MF_SEPARATOR,0,nil);
- AppendMenuW(menu,MF_POPUP,MakeStationsMenu,TranslateW('Play Station'));
- GetCursorPos(pt);
- id:=integer(TrackPopupMenu(menu,TPM_RETURNCMD+TPM_NONOTIFY,pt.x,pt.y,0,hiddenwindow,nil));
- case id of
- 0: ; // nothing
- startid+1: begin // mute
- Service_RadioMute(0,0);
- end;
- startid+2: begin // play/pause
- CallService(MS_RADIO_COMMAND,MRC_PAUSE,0);
- end;
- startid+3: begin // stop
- CallService(MS_RADIO_COMMAND,MRC_STOP,0);
- end;
- else // choose station
- Service_RadioPlayStop(id,0);
- end;
- DestroyMenu(menu);
- end;
- result:=id;
-end;
-
-procedure CreateMIMTrayMenu;
-var
- mi:TCListMenuItem;
-begin
- if ServiceExists(MS_CLIST_ADDTRAYMENUITEM)<>0 then
-// if hiddenwindow<>0 then
- begin
- FillChar(mi, sizeof(mi), 0);
- mi.cbSize :=sizeof(mi);
- mi.pszService:=MS_RADIO_TRAYMENU;
- mi.szName.a :=cPluginName;
- mi.hIcon :=CallService(MS_SKIN2_GETICON,0,lparam(IcoBtnSettings));
- Menu_AddTrayMenuItem(@mi);
- end;
-end;
-
diff --git a/protocols/mRadio/i_vars.inc b/protocols/mRadio/i_vars.inc index 26e7024cc1..5d75dc7fae 100644 --- a/protocols/mRadio/i_vars.inc +++ b/protocols/mRadio/i_vars.inc @@ -97,11 +97,7 @@ const hVolCtrl :HWND=0;
hVolFrmCtrl :HWND=0;
const
- {$IFDEF KOL_MCK}
- btnMute:pIcoButton = nil;
- {$ELSE}
hMuteFrmCtrl:HWND=0;
- {$ENDIF}
const
Inited:boolean=false;
const
diff --git a/protocols/mRadio/mradio.dpr b/protocols/mRadio/mradio.dpr index 56c2b7dba9..274fbd8977 100644 --- a/protocols/mRadio/mradio.dpr +++ b/protocols/mRadio/mradio.dpr @@ -9,7 +9,7 @@ library mradio; uses
// FastMM4,
- {$IFDEF KOL_MCK}kol,icobuttons,KOLCCtrls,{$ENDIF}Windows,messages,commctrl
+ Windows,messages,commctrl
,common,io,wrapper,wrapdlgs,syswin
,Dynamic_Bass,dynbasswma
,m_api,dbsettings,mirutils,playlist,memini;
@@ -91,11 +91,7 @@ end; {$include i_service.inc}
{$include i_myservice.inc}
{$include i_hotkey.inc}
-{$IFDEF KOL_MCK}
- {$include i_frame.inc}
-{$ELSE}
- {$include i_frameapi.inc}
-{$ENDIF}
+{$include i_frameapi.inc}
{$include i_tray.inc}
{$include i_visual.inc}
{$include i_optdlg.inc}
diff --git a/protocols/mRadio/mradio.rc b/protocols/mRadio/mradio.rc index 91e976fa35..2b81408090 100644 --- a/protocols/mRadio/mradio.rc +++ b/protocols/mRadio/mradio.rc @@ -138,8 +138,8 @@ BEGIN CONTROL "" ,IDC_RADIO_VOL ,"msctls_trackbar32", TBS_BOTTOM|TBS_NOTICKS|$100,0,2,98,11
// CONTROL "*",IDC_RADIO_MUTE,"MButtonClass" ,WS_TABSTOP,100,1,12,12//,$18000000
PUSHBUTTON "*" ,IDC_RADIO_MUTE, 100,1,12,12,
-// BS_OWNERDRAW
- BS_FLAT | BS_ICON | BS_PUSHLIKE | BS_CHECKBOX | BS_DEFPUSHBUTTON | BS_CENTER | BS_VCENTER
+ BS_OWNERDRAW
+// BS_FLAT | BS_ICON | BS_PUSHLIKE | BS_CHECKBOX | BS_DEFPUSHBUTTON | BS_CENTER | BS_VCENTER
END
diff --git a/protocols/mRadio/mradio.res b/protocols/mRadio/mradio.res Binary files differindex d70c64c58e..10d008f143 100644 --- a/protocols/mRadio/mradio.res +++ b/protocols/mRadio/mradio.res |