diff options
Diffstat (limited to 'include')
100 files changed, 28593 insertions, 0 deletions
diff --git a/include/delphi/README.txt b/include/delphi/README.txt new file mode 100644 index 0000000000..4c0ab5f0cf --- /dev/null +++ b/include/delphi/README.txt @@ -0,0 +1,92 @@ +
+ - Miranda Module API for Borland Delphi, FreePascal -
+
+ These include files allow you to write modules to extend Miranda
+ Older versions of these files
+ limited support for FPC, versions & compilers are :
+
+ Borland Delphi 2.0 thru 6.0
+ FreePascal 1.0.4, 1.0.6
+
+ You can now create modules for Miranda (v0.1.2.2) and use
+ new stuff like Netlib! though you can still write for
+ the current stable release (v0.1.2.1) but you'll have to
+ be aware of version dependant things.
+
+ Worry not though, every service/event is marked with a version
+ code if it's not present in older Miranda versions.
+
+ Be warned, this is a brand new porting though it has borrowed
+ from older ports (see CVS, oh this is viewCVS? mmm, cheese.)
+ Things are presented in a more Delphi esque than a C esque manner
+ so if you feel confused refer to the C header.
+
+ A word of warning, don't try to compile /delphiplugins examples
+ with these include files and expect it to work,
+
+
+ Include files use the {$include } syntax and will never work
+ as units.
+
+ -- FPC support? --
+
+ FPC is now properly supported, but you may need to use -SD -S2
+ command line switches (for Delphi, BP7 mode) remember to use -Fi
+ and -Fu to give the path to these files or use {$UNITPATH} and {$INCLUDEPATH}
+
+ These include files don't any FPC stuff like macros
+ and inlined functions.
+
+ -- Things to be aware of --
+
+ This version is not yet directly supported, if you want to learn
+ the API look at the CVS tree for documentation on plugins, as well
+ as guidelines and examples of the general structure of Miranda.
+
+ This is my cop out for now, I'll try to write a more general 'guide' later
+ on.
+
+ -
+
+ Miranda uses a manifest to allow COMCTRL v6 to be loaded on XP,
+ This causes problems with image lists with Delphi (there are work arounds)
+ see borland.com for the article.
+
+ You may want to refuse to load on XP or try to use Miranda's API to work with
+ imagelists and load images from resource as bitmaps (ugh)
+
+ - lstrcat, lstrcpy
+
+ I've used the Windows API calls to these C functions over Delphi's RTL
+ because SysUtils.pas just adds a bloat.
+
+ - *If* you use SysUtils.pas
+
+ Delphi loads OLE for variant support, it maybe advisable to unload
+ the DLL as soon as you start, this maybe a problem though, since Miranda
+ also uses OLE for extended image support, it doesn't however keep
+ it loaded all the time.
+
+ There should be no problem in just decrementing the reference count
+ to the DLL and it'll unload if you were the only reference.
+
+ if however you're using variants in your code, blergh.
+
+ -- How you get it to work --
+
+ see testdll.dpr, it won't do much but it'll show a pretty description in the
+ options dialog (oh impressive!)
+
+ To bring in new files, just use {$include that_file_you_want.inc}
+ If other include files are needed by the include file you bring in,
+ it'll try to include it itself.
+
+ Of course you need to add the path to where the .inc files are to the project's
+ search path, or if you compile via the command line, use -U and -I
+ -U is needed because m_globaldefs.pas is a unit.
+
+ Each header file is marked with "UNITDEP" which will tell you which units
+ it requires.
+
+ All files that require the PLUGINLINK structure require m_globaldefs.pas
+ (this is all the C header files that use such macros!)
diff --git a/include/delphi/m_addcontact.inc b/include/delphi/m_addcontact.inc new file mode 100644 index 0000000000..6bf08e8208 --- /dev/null +++ b/include/delphi/m_addcontact.inc @@ -0,0 +1,54 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_ADDCONTACT}
+{$DEFINE M_ADDCONTACT}
+
+const
+
+ HANDLE_SEARCHRESULT = 0;
+ HANDLE_EVENT = 1;
+ HANDLE_CONTACT = 2;
+
+type
+
+ PADDCONTACTSTRUCT = ^TADDCONTACTSTRUCT;
+ TADDCONTACTSTRUCT = record
+ handleType: Integer;
+ handle: THandle; // HDBEVENT, HCONTACT, SearchResult
+ szProto: PChar; // used by search result only
+ psr: Pointer; // @PROTOSEARCHRESULT
+ end;
+
+const
+
+ {
+ wParam : (HWND) Parent window of the dialog that will be presented
+ lParam : Pointer to an initialised TADDCONTACTSTRUCT
+ Affect : Open's the add contact dialog
+ Version: 0.1.2.2+
+ }
+ MS_ADDCONTACT_SHOW = 'AddContact/Show';
+
+{$ENDIF}
diff --git a/include/delphi/m_api.pas b/include/delphi/m_api.pas new file mode 100644 index 0000000000..412d33e517 --- /dev/null +++ b/include/delphi/m_api.pas @@ -0,0 +1,75 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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.
+
+*)
+
+{$IFDEF FPC}
+ {$PACKRECORDS C}
+ {$MODE Delphi}
+{$ENDIF}
+
+unit m_api;
+
+interface
+
+uses
+
+ m_globaldefs, windows;
+
+ {$include m_plugins.inc}
+ {$include m_system.inc}
+ {$include m_database.inc}
+ {$include m_findadd.inc}
+ {$include m_awaymsg.inc}
+ {$include m_email.inc}
+ {$include m_history.inc}
+ {$include m_message.inc}
+ {$include m_url.inc}
+ {$include newpluginapi.inc}
+ {$include m_clui.inc}
+ {$include m_ignore.inc}
+ {$include m_skin.inc}
+ {$include m_file.inc}
+ {$include m_netlib.inc}
+ {$include m_langpack.inc}
+ {$include m_clist.inc}
+ {$include m_clc.inc}
+ {$include m_userinfo.inc}
+ {$include m_protosvc.inc}
+ {$include m_options.inc}
+ {$include m_icq.inc}
+ {$include m_protocols.inc}
+ {$include m_protomod.inc}
+ {$include m_utils.inc}
+ {$include m_addcontact.inc}
+ {$include statusmodes.inc}
+ {$include m_contacts.inc}
+ {$define M_API_UNIT}
+ {$include m_helpers.inc}
+
+implementation
+
+ {$undef M_API_UNIT}
+ {$include m_helpers.inc}
+
+end.
+
diff --git a/include/delphi/m_awaymsg.inc b/include/delphi/m_awaymsg.inc new file mode 100644 index 0000000000..44be914423 --- /dev/null +++ b/include/delphi/m_awaymsg.inc @@ -0,0 +1,40 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_AWAYMSG}
+{$DEFINE M_AWAYMSG}
+
+const
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affect : Show the away/na/etc message for a contact
+ Returns: 0 on success, non zero on failure, see notes
+ notes : returns without waiting for the message to be shown.
+ version: v0.1.0.1+
+ }
+ MS_AWAYMSG_SHOWAWAYMSG = 'SRAway/GetMessage';
+
+{$ENDIF}
diff --git a/include/delphi/m_clc.inc b/include/delphi/m_clc.inc new file mode 100644 index 0000000000..743d8370aa --- /dev/null +++ b/include/delphi/m_clc.inc @@ -0,0 +1,284 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_CLC}
+{$DEFINE M_CLC}
+
+const
+
+ CLISTCONTROL_CLASS = 'CListControl';
+
+ // styles
+
+ CLS_MANUALUPDATE = $0001; // todo
+ CLS_SHOWHIDDEN = $0002;
+ CLS_HIDEOFFLINE = $0004; // hides all offline users
+ CLS_CHECKBOXES = $0008;
+ CLS_MULTICOLUMN = $0010; // not true multi-column, just for ignore/vis options
+ CLS_HIDEEMPTYGROUPS = $0020; // note: this flag will be spontaneously removed if the 'new subgroup' menu item is clicked, for obvious reasons
+ CLS_USEGROUPS = $0040;
+ CLS_NOHIDEOFFLINE = $0080; // overrides CLS_HIDEOFFLINE and the per-group hideoffline setting
+ CLS_GREYALTERNATE = $0100; // make every other line slightly grey
+ CLS_GROUPCHECKBOXES = $0200; // put checkboxes on groups too (managed by CLC)
+
+ CLS_EX_DISABLEDRAGDROP = $00000001;
+ CLS_EX_EDITLABELS = $00000002;
+ CLS_EX_SHOWSELALWAYS = $00000004;
+ CLS_EX_TRACKSELECT = $00000008;
+ CLS_EX_SHOWGROUPCOUNTS = $00000010;
+ CLS_EX_DIVIDERONOFF = $00000020;
+ CLS_EX_HIDECOUNTSWHENEMPTY = $00000040;
+ CLS_EX_NOTRANSLUCENTSEL = $00000080;
+ CLS_EX_LINEWITHGROUPS = $00000100;
+ CLS_EX_QUICKSEARCHVISONLY = $00000200;
+ CLS_EX_SORTGROUPSALPHA = $00000400;
+ CLS_EX_NOSMOOTHSCROLLING = $00000800;
+
+ CLM_FIRST = $1000; // this is the same as LVM_FIRST
+ CLM_LAST = $1100;
+
+// messages, compare with equivalent TVM_* in the WINAPI
+
+ CLM_ADDCONTACT = (CLM_FIRST+0); // wParam=hContact
+ CLM_ADDGROUP = (CLM_FIRST+1); // wParam=hGroup
+ CLM_AUTOREBUILD = (CLM_FIRST+2);
+ CLM_DELETEITEM = (CLM_FIRST+3); // wParam=hItem
+ CLM_EDITLABEL = (CLM_FIRST+4); // wParam=hItem
+ CLM_ENDEDITLABELNOW = (CLM_FIRST+5); // wParam=cancel, 0 to save
+ CLM_ENSUREVISIBLE = (CLM_FIRST+6); // wParam=hItem, lParam=partialOk
+
+ CLE_TOGGLE = -1;
+ CLE_COLLAPSE = 0;
+ CLE_EXPAND = 1;
+ CLE_INVALID = $FFFF;
+
+ CLM_EXPAND = (CLM_FIRST+7); // wParam=hItem, lParam=CLE_
+ CLM_FINDCONTACT = (CLM_FIRST+8); // wParam=hContact, returns an hItem
+ CLM_FINDGROUP = (CLM_FIRST+9); // wParam=hGroup, returns an hItem
+ CLM_GETBKCOLOR = (CLM_FIRST+10); // returns a COLORREF
+ CLM_GETCHECKMARK = (CLM_FIRST+11); // wParam=hItem, returns 1 or 0
+ CLM_GETCOUNT = (CLM_FIRST+12); // returns the total number of items
+
+ 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_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
+ CLM_GETISEARCHSTRING = (CLM_FIRST+20); // lParam=(char*)pszStr, max 120 bytes, returns number of chars in string
+ CLM_GETITEMTEXT = (CLM_FIRST+21); // wParam=hItem, lParam=(char*)pszStr, max 120 bytes
+ CLM_GETSCROLLTIME = (CLM_FIRST+22); // returns time in ms
+ CLM_GETSELECTION = (CLM_FIRST+23); // returns hItem
+
+ CLCHT_ABOVE = $0001; // above client area
+ CLCHT_BELOW = $0002; // below client area
+ CLCHT_TOLEFT = $0004; // left of client area
+ CLCHT_TORIGHT = $0008; // right of client area
+ CLCHT_NOWHERE = $0010; // in client area, not on an item
+ CLCHT_ONITEMICON = $0020;
+ CLCHT_ONITEMCHECK = $0040;
+ CLCHT_ONITEMLABEL = $0080;
+ CLCHT_ONITEMINDENT = $0100; // to the left of an item icon
+ CLCHT_ONITEMEXTRA = $0200; // on an extra icon, HIBYTE(HIWORD()) says which
+ CLCHT_ONITEM = $03E0;
+ CLCHT_INLEFTMARGIN = $0400;
+ CLCHT_BELOWITEMS = $0800; // in client area but below last item
+
+ CLM_HITTEST = (CLM_FIRST+25); // lParam=MAKELPARAM(x,y) (relative to control), wParam=(PDWORD)&hitTest (see encoding of HitTest() in clc.h, can be NULL) returns hItem or NULL
+ CLM_SELECTITEM = (CLM_FIRST+26); // wParam=hItem
+
+ CLB_TOPLEFT = 0;
+ CLB_STRETCHV = 1;
+ CLB_STRETCHH = 2; // and tile vertically
+ CLB_STRETCH = 3;
+
+ CLBM_TYPE = $00FF;
+ CLBF_TILEH = $1000;
+ CLBF_TILEV = $2000;
+ CLBF_PROPORTIONAL = $4000;
+ CLBF_SCROLL = $8000;
+
+ 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
+
+ FONTID_CONTACTS = 0;
+ FONTID_INVIS = 1;
+ FONTID_OFFLINE = 2;
+ FONTID_NOTONLIST = 3;
+ FONTID_GROUPS = 4;
+ FONTID_GROUPCOUNTS = 5;
+ FONTID_DIVIDERS = 6;
+ FONTID_OFFINVIS = 7;
+ FONTID_MAX = 7;
+
+ CLM_SETFONT = (CLM_FIRST+33); // wParam=hFont, lParam=MAKELPARAM(fRedraw,fontId)
+ CLM_SETINDENT = (CLM_FIRST+34); // wParam=new indent, default is 3 pixels
+ CLM_SETITEMTEXT = (CLM_FIRST+35); // wParam=hItem, lParam=(char*)pszNewText
+ CLM_SETSCROLLTIME = (CLM_FIRST+36); // wParam=time in ms, default 200
+ CLM_SETHIDEEMPTYGROUPS = (CLM_FIRST+38); // wParam=TRUE/FALSE
+
+ GREYF_UNFOCUS = $80000000;
+ MODEF_OFFLINE = $40000000;
+
+ // and use the PF2_ #defines from m_protosvc.inc
+ CLM_SETGREYOUTFLAGS = (CLM_FIRST+39); // wParam=new flags
+ CLM_GETHIDEOFFLINEROOT = (CLM_FIRST+40); // returns TRUE/FALSE
+ CLM_SETHIDEOFFLINEROOT = (CLM_FIRST+41); // wParam=TRUE/FALSE
+ CLM_SETUSEGROUPS = (CLM_FIRST+42); // wParam=TRUE/FALSE
+ CLM_SETOFFLINEMODES = (CLM_FIRST+43); // for 'hide offline', wParam=PF2_ flags and MODEF_OFFLINE
+ CLM_GETEXSTYLE = (CLM_FIRST+44); // returns CLS_EX_ flags
+ CLM_SETEXSTYLE = (CLM_FIRST+45); // wParam=CLS_EX_ flags
+ CLM_GETLEFTMARGIN = (CLM_FIRST+46); // returns count of pixels
+ CLM_SETLEFTMARGIN = (CLM_FIRST+47); // wParam=pixels
+ // the order of info items is never changed, so make sure you add them in the
+ // order you want them to remain
+ CLM_ADDINFOITEM = (CLM_FIRST+48); // lParam=&TCLCINFOITEM, returns hItem
+ CLM_GETITEMTYPE = (CLM_FIRST+49); // wParam=hItem, returns a CLCIT_
+ CLM_GETNEXTITEM = (CLM_FIRST+50); // wParam=flag, lParam=hItem, returns an hItem
+ CLM_GETTEXTCOLOR = (CLM_FIRST+51); // wParam=FONTID_, returns COLORREF
+ CLM_SETTEXTCOLOR = (CLM_FIRST+52); // wParam=FONTID_, lParam=COLORREF
+
+ 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
+ CLCIIF_GROUPFONT = $80; // draw the item using FONTID_GROUPS
+
+ CLCIT_INVALID = -1;
+ CLCIT_GROUP = 0;
+ CLCIT_CONTACT = 1;
+ CLCIT_DIVIDER = 2;
+ CLCIT_INFO = 3;
+
+ CLGN_ROOT = 0;
+ CLGN_CHILD = 1;
+ CLGN_PARENT = 2;
+ CLGN_NEXT = 3;
+ CLGN_PREVIOUS = 4;
+ CLGN_NEXTCONTACT = 5;
+ CLGN_PREVIOUSCONTACT = 6;
+ CLGN_NEXTGROUP = 7;
+ CLGN_PREVIOUSGROUP = 8;
+
+ CLNF_ISGROUP = 1;
+ CLNF_ISINFO = 2;
+
+ CLN_FIRST = (0-100);
+ CLN_EXPANDED = (CLN_FIRST-0); // hItem=hGroup, action=CLE_*
+ CLN_LISTREBUILT = (CLN_FIRST-1);
+ CLN_ITEMCHECKED = (CLN_FIRST-2); // todo // hItem,action,flags valid
+ CLN_DRAGGING = (CLN_FIRST-3); // hItem,pt,flags valid. only sent when cursor outside window, return nonzero if processed
+ CLN_DROPPED = (CLN_FIRST-4); // hItem,pt,flags valid. only sent when cursor outside window, return nonzero if processed
+ CLN_LISTSIZECHANGE = (CLN_FIRST-5); // pt.y valid. the vertical height of the visible items in the list has changed.
+ CLN_OPTIONSCHANGED = (CLN_FIRST-6); // nothing valid. If you set some extended options they have been overwritten and should be re-set
+ CLN_DRAGSTOP = (CLN_FIRST-7); // hItem,flags valid. sent when cursor goes back in to the window having been outside, return nonzero if processed
+ CLN_NEWCONTACT = (CLN_FIRST-8); // hItem,flags valid. sent when a new contact is added without a full list rebuild
+ 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
+
+type
+
+ PCLCINFOITEM = ^TCLCINFOITEM;
+ TCLCINFOITEM = record
+ cbSize: int;
+ pszText: PChar;
+ hParentGroup: THandle;
+ flags: DWORD;
+ hIcon: THandle; // todo
+ end;
+
+ PNMCLISTCONTROL = ^TNMCLISTCONTROL;
+ TNMCLISTCONTROL = record
+ hdr: TNMHDR; // depends on Windows.pas
+ hItem: THandle;
+ action: int;
+ iColumn: int; // -1 if not on an extra column
+ flags: DWORD;
+ pt: TPoint; // depends on Windows.pas
+ end;
+
+ PCLCINFOTIP = ^TCLCINFOTIP;
+ TCLCINFOTIP = record
+ cbSize: int;
+ isTreeFocused: int; // so the plugin can provide an option
+ isGroup: int; // 0 if it's contact, 1 if it's a group
+ hItem: THandle; // handle to group or contact
+ ptCursor: TPoint;
+ rcItem: TRect;
+ end;
+
+const
+
+ {
+ wParam : 0
+ lParam : Pointer to a TCLCINFOTIP structure
+ Affect : An InfoTip for an item should be shown now, see notes
+ Returns: [non zero] if you process this, because it makes no sense
+ for more than one module to process this.
+ Notes : It's upto the module where to put the InfoTip, Normally
+ it's a few pixels below and to the right of the cursor.
+ -
+ This event is called after the mouse ehas been stationary over
+ a contact for (by default) 200ms
+ }
+ ME_CLC_SHOWINFOTIP = 'CLC/ShowInfoTip';
+
+ {
+ wParam : 0
+ lParam : Pointer to an initialised TCLCINFOTIP
+ Affect : It's time to destroy an infotip, see notes
+ Notes : Only cbSize, isGroup, hItem are set
+ notes : This is sent when the mouse moves off a contact when ME_CLC_SHOWINFOTIP
+ has previously been called.
+ -
+ If you don't want this behaviour, you should have grabbed the mouse
+ capture yourself --
+ }
+ ME_CLC_HIDEINFOTIP = 'CLC/HideInfoTip';
+
+ {
+ wParam : new_time
+ lParam : 0
+ Affect : Set a new hover time before the info tip hooks are called, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : The value of this setting is applid to all current CLC windows
+ and saved to b applied to all future windows, it is persistent.
+ -
+ Time is in milliseconds, default is 750ms
+ }
+ MS_CLC_SETINFOTIPHOVERTIME = 'CLC/SetInfoTipHoverTime';
+
+ {
+ wParam : 0
+ lParam : 0
+ Affect : get the hover time before the infotip hooks are called
+ returns: the hover time in MS
+ }
+ MS_CLC_GETINFOTIPHOVERTIME = 'CLC/GetInfoTipHoverTime';
+
+{$ENDIF}
\ No newline at end of file diff --git a/include/delphi/m_clist.inc b/include/delphi/m_clist.inc new file mode 100644 index 0000000000..20a3fb0e29 --- /dev/null +++ b/include/delphi/m_clist.inc @@ -0,0 +1,641 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_CLIST}
+{$DEFINE M_CLIST}
+
+{$ifndef STATUSMODES}
+ {$include statusmodes.inc}
+{$endif}
+
+const
+
+ // for MS_CLIST_GETSTATUSMODEDESCRIPTION
+
+ GSMDF_PREFIXONLINE = 1; // prefix "Online :" for online submodes, e.g. 'away'
+
+ // for MS_CLIST_ADDMAINMENUITEM
+
+ CMIF_GRAYED = 1;
+ CMIF_CHECKED = 2;
+ CMIF_HIDDEN = 4; // only works on contact menus
+ CMIF_NOTOFFLINE = 8; // item won't appear for contacts that are offline
+ CMIF_NOTONLINE = 16; // " online
+ CMIF_NOTONLIST = 32; // item won't appear on standard contacts
+ CMIF_NOTOFFLIST = 64; // item won't appear on contacts that have the 'NotOnList' setting
+
+ // for MS_CLIST_MODIFYMENUITEM
+
+ CMIM_NAME = $80000000;
+ CMIM_FLAGS = $40000000;
+ CMIM_ICON = $20000000;
+ CMIM_HOTKEY = $10000000;
+ CMIM_ALL = $F0000000;
+
+ // for MS_CLIST_GETCONTACTDISPLAYNAME
+
+ // will never return the user's custom name, even if that's the one to be displayed
+ GCDNF_NOMYHANDLE = 1;
+
+ // for MS_CLIST_ADDEVENT
+
+ //flashes the icon even if the user is occupied, and puts the event
+ // at the top of the queue
+ CLEF_URGENT = 1;
+ { icon will not flash forever, only a few times, e.g. online alert }
+ CLEF_ONLYAFEW = 2;
+
+ // for MS_CLIST_GETICONSIMAGELIST
+
+ IMAGE_GROUPOPEN = 11;
+ IMAGE_GROUPSHUT = 12;
+
+ // for MS_CLIST_MENUPROCESSCOMMAND
+
+ MPCF_CONTACTMENU = 1; // test commands from a contact menu
+ MPCF_MAINMENU = 2; // test commands from the main menu
+
+ // for MS_CLIST_GROUPGETNAME/2
+
+ GROUPF_EXPANDED = $04;
+ GROUPF_HIDEOFFLINE = $08;
+
+ //
+
+ SETTING_TOOLWINDOW_DEFAULT = 1;
+ SETTING_SHOWMAINMENU_DEFAULT = 1;
+ SETTING_SHOWCAPTION_DEFAULT = 1;
+ SETTING_CLIENTDRAG_DEFAULT = 0;
+ SETTING_ONTOP_DEFAULT = 1;
+ SETTING_MIN2TRAY_DEFAULT = 1;
+ SETTING_TRAY1CLICK_DEFAULT = 0;
+ SETTING_HIDEOFFLINE_DEFAULT = 0;
+ SETTING_HIDEEMPTYGROUPS_DEFAULT = 0;
+ SETTING_USEGROUPS_DEFAULT = 1;
+ SETTING_SORTBYSTATUS_DEFAULT = 0;
+ SETTING_TRANSPARENT_DEFAULT = 0;
+ SETTING_ALPHA_DEFAULT = 200;
+ SETTING_AUTOALPHA_DEFAULT = 150;
+ SETTING_CONFIRMDELETE_DEFAULT = 1;
+ SETTING_AUTOHIDE_DEFAULT = 0;
+ SETTING_HIDETIME_DEFAULT = 30;
+ SETTING_CYCLETIME_DEFAULT = 4;
+ SETTING_ALWAYSSTATUS_DEFAULT = 0;
+ SETTING_ALWAYSMULTI_DEFAULT = 0;
+ SETTING_TRAYICON_SINGLE = 0;
+ SETTING_TRAYICON_CYCLE = 1;
+ SETTING_TRAYICON_MULTI = 2;
+ SETTING_TRAYICON_DEFAULT = SETTING_TRAYICON_SINGLE;
+ SETTING_STATE_HIDDEN = 0;
+ SETTING_STATE_MINIMIZED = 1;
+ SETTING_STATE_NORMAL = 2;
+
+type
+
+ PCLISTMENUITEM = ^TCLISTMENUITEM;
+ TCLISTMENUITEM = record
+ cbSize: int; // size in bytes of this structure
+ pszName: PChar; // text of the menu item
+ flags: DWORD;
+ position: int; // approx position on the menu, lower numbers go nearer the top
+ hIcon: THandle; // icon to put by the item, if this was *not* loaded from
+ // a resource, you can delete it straight after the call
+ pszService: PChar; // name of the service to call when the service is clicked
+ pszPopupName: PChar;// name of the popup menu that this item is on, if this
+ // is NULL the iteem is on the root of the menu
+ popupPosition: int; // position of the popup menu on the root menu, ignored
+ // if pszPopupName is NULL(0) or if the popup menu already exists
+ hotKey: DWORD; // keyboard accelerator, same as lParam of WM_HOTKEY, 0 for none
+ pszContactOwner: PChar; // contact menus only, the protocol module that owns
+ // the contacts to which this to which this menu item
+ // applies, NULL(0) if it applies to all contacts.
+ // if it applies to multiple but not all protocols
+ // add multiple menu items or use ME_CLIST_PREBUILDCONTACTMENU
+ end;
+
+ PCLISTDOUBLECLICKACTION = ^TCLISTDOUBLECLICKACTION;
+ TCLISTDOUBLECLICKACTION = record
+ cbSize: int;
+ pszContactOwner: PChar; // name of the protocol owning the contact or NULL(0) for all
+ flags: DWORD; // CMIF_NOT flags above
+ pszService: PChar; // service to call on double click, is called with wParam=hContact, lParam=0
+ end;
+
+ PCLISTEVENT = ^TCLISTEVENT;
+ TCLISTEVENT = record
+ cbSize: int; // size in bytes
+ hContact: THandle; // handle to the contact to put the icon by
+ hIcon: THandle; // icon to flash!
+ flags: DWORD;
+ hDBEvent: THandle; // caller defined, but should be unique for hContact
+ lParam: LPARAM;
+ pszService: PChar; // name of service to call on activation
+ pszTooltip: PChar; // short description of the event to display as a tooltip on the systray
+ end;
+
+const
+
+ {
+ wParam : new_status
+ lParam : 0
+ Affect : Sent when the user acks to change their status, see notes
+ Notes : Also sent due to a MS_CLIST_SETSTATUSMODE
+ }
+ ME_CLIST_STATUSMODECHANGE = 'CList/StatusModeChange';
+
+ {
+ wParam : new_status
+ lParam : 0
+ Affect : Force a change of status mode, see statusmodes.inc
+ }
+ MS_CLIST_SETSTATUSMODE = 'CList/SetStatusMode';
+
+ {
+ wParam : 0
+ lParam : 0
+ Affect : Get the current status mode, see notes
+ Notes : This is the status, as set by the user, not any protocol specific status
+ all protocol modules will attempt to conform to this setting at ALL times.
+ }
+ MS_CLIST_GETSTATUSMODE = 'CList/GetStatusMode';
+
+ {
+ wParam : status_mode
+ lParam : flags
+ Affect : Get a textual description of the given status mode
+ Returns: pointer to a static buffer of the description of the given status mode
+ or NULL(0) if the mode was unknown.
+ Version: v0.1.0.1+
+ }
+ MS_CLIST_GETSTATUSMODEDESCRIPTION = 'CList/GetStatusModeDescription';
+
+ {
+ wParam : 0
+ lParam : Pointer to a initalised TCLISTMENUITEM structure
+ Affect : Add a new menu item to the main menu, see notes
+ Returns: A handle to the new MENU item or NULL(0) on failure
+ Notes : The given TCLISTMENUITEM.pszService in is called when the item
+ get clicked with :
+ -
+ wParam = 0, lParam = hwndContactList
+ }
+ MS_CLIST_ADDMAINMENUITEM = 'CList/AddMainMenuItem';
+
+ {
+ wParam : 0
+ lParam : Pointer to a initalised TCLISTMENUITEM structure
+ Affect : Add a new item to the user contact menus, see notes
+ Notes : exactly the same as MS_CLIST_ADDMAINMENUITEM except when an item
+ is selected, the service gets called with wParam=hContact,
+ pszContactOwner is obeyed.
+ -
+ Popup menus are not supported, pszPopupName and popupPosition
+ are ignored. If CTRL is held down when right clicking the menu
+ position numbers will be displayed in brackets afterr the menu item
+ text, this only works in debug builds!
+ }
+ MS_CLIST_ADDCONTACTMENUITEM = 'CList/AddContactMenuItem';
+
+ {
+ wParam : HMENUITEM
+ lParam : Pointer to a initalised TCLISTMENUITEM
+ Affect : Modify an existing menu item, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : hMenuItem will have been returned by MS_CLIST_ADD[MAIN]MENUITEM
+ TCLISTMENUITEM.flags should contain CMIM_* constants (see above)
+ to mark which fields should be updated, if it's not present, they
+ can't be updated -- if flags do not exist for a field it can not
+ be updated.
+ Version: v0.1.0.1+
+ }
+ MS_CLIST_MODIFYMENUITEM = 'CList/ModifyMenuItem';
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affect : the context menu for a contact is about to be built, see notes
+ Notes : modules should use this to change menu items that are specific
+ to the contact that has them
+ Version: v0.1.0.1+
+ }
+ ME_CLIST_PREBUILDCONTACTMENU = 'CList/PreBuildContactMenu';
+
+ {
+ wParam : 0
+ lParam : Pointer to a initalised TCLISTDOUBLECLICKACTION structure
+ Affect : Sets the service to call when a contact is double-clicked, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : in case of conflicts, the first module to have registered
+ will get the double click, no others will, this service
+ will return success even for duplicates
+ -
+ This service was dropped from development during 0.3.0.0, it is no
+ longer supported, see ME_CLIST_DOUBLECLICKED
+ Version: 0.1.2.2+, 0.2.0+ ONLY (not 3.0a)
+ }
+ MS_CLIST_SETDOUBLECLICKACTION = 'CList/SetDoubleClickAction';
+
+ {
+ wParam : HCONTACT
+ lParam : <none>
+ Affect : Register with this event to be notified of a double click on the CList
+ against a HCONTACT, you will not be notified if there is a pending CList event
+ that the double click clears, (i.e. flashing icon is presented to be clicked)
+ Version: 0.3.0.0
+ }
+ ME_CLIST_DOUBLECLICKED = 'CList/DoubleClicked';
+
+ {
+ wParam : HCONTACT
+ lParam : flags
+ Affect : Gets the string that the contact list will use to represent a contact
+ Returns: Always a pointer
+ Notes : Returns a pointer to the name, will always succeed, even if it needs
+ to return "(Unknown Contact)"
+ -
+ this pointer is a statically allocated buffer which will
+ be overwritten on every call to this service, callers should make
+ sure that they copy the information before they call it again
+ Version: v0.1.2.0+, 0.2.0+ ONLY (0.3a supports the contacts module)
+ }
+ MS_CLIST_GETCONTACTDISPLAYNAME = 'CList/GetContactDisplayName';
+
+ {
+ wParam : 0
+ lParam : Pointer to a TCLISTEVENT
+ Affect : Add's an event to the list
+ Notes : The service will flash TCLISTEVENT.hIcon, next to the
+ contact, TCLISTEVENT.hContact
+ -
+ pszService is called is called wParam=hwndContactList,
+ lParam=pointer to a TCLISTEVENT.
+ -
+ the TCLISTEVENT data is invalidated after this service returns
+ so copy anything from it if required.
+ -
+ TCLISTEVENT.pszService will also be called if the user
+ double clicks on the icon, at which point it will be removed
+ from the contact lists queue automatically.
+ -
+ TCLISTEVENT.hContact and TCLISTEVENT.hDBEvent should be unique.
+ }
+ MS_CLIST_ADDEVENT = 'CList/AddEvent';
+
+ {
+ wParam : HCONTACT
+ lParam : HDBEVENT
+ Affect : Remove an event from the contact list queue
+ Returns: 0 on success, [non zero] on failure
+ }
+ MS_CLIST_REMOVEEVENT = 'Clist/RemoveEvent';
+
+ {
+ wParam : HCONTACT
+ lParam : iEvent
+ Affect : Get the details of an event in the queue, see notes
+ Returns: A CLISTEVENT* or NULL(0) on failure
+ Notes : Returns the iEvent'1st/2nd/3rd/nth elemented queried,
+ e.g. iEvent=0 will get the event that will be returned if the
+ user double clicks on that HCONTACT
+ -
+ Use HCONTACT=NULL, iEvent=0 for example to get the event
+ the user will get if they double click on the tray.
+ Version: v0.1.2.1+
+ }
+ MS_CLIST_GETEVENT = 'CList/GetEvent';
+
+ {
+ wParam : ControlID
+ lParam : Pointer to MEASUREITEMSTRUCT struct
+ Affect : Process a WM_MEASUREITEM message for user context menus, see notes
+ Notes : just because wParam, lParam is defined here, only pass them
+ opaquely to this service, as is.
+ -
+ This is just to draw icons, if it is not called, the icons
+ will not be drawn
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_MENUMEASUREITEM = 'CList/MenuMeasureItem';
+
+ {
+ wParam :
+ lParam :
+ Affect : Process a WM_DRAWITEM message for user context menus,
+ wParam, lParam should be passed from such message handler.
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_MENUDRAWITEM = 'CList/MenuDrawItem';
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affect : Built the context menu for a specific contact
+ Returns: A HMENU handle identifying the menu, thhis should be DestroyMenu()ed
+ when done.
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_MENUBUILDCONTACT = 'CList/MenuBuildContact';
+
+ {
+ wParam : 0
+ lParam : 0
+ Affect : Get the image list handle with all the useful icons in it
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_GETICONSIMAGELIST = 'CList/GetIconsImageList';
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affect : Get the icon that should be associated with a contact
+ Returns: an index into the contact list imagelist, if the icon
+ is a flashing icon, this service won't return information about it
+ see below
+ Version: v0.1.2.0+
+ }
+ MS_CLIST_GETCONTACTICON = 'CList/GetContactIcon';
+
+ {
+ wParam : HCONTACT
+ lParam : ICON_ID
+ Affect : The icon of a contact in the contact list has changed,
+ ICON_ID is an index to what image has changed
+ Version: v0.1.2.1+
+ }
+ ME_CLIST_CONTACTICONCHANGED = 'CList/ContactIconChanged';
+
+ // ideally only used by a CLIST UI module
+
+ {
+ wParam : 0
+ lParam : 0
+ Affect : Get the handle to Miranda's main menu
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_MENUGETMAIN = 'CList/MenuGetMain';
+
+ {
+ wParam : 0
+ lParam : 0
+ Affect : Get a handle to Miranda's status menu
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_MENUGETSTATUS = 'CList/MenuGetStatus';
+
+ {
+ wParam : MAKEWPARAM(LOWORD(wParam of WM_COMMAND),flags)
+ lParam : HCONTACT
+ Affect : Process a mennu selection from a menu, see notes
+ Returns: True if it processed the command, False otherwise
+ notes : hContact is the currently selected contact, it is not used
+ if this is a main menu command, if this is NULL then the command
+ is a contact menu one, the command is ignored
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_MENUPROCESSCOMMAND = 'CList/MenuProcessCommand';
+
+ {
+ wParam : virtual key code
+ lParam : MPCF_* flags
+ Affect : Process a menu hotkey, see notes
+ Returns: True if it processed the command, False otherwise
+ Notes : this should be called in WM_KEYDOWN
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_MENUPROCESSHOTKEY = 'CList/MenuProcessHotkey';
+
+ {
+ wParam : Pointer to a MSG structurer
+ lParam : Pointer to an LRESULT
+ Affect : Process all the messages required for docking, see notes
+ Returns: True if the message should NOT be processed anymore, False otherwise
+ Notes : only msg.hwnd, msg.message, msg.wParam and msg.lParam are used
+ your WndProc should return the lResult if AND only IF, TRUE is returned
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_DOCKINGPROCESSMESSAGE = 'CList/DockingProcessMessage';
+
+ {
+ wParam : 0
+ lParam : 0
+ Affect : Determines wheter the contact list docked
+ Returns: pnon zero] if the contact list is docked, or 0 if it's not
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_DOCKINGISDOCKED = 'CList/DockingIsDocked';
+
+ {
+ wParam : Pointer to a TMSG
+ lParam : Pointer to an LRESULT
+ Affect : Process all the messages required for the tray icon, see notes
+ Returns: TRUE if the message should not be processed anymore, False otherwise
+ Notes : Only msg.hwnd, msg.message, msg.wparam and msg.lParam are used
+ your WndProc should return LRESULT if and ONLY if TRUE is returned
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_TRAYICONPROCESSMESSAGE = 'CList/TrayIconProcessMessage';
+
+ {
+ wParam : Pointer to TMSG
+ lParam : Pointer to an LRESULT
+ Affect : Process all the messages required for hotkeys, see notes
+ Returns: True if the message should not be processed anymore or False otherwise
+ Notes : only msg.hwnd, msg.message, msg.wParam, msg.lParam are used
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_HOTKEYSPROCESSMESSAGE = 'CList/HotkeysProcessMessage';
+
+ {
+ wParam : 0
+ lParam : 0
+ Affect : Toggles the show/hide status of the contact list
+ Returns: 0 on success, [non zero] on failure
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_SHOWHIDE = 'CList/ShowHide';
+
+ {
+ wParam : 0
+ lParam : 0
+ Affect : temporarily disable the autohide feature, see notes
+ Notes : this service will restart the auto hide timer, so if you need
+ to keep the window visible you'll have to bee getting user input
+ or calling this service each time
+ Version: v0.1.2.1+
+ }
+ MS_CLIST_PAUSEAUTOHIDE = 'CList/PauseAutoHide';
+
+ {
+ wParam : HPARENTGROUP
+ lParam : 0
+ Affect : Create a new group and calls CLUI to display it, see notes
+ Returns: A handle to the new group.
+ Notes : If HPARENTGROUP is NULL(0) it will create a group at the root.
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_GROUPCREATE = 'CList/GroupCreate';
+
+ {
+ wParam : HGROUP
+ lParam : 0
+ Affect : Delete a group and call CLUI to display the change
+ Returns: 0 on success, [non zero] on failure
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_GROUPDELETE = 'CList/GroupDelete';
+
+ {
+ wParam : HGROUP
+ lParam : newState
+ Affect : Change the expanded state flag for a group internally, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : if newState is non zero then the group is expanded, 0 it's collapsed
+ CLUI IS *NOT* called when the change is made.
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_GROUPSETEXPANDED = 'CList/GroupSetExpanded';
+
+ {
+ wParam : HGROUP
+ lParam : MAKELPARAM(flags, flagsMask)
+ Affect : Change the flag for a group, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : only if flags given in flagsmask are altered,
+ CLUI is called on change to GROUPF_HIDEOFFLINE
+ Version: v0.1.2.1+
+ }
+ MS_CLIST_GROUPSETFLAGS = 'CList/GroupSetFlags';
+
+ {
+ wParam : HGROUP
+ lParam : Pointer to a integer to be filled with expanded state
+ Affect : get the name of a group, see notes
+ Returns: a static buffer pointing to the name of the group
+ returns NULL(0) if HGROUP is invalid.
+ Notes : the returned buffer is only valid til the next call
+ to this service, lParam can be NULL(0) if you don't
+ want to know if the group is expanded
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_GROUPGETNAME = 'CList/GroupGetName';
+
+ {
+ wParam : HGROUP
+ lParam : Pointer to flags
+ Affect : Get the name of the group, see notes
+ Returns: A static buffer pointing to the name of the group
+ returns NULL(0) if HGROUP is invalid
+ Note : this buffer is only valid til the next call to this service
+ flags can be NULL(0), otherwise it'll return GROUPF_* constants
+ Version: v0.1.2.1+
+ }
+ MS_CLIST_GROUPGETNAME2 = 'CList/GroupGetName2';
+
+ {
+ wParam : HGROUP
+ lParam : HBEFOREGROUP
+ Affect : Move a group directly before another group
+ Returns: the new handle of the group on success, NULL(0) on failure
+ Notes : the order is represented by the order in which MS_CLUI_GROUPADDED
+ is called, however UI's are free to ignore this order and sort
+ if they wish.
+ Version: v0.1.2.1+
+ }
+ MS_CLIST_GROUPMOVEBEFORE = 'CList/GroupMoveBefore';
+
+ {
+ wParam : HGROUP
+ lParam : Pointer to a null terminated string containing the new name
+ Affect : Rename a group internally, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : this will fail if the group name is a duplicate of an existing
+ a name, CLUI is not called when this change is made.
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_GROUPRENAME = 'CList/GroupRename';
+
+ {
+ wParam : 0
+ lParam : 0
+ Affect : Build a menu of the group tree, see notes
+ Returns: Handle to the menu, NULL(0) on failure
+ Notes : NULL be returned if the user doesn't have any groups
+ the dwItemData of every menu item is the handle to that group.
+ Menu item ID's are assigned starting at 100 in no particular order
+ Version: v0.1.2.1+
+ }
+ MS_CLIST_GROUPBUILDMENU = 'CList/GroupBuildMenu';
+
+ {
+ wParam : newValue
+ lParam : 0
+ Affect : Changes the 'hide offline contacts' flag and calls CLUI, see notes
+ Returns: 0 success, [non zero] on failure
+ Notes : newValue is 0 to show all contacts, 1 to show only online contacts
+ -1 to toggle the value
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_SETHIDEOFFLINE = 'CList/SetHideOffline';
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affect : Do the message processing associated with the double clicking a contact
+ Returns: 0 on success, [non zero] on failure
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_CONTACTDOUBLECLICKED = 'CList/ContactDoubleClicked';
+
+ {
+ wParam : HCONTACT
+ lParam : Pointer to an array of pchar's containing files/dirs
+ Affect : Do the processing when some files are droppeed on a contact, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : the array is terminated when a NULL(0) entry is found
+ Version: v0.1.2.1+
+ }
+ MS_CLIST_CONTACTFILESDROPPED = 'CList/ContactFilesDropped';
+
+ {
+ wParam : HCONTACT
+ lParam : HGROUP
+ Affect : Change the group a contact belongs to, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : use hGroup=NULL(0) to remove any group association with the contact
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_CONTACTCHANGEGROUP = 'CList/ContactChangeGroup';
+
+ {
+ wParam : HCONTACT_1
+ lParam : HCONTACT_2
+ Affect : Determine the ordering of two given contacts
+ Returns: 0 if hContact1 is the same as hContact2
+ 1 if hContact1 should be displayed before hContact2
+ -1 if hContact1 should be displayed after hCotnact2
+ Version: v0.1.1.0+
+ }
+ MS_CLIST_CONTACTSCOMPARE = 'CList/ContactsCompare';
+
+{$ENDIF}
diff --git a/include/delphi/m_clui.inc b/include/delphi/m_clui.inc new file mode 100644 index 0000000000..c62b40e458 --- /dev/null +++ b/include/delphi/m_clui.inc @@ -0,0 +1,215 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_CLUI}
+{$DEFINE M_CLUI}
+
+ {<</
+ this header was created for use for v0.1.1.0, most of it's UI related
+ stuff and you probably don't need to call it, see m_clist.inc instead.
+ -- There are some functions that were implemented in v0.1.2.0 though
+ />>}
+
+const
+
+ {
+ wParam : 0
+ lParam : 0
+ Affects: Returns a window handle for the contact list window, see notes
+ Returns: ""
+ Notes : This call has a very specific purpose internally Miranda
+ and shouldn't be used gratuitously, in almost all cases
+ there's another call to do whatever it is that you're
+ trying to do.
+ }
+ MS_CLUI_GETHWND = 'CLUI/GetHwnd';
+
+ {
+ wParam : new status
+ lParam : null terminated string to a protocol ID
+ Affects: Change the protocol specific status indicators, see notes!
+ Returns: 0 on success, [non zero] on failure
+ Notes : protocol modules don't want to call this, they want
+ clist/protocolstatuschanged instead
+ }
+ MS_CLUI_PROTOCOLSTATUSCHANGED = 'CLUI/ProtocolStatusChanged';
+
+ {
+ wParam : Handle to a group
+ lParam : 1 or 0
+ Affect : A new group was created, add it to the list, see notes
+ Notes : lParam is set to 1 or 0 if the user just created
+ the group or not.
+ -
+ this is also called when the contact list is being rebuilt,
+ new groups are always created with the name 'New group'
+ }
+ MS_CLUI_GROUPADDED = 'CLUI/GroupCreated';
+
+ {
+ wParam : HCONTACT
+ lParam : ICON_ID
+ Affect : Change the icon for a contact, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : ICON_ID is an offset in the imagelist, see clist/geticonsimagelist
+ }
+ MS_CLUI_CONTACTSETICON = 'CLUI/ContactSetIcon';
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affect : Remove a contact from the list, see notes
+ Returns: 0 on success, [non zereo] on failure
+ Notes : this contact is NOT actually being deleted, since if
+ a contact goes offline while 'hide offline' option is sset,
+ this service will be called then ALSO
+ }
+ MS_CLUI_CONTACTDELETED = 'CLUI/ContactDeleted';
+
+ {
+ wParam : HCONTACT
+ lParam : ICON_ID
+ Affect : Add a contact to the list, see note
+ returns: 0 on success, [non zero] on failure
+ Notes : the caller processes the 'hide offline' setting, so the callee
+ should not do further processing based on the value of this setting
+ -
+ WARNING: this will be called to re-add a contact when they come
+ online if 'hide offline' is on, but it cannot determine if
+ the contact is already on the list, so you may get requests to
+ add a contact when it is already on the list, which you should ignore.
+ -
+ You'll also get this whenever an event is added for a contact,
+ since if the contact was offline, it needs to be shown to
+ display the mesage, even if 'hide offlines' is on.
+ -
+ you should not resort the list on this call, a seperate resort
+ request will be sent.
+ -
+ ICON_ID is an offset in the image list, see clist/geticonsimagelist
+
+ }
+ MS_CLUI_CONTACTADDED = 'CLUI/ContactAdded';
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affect : Reename a contact in the lists, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : You should not re-sort the list on this call, a separate resort
+ request will be sent, you can get the new name from clist/getcontactdisplayname
+ }
+ MS_CLUI_CONTACTRENAMED = 'CLUI/ContactRenamed';
+
+ {
+ wParam : 0
+ lParam : 0
+ Affect : Start a rebuild of the contact list, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : this is the cue to clear the existing content of the list
+ expect to get a series of :
+
+ clui/groupadded
+ clui/contactadded
+ clui/resortlist
+ }
+ MS_CLUI_LISTBEGINREBUILD = 'CLUI/ListBeginRebuild';
+
+ {
+ wParam : 0
+ lParam : 0
+ Affect : End a rebuild of the contact list, see notes
+ Returns: 0 on success, [non zero] on error
+ Notes : if you dissplayed an hourglass in beginbuild, set it back
+ here, you do not need to explicitly sort the list
+ }
+ MS_CLUI_LISTENDREBUILD = 'CLUI/ListEndRebuild';
+
+ {
+ wParam : 0
+ lParam : 0
+ Affect : Sort the contact list now, see notes
+ Returns: 0 success, [non zero] on failure
+ Notes : Sorts are buffered so you won't get this message lots of times
+ if the lists needs to be resorted many times rapidly
+ }
+ MS_CLUI_SORTLIST = 'CLUI/SortList';
+
+ {
+ wParam : CLUICAPS_*
+ lParam : 0
+ Affect : Gets a load of capabilites for the loaded CLUI, see notes
+ Returns: the requested value, 0 of wParam is unknown --
+ if this service is not implemented it is assumed all return
+ values will be 0.
+ Version: v0.1.2.1+
+ }
+
+ { can only provide this flag to return the following set of caps, the strings
+ show the database setting/type to store the list option, changing the value
+ does not reflect what the change is, i.e. ontop can only be affected with
+ a call to SetWindowPos() }
+ CLUICAPS_FLAGS1 = 0;
+ { empty groups aren't shown, 'CList/HideEmptyGroups' (byte) [changes make the list reload] }
+ CLUIF_HIDEEMPTYGROUPS = 1;
+ { groups can be disabled, lists can be merged into one seamlessly, (byte) 'CList/UseGroups' }
+ CLUIF_DISABLEGROUPS = 2;
+ { list can be displayed 'on top' of all other windows, 4 (byte) 'CList/OnTop' }
+ CLUIF_HASONTOPOPTION = 4;
+ { can disappear after a while of inactive use,
+ (byte) 'CList/AutoHide' (word) 'CList/HideTime' }
+ CLUIF_HASAUTOHIDEOPTION = 8;
+
+ MS_CLUI_GETCAPS = 'CLUI/GetCaps';
+
+ {
+ wParam : HCONTACT
+ lParam : MAKELPARAM(screenX, screenY)
+ Affect : A contact is being dragged outside the main window
+ Return : return [non zero] to show the drag cursor as "accepting" the drag
+ or zero to show the circle/slash 'not allowed'
+ Version: v0.1.2.0+
+ }
+ ME_CLUI_CONTACTDRAGGING = 'CLUI/ContactDragging';
+
+ {
+ wParam : HCONTACT
+ lParam : MAKELPARAM(screenX, screenY)
+ Affect : a contact has just been dropped outside the main window, see notes
+ Notes : return non zero to stop other hooks processing this event.
+ Version: v0.1.2.0+
+ }
+ ME_CLUI_CONTACTDROPPED = 'CLUI/ContactDropped';
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affect : A contact that *was* being dragged outside the main window
+ has gone back to the main window
+ Return : always return 0
+ Version: v0.1.2.1+
+ }
+ ME_CLUI_CONTACTDRAGSTOP = 'CLUI/ContactDragStop';
+
+{$ENDIF}
\ No newline at end of file diff --git a/include/delphi/m_contacts.inc b/include/delphi/m_contacts.inc new file mode 100644 index 0000000000..4ea0d936c3 --- /dev/null +++ b/include/delphi/m_contacts.inc @@ -0,0 +1,84 @@ +(*
+Miranda IM
+
+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.
+*)
+
+type
+
+ PCONTACTINFO = ^TCONTACTINFO;
+ TCONTACTINFO = record
+ cbSize: int;
+ dwFlag: Byte;
+ hContact: THandle;
+ szProto: PChar;
+ type_: Byte;
+ retval: record (* in C this is a nameless union *)
+ case longint of
+ 0: (bVal: Byte);
+ 1: (wVal: WORD);
+ 2: (dVal: DWORD);
+ 3: (pszVal: PChar);
+ 4: (cchVal: Word);
+ end;
+ end;
+
+const
+
+// CNF_* Types of information you can retreive by setting the dwFlag in CONTACTINFO
+
+ CNF_FIRSTNAME = 1; // returns first name (string)
+ CNF_LASTNAME = 2; // returns last name (string)
+ CNF_NICK = 3; // returns nick name (string)
+ CNF_CUSTOMNICK = 4; // returns custom nick name, clist name (string)
+ CNF_EMAIL = 5; // returns email (string)
+ CNF_CITY = 6; // returns city (string)
+ CNF_STATE = 7; // returns state (string)
+ CNF_COUNTRY = 8; // returns country (string)
+ CNF_PHONE = 9; // returns phone (string)
+ CNF_HOMEPAGE = 10; // returns homepage (string)
+ CNF_ABOUT = 11; // returns about info (string)
+ CNF_GENDER = 12; // returns gender (byte,'M','F' character)
+ CNF_AGE = 13; // returns age (byte, 0==unspecified)
+ CNF_FIRSTLAST = 14; // returns first name + last name (string)
+ CNF_UNIQUEID = 15; // returns uniqueid, protocol username (must check type for type of return)
+
+// Special types
+// Return the custom name using the name order setting
+// IMPORTANT: When using CNF_DISPLAY you MUST free the string returned
+// You must **NOT** do this from your version of free() you have to use Miranda's free()
+// you can get a function pointer to Miranda's free() via MS_SYSTEM_GET_MMI, see m_system.h
+ CNF_DISPLAY = 16;
+// Same as CNF_DISPLAY except the custom handle is not used
+// IMPORTANT: When using CNF_DISPLAYNC you MUST free the string returned
+// You must **NOT** do this from your version of free() you have to use Miranda's free()
+// you can get a function pointer to Miranda's free() via MS_SYSTEM_GET_MMI, see m_system.h
+ CNF_DISPLAYNC = 17;
+
+// If MS_CONTACT_GETCONTACTINFO returns 0 (valid), then one of the following
+// types is setting telling you what type of info you received
+ CNFT_BYTE = 1;
+ CNFT_WORD = 2;
+ CNFT_DWORD = 3;
+ CNFT_ASCIIZ = 4;
+
+ {
+ wParam : not used
+ lParam : Pointer to an initialised TCONTACTINFO structure
+ affects: Get contact information
+ returns: Zero on success, non zero on failure.
+ notes : If successful, the type is set and the result is put into the associated member of TCONTACTINFO
+ }
+ MS_CONTACT_GETCONTACTINFO = 'Miranda/Contact/GetContactInfo';
diff --git a/include/delphi/m_database.inc b/include/delphi/m_database.inc new file mode 100644 index 0000000000..678977979c --- /dev/null +++ b/include/delphi/m_database.inc @@ -0,0 +1,654 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_DATABASE}
+{$DEFINE M_DATABASE}
+
+const
+
+ DBVT_DELETED = 0; // setting got deleted, no values are valid
+ DBVT_BYTE = 1; // bVal, cVal are valid
+ DBVT_WORD = 2; // wVal, sVal are valid
+ DBVT_DWORD = 4; // dVal, lVal are valid
+ DBVT_ASCIIZ = 255; // pszVal is valid
+ DBVT_BLOB = 254; // cpbVal and pbVal are valid
+ DBVTF_VARIABLELENGTH = $80; // ?
+
+type
+
+ HCONTACT = Integer;
+ HDBEVENT = Integer;
+
+ PDBVARIANT = ^TDBVARIANT;
+ TDBVARIANT = record
+ type_: Byte;
+ case LongInt of
+ 0: (bVal: Byte);
+ 1: (cVal: Char);
+ 2: (wVal: Word);
+ 3: (sVal: SmallInt);
+ 4: (dVal: LongInt);
+ 5: (lVal: Integer);
+ 6: (
+ pszVal: PChar;
+ cchVal: Word;
+ );
+ 7: (
+ cpbVal: Word;
+ pbVal: PByte;
+ );
+ end;
+
+const
+
+ {
+ wParam : size of the buffer to be filled
+ lParam : pointer to the buffer to be filled
+ affect : Get's the name of the current profile being used by the database
+ module -- this is the same as the filename of the profile without
+ the .ext
+ return : 0 on success, non zero on failure
+ }
+ MS_DB_GETPROFILENAME = 'DB/GetProfileName';
+
+ {
+ wParam : size of buffer pointed to by lParam
+ lParam : pointer to a buffer to be filled
+ affect : Fill a buffer with the current profile path being used, this does not include the trailing backslash.
+ return : 0 on success, non zero on failure
+ version: 0.3a only
+ }
+ MS_DB_GETPROFILEPATH = 'DB/GetProfilePath';
+
+type
+
+ PDBCONTACTGETSETTING = ^TDBCONTACTGETSETTING;
+ TDBCONTACTGETSETTING = record
+ { name of the module that wrote the setting to get }
+ szModule: PChar;
+ { the name of the setting to get }
+ szSetting: PChar;
+ { pointer to DBVARIANT to receive the value -- must be allocated for GETSETTINGSTATIC
+ calls thou }
+ pValue: PDBVARIANT;
+ end;
+
+ PDBCONTACTWRITESETTING = ^TDBCONTACTWRITESETTING;
+ TDBCONTACTWRITESETTING = record
+ { module sig to write this setting under }
+ szModule: PChar;
+ { setting name to write }
+ szSetting: PChar;
+ { variant containing value to set }
+ value: TDBVARIANT;
+ end;
+
+const
+
+ {
+ wParam : Handle of a contact to get the setting for (see notes)
+ lParam : pointer to a TDBCONTACTGETSETTING structure to be filled with setting
+ this structure also has to be initalised (see notes)
+ affect : Queries the database module for a setting from a contact.
+ returns: 0 on success, non zero on failure (contact not found, setting doesn't exist)
+ notes : TDBCONTACTGETSETTING must be filled with the module name that created
+ /wrote the setting you want to get (e.g. your module name)
+ and the actual setting to read with TDBCONTACTGETSETTING.szModule and
+ TDBCONTACTGETSETTING.szSetting -- TDBCONTACTGETSETTING.pValue is
+ a pointer to a TDBVARIANT with the returned setting, this maybe nil
+ and MUST be freed after you're done with it with FreeVariant()
+
+ There are helper functions for reading/writing/deleting common types to and
+ from the database -- see DBGetContactSetting<type>
+
+ the contact handle (hContact) can be returned by FindContact/AddContact
+ }
+ MS_DB_CONTACT_GETSETTING = 'DB/Contact/GetSetting';
+
+ {
+ wParam : Handle for a contact to query a setting for
+ lParam : Pointer to a TDBCONTACTGETSETTING structure
+ affects: This service is almost the same as the one above, but it does
+ not return a dynamic copy (with malloc()) -- the caller
+ must do this for datatypes which require it, e.g. a string.
+
+ This means the TDBCONTACTGETSETTING.pValue *has* to exist and be
+ allocated by the caller (doesn't have to be allocated from the heap)
+ the DBVARIANT structure has to be initalised with the type wanted
+ and enough buffer space around to return the info, do not
+ expect this service to be as fast as the one above.
+
+ returns: 0 on success, non zero on failure.
+ }
+ MS_DB_CONTACT_GETSETTINGSTATIC = 'DB/Contact/GetSettingStatic';
+
+ {
+ wParam : 0
+ lParam : Pointer to a TDBVARIANT structure
+ affect : Free's the passed DBVARIANT's dynamic memory (if any) see notes
+ returns: 0 on success, non zero on failure
+ notes : use the helper function FreeVariant()
+ }
+ MS_DB_CONTACT_FREEVARIANT = 'DB/Contact/FreeVariant';
+
+ {
+ wParam : Handle to contact to write setting for
+ lParam : Pointer to TDBCONTACTWRITESETTING which must be initalised
+ affects: writes a setting under a contact -- TDBCONTACTWRITESETTING structure
+ must contain the module name writing -- the setting name, and the value
+ to write (which is NOT a pointer) .szModule, .szSetting, .Value, see notes
+ returns: 0 on success, non zero on failure
+ notes : this service triggers 'DB/Contact/SettingChanged' before it returns
+ as always, there is a helper function to use this service.
+ }
+ MS_DB_CONTACT_WRITESETTING = 'DB/Contact/WriteSetting';
+
+ {
+ wParam : hContact under which the setting should be deleted
+ lParam : Pointer to a TDBCONTACTGETSETTING structure
+ affects: Deletes the given setting for a contact, the TDBCONTACTGETSETTING.pValue
+ field is ignored -- only .szModule and .szSetting are needed, see notes
+ returns: 0 on success, non zero on failure
+ notes : triggers 'DB/Contact/SettingChanged' BEFORE it deletes the given
+ setting, when the service returns the TDBVARIANT structure .type_ is set
+ to 0 and no fields are valid, there is a helper function for this
+ service, see below.
+ }
+ MS_DB_CONTACT_DELETESETTING = 'DB/Contact/DeleteSetting';
+
+ {
+ wParam : Handle of a contact to enum settings for
+ lParam : Pointer to a TDBCONTACTENUMSETTINGS structure, must be initalised
+ affect : Enumerates all settings for a given contact under a module,
+ TDBCONTACTENUMSETTINGS must be filled with the function pointer to call
+ the TDBCONTACTENUMSETTINGS.lParam value to pass to it each time,
+ as well as the .szModule under which the contact is valid
+ returns: returns the value of the last call to the enum function, or -1
+ if no settings could be enumerated
+ notes : the szSetting argument passed to the enumeration function is only
+ valid for the duration of that enumeration call,
+ it must be allocated dynamically if it is required after that call frame
+ has returned.
+ Also, deleting settings as they are enumerated has unpredictable results!
+ but writing a new value for a setting is okay.
+ it is unclear how you stop the enumeration once it is started, maybe
+ possible to return -1 to stop it.
+ vesion : only valid for 0.1.0.1+
+ }
+
+type
+
+ TDBSETTINGENUMPROC = function(const szSetting: PChar; lParam: LPARAM): int; cdecl;
+
+ PDBCONTACTENUMSETTINGS = ^TDBCONTACTENUMSETTINGS;
+ TDBCONTACTENUMSETTINGS = record
+ { function pointer to call to start the enum via MS_DB_CONTACT_ENUMSETTINGS }
+ pfnEnumProc: TDBSETTINGENUMPROC;
+ { passed to the above function }
+ lParam: LPARAM;
+ { name of the module to get settings for }
+ szModule: PChar;
+ { not used by us }
+ ofsSettings: DWORD;
+ end;
+
+const
+
+ MS_DB_CONTACT_ENUMSETTINGS = 'DB/Contact/EnumSettings';
+
+ {
+ wParam : 0
+ lParam : 0
+ affect : none
+ returns: Returns the number of contacts in the database for the loaded profile
+ not including the profile user, see notes.
+ notes : the contacts in the database can be read with FindFirst/FindNext
+ }
+ MS_DB_CONTACT_GETCOUNT = 'DB/Contact/GetCount';
+
+ {
+ wParam : 0
+ lParam : 0
+ returns: Returns a handle to the first contact in the database,
+ this handle does not need to be closed, if there are no users
+ NULL(0) is returned.
+ }
+ MS_DB_CONTACT_FINDFIRST = 'DB/Contact/FindFirst';
+
+ {
+ wParam : Contact handle
+ lParam : 0
+ returns: Returns a handle to the next contact after the given contact in
+ wParam, this handle does not neeed to be closed -- may return NULL(0)
+ if the given contact in wParam was the last in the database, or the
+ given contact was invalid
+ }
+ MS_DB_CONTACT_FINDNEXT = 'DB/Contact/FindNext';
+
+ {
+ wParam : Handle of a contact to delete
+ lParam : 0
+ affect : the user by the given handle is deleted from the database, see notes
+ returns: Returns 0 on success or nonzero if the handle was invalid
+ notes : this triggers DB/Contact/Deleted BEFORE it actually deletes the contact
+ all events are also deleted -- other modules may end up with invalid
+ handles because of this, which they should be prepared for.
+ }
+ MS_DB_CONTACT_DELETE = 'DB/Contact/Delete';
+
+ {
+ wParam : 0
+ lParam : 0
+ affects: creates a new contact in the database, they have no settings,
+ settings must be added with MS_DB_CONTACT_WRITESETTING or
+ database helper functions for writing, see notes
+ returns: A handle to a new contact or NULL(0) on failure.
+ notes : triggers the ME_DB_CONTACT_ADDED event just before the service returns
+ }
+ MS_DB_CONTACT_ADD = 'DB/Contact/Add';
+
+
+ {
+ wParam : (HANDLE) hContact
+ lParam : 0
+ affects: Checks the given handle within the database for valid information, for
+ a proper internal header.
+ returns: Returns 1 if the contact handle is valid, 0 if it is not
+ notes : Due to the nature of multiple threading a contact handle can be deleted
+ soon after this service has returned a handle as valid, however it will never point
+ to another contact.
+ }
+ MS_DB_CONTACT_IS = 'DB/Contact/Is';
+
+
+ {
+ wParam : contact handle for events count is needed
+ lParam : 0
+ service: Gets the number of events in the chain belonging to a contact
+ in the databasee.
+ returns: the numbef of events owned by hContact or -1 if hContact
+ is invalid, they can be found with the event/find* servicees
+ }
+ MS_DB_EVENT_GETCOUNT = 'DB/Event/GetCount';
+
+ {
+ wParam : contact handle to add an event for
+ lParam : Pointer to TDBEVENTINFO initialised with data
+ affect : Add's an event to the contact's event list, the TDBEVENTINFO
+ structure should be filled with the event of message -- see notes
+ returns: a handle to a DB event (HDBEVENT), or NULL on error
+ notes : Triggers DB/Event/Added event just before it returns,
+ Events are sorted chronologically as they are entered,
+ so you cannot guarantee that the new hEvent is the last event in the chain,
+ however if a new event is added that has a timestamp less than
+ 90 seconds *before* the event that should be after it,
+ it will be added afterwards, to allow for protocols that only
+ store times to the nearest minute, and slight delays in transports.
+ There are a few predefined eventTypes below for easier compatibility, but
+ modules are free to define their own, beginning at 2000
+ DBEVENTINFO.timestamp is in GMT, as returned by time()
+ }
+
+ DBEF_FIRST = 1; // internally only, do not use
+ DBEF_SENT = 2; // if set, the event was sent by the user, otherwise it was received
+ DBEF_READ = 4; // event has been read by the user -- only needed for history
+
+ EVENTTYPE_MESSAGE = 0;
+ EVENTTYPE_URL = 1;
+ EVENTTYPE_CONTACTS = 2; // v0.1.2.2+
+ EVENTTYPE_ADDED = 1000; // v0.1.1.0+: these used to be module-
+ EVENTTYPE_AUTHREQUEST = 1001; // specific codes, hence the module-
+ EVENTTYPE_FILE = 1002; // specific limit has been raised to 2000
+
+type
+
+ PDBEVENTINFO = ^TDBEVENTINFO;
+ TDBEVENTINFO = record
+ { size of the structure }
+ cbSize: int;
+ { module that 'owns' this event and controls the data format }
+ szModule: PChar;
+ { timestamp in UNIX time }
+ timestamp: DWORD;
+ { the DBEF_* flags above }
+ flags: DWORD;
+ { event type, such as message, can be module defined }
+ eventType: WORD;
+ { size in bytes of pBlob^ }
+ cbBlob: DWORD;
+ { pointer to buffer containing the module defined event data }
+ pBlob: PByte;
+ end;
+
+const
+
+ MS_DB_EVENT_ADD = 'DB/Event/Add';
+
+
+
+ {
+ wParam : Handle to the contact
+ lParam : HDBEVENT handle to delete
+ affects: Removes a single event from the database for the given contact
+ returns: 0 on success, nonzero on failure
+ notes : Triggers DB/Event/Deleted just before the event *is* deleted
+ }
+ MS_DB_EVENT_DELETE = 'DB/Event/Delete';
+
+ {
+ wParam : Handle to DB event
+ lParam : 0
+ returns: Returns the space in bytes requried to store the blob in HDBEVENT
+ given by HDBEVENT(wParam) -- or -1 on error
+ }
+ MS_DB_EVENT_GETBLOBSIZE = 'DB/Event/GetBlobSize';
+
+ {
+ wParam : Handle to a DB event
+ lParam : Pointer to a TDBEVENTINFO structure which must be initialised
+ affects: Returns all the information about an DB event handle to a TDBEVENTINFO
+ structure which must be initalised, DBEI.cbSize, DBEI.pBlob and DBEI.cbSize
+ before calling this service, the size can be assertained with
+ GetBlobSize() service, see notes
+ returns: Returns 0 on success, non zero on failure
+ notes : The correct value dbe.cbBlob can be got using db/event/getblobsize
+ If successful, all the fields of dbe are filled. dbe.cbBlob is set to the
+ actual number of bytes retrieved and put in dbe.pBlob
+ If dbe.cbBlob is too small, dbe.pBlob is filled up to the size of dbe.cbBlob
+ and then dbe.cbBlob is set to the required size of data to go in dbe.pBlob
+ On return, dbe.szModule is a pointer to the database module's
+ own internal list of modules. Look but don't touch.
+ }
+ MS_DB_EVENT_GET = 'DB/Event/Get';
+
+ {
+ wParam : HCONTACT
+ lParam : HDBEVENT
+ affect : Changes the flag for an event to mark it as read
+ Returns: Returns the entire flag DWORD for the event after the change, or -1
+ if HDBEVENT is invalid, see notes
+ notes : This iss one of the database write operations that does not trigger
+ an event, modules should not save flagss states for any length of time.
+ }
+ MS_DB_EVENT_MARKREAD = 'DB/Event/MarkRead';
+
+ {
+ wParam : HDBEVENT
+ lParam : 0
+ Affect : Returns a handle to a contact that owns the HDBEVENT,
+ see notes
+ Returns: Returns a handle if successful or HDBEEVENT(-1) on failure
+ notes : This service is very slow, only use wheen you have no other choice
+ at all.
+ }
+ MS_DB_EVENT_GETCONTACT = 'DB/Event/GetContact';
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affect : Retrieves a handlee to the first event in the chain
+ for a HCONTACT
+ returns: Returns a handle, or NULL(0) if HCONTACT is invalid or has
+ no events, events in a chain are sorted chronologically automatically
+ }
+ MS_DB_EVENT_FINDFIRST = 'DB/Event/FindFirst';
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affect : Retrieves a handle to the first unreead event in a chain for a HCONTACT
+ see notes
+ Returns: Returns a HDBEVENT handle or NULL(0) if the HCONTACT is invalid
+ or all it's events have beeen read.
+ Notes : Events in a chain are sorted chronologically automatically,
+ but this does not necessarily mean that all events after
+ the first unread are unread too.
+ They should be checked individually with event/findnext and event/get
+ This service is designed for startup, reloading all the events that remained
+ unread from last time
+ }
+ MS_DB_EVENT_FINDFIRSTUNREAD = 'DB/Event/FindFirstUnread';
+
+ {
+ wParam : HCONTACT
+ lParam : 0;
+ Affects: Retrieves a handle to the lasts event in the chain for a HCONTACT
+ Returns: Returns a handle or NULL(0) if HCONTACT is invalid or has no events
+ }
+ MS_DB_EVENT_FINDLAST = 'DB/Event/FindLast';
+
+ {
+ wParam : HDBEVENT
+ lParam : 0
+ Affects: Retrieves a handle to the next event in a chain after HDBEVENT
+ Returns: A handle to the next DB event or NULL(0) if HDBEVENT is invalid
+ or the last event in the chain.
+ }
+ MS_DB_EVENT_FINDNEXT = 'DB/Event/FindNext';
+
+ {
+ wParam : HDBEVENT
+ lParam : 0
+ Affects: Retrieves a handle to the previous event in a chain before HDBEVENT
+ Returns: A handle to the previous HDBEVENT or NULL(0) if HDBEVENT is invalid
+ or is the first event in the chain
+ }
+ MS_DB_EVENT_FINDPREV = 'DB/Event/FindPrev';
+
+
+
+ {
+ wParam : size in bytes of string buffer (including null term)
+ lParam : pointer to string buffer
+ Affect : Scrambles the string buffer in place using a strange encryption algorithm,
+ see notes
+ Returns: Always returns 0
+ notes : this service may be changed at a later date such that it increasess
+ the length of the string
+ }
+ MS_DB_CRYPT_ENCODESTRING = 'DB/Crypt/EncodeString';
+
+ {
+ wParam : size in bytes of string buffer, including null term
+ lParam : pointer to string buffer
+ Affect : Descrambles pszString in-place using the strange encryption algorithm,
+ see notes.
+ Return : Always returns 0
+ notes : Reverses the operation done by MS_DB_CRYPT_ENCODINGSTRING
+ }
+ MS_DB_CRYPT_DECODESTRING = 'DB/Crypt/DecodeString';
+
+
+
+ {
+ wParam : timestamp (DWORD)
+ lParam : 0
+ Affect : Converts a GMT timestap into local time
+ Returns: Returns the converted value, see notes
+ Notes : Timestamps have a zereo at midnight 1/1/1970 GMT, this service
+ converts such a value to be based at midnight 1/1/1970 local time.
+ This service does not use a simple conversion based on the current offset
+ between GMT and local. Rather, it figures out whether daylight savings time
+ would have been in place at the time of the stamp and gives the local time as
+ it would have been at the time and date the stamp contains.
+ }
+ MS_DB_TIME_TIMESTAMPTOLOCAL = 'DB/Time/TimestampToLocal';
+
+ {
+ wParam : timestamp (DWORD)
+ lParam : pointer to initalised DBTIMETOSTRING structure
+ Affect : Converts a GMT timestamp to a customisable local time string
+ see notes
+ Returns: Always returns 0
+ notes : The string is formatted according to thhe current user's locale
+ language and preference --
+
+ .szFormat can have the following special chars :
+ t time without seconds, e.g. hh:mm
+ s time with seconds, e.g. hh:mm:ss
+ m time without minutes e.g. hh
+ d short date, e.g. dd/mm/yyyy
+ D long date, e.g. d mmmm yyyy
+
+ all other characters are copied as is.
+ }
+
+type
+
+ PDBTIMETOSTRING = ^TDBTIMETOSTRING;
+ TDBTIMETOSTRING = record
+ { format string, see above }
+ szFormat: PChar;
+ { pointer to dest buffer to store the result }
+ szDest: PChar;
+ { size of the buffer }
+ cbDest: int;
+ end;
+
+const
+
+ MS_DB_TIME_TIMESTAMPTOSTRING = 'DB/Time/TimestampToString';
+
+
+
+ {
+ wParam : newSetting (BOOLEAN)
+ lParam : 0
+ Affect : Miranda's database is normally protected against corruption by
+ aggressively flushing data to the disk on writes, if you're doing
+ alot of writes e.g. an import plugin, it can sometimes be desirable
+ to switch this feature off to speed up the process, if you do switch
+ it off, you must remember that crashes are far more likely to be
+ catastrophic, so switch it back on at the earliest possible opportunity.
+ if you're doing a lot of setting writes, the flush is already delayed
+ so you need not use this service for that purpose, see notes.
+ Returns: Always returns 0 (successful)
+ notes : This is set to true initally
+ }
+ MS_DB_SETSAFETYMODE = 'DB/SetSafetyMode';
+
+ {
+ wParam : (caller defined data) will be passed to lParam of the call back
+ lParam : function pointer to TDBMODULEENUMPROC
+ Affects: Enumerates the names of all modules that have stored or
+ requested information from the database,
+ the modules are returned in no real order --
+ Writing to the database while module names are being enumerated will cause
+ unpredictable results in the enumeration, but the write will work.
+
+ the enumeration will stop if the callback returns a non zero value.
+
+ Returns: the last return value from the enumeration call back.
+ Notes : This service is only useful for debugging or EnumSettings
+ version: The service registered to enumerate all modules that have touched
+ the database module uses wParam as the lParam cookie value and the lParam
+ value given here is the function pointer -- this is not safe
+ to use before v0.1.2.1 because I don't know if this was done in v0.1.2.1-
+
+ prior to v0.1.2.1 you can not pass a value to the enumeration because
+ of a bug -- which is fixed, but hey :) -- [sam]
+ }
+type
+ TDBMODULEENUMPROC = function(const szModule: PChar; ofsModuleName: DWORD; lParam: LPARAM): int; cdecl;
+const
+ MS_DB_MODULES_ENUM = 'DB/Modules/Enum';
+
+
+
+ {
+ wParam : HCONTACT
+ lParam : HDBCONTACT
+ Affect : Called when a new event has been added to the event chain
+ for a contact, HCONTACT contains the contact who added the event,
+ HDBCONTACT a handle to what was added.
+ see notes
+ notes : since events are sorted chronologically, you can not guarantee
+ that HDBEVEnT is in any particular position in the chain.
+
+ }
+ ME_DB_EVENT_ADDED = 'DB/Event/Added';
+
+ {
+ wParam : HANDLE (hContact)
+ lParam : @DBEVENTINFO
+ Affects: Hook is fired before any DBEVENTS are created within the database for
+ a contact (or a user, if hContact is NULL(0)) - It allows a module to
+ query/change DBEVENTINFO before it is created, see notes.
+ Returns: Hook should return 1 to stop event being added (will stop other hooks seeing the event too)
+ Or 0 to continue processing (passing the data on as well)
+ Notes : This hook is fired for all event types, and the BLOBS that the eventypes mark
+ Maybe changed, therefore be careful about using BLOB formats.
+ Because the memory pointing within the DBEVENTINFO CAN NOT BE OWNED or free()'d
+ it is recommended that the hook only be used to stop events.
+ Version: 0.3.3a+ (2003/12/03)
+ }
+ ME_DB_EVENT_FILTER_ADD = 'DB/Event/FilterAdd';
+
+ {
+ wParam : HCONTACT
+ lParam : HDBEVENT
+ Affect : Called when an event is about to be deleted from the event chain
+ for a contact, see notes
+ notes : Returning non zero from your hook will NOT stop the deletion,
+ but it will as usual stop other hooks being called
+ }
+ ME_DB_EVENT_DELETED = 'DB/Event/Deleted';
+
+
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affect : Called when a new contact has been added to the database,
+ HCONTACT contains a handle to the new contact.
+ }
+ ME_DB_CONTACT_ADDED = 'DB/Contact/Added';
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affect : Called when a contact is about to be deleted
+ Returns: Returning nonzero from your hook will not stop the deletion
+ but it will stop the other hooks from being called
+ }
+ ME_DB_CONTACT_DELETED = 'DB/Contact/Deleted';
+
+ {
+ wParam : HCONTACT
+ lParam : Pointer to a TDBCONTACTWRITESETTING
+ Affect : Calleed when a contact has one of it's settings changed
+ hContact is a valid handle to the contact that has changed,
+ see notes.
+ notes : this event will be triggered many times rapidly when alot of values
+ are set.
+ Modules that hook this should be aware of this fact and quickly
+ return if they are not interested in the value that has changed.
+ Careful not to get into infinite loops with this event,
+
+ The TDBCONTACTWRITESETTING pointer is the same one as the
+ original service all, so don't change any of it's fields
+ }
+ ME_DB_CONTACT_SETTINGCHANGED = 'DB/Contact/SettingChanged';
+
+{$ENDIF}
diff --git a/include/delphi/m_email.inc b/include/delphi/m_email.inc new file mode 100644 index 0000000000..71859ed208 --- /dev/null +++ b/include/delphi/m_email.inc @@ -0,0 +1,39 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_EMAIL}
+{$DEFINE M_EMAIL}
+
+const
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affects: Send an e-mail to the specified contact, see notes
+ Returns: Returns 0 on success or nonzero on failure
+ Notes : If an error occurs the service displays a message box
+ with the error text -- use this service to alter this
+ }
+ MS_EMAIL_SENDEMAIL = 'SREMail/SendCommand';
+
+{$ENDIF}
diff --git a/include/delphi/m_file.inc b/include/delphi/m_file.inc new file mode 100644 index 0000000000..e1e388fcdc --- /dev/null +++ b/include/delphi/m_file.inc @@ -0,0 +1,66 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_FILE}
+{$DEFINE M_FILE}
+
+const
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affects: Brings up the send file dialog for a contact, see notes
+ Returns: 0 on success [non zero] on failure
+ Notes : Returns immediately without waiting for the send
+ }
+ MS_FILE_SENDFILE = 'SRFile/SendCommand';
+
+ {
+ wParam : HCONTACT
+ lParam : pointer to an array of PChar's the first nil item
+ terminates the list -- see notes
+ Affects: Brings up the send file dialog with specifieed files already chosen
+ the user is not prevented from editing the list --
+ Returns: 0 on success [non zero] on failure -- returns immediately without
+ waiting for the send to finish
+ Notes : both directories and files can be given
+ Version: v0.1.2.1+
+ }
+ MS_FILE_SENDSPECIFICFILES = 'SRFile/SendSpecificFiles';
+
+ {
+ wParam : HCONTACT
+ lParam : Pointer to a buffer
+ Affects: returns the received files folder for a contact, the buffer
+ should be at least MAX_PATH long (defined with WinAPI),
+ the returned path may not exist -- see notes
+ Returns: Returns 0 on success [non zero] on failure
+ notes : If HCONTACT is NULL(0) the path returned is the path
+ without the postfix contact name.
+ Version: v0.1.2.2+
+ }
+ MS_FILE_GETRECEIVEDFILESFOLDER = 'SRFile/GetReceivedFilesFolder';
+
+
+{$ENDIF}
diff --git a/include/delphi/m_findadd.inc b/include/delphi/m_findadd.inc new file mode 100644 index 0000000000..9952a787c8 --- /dev/null +++ b/include/delphi/m_findadd.inc @@ -0,0 +1,38 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_FINDADD}
+{$DEFINE M_FINDADD}
+
+const
+
+ {
+ wParam : 0
+ lParam : 0
+ Affects: Openss the find/add users dialog box, or gives it focus if it's
+ already open.
+ Returns: Always returns 0
+ }
+ MS_FINDADDFINDADD = 'FindAdd/FindAddCommand';
+
+{$ENDIF}
diff --git a/include/delphi/m_globaldefs.pas b/include/delphi/m_globaldefs.pas new file mode 100644 index 0000000000..1e8270696b --- /dev/null +++ b/include/delphi/m_globaldefs.pas @@ -0,0 +1,97 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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.
+
+*)
+
+{$IFDEF FPC}
+ {$PACKRECORDS C}
+ {$MODE Delphi}
+{$ENDIF}
+
+unit m_globaldefs;
+
+interface
+
+uses
+
+{$ifdef FPC}
+ strings;
+{$else}
+ Windows;
+{$endif}
+
+type
+
+ PByte = ^Byte;
+ int = Integer;
+ pint = ^int;
+ WPARAM = Integer;
+ LPARAM = Integer;
+ DWORD = Integer;
+ THandle = Integer;
+
+ // strcpy()
+
+ {$ifdef FPC}
+ TStrCpy = function(Dst, Src: PChar): PChar;
+ {$else}
+ TStrCpy = function(Dst, Src: PChar): PChar; stdcall;
+ {$endif}
+
+ // strcat()
+
+ {$ifdef FPC}
+ TStrCat = function(Dst, Src: PChar): PChar;
+ {$else}
+ TStrCat = function(Dst, Src: PChar): PChar; stdcall;
+ {$endif}
+
+const
+
+ {$ifdef FPC}
+ strcpy: TStrCpy = strings.strcopy;
+ {$else}
+ strcpy: TStrCpy = lstrcpy;
+ {$endif}
+
+ {$ifdef FPC}
+ strcat: TStrCat = strings.strcat;
+ {$else}
+ strcat: TStrCat = lstrcat;
+ {$endif}
+
+ {$include newpluginapi.inc}
+
+var
+ { this is now a pointer to a record of function pointers to match the C API,
+ and to break old code and annoy you. }
+
+ PLUGINLINK: PPLUGINLINK;
+
+ { has to be returned via MirandaPluginInfo and has to be statically allocated,
+ this means only one module can return info, you shouldn't be merging them anyway! }
+
+ PLUGININFO: TPLUGININFO;
+
+implementation
+
+end.
diff --git a/include/delphi/m_helpers.inc b/include/delphi/m_helpers.inc new file mode 100644 index 0000000000..ae5b28db8f --- /dev/null +++ b/include/delphi/m_helpers.inc @@ -0,0 +1,613 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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.
+
+*)
+
+{$ifdef M_API_UNIT}
+
+ function PLUGIN_MAKE_VERSION(a,b,c,d: Cardinal): int;
+ function PLUGIN_CMP_VERSION(verA: LongInt; verB: LongInt): int;
+
+{$else}
+
+ function PLUGIN_MAKE_VERSION(a,b,c,d: Cardinal): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := (a shl 24) or (b shl 16) or (c shl 8) or d;
+ end;
+
+ function PLUGIN_CMP_VERSION(verA: LongInt; verB: LongInt): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := 0;
+ { could be used to compare for severity of age for positive values, if a<b
+ results are minus values, 0 for equal, positive if a is newer }
+ Inc(Result, (verA and $FF) - (verB and $FF));
+ Inc(Result, (verA and $FF00) - (verB and $FF00));
+ Inc(Result, (verA and $FF0000) - (verB and $FF0000));
+ Inc(Result, (verA and $FF000000) - (verB and $FF000000));
+ end;
+
+{$endif}
+
+{$ifdef M_SYSTEM}
+ {$ifdef M_API_UNIT}
+
+ function CallService(const szService: PChar; wParam: WPARAM; lParam: LPARAM): int;
+
+ function HookEvent(const szHook: PChar; hook_proc: TMIRANDAHOOK): int;
+
+ function CreateServiceFunction(const szName: PChar; const MirandaService: TMIRANDASERVICE): int;
+
+ {$else}
+
+ function CallService(const szService: PChar; wParam: WPARAM; lParam: lParam): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := PluginLink^.CallService(szService, wParam, lParam);
+ end;
+
+ function HookEvent(const szHook: PChar; hook_proc: TMIRANDAHOOK): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := PluginLink^.HookEvent(szHook, @hook_proc);
+ end;
+
+ function CreateServiceFunction(const szName: PChar; const MirandaService: TMIRANDASERVICE): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := PluginLink^.CreateServiceFunction(szName, @MirandaService);
+ end;
+
+ {$endif}
+
+{$endif}
+
+{$ifdef M_DATABASE}
+
+ {$ifdef M_API_UNIT}
+
+ function DBGetContactSettingByte(hContact: THandle;
+ const szModule: PChar; const szSetting: PChar; errorValue: Integer): Integer;
+
+ function DBGetContactSettingWord(hContact: THandle;
+ const szModule: PChar; const szSetting: PChar; errorValue: Integer): Integer;
+
+ function DBGetContactSettingDword(hContact: THandle;
+ const szModule: PChar; const szSetting: PChar; errorValue: Integer): Integer;
+
+ function DBGetContactSetting(hContact: THandle;
+ const szModule: PChar; const szSetting: PChar; dbv: PDBVARIANT): Integer;
+
+ function DBFreeVariant(dbv: PDBVARIANT): Integer;
+
+ function DBDeleteContactSetting(hContact: THandle; const szModule: PChar; const szSetting: PChar): Integer;
+
+ function DBWriteContactSettingByte(hContact: THandle; const szModule: PChar; const szSetting: PChar; val: Byte): Integer;
+
+ function DBWriteContactSettingWord(hContact: THandle; const szModule: PChar; const szSetting: PChar; val: Word): Integer;
+
+ function DBWriteContactSettingDWord(hContact: THandle; const szModule: PChar; const szSetting: PChar; val: LongInt): Integer;
+
+ function DBWriteContactSettingString(hContact: THandle; const szModule: PChar; const szSetting: PChar; const val: PChar): Integer;
+
+ {$else}
+
+ function DBGetContactSettingByte(hContact: THandle;
+ const szModule: PChar; const szSetting: PChar; errorValue: Integer): Integer;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ dbv: TDBVARIANT;
+ cgs: TDBCONTACTGETSETTING;
+ begin
+
+ cgs.szModule := szModule;
+ cgs.szSetting := szSetting;
+ cgs.pValue := @dbv;
+
+ If PluginLink^.CallService(MS_DB_CONTACT_GETSETTING, hContact, lParam(@cgs)) <> 0 then
+ Result := ErrorValue
+ else
+ Result := dbv.bVal;
+ end;
+
+ function DBGetContactSettingWord(hContact: THandle;
+ const szModule: PChar; const szSetting: PChar; errorValue: Integer): Integer;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ dbv: TDBVARIANT;
+ cgs: TDBCONTACTGETSETTING;
+ begin
+ cgs.szModule := szModule;
+ cgs.szSetting := szSetting;
+ cgs.pValue := @dbv;
+ If PluginLink^.CallService(MS_DB_CONTACT_GETSETTING, hContact, lParam(@cgs)) <> 0 then
+ Result := ErrorValue
+ else
+ Result := dbv.wVal;
+ end;
+
+ function DBGetContactSettingDword(hContact: THandle;
+ const szModule: PChar; const szSetting: PChar; errorValue: Integer): Integer;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ dbv: TDBVARIANT;
+ cgs: TDBCONTACTGETSETTING;
+ begin
+ cgs.szModule := szModule;
+ cgs.szSetting := szSetting;
+ cgs.pValue := @dbv;
+ If PluginLink^.CallService(MS_DB_CONTACT_GETSETTING, hContact, lParam(@cgs)) <> 0 then
+ Result := ErrorValue
+ else
+ Result := dbv.dVal;
+ end;
+
+ function DBGetContactSetting(hContact: THandle;
+ const szModule: PChar; const szSetting: PChar; dbv: PDBVARIANT): Integer;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ cgs: TDBCONTACTGETSETTING;
+ begin
+ cgs.szModule := szModule;
+ cgs.szSetting := szSetting;
+ cgs.pValue := dbv;
+ Result := PluginLink^.CallService(MS_DB_CONTACT_GETSETTING, hContact, lParam(@cgs));
+ end;
+
+ function DBFreeVariant(dbv: PDBVARIANT): Integer;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := PluginLink^.CallService(MS_DB_CONTACT_FREEVARIANT, 0, lParam(dbv));
+ end;
+
+ function DBDeleteContactSetting(hContact: THandle; const szModule: PChar; const szSetting: PChar): Integer;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ cgs: TDBCONTACTGETSETTING;
+ begin
+ cgs.szModule := szModule;
+ cgs.szSetting := szSetting;
+ Result := PluginLink^.CallService(MS_DB_CONTACT_DELETESETTING, hContact, lParam(@cgs));
+ end;
+
+ function DBWriteContactSettingByte(hContact: THandle; const szModule: PChar; const szSetting: PChar; val: Byte): Integer;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ cws: TDBCONTACTWRITESETTING;
+ begin
+ cws.szModule := szModule;
+ cws.szSetting := szSetting;
+ cws.value.type_ := DBVT_BYTE;
+ cws.value.bVal := Val;
+ Result := PluginLink^.CallService(MS_DB_CONTACT_WRITESETTING, hContact, lParam(@cws));
+ end;
+
+ function DBWriteContactSettingWord(hContact: THandle; const szModule: PChar; const szSetting: PChar; val: Word): Integer;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ cws: TDBCONTACTWRITESETTING;
+ begin
+ cws.szModule := szModule;
+ cws.szSetting := szSetting;
+ cws.value.type_ := DBVT_WORD;
+ cws.value.wVal := Val;
+ Result := PluginLink^.CallService(MS_DB_CONTACT_WRITESETTING, hContact, lParam(@cws));
+ end;
+
+ function DBWriteContactSettingDWord(hContact: THandle; const szModule: PChar; const szSetting: PChar; val: LongInt): Integer;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ cws: TDBCONTACTWRITESETTING;
+ begin
+ cws.szModule := szModule;
+ cws.szSetting := szSetting;
+ cws.value.type_ := DBVT_DWORD;
+ cws.value.dVal := Val;
+ Result := PluginLink^.CallService(MS_DB_CONTACT_WRITESETTING, hContact, lParam(@cws));
+ end;
+
+ function DBWriteContactSettingString(hContact: THandle; const szModule: PChar; const szSetting: PChar; const val: PChar): Integer;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ cws: TDBCONTACTWRITESETTING;
+ begin
+ cws.szModule := szModule;
+ cws.szSetting := szSetting;
+ cws.value.type_ := DBVT_ASCIIZ;
+ cws.value.pszVal := Val;
+ Result := PluginLink^.CallService(MS_DB_CONTACT_WRITESETTING, hContact, lParam(@cws));
+ end;
+
+ {$endif}
+
+{$endif}
+
+{$ifdef M_NETLIB}
+
+ {$ifdef M_API_UNIT}
+
+ function Netlib_CloseHandle(Handle: THandle): int;
+
+ function Netlib_GetBase64DecodedBufferSize(const cchEncoded: int): int;
+
+ function Netlib_GetBase64EncodedBufferSize(const cbDecoded: int): int;
+
+ function Netlib_Send(hConn: THandle; const buf: PChar; len: int; flags: int): int;
+
+ function Netlib_Recv(hConn: THandle; const buf: PChar; len: int; flags: int): int;
+
+ procedure Netlib_Log(hNetLib: THandle; const sz: PChar);
+
+ {$else}
+
+ function Netlib_CloseHandle(Handle: THandle): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := PluginLink^.CallService(MS_NETLIB_CLOSEHANDLE, Handle, 0);
+ end;
+
+ function Netlib_GetBase64DecodedBufferSize(const cchEncoded: int): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := (cchEncoded shr 2) * 3;
+ end;
+
+ function Netlib_GetBase64EncodedBufferSize(const cbDecoded: int): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := (cbDecoded * 4+11) div 12*4+1;
+ end;
+
+ function Netlib_Send(hConn: THandle; const buf: PChar; len: int; flags: int): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ nlb: TNETLIBBUFFER;
+ begin
+ nlb.buf := buf;
+ nlb.len := len;
+ nlb.flags := flags;
+ Result := PluginLink^.CallService(MS_NETLIB_SEND, wParam(hConn), lParam(@nlb));
+ end;
+
+ function Netlib_Recv(hConn: THandle; const buf: PChar; len: int; flags: int): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ nlb: TNETLIBBUFFER;
+ begin
+ nlb.buf := buf;
+ nlb.len := len;
+ nlb.flags := flags;
+ Result := PluginLink^.CallService(MS_NETLIB_RECV, wParam(hConn), lParam(@nlb));
+ end;
+
+ procedure Netlib_Log(hNetLib: THandle; const sz: PChar);
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ PluginLink^.CallService(MS_NETLIB_LOG, hNetLib, lParam(sz));
+ end;
+
+ {$endif}
+
+{$endif}
+
+{$ifdef M_UTILS}
+
+ {$ifdef M_API_UNIT}
+
+ function WindowList_Add(hList: THandle; hWnd: HWND; hContact: THandle): int;
+
+ function WindowList_Remove(hList: THandle; hWnd: THandle): int;
+
+ function WindowList_Find(hList: THandle; hContact: THandle): int;
+
+ function WindowList_Broadcast(hList: THandle; message: int; wParam: WPARAM; lParam: LPARAM): int;
+
+ function Utils_SaveWindowPosition(hWnd: THandle; hContact: THandle; const szModule, szNamePrefix: PChar): int;
+
+ function Utils_RestoreWindowPosition(hWnd: THandle; hContact: THandle; Flags: int; const szModule, szNamePrefix: PChar): int;
+
+ {$else}
+
+ function WindowList_Add(hList: THandle; hWnd: hWnd; hContact: THandle): int;
+ var
+ wle: TWINDOWLISTENTRY;
+ begin
+ wle.hList := hList;
+ wle.hWnd := hWnd;
+ wle.hContact := hContact;
+ Result := PluginLink^.CallService(MS_UTILS_ADDTOWINDOWLIST, 0, lParam(@wle));
+ end;
+
+ function WindowList_Remove(hList: THandle; hWnd: THandle): int;
+ begin
+ Result := PluginLink^.CallService(MS_UTILS_REMOVEFROMWINDOWLIST, hList, hWnd);
+ end;
+
+ function WindowList_Find(hList: THandle; hContact: THandle): int;
+ begin
+ Result := PluginLink^.CallService(MS_UTILS_FINDWINDOWINLIST, hList, hContact);
+ end;
+
+ function WindowList_Broadcast(hList: THandle; message: int; wParam: WPARAM; lParam: LPARAM): int;
+ var
+ msg: TMSG;
+ begin
+ msg.message := message;
+ msg.wParam := wParam;
+ msg.lParam := lParam;
+ Result := PluginLink^.CallService(MS_UTILS_BROADCASTTOWINDOWLIST, hList, Integer(@Msg));
+ end;
+
+ function Utils_SaveWindowPosition(hWnd: THandle; hContact: THandle; const szModule, szNamePrefix: PChar): int;
+ var
+ swp: TSAVEWINDOWPOS;
+ begin
+ swp.hWnd := hWnd;
+ swp.hContact := hContact;
+ swp.szModule := szModule;
+ swp.szNamePrefix := szNamePrefix;
+ Result := PluginLink^.CallService(MS_UTILS_SAVEWINDOWPOSITION, 0, lParam(@swp));
+ end;
+
+ function Utils_RestoreWindowPosition(hWnd: THandle; hContact: THandle; Flags: int; const szModule, szNamePrefix: PChar): int;
+ var
+ swp: TSAVEWINDOWPOS;
+ begin
+ swp.hWnd := hWnd;
+ swp.hContact := hContact;
+ swp.szModule := szModule;
+ swp.szNamePrefix := szNamePrefix;
+ Result := PluginLink^.CallService(MS_UTILS_RESTOREWINDOWPOSITION, Flags, lParam(@swp));
+ end;
+
+ {$endif}
+
+{$endif}
+
+{$ifdef M_LANGPACK}
+
+ {$ifdef M_API_UNIT}
+
+ function Translate(sz: PChar): PChar;
+
+ function TranslateString(sz: string): string;
+
+ function TranslateDialogDefault(hwndDlg: THandle): int;
+
+ {$else}
+
+ function Translate(sz: PChar): PChar;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ { the return value maybe NULL(0) -- it's upto the caller to know if the allocated
+ string has to be removed from the DLL heap, this has little to do with Miranda,
+ but if a dynamic string is passed and a return string is used -- the dynamic
+ string is lost -- be careful, lazy? use TranslateString (note it's slower) }
+ Result := PChar(PluginLink^.CallService(MS_LANGPACK_TRANSLATESTRING, 0, lParam(sz)));
+ end;
+
+ function TranslateString(sz: string): string;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := string(PChar( PluginLink^.CallService(MS_LANGPACK_TRANSLATESTRING, 0, lParam(sz))));
+ end;
+
+ function TranslateDialogDefault(hwndDlg: THandle): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ lptd: TLANGPACKTRANSLATEDIALOG;
+ begin
+ lptd.cbSize := sizeof(lptd);
+ lptd.flags := 0;
+ lptd.hwndDlg := hwndDlg;
+ lptd.ignoreControls := nil;
+ Result := PluginLink^.CallService(MS_LANGPACK_TRANSLATEDIALOG, 0, lParam(@lptd));
+ end;
+
+ {$endif}
+
+{$endif}
+
+{$ifdef M_PROTOCOLS}
+ {$ifdef M_API_UNIT}
+
+ function CallContactService(hContact: THandle; const szProtoService: PChar; wParam: WPARAM; lParam: LPARAM): int;
+
+ function CallProtoService(const szModule, szService: PChar; wParam: WPARAM; lParam: LPARAM): int;
+
+ {$else}
+
+ function CallContactService(hContact: THandle; const szProtoService: PChar; wParam: WPARAM; lParam: LPARAM): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ css: TCCSDATA;
+ begin
+ css.hContact := hContact;
+ css.szProtoService := szProtoService;
+ css.wParam := wParam;
+ css.lParam := lParam;
+ Result := PluginLink^.CallService(MS_PROTO_CALLCONTACTSERVICE, 0, Integer(@css));
+ end;
+
+ function CallProtoService(const szModule, szService: PChar; wParam: WPARAM; lParam: LPARAM): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ szStr: array[0..MAXMODULELABELLENGTH] of Char;
+ begin
+ strcpy(szStr, szModule);
+ strcat(szStr, szService);
+ Result := PluginLink^.CallService(szStr, wParam, lParam);
+ end;
+
+ {$endif}
+{$endif}
+
+{$ifdef M_PROTOMOD}
+ {$ifdef M_API_UNIT}
+
+ function ProtoBroadcastAck(const szModule: PChar; hContact: THandle; type_: int; result_: int; hProcess: THandle; lParam: LPARAM): int;
+
+ function CreateProtoServiceFunction(const szModule, szService: PChar; serviceProc: TMIRANDASERVICE): int;
+
+ {$else}
+
+ function ProtoBroadcastAck(const szModule: PChar; hContact: THandle; type_: int; result_: int; hProcess: THandle; lParam: LPARAM): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ ack: TACKDATA;
+ begin
+ ack.cbSize := sizeof(TACKDATA);
+ ack.szModule := szModule;
+ ack.hContact := hContact;
+ ack.type_ := type_;
+ ack.result_ := result_;
+ ack.hProcess := hProcess;
+ ack.lParam := lParam;
+ Result := PluginLink^.CallService(MS_PROTO_BROADCASTACK, 0, Integer(@ack));
+ end;
+
+ function CreateProtoServiceFunction(const szModule, szService: PChar; serviceProc: TMIRANDASERVICE): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ szStr: array[0..MAXMODULELABELLENGTH] of Char;
+ begin
+ strcpy(szStr, szModule);
+ strcat(szStr, szService);
+ Result := PluginLink^.CreateServiceFunction(szStr, @serviceProc);
+ end;
+
+ {$endif}
+
+{$endif}
+
+{$ifdef M_SKIN}
+
+ {$ifdef M_API_UNIT}
+
+ function LoadSkinnedIcon(id: int): THandle;
+
+ function LoadSkinnedProtoIcon(const szProto: PChar; status: int): THandle;
+
+ function SkinAddNewSound(const name, description, defaultFile: PChar): int;
+
+ function SkinPlaySound (const name: PChar): int;
+
+ {$else}
+
+ function LoadSkinnedIcon(id: int): THandle;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := PluginLink^.CallService(MS_SKIN_LOADICON, id, 0);
+ end;
+
+ function LoadSkinnedProtoIcon(const szProto: PChar; status: int): THandle;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := PluginLink^.CallService(MS_SKIN_LOADPROTOICON, wParam(szProto), status);
+ end;
+
+ function SkinAddNewSound(const name, description, defaultFile: PChar): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ ssd: TSKINSOUNDDESC;
+ begin
+ ssd.cbSize := sizeof(ssd);
+ ssd.pszName := name;
+ ssd.pszDescription := description;
+ ssd.pszDefaultFile := defaultFile;
+ Result := PluginLink^.CallService(MS_SKIN_ADDNEWSOUND, 0, lParam(@ssd));
+ end;
+
+ function SkinPlaySound (const name: PChar): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := PluginLink^.CallService(MS_SKIN_PLAYSOUND, 0, lParam(name));
+ end;
+
+ {$endif}
+
+{$endif}
diff --git a/include/delphi/m_history.inc b/include/delphi/m_history.inc new file mode 100644 index 0000000000..af019ee255 --- /dev/null +++ b/include/delphi/m_history.inc @@ -0,0 +1,37 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_HISTORY}
+{$DEFINE M_HISTORY}
+
+const
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affects: Show's the history dialog box for a contact, see notes
+ Notes : HCONTACT can be NULL(0) to show system messages
+ }
+ MS_HISTORY_SHOWCONTACTHISTORY = 'History/ShowContactHistory';
+
+{$ENDIF}
diff --git a/include/delphi/m_icq.inc b/include/delphi/m_icq.inc new file mode 100644 index 0000000000..a498513f01 --- /dev/null +++ b/include/delphi/m_icq.inc @@ -0,0 +1,191 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_ICQ}
+{$DEFINE M_ICQ}
+
+const
+
+ // extra database event type
+ ICQEVENTTYPE_WEBPAGER = 2003;
+
+ // extra flags for PSS_MESSAGE
+ PIMF_ROUTE_DEFAULT = 0;
+ PIMF_ROUTE_DIRECT = $10000;
+ PIMF_ROUTE_THRUSERVER = $20000;
+ PIMF_ROUTE_BESTWAY = $30000;
+ PIMF_ROUTE_MASK = $30000;
+
+ // for SMS
+
+ ICQACKTYPE_SMS = 1001;
+ ICQEVENTTYPE_SMS = 2001; // database event type
+
+ // for e-mail express
+
+ {
+ BLOB:
+ text: ASCIIZ usually in the form "Subject: %s\r\n%s"
+ from-name: ASCIIZ
+ from-e-mail: ASCIIZ
+ }
+
+ ICQEVENTTYPE_EMAILEXPRESS = 2002;
+
+ // for server side lists, used internally only
+
+ // hProcess=dwSequence, lParam=server's error code, 0 for success
+ ICQACKTYPE_SERVERCLIST = 1003;
+
+{$ifndef m_protosvc}
+ {$include m_protosvc.inc}
+{$endif}
+
+type
+
+ PICQSEARCHRESULT = ^TICQSEARCHRESULT;
+ TICQSEARCHRESULT = record
+ hdr: TPROTOSEARCHRESULT;
+ uin: DWORD;
+ auth: Byte;
+ end;
+
+ PICQDETAILSSEARCH = ^TICQDETAILSSEARCH;
+ TICQDETAILSSEARCH = record
+ nick: PChar;
+ firstName: PChar;
+ lastNamee: PChar;
+ end;
+
+const
+
+ {
+ wParam : 0
+ lParam : null terminated string containing e-mail to search
+ affects: Start a search for all ICQ users by e-mail -- see notes
+ returns: Returnss a handle to the search on success, NULL(0) on failure
+ notes : uses the same scheme as PSS_BASICSEARCH,
+ *DEPRECATED* in favour of PS_SEARCHBYEMAIL
+ }
+ MS_ICQ_SEARCHBYEMAIL = 'ICQ/SearchByEmail';
+
+ {
+ wParam : 0
+ lParam : POinter to a TICQDETAILSSEARCH structure
+ Affect : Start a search of all ICQ users by details, see notes
+ Returns: A handle to the search on success, NULL(0) on failure
+ Notes : Results are returned in the same scheme as in PSS_BASICSEARCH,
+ Not recommended, use PS_SEARCHBYNAME
+ }
+ MS_ICQ_SEARCHBYDETAILS = 'ICQ/SearchByDetails';
+
+ {
+ wParam : Pointer to a null terminated string containing phone number
+ lParam : Pointer to a null terminated string containing the message
+ Affect : Send an SMS via the ICQ network, See notes
+ Returns: Handle to the send on success, NULL(0) on failure
+ Notes : the phone number should be the full number with internation code
+ and prefixed by + e.g. +44<numba>
+ }
+ MS_ICQ_SENDSMS = 'ICQ/SendSMS';
+
+ {
+ wParam : level
+ lParam : null terminated string containing logging message
+ Affect : a logging message was sent from ICQLib
+ }
+ ME_ICQ_LOG = 'ICQ/Log';
+
+{$ENDIF}
+
+ {$ifdef __}
+//Changing user info:
+//See documentation of PS_CHANGEINFO
+//The changing user info stuff built into the protocol is purposely extremely
+//thin, to the extent that your data is passed as-is to the server without
+//verification. Don't mess up.
+//Everything is byte-aligned
+//WORD: 2 bytes, little-endian (that's x86 order)
+//DWORD: 4 bytes, little-endian
+//LNTS: a WORD containing the length of the string, followed by the string
+// itself. No zero terminator.
+#define ICQCHANGEINFO_MAIN 0xEA03
+/* pInfoData points to:
+ WORD datalen
+ LNTS nick
+ LNTS first
+ LNTS last
+ LNTS email
+ LNTS city
+ LNTS state
+ LNTS phone
+ LNTS fax
+ LNTS street
+ LNTS cellular (if SMS-able string contains an ending ' SMS')
+ LNTS zip
+ WORD country
+ BYTE gmt
+ BYTE unknown, usually 0
+*/
+#define ICQCHANGEINFO_MORE 0xFD03
+/* pInfoData points to:
+ WORD datalen
+ BYTE age
+ BYTE 0
+ BYTE sex
+ LNTS homepage
+ WORD birth-year
+ BYTE birth-month
+ BYTE birth-day
+ BYTE lang1
+ BYTE lang2
+ BYTE lang3
+*/
+#define ICQCHANGEINFO_ABOUT 0x0604
+/* pInfoData points to:
+ WORD datalen
+ LNTS about
+*/
+#define ICQCHANGEINFO_WORK 0xF303
+/* pInfoData points to:
+ WORD datalen
+ LNTS city
+ LNTS state
+ DWORD 0
+ LNTS street
+ LNTS zip
+ WORD country
+ LNTS company-name
+ LNTS company-dept
+ LNTS company-position
+ WORD 0
+ LNTS company-web
+*/
+#define ICQCHANGEINFO_PASSWORD 0x2E04
+/* pInfoData points to:
+ WORD datalen
+ LNTS newpassword
+*/
+ {$endif}
+
diff --git a/include/delphi/m_ignore.inc b/include/delphi/m_ignore.inc new file mode 100644 index 0000000000..4dd83c4cee --- /dev/null +++ b/include/delphi/m_ignore.inc @@ -0,0 +1,74 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_IGNORE}
+{$DEFINE M_IGNORE}
+
+ { this module only provides UI and storage for blocking only, protocol modules
+ are responsible for implementing the block }
+
+const
+
+ IGNOREEVENT_ALL = LPARAM(-1);
+ IGNOREEVENT_MESSAGE = 1;
+ IGNOREEVENT_URL = 2;
+ IGNOREEVENT_FILE = 3;
+ IGNOREEVENT_USERONLINE = 4;
+ IGNOREEVENT_AUTHORIZATION=5;
+ IGNOREEVENT_YOUWEREADDED=6; // 0.3.3a+
+
+ {
+ wParam : HCONTACT
+ lParam : IGNOREEVENT_*
+ Affects: Determines if a message type to a contact should be ignored, see notes
+ Returns: 0 if the message type MUST be shown [non zero] if it MUST be ignored
+ Notes : HCONTACT can be NULL(0) to see what to do with a contact
+ that isn't on the list (or is unknown in some way)
+ don't use the IGNOREEVENT_ALL type!
+ Version: v0.1.0.1+
+ }
+ MS_IGNORE_ISIGNORED = 'Ignore/IsIgnored';
+
+ {
+ wParam : HCONTACT
+ lParam : IGNOREEVENT_* constant
+ Affects: Ignore future messages from a contact, see notes
+ Returns: 0 on success, [nonzero] on failure
+ Notes : wParam: NULL(0) can be used to see if an unknown contact should be ignored
+ or not - you can't SET unknown contact's ignore types, this is to stop
+ a plugin allowing certain functions (I guess)
+ Version: v0.1.0.1+
+ }
+ MS_IGNORE_IGNORE = 'Ignore/Ignore';
+
+ {
+ wParam : HCONTACT
+ lParam : IGNOREEVENT_*
+ Affects: Receive future messages from a contact -- of the given type, see notes
+ Returns: 0 on success, non zero on failure
+ Notes : Use NULL(0) for HCONTACT to retrieve the setting for an unknown contact
+ Version: v0.1.0.1+
+ }
+ MS_IGNORE_UNIGNORE = 'Ignore/Unignore';
+
+{$ENDIF}
diff --git a/include/delphi/m_langpack.inc b/include/delphi/m_langpack.inc new file mode 100644 index 0000000000..2c1f99478c --- /dev/null +++ b/include/delphi/m_langpack.inc @@ -0,0 +1,82 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_LANGPACK}
+{$DEFINE M_LANGPACK}
+
+const
+
+ {
+ wParam : 0
+ lParam : pointer to a null terminated string
+ Affects: Returns a pointer to a localised string, if there is no known
+ translation it will return lParam, the return value does *not*
+ have to be freed in anyway (if successful) -- see notes
+ Returns: a pointer to a null terminated string
+ Notes : No check is done to see if Miranda has the required version
+ Version: v0.1.1.0+
+ }
+ MS_LANGPACK_TRANSLATESTRING = 'LangPack/TranslateString';
+
+ {
+ wParam : 0
+ lParam : Pointer to a LANGPACKTRANSLATEDIALOG initialised structure, see notes
+ Affects: Translates a dialog into the user's local language
+ Returns: 0 on successs [non zero] on failure
+ Notes : this service only knows about the following window classes/elements:
+ Window titles, STATIC, EDIT, Hyperlink, BUTTON.
+ Version: v0.1.1.0+
+ }
+
+type
+
+ PLANGPACKTRANSLATEDIALOG = ^TLANGPACKTRANSLATEDIALOG;
+ TLANGPACKTRANSLATEDIALOG = record
+ cbSize: int;
+ flags: DWORD;
+ hwndDlg: THandle;
+ ignoreControls: ^Integer; // pointer to an array of integers? mebbe?
+ end;
+
+const
+
+ { translate all edit controls, by default non-read-only edit controls are not }
+ LPTDF_NOIGNOREEDIT = 1;
+ { don't translate the title of the dialog }
+ LPTDF_NOTITLE = 2;
+
+ MS_LANGPACK_TRANSLATEDIALOG = 'LangPack/TranslateDialog';
+
+ {
+ wParam : HMENU handle (WinAPI handle to a menu)
+ lParam : 0
+ Affects: Translates a menu into the user's local language -- see notes
+ Returns: 0 on success [non zero] on failure
+ Notes : This doesn't work with owner draw menus that store their
+ captions in a structure known by the owner -- something to be aware of ;)
+ version: v0.1.1.0+
+ }
+ MS_LANGPACK_TRANSLATEMENU = 'LangPack/TranslateMenu';
+
+{$ENDIF}
diff --git a/include/delphi/m_message.inc b/include/delphi/m_message.inc new file mode 100644 index 0000000000..dec113bb53 --- /dev/null +++ b/include/delphi/m_message.inc @@ -0,0 +1,57 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_MESSAGE}
+{$DEFINE M_MESSAGE}
+
+const
+
+ {
+ wParam : HCONTACT
+ lParam : Pointer to a null terminated string
+ Affects: brings up the send message dialog for a contact, see notes
+ Returns: 0 on success, non zero on failure
+ Notes : returns immediately, just after the send dialog is shown,
+ the lParam is entered into the editbox of the window,
+ but it's not sent.
+ Version: v0.1.2.0+ only supports a string, prior NULL(0) is expected
+ this service was defined as 'SRMsg/LaunchMessageWindow'
+ use both if compatibility use both, the correct one will work,
+ but don't rely on the message to be displayed
+
+ }
+ MS_MSG_SENDMESSAGE = 'SRMsg/SendCommand';
+ MS_MSG_SENDMESSAGE_OLD = 'SRMsg/LaunchMessageWindow';
+
+ {
+ wParam : 0
+ lParam : Pointer to a null termed string
+ Affects: displays the send message dialog with the 'multiple' option open
+ and no contacts selected
+ Returns: Returns 0 on success, nonzero on failure
+ Version: only present after v0.1.2.1+
+ }
+ MS_MSG_FORWARDMESSAGE = 'SRMsg/ForwardMessage';
+
+{$ENDIF}
diff --git a/include/delphi/m_netlib.inc b/include/delphi/m_netlib.inc new file mode 100644 index 0000000000..8c5f37ef9c --- /dev/null +++ b/include/delphi/m_netlib.inc @@ -0,0 +1,713 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_NETLIB}
+{$DEFINE M_NETLIB}
+
+{>>/
+
+ NetLib :
+
+ Instead of you writing all the code for working with sockets and supporting
+ app level protocols such as SOCKS5, it's all done for you.
+
+ NetLib takes care of all that and you can even register a special abstract
+ nexus, e.g. ICQ direct, the user can configure all this from the options dialog
+ and you don't have to bother with any of it.
+
+ NetLib wraps up any Winsock calls but you can still get the socket handle
+ from your netlib handle and do stuff.
+
+ It gives all modules an abstract way of dealing with transport -- mainly sockets
+ and proxies, Now the but..
+
+ It's new (mmmm) thus unsupported by any older version of Miranda, and if you
+ want to be lazy and not write any "wrapper" mini netlib then you'll have
+ the kudos of "only works with nightly build version of Miranda" :)
+
+/<<}
+
+ {$ifndef M_SYSTEM}
+ {$include m_system.inc}
+ {$endif}
+
+const
+
+ // for TNETLIBUSER.flags
+
+ { bind incoming ports }
+ NUF_INCOMING = $01;
+ { makes outgoing plain connections }
+ NUF_OUTGOING = $02;
+ { can use HTTP gateway for plain sockets. ???HttpGateway* are valid,
+ enables the HTTP proxy option, displayed in options }
+ NUF_HTTPGATEWAY = $04;
+ { don't show this as an entry for custom settings to be defined for,
+ TNETLIB.szDescriptiveName is ignored }
+ NUF_NOOPTIONS = $08;
+ { some connections are made for HTTP communication,
+ enables the HTTP proxy option, displayed in options }
+ NUF_HTTPCONNS = $10;
+ { Disables the HTTPS proxy option in options, Use this if all communication
+ is HTTP }
+ NUF_NOHTTPSOPTION = $20;
+
+ // for TNETLIBUSERSETTINGS.proxyType
+
+ { SOCKS4 -- No DNS or multi addressing mode (proxy side) -- optional username can
+ be given, no password }
+ PROXYTYPE_SOCKS4 = 1;
+ { SOCKS5 -- DNS names can be given as addresses to connect to, optional
+ plain text username/password scheme (which may cause failure due to denied access)
+ IP address maybe returned for DNS addresses -- thus server side DNS }
+ PROXYTYPE_SOCKS5 = 2;
+ PROXYTYPE_HTTP = 3;
+ PROXYTYPE_HTTPS = 4;
+
+ // for TNETLIBOPENCONNECTION.flags
+
+ { this connection will be useed for HTTP communications,
+ if configured for an HTTP(S) proxy the connection is opened as if there
+ was no proxy }
+
+ NLOCF_HTTP = $0001;
+
+ // for TNETLIBHTTPPROXYINFO.flags
+
+ { append sequence numbers to GET requests }
+ NLHPIF_USEGETSEQUENCE = $0001;
+ { append sequence numbers to POST requests }
+ NLHPIF_USEPOSTSEQUENCE = $0002;
+ { GET and POST use the same sequence }
+ NLHPIF_GETPOSTSAMESEQUENCE = $0004;
+
+ // for TNETLIBHTTPREQUEST.flags, .requestType
+
+ { used by MS_NETLIB_RECVHTTPHEADERS returned structure }
+
+ REQUEST_RESPONSE = 0;
+ REQUEST_GET = 1;
+ REQUEST_POST = 2;
+ REQUEST_CONNECT = 3;
+
+ { auto generate a 'host' header from .szUrl }
+ NLHRF_GENERATEHOST = $00000001;
+ { remove any host and/or protocol portion of szUrl before sending it }
+ NLHRF_REMOVEHOST = $00000002;
+ { removes host and/or protocol from szUrl unless the connection was
+ opened through an HTTP or HTTPS proxy. }
+ NLHRF_SMARTREMOVEHOST = $00000004;
+ { if the connection was opened through an HTTP or HTTPS proxy then
+ send a Proxy-Authorization header if required. }
+ NLHRF_SMARTAUTHHEADER = $00000008;
+ { never dump this to the log }
+ NLHRF_NODUMP = $00010000;
+ { don't dump http headers (only useful for POSTs and MS_NETLIB_HTTPTRANSACTION }
+ NLHRF_NODUMPHEADERS = $00020000;
+ { this transaction is a proxy communication. For dump filtering only. }
+ NLHRF_DUMPPROXY = $00040000;
+ { dump posted and reply data as text. Headers are always dumped as text. }
+ NLHRF_DUMPASTEXT = $00080000;
+
+ // for TNETLIBBUFFER.flags
+
+ { don't wrap outgoing packet using TNETLIBUSER.pfnHttpGatewayWrapSend }
+ MSG_NOHTTPGATEWAYWRAP = $010000;
+ { don't dump this packet to the log }
+ MSG_NODUMP = $020000;
+ { this iss proxy communication, for dump filtering only }
+ MSG_DUMPPROXY = $040000;
+ { don't dump as hex, it's text }
+ MSG_DUMPASTEXT = $080000;
+ { send as raw, bybpass HTTP proxy stuff }
+ MSG_RAW = $100000;
+
+
+ // all record types structures are declared in their own block because the C header
+ // file used forward declaration (to get typed parameters for certain function pointers)
+ // This sort of define-type-pointer-before-type can only be done in the same type block
+ // in D2 (don't know about later versions)
+
+type
+
+ { forward typed pointers to records }
+
+ PNETLIBOPENCONNECTION = ^TNETLIBOPENCONNECTION;
+ PNETLIBHTTPREQUEST = ^TNETLIBHTTPREQUEST;
+
+ { This function pointer is to the CRT realloc() used by Miranda -- it allows reallocation of memory passed
+ to us (not that we could EVER share the same CRT) but to allow DLLs in general to reallocate memory }
+ TNetlibRealloc = function(Mem: Pointer; size_t: int): Pointer; cdecl;
+ TNetlibHTTPGatewayInitProc = function(hConn: THandle; nloc: PNETLIBOPENCONNECTION; nlhr: PNETLIBHTTPREQUEST): int; cdecl;
+ TNetlibHTTPGatewayBeginProc = function(hConn: THandle; nloc: PNETLIBOPENCONNECTION): int; cdecl;
+ TNetlibHTTPGatewayWrapSendProc = function(hConn: THandle; buf: PByte; len: int; flags: int; pfnNetLibSend: TMIRANDASERVICE): int; cdecl;
+ TNetlibHTTPGatewayUnwrapRecvProc = function(nlhr: PNETLIBHTTPREQUEST; buf: PByte; len: int; outBufLen: pInt; NetlibRealloc: TNetlibRealloc): PByte; cdecl;
+
+ PNETLIBUSER = ^TNETLIBUSER;
+ TNETLIBUSER = record
+ cbSize: int;
+ { used for DB settings and log, 'NL' stuff }
+ szSettingsModule: PChar;
+ { shows a descriptive name for which different proxy settings can be defined }
+ szDescriptiveName: PChar;
+ { see NUF_* constants above }
+ flags: DWORD;
+ szHttpGatewayHello: PChar;
+ { can be NULL(0) to send no User-Agent: also used by HTTPS proxies }
+ szHttpGatewayUserAgent: PChar;
+ pfnHttpGatewayInit: TNetlibHTTPGatewayInitProc;
+ { can be NULL(0) if no begin is required }
+ pfnHttpGatewayBegin: TNetlibHTTPGatewayBeginProc;
+ { can be NULL(0) if no wrapping is required }
+ pfnHttpGatewayWrapSend: TNetlibHTTPGatewayWrapSendProc;
+ { can be NULL(0) " " }
+ pfnHttpGatewayUnwrapRecv: TNetlibHTTPGatewayUnwrapRecvProc;
+ { only if NUF_INCOMING, will be used for validation of user input }
+ minIncomingPorts: int;
+ end;
+
+ PNETLIBUSERSETTINGS = ^TNETLIBUSERSETTINGS;
+ TNETLIBUSERSETTINGS = record
+ { filled before calling }
+ cbSize: int;
+ { 1 or 0 }
+ useProxy: int;
+ { PROXYTYPE_* constant, see above }
+ proxyType: int;
+ { can be NULL(0) }
+ szProxyServer: PChar;
+ { in host byte order }
+ wProxyPort: int;
+ { 1 or 0, always 0 for SOCKS4 (doesn't have auth) }
+ useProxyAuth: int;
+ { can be NULL(0), always used by SOCKS4 }
+ szProxyAuthUser: PChar;
+ { can be NULL(0) }
+ szProxyAuthPassword: PChar;
+ { 1 or 0, only used by HTTP, HTTPS }
+ useProxyAuthNtlm: int;
+ { 1 or 0 }
+ dnsThroughProxy: int;
+ { 1 or 0 }
+ specifyIncomingPorts: int;
+ { can be NULL(0), form '1024-1050,1060-1070,2000' }
+ szIncomingPorts: PChar;
+ end;
+
+ TNetlibNewConnectionProc = procedure(hNewConnection: THandle; dwRemoveIP: DWORD); cdecl;
+
+ PNETLIBBIND = ^TNETLIBBIND;
+ TNETLIBBIND = record
+ cbSize: int;
+ { function to call when there's a new connection, dwRemoteIP is in host byte
+ order -- the handle is to the new connection }
+ pfnNewConnection: TNetlibNewConnectionProc;
+ { set on return, host byte order }
+ dwInternalIP: DWORD;
+ { set on return, host byte order }
+ wPort: WORD;
+ end;
+
+ { Pointered type is above }
+ TNETLIBOPENCONNECTION = record
+ cbSize: int;
+ szHost: PChar; // can be an IP in string form
+ wPort: Word;
+ flags: DWORD; // see NLOCF_* flags
+ end;
+
+ PNETLIBHTTPPROXYINFO = ^TNETLIBHTTPPROXYINFO;
+ TNETLIBHTTPPROXYINFO = record
+ cbSize: int;
+ { see NLHPIF_* above }
+ flags: DWORD;
+ szHttpPostUrl: PChar;
+ szHttpGetUrl: PChar;
+ firstGetSequence: int;
+ firstPostSequence: int;
+ end;
+
+ PNETLIBBASE64 = ^TNETLIBBASE64;
+ TNETLIBBASE64 = record
+ pszEncoded: PChar;
+ cchEncoded: int;
+ pbDecoded: PByte;
+ cbDecoded: int;
+ end;
+
+ PNETLIBHTTPHEADER = ^TNETLIBHTTPHEADER;
+ TNETLIBHTTPHEADER = record
+ szName: PChar;
+ szValue: PChar;
+ end;
+
+ { PNETLIBHTTPREQUEST = ^TNETLIBHTTPREQUEST, defined above because this is
+ forward referenced from there }
+ TNETLIBHTTPREQUEST = record
+ cbSize: int;
+ requestType: int; // REQUEST_* constant
+ flags: DWORD;
+ szUrl: PChar;
+ { doesn't contain Content-Length, it'll be added automatically }
+ headers: PNETLIBHTTPHEADER; // pointer to an array of em?
+ headersCount: int; // yes they do
+ pData: PChar; // data to be sent on POST request
+ dataLength: int; // must be 0 for REQUEST_GET/REQUEST_CONNECT
+ resultCode: int;
+ szResultDescr: PChar;
+ end;
+
+ PNETLIBBUFFER = ^TNETLIBBUFFER;
+ TNETLIBBUFFER = record
+ buf: PChar;
+ len: int;
+ { see MSG_* constants above }
+ flags: int;
+ end;
+
+ PNETLIBSELECT = ^TNETLIBSELECT;
+ TNETLIBSELECT = record
+ cbSize: int;
+ dwTimeout: DWORD; // in milliseconds, INFINITE is acceptable
+ hReadConns: array[0..64+1] of THandle;
+ hWriteConns: array[0..64+1] of THandle;
+ hExceptConns: array[0..64+1] of THandle;
+ end;
+
+ PNETLIBPACKETRECVER = ^TNETLIBPACKETRECVER;
+ TNETLIBPACKETRECVER = record
+ cbSize: int;
+ { infinite is allowed -- initialise before use }
+ dwTimeout: DWORD;
+ { this many bytes are removed from the start of the buffer,
+ set to 0 on return -- initialise before use }
+ bytesUsed: int;
+ { equal the returnd value by service, unless the return value is 0 (connection closed) }
+ bytesAvailable: int;
+ { same as the parameter given to MS_NETLIB_CREATEPACKETRECVER: wParam }
+ bufferSize: int;
+ { contains the read data }
+ buffer: PByte;
+ end;
+
+const
+
+ {
+ wParam : 0
+ lParam : Pointer to an initalised TNETLIBUSER structure
+ Affects: Initialises the netlib for a set of connections, see notes
+ Returns: Returns a handle for future netlib calls, NULL on failure.
+ Notes : Netlib is loaded AFTER all plugins, thus a call to this service
+ in Load() will fail, hook ME_SYSTEM_MODULESLOADED and call it
+ from there.
+ -
+ Netlib will save settings under .szSettings module, all settings
+ (being?) begin with 'NL'.
+ -
+ Defacto settings are the same as <All connections> combobox entry option
+ as seen in Miranda->Options->Network
+ Version: v0.1.2.2+
+ Errors : ERROR_INVALID_PARAMETER, ERROR_OUTOFMEMORY, ERROR_DUP_NAME
+ }
+ MS_NETLIB_REGISTERUSER = 'Netlib/RegisterUser';
+
+ {
+ wParam : HANDLE
+ lParam : Pointer to a initalised TNETLIBUSERSETTINGS structure
+ Affects: Gets the user configured settings for a Netlib user, see notes
+ Returns: [non zero] on SUCCESS, NULL(0) on failure
+ Notes : .cbSize must be filled with sizeof() before calling --
+ the returned null terminated strings (in the structure) are valid
+ as long as HANDLE remains open or proxy options are changed
+ again, do not rely on them being around forever.
+ Version: v0.1.2.2+
+ Errors : ERROR_INVALID_PARAMETER
+ }
+ MS_NETLIB_GETUSERSETTINGS = 'Netlib/GetUserSettings';
+
+ {
+ wParam : HANDLE
+ lParam : Pointer to a initalised NETLIBUSERSETTINGS structure
+ Affect : Changes the configurable settings for a Netlib user -- see notes
+ Returns: [non zero] on success, NULL(0) on failure
+ Notes : This service is only really useful for people that specify NUF_NOOPTIONS
+ when registering and want to create their own options.
+ Settings will be stored even if the option to enable it, is it not enabled,
+ e.g. useProxyAuth is 0, szProxyAuthPassword will still be saved
+ Errors : ERROR_INVALID_PARAMETER
+ }
+ MS_NETLIB_SETUSERSETTINGS = 'Netlib/SetUserSettings';
+
+ {
+ wParam : HANDLE / SOCKET
+ lParam : 0
+ Affects: Closes a handle, see notes
+ Returns: Returns [non zero] on success, NULL(0) on failure
+ Notes : All netlib handles should be closed once they're finished with,
+ If a SOCKET type is passed instead of netlib handle type, it is closed
+ Errors : ERROR_INVALID_PARAMETER
+ }
+ MS_NETLIB_CLOSEHANDLE = 'Netlib/CloseHandle';
+
+ {
+ wParam : HANDLE
+ lParam : Pointer to a initialised TNETLIBBIND
+ Affects: Open a port and wait for connections on it -- see notes
+ Returns: Returns a handle on success, NULL(0) on failure
+ Notes : this function does the equivalent of socket(), bind(), getsockname(),
+ listen(), accept() -- internally this function creates a new thread
+ which waits around in accept() for new connections.
+ When one is received, TNETLIBBIND.pfnNewConnection is called,
+ from the context of the NEW thread and then it
+ returns to waiting for connections.
+ -
+ Close the returned handle to end the thread and close the port.
+ -
+ Errors : ERROR_INVALID_PARAMETER, any returned by socket(), bind(), listen()
+ getsockname()
+ }
+ MS_NETLIB_BINDPORT = 'Netlib/BindPort';
+
+ {
+ wParam : HANDLE
+ lParam : Pointer to an initalised TNETLIBOPENCONNECTION structure
+ Affects: Opens a connection -- see notes
+ Returns: Returns a Handle to a new connection on success, NULL(0) on failure
+ Notes : internally this service is the equivalent of socket(), gethostbyname(),
+ connect()
+ -
+ If NLOCF_HTTP is set and HANDLE is configured for HTTP(S) proxy
+ then this function will connect() to that proxy server ONLY,
+ without performing any initialisation conversation.
+ -
+ If HANDLE is configured for an HTTP proxy and does not support
+ HTTP gateways and you try to open a connection without NLOCF_HTTP
+ then this service will first attempt to open an HTTPS connection,
+ if that fails, it will try a direct connection, if *that* fails
+ then it will return failure with the error
+ from connect() during the connection attempt
+ Errors : ERROR_INVALID_PARAMETER, any returned by socket(), gethostbyname(),
+ connect(), MS_NETLIB_SEND, MS_NETLIB_RECV, select()
+ -
+ ERROR_TIMEOUT (during proxy communication)
+ ERROR_BAD_FORMAT (very invalid proxy reply)
+ ERROR_ACCESS_DENIED (by proxy)
+ ERROR_CONNECTION_UNAVAIL (socks proxy can't connect to identd)
+ ERROR_INVALID_ACCESS (proxy refused identd auth)
+ ERROR_INVALID_DATA (proxy returned invalid code)
+ ERROR_INVALID_ID_AUTHORITY (proxy requires use of auth method that's not supported)
+ ERROR_GEN_FAILURE (socks5/https general failure)
+ ERROR_CALL_NOT_IMPLEMENTED (socks5 command not supported)
+ ERROR_INVALID_ADDRESS (socks5 address type not supported)
+ -
+ HTTP: anything from TNETLIBUSER.pfnHttpGatewayInit, TNETLIBUSER.pfnHttpGatewayBegin,
+ MS_NETLIB_SENDHTTPREQUEST or MS_NETLIB_RECVHTTPHEADERS
+ }
+ MS_NETLIB_OPENCONNECTION = 'Netlib/OpenConnection';
+
+ {
+ wParam : HANDLE
+ lParam : Pointer to an initialised NETLIBHTTPPROXYINFO structure
+ Affects: Sets the required information for an HTTP proxy connection -- see notes
+ Returns: [non zero] on success, NULL(0) on failure
+ Notes : This service is designed to be called from
+ within TNETLIBUSER.pfnHttpGatewayInit (see notes in C header under
+ MS_NETLIB_REGISTERUSER)
+ Errors : ERROR_INVALID_PARAMETER
+ }
+ MS_NETLIB_SETHTTPPROXYINFO = 'Netlib/SetHttpProxyInfo';
+
+ {
+ wParam : HANDLE
+ lParam : 0
+ Affects: Get's the SOCKET associated with a handle -- see notes
+ Returns: the SOCKET on success, INVALID_SOCKET on failure
+ Notes : The Netlib handle passed to this service should only be passed
+ if they were returned with MS_NETLIB_OPENCONNECTION or MS_NETLIB_BINDPORT
+ -
+ Be careful how you use this socket because you might be connected via an
+ HTTP proxy, in which case calling send/recv() will break things
+ -
+ Errors : ERROR_INVALID_PARAMETER
+ }
+ MS_NETLIB_GETSOCKET = 'Netlib/GetSocket';
+
+ {
+ wParam : 0
+ lParam : Pointer to a null terminated string
+ Affects: URL-encodes a string for x-www-form-urlencoded (and other uses) -- see notes
+ Returns: A pointer to a null terminated string, NULL(0) on failure
+ Notes : The returned string must be freed after it's no longer needed,
+ to do this Miranda's process heap must be used (under the WINAPI), e.g.
+ HeapFree(GetProcessHeap(), 0, the_returned_string)
+ Errors : ERROR_INVALID_PARAMETER, ERROR_OUTOFMEMORY
+ }
+ MS_NETLIB_URLENCODE = 'Netlib/UrlEncode';
+
+ {
+ wParam : 0
+ lParam : Pointer to a TNETLIBBASE64 initialised structure
+ Affects: Decodes a Base64 null terminated string, see notes
+ Returns: [non zero] on success, NULL(0) on failure
+ Notes : TNETLIBBASE64.pszEncoded and cchEncoded must contain a pointer to
+ a buffer to use as input, and it's length, the length
+ should not include space taken for null termination --
+ -
+ Output is placed in ..pbDecoded and ..cbDecoded for buffer and
+ length of buffer -- the maxiumum output for a given input can
+ be worked out with Netlib_GetBase64DecodedBufferSize() function
+ see below.
+ -
+ For more information on Base64 see rfc-1421.
+ Errors : ERROR_INVALID_PARAMETER, ERROR_INVALID_DATA, ERROR_BUFFER_OVERFLOW
+ }
+ MS_NETLIB_BASE64DECODE = 'Netlib/Base64Decode';
+
+ {
+ wParam : 0
+ lParam : Pointer to an initialised TNETLIBBASE64 structure
+ Affect : Base64 encode a string, see notes
+ Returns: [non zero] on success, NULL(0) on failure
+ Notes : TNETLIBBASE64.pbDecode and TNETLIBBASE64.cbDecoded contain
+ the input buffer and it's length --
+ TNETLIBBASE64.pszEncoded and TNETLIBBASE64.cchEncoded contain the
+ buffer in which to put the output and it's length.
+ -
+ The maximum output size for a given input can be worked
+ out with the function Netlib_GetBase64EncodedBufferSize() below
+ .pszEncoded is null terminated, on return TNETLIBBASE64.cchEncoded
+ is set to the actual length excluding 0.
+ Errors : ERROR_INVALID_PARAMETER, ERROR_BUFFER_OVERFLOW
+ }
+ MS_NETLIB_BASE64ENCODE = 'Netlib/Base64Encode';
+
+ {
+ wParam : HANDLE
+ lParam : Pointer to a initialised TNETLIBHTTPREQUEST structure
+ Affect : Send an HTTP request over a connection, see notes
+ Returns: The number of bytes on success, SOCKET_ERROR on failure
+ Notes : HANDLE must of been returned by MS_NETLIB_OPENCONNECTION,,
+ If you use NLHRF_SMARTAUTHHEADER and NTLM auth is in use then
+ full NTLM auth transcation occurs, comprising sending the
+ domain, getting the challenge, sending the response.
+ NETLIBHTTPREQUEST.resultCode and NETLIBHTTPREQUEST.szResultDescr are
+ ignored by this service.
+ Errors : ERROR_INVALID_PARAMETER, MS_NETLIB_SEND (return codes)
+ }
+ MS_NETLIB_SENDHTTPREQUEST = 'Netlib/SendHttpRequest';
+
+ {
+ wParam : HANDLE
+ lParam : 0
+ Affect : Receive HTTP headers, see notes
+ Returns: A pointer to a TNETLIBHTTPREQUEST structure on success, NULL(0) on failure
+ Notes : The returned pointer must be freed after it's done with
+ use MS_NETLIB_FREEHTTPREQUESTSTRUCT.
+ -
+ HANDLE must be returned by MS_NETLIB_OPENCONNECTION
+ -
+ Return^.pData=NIL and Return^.dataLength=0 always
+ -
+ The returned data should be retrieved using MS_NETLIB_RECV once
+ the headers have been parsed.
+ If headers haven't finished within 60 seconds the function returns
+ NULL(0) and ERROR_TIMEOUT
+ Errors : ERROR_INVALID_PARAMETER, any MS_NETLIB_RECV or select()
+ ERROR_HANDLE_EOF (connection closed bfore headers complete)
+ ERROR_TIMEOUT (headers still not complete after 60 seconds)
+ ERROR_BAD_FORMAT (invalid character or line ending in headers, or first line is blank)
+ ERROR_BUFFER_OVERFLOW (each header line must be less than 4096 chars long)
+ ERROR_INVALID_DATA (first header line is malformed ("http/[01].[0-9] [0-9]+ .*", or no colon in subsequent line)
+
+ }
+ MS_NETLIB_RECVHTTPHEADERS = 'Netlib/RecvHttpHeaders';
+
+ {
+ wParam : 0
+ lParam : Pointer returned by MS_NETLIB_RECVHTTPHEADERS to free
+ Affect : Free the memory used by a TNETLIBHTTPREQUEST structure, see notes
+ Returns: [non zero] on success, NULL(0) on failure
+ Notes : This service should only be used with memory pointers returned
+ by either MS_NETLIB_RECVHTTPHEADERS or MS_NETLIB_HTTPTRANSACTION!.
+ Errors : ERROR_INVALID_PARAMETER
+
+ }
+ MS_NETLIB_FREEHTTPREQUESTSTRUCT = 'Netlib/FreeHttpRequestStruct';
+
+ {
+ wParam : HANDLE
+ lParam : Pointer to a TNETLIBHTTPREQUEST structure
+ Affect : Carry out an entire HTTP transaction, see notes
+ Returns: another pointer to a TNETLIBHTTPREQUEST structure or NULL(0)
+ on failure
+ Notes : The returned pointer must be freed at some point
+ with MS_NETLIB_FREEHTTPREQUESTSTRUCT,
+ -
+ TNETLIBHTTPREQUEST.szUrl should have a full HTTP URL, if it
+ does not start with http://, that will be assumed, but do not
+ take this assumption to stay assumed (heh..) in the future
+ -
+ this service equivalent of open(), sendhttp(), getheaders()
+ netlib_recv(), netlib_closehandle()
+ -
+ TNETLIBHTTPREQUEST.headers will be added to with the following
+ headers if they're not already present :
+ "Host" (even if it is requested in .flags)
+ "User-Agent" (in form : 'Miranda/d.d.d.d <(status of release)>')
+ "Content-Length" (for POSTs only, set to TNETLIBHTTPREQUEST.dataLength)
+
+ If you don't want to send any of these headers --
+ set TNETLIBHTTPREQUEST.headers to NULL(0)
+ -
+ In the returned pointer, pData[dataLen] is always 0 for 'safety'
+ also : headers, headersCount, pData, dataLength, resultCode and
+ szResultDescr are all valid
+ -
+ Also take care not to assume that a returned pointer means that
+ at the HTTP level it all worked out -- refer to the resultCode for
+ 2xx before doing anything else
+ -
+ Errors : ERROR_INVALID_PARAMETER, ERROR_OUTOFMEMORY
+ Errors returned by the aforementioned internally used functions
+ }
+ MS_NETLIB_HTTPTRANSACTION = 'Netlib/HttpTransaction';
+
+ {
+ wParam : HANDLE
+ lParam : Pointer to an initialised TNETLIBBUFFER structure
+ Affect : Send data over an open connection see notes
+ Returns: The number of bytes sent on success, SOCKET_ERROR on failure
+ Notes : see Netlib_Send() helper function
+ Errors : ERROR_INVALID_PARAMETER,
+ anything from socket(), connect()
+ send(), TNETLIBUSER.pfnHttpGatewayWrapSend(),
+ (HTTP proxy): ERROR_GEN_FAILURE (http result code wasn't 2xx)
+ MS_NETLIB_SENDHTTPREQUEST, MS_NETLIB_RECVHTTPHEADERS
+ }
+ MS_NETLIB_SEND = 'Netlib/Send';
+
+ {
+ wParam : HANDLE
+ lParam : Pointer to an initialised TNETLIBBUFFER structure
+ Affect : Receive data over a connection, see notes
+ Returns: The number of bytes read on success, SOCKET_ERROR on failure
+ Notes :
+ This service uses some of the same flags as MS_NETLIB_SEND :
+ MSG_PEEK,
+ MSG_NODUMP,
+ MSG_DUMPPROXY,
+ MSG_NOHTTPGATEWAYWRAP,
+ MSG_DUMPASTEXT,
+ MSG_RAW
+ -
+ On using MSG_NOHTTPGATEWAYWRAP: Because packets through an HTTP proxy are
+ batched and cached and stuff, using this flag is not a guarantee that it
+ will be obeyed, and if it is it may even be propogated to future calls
+ even if you don't specify it then. Because of this, the flag should be
+ considered an all-or-nothing thing: either use it for the entire duration
+ of a connection, or not at all.
+ Errors : ERROR_INVALID_PARAMETER, anything from recv()
+ (HTTP proxy):
+ ERROR_GEN_FAILURE (http result code wasn't 2xx)
+ ERROR_INVALID_DATA (no Content-Length header in reply)
+ ERROR_NOT_ENOUGH_MEMORY (Content-Length very large)
+ ERROR_HANDLE_EOF (connection closed before Content-Length bytes recved)
+ anything from select(),
+ MS_NETLIB_RECVHTTPHEADERS, nlu.pfnHttpGatewayUnwrapRecv, socket(),
+ connect(), MS_NETLIB_SENDHTTPREQUEST
+
+ }
+ MS_NETLIB_RECV = 'Netlib/Recv';
+
+ {
+ wParam : 0
+ lParam : Pointer to an initialised TNETLIBSELECT structure
+ Affect : Determine the status of one or more connections, see notes
+ Returns: The numbe of ready connections, SOCKET_ERROR on failure
+ Notes : All handles passed to this service must have been returned
+ either by MS_NETLIB_OPENCONNECTION or MS_NETLIB_BINDPORT,
+ the last handle in each list must be followed by either NULL
+ or INVALID_HANDLE_VALUE.
+ Errors : ERROR_INVALID_HANDLE, ERROR_INVALID_DATA, anything from select()
+ }
+ MS_NETLIB_SELECT = 'Netlib/Select';
+
+ {
+ wParam : HANDLE
+ lParam : maxPacketSize
+ Affect : Create a packet receiver, see notes
+ Returns: A handle on success, NULL(0) on failure
+ Notes : The packet receiver implements the common situation where
+ you have a variable length of packets coming thru over a connection
+ and you want them split up in order to handle them.
+ -
+ The major limiation is, that the buffer is created in memory,
+ so you can't have arbitrarily large packets
+ Errors : ERROR_INVALID_PARAMETER, ERROR_OUTOFMEMORY
+ }
+ MS_NETLIB_CREATEPACKETRECVER = 'Netlib/CreatePacketRecver';
+
+ {
+ wParam : Handle returned by MS_NETLIB_CREATEPACKETRECVER
+ lParam : Pointer to an initialised TNETLIBPACKETRECVER
+ Returns: The total number of bytes available in the buffer, NULL(0)
+ if the connection was closed or SOCKET_ERROR.
+ -
+ If TNETLIBPACKETRECVER.bytesUsed is set to zero and the
+ buffer is already full up to the maxPacketSize, it is assumed
+ that a too large packet has been received, All data in
+ the buffer is discarded and receiving has started anew.
+ -
+ This will probably cause alignment problem so if you think
+ that tis iss likely to happen, then you should deal with it
+ yourself.
+ -
+ Closing the packet receiver will not close the associated
+ connection but will discard any bytes still in the buffer,
+ so if you intend to carry on reading from that connection,
+ make sure you have processed the buffer first.
+ -
+ This service is equivalent of memmove() to remove
+ the first bytesUsed from the buffer, select(), if dwTimeOut
+ is not INFINITE, then MS_NETLIB_RECV
+ Errors : ERROR_INVALID_PARAMETER, ERROR_TIMEOUT, anything from select(),
+ MS_NETLIB_RECV
+ }
+ MS_NETLIB_GETMOREPACKETS = 'Netlib/GetMorePackets';
+
+ {
+ wParam : HANDLE
+ lParam : Pointer to null terminated string to uh, log.
+ Affect : Add a message to the log (if it's running) see notes
+ Returns: non zeror on success, NULL(0) on failure
+ Notes : Don't include \r\n or #13#10 it's not needed,
+ -
+ Doesn't support formatting like the given C code for
+ Netlib_Logf, just use FmtStr() and then call this service
+ if you want that.
+ Errors : ERROR_INVALID_PARAMETER
+ }
+ MS_NETLIB_LOG = 'Netlib/Log';
+
+{$ENDIF}
diff --git a/include/delphi/m_options.inc b/include/delphi/m_options.inc new file mode 100644 index 0000000000..23d891a81c --- /dev/null +++ b/include/delphi/m_options.inc @@ -0,0 +1,109 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_OPTIONS}
+{$DEFINE M_OPTIONS}
+
+const
+
+ {
+ wParam : addinfo
+ lParam : 0
+ Affects: The user opened the options dialog, see notes
+ Notes : Modules should do whatever initalisation they need and call
+ MS_OPT_ADDPAGE with the wParam -- MS_OPT_ADDPAGE
+ can be called one or more times
+ if more than one page wants to be displayed.
+ }
+ ME_OPT_INITIALISE = 'Opt/Initialise';
+
+ {
+ wParam : wParam from ME_OPT_INITIALISE
+ lParam : Pointer to an initialised TOPTIONSDIALOGPAGE
+ Affects: Adds a page to the options dialog, see notes
+ Notes : Strings in the structure can be released as soon as the
+ service returns -- but icons must be kept around, this iss
+ not a problem if you're loading theem from a resource.
+ -
+ This service should only be called within the ME_OPT_INITIALISE
+ event hook.
+ -
+ Pages in the options dialog operate just like pages in property
+ sheets, See the WinAPI documentation for details on how they operate.
+ Version: Prior to v0.1.2.1 the options dialog would resize
+ to fit the largest page, but since then it's a fixed size
+ The largest page that fits neatly is 314x240 DLU's
+ -
+ Some of OPTIONSDIALOGPAGE's fields are version dependant.
+ }
+ MS_OPT_ADDPAGE = 'Opt/AddPage';
+
+ { defacto size }
+
+ OPTIONSDIALOGPAGE_V0100_SIZE = $18;
+ OPTIONSDIALOGPAGE_V0120_SIZE = $28;
+
+ { page is only shown when in 'simple' mode }
+ ODPF_SIMPLEONLY = 1;
+ { page is only shown when in 'expert' mode }
+ ODPF_EXPERTONLY = 2;
+ { give group box titles a bold font }
+ ODPF_BOLDGROUPS = 4;
+
+type
+
+ POPTIONSDIALOGPAGE = ^TOPTIONSDIALOGPAGE;
+ TOPTIONSDIALOGPAGE = record
+ cbSize: int;
+ position: int; // position number, lower numbers are top most
+ pszTitle: PChar;
+ pfnDlgProc: Pointer; // DLGPROC prototype
+ pszTemplate: PChar;
+ hInstance: THandle;
+ hIcon: THandle; // v0.1.0.1+
+ pszGroup: PChar; // v0.1.0.1+
+ groupPosition: int; // v0.1.0.1+
+ hGroupIcon: THandle; // v0.1.0.1+
+ flags: DWORD; // v0.1.2.1+
+ { if in simple mode the dialog will be cut off AFTER this control ID, 0
+ for disable }
+ nIDBottomSimpleControl: int; // v0.1.2.1+
+ { if in simple mode the dialog will cut off AFTER this control ID, 0 to disable }
+ nIDRightSimpleControl: int; // v0.1.2.1+
+ { these controls will be hidden in simple mode, pointer to an array of ID's
+ must remain valid for the duration of the dialog }
+ expertOnlyControls: ^int;
+ nExpertOnlyControls: int; // v0.1.2.1+
+ end;
+
+const
+
+ { sent to pages via WM_NOTIFY when the expert checkbox is clicked, lParam = new state }
+ PSN_EXPERTCHANGED = 2;
+ { returns true/false }
+ PSM_ISEXPERT = ($0400 + 101);
+ { returns HFONT used for group box titles }
+ PSM_GETBOLDFONT = ($0400 + 102);
+
+{$ENDIF}
diff --git a/include/delphi/m_plugins.inc b/include/delphi/m_plugins.inc new file mode 100644 index 0000000000..689b7a39e7 --- /dev/null +++ b/include/delphi/m_plugins.inc @@ -0,0 +1,70 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_PLUGINS}
+{$DEFINE M_PLUGINS}
+
+const
+
+ DEFMOD_PROTOCOLICQ = 1; // removed from v0.3.0.0 alpha
+ DEFMOD_PROTOCOLMSN = 2; // removed from v0.1.2.0+
+ DEFMOD_UIFINDADD = 3;
+ DEFMOD_UIUSERINFO = 4;
+ DEFMOD_SRMESSAGE = 5;
+ DEFMOD_SRURL = 6;
+ DEFMOD_SREMAIL = 7;
+ DEFMOD_SRAUTH = 8;
+ DEFMOD_SRFILE = 9;
+ DEFMOD_UIHELP = 10;
+ DEFMOD_UIHISTORY = 11;
+ DEFMOD_RNDCHECKUPD = 12;
+ DEFMOD_RNDICQIMPORT = 13; // not built in to v0.1.0.1+
+ DEFMOD_RNDAUTOAWAY = 14;
+ DEFMOD_RNDUSERONLINE = 15;
+ DEFMOD_RNDCRYPT = 16; // v0.1.0.1-v0.1.2.0
+ DEFMOD_SRAWAY = 17; // v0.1.0.1+
+ DEFMOD_RNDIGNORE = 18; // v0.1.0.1+
+ DEFMOD_UIVISIBILITY = 19; // v0.1.1.0+, options page only
+ DEFMOD_UICLUI = 20; // v0.1.1.0+
+ DEFMOD_UIPLUGINOPTS = 21; // v0.1.2.1+
+ DEFMOD_PROTOCOLNETLIB = 22; // v0.1.2.2+
+
+ DEFMOD_HIGHEST = 22;
+
+
+
+ {
+ wParam : 0
+ lParam : 0
+ Affect : Gets an array of modules that the plugins report they want to replace
+ Returns: Returns a pointer to an array of ints, with elements 1 or 0,
+ indexed by the DEFMOD_* constants, 1 is to mark that the default
+ module shouldn't be loaded, see notes
+ Notes : this is primarily for use by the core's module initialiser,
+ but could also be used by modules that are doing
+ naughty things that are very feature-dependent.
+ }
+ MS_PLUGINS_GETDISABLEDEFAULTARRAY = 'Plugins/GetDisableDefaultArray';
+
+{$ENDIF}
diff --git a/include/delphi/m_popup.inc b/include/delphi/m_popup.inc new file mode 100644 index 0000000000..f8d2ea9df9 --- /dev/null +++ b/include/delphi/m_popup.inc @@ -0,0 +1,222 @@ +(*
+===============================================================================
+ PopUp plugin
+Plugin Name: PopUp
+Plugin author: hrk, Luca Santarelli, hrk@users.sourceforge.net
+This file has been created by egodust, Sam, egodust@users.sourceforge.net
+===============================================================================
+
+The purpose of this plugin is to give developers a common "platform/interface" to show PopUps. It is born from the source code of NewStatusNotify, another plugin I've made.
+
+Remember that users *must* have this plugin enabled, or they won't get any popup. Write this in the requirements, do whatever you wish ;-)... but tell them!
+===============================================================================
+
+-- To use this file you need Windows.pas, m_globaldefs.pas (get it from the CVS under the 'inc' module)
+-- To include this in the source, use {$include m_popup.h}
+
+*)
+
+{$ifndef M_POPUP_H}
+{$define M_POPUP_H}
+
+{$ifdef FPC}
+ {$PACKRECORDS C}
+ {$MODE Delphi}
+{$endif}
+
+const
+
+ MAX_CONTACTNAME = 2048;
+ MAX_SECONDLINE = 2048;
+
+ SM_WARNING = $01; //Triangle icon.
+ SM_NOTIFY = $02; //Exclamation mark icon.
+
+type
+
+ // for info on what this stuff is, see m_popup.h
+
+ PPOPUPDATA = ^TPOPUPDATA;
+ TPOPUPDATA = record
+ lchContact: HCONTACT;
+ lchIcon: THandle;
+ lpszContactName: array[0..MAX_CONTACTNAME-1] of Char;
+ lpszText: array[0..MAX_SECONDLINE-1] of Char;
+ colorBack: COLORREF;
+ colorForeText: COLORREF;
+ PluginWindowProc: Pointer; // must be a window procedure using stdcall
+ PluginData: Pointer;
+ end;
+
+type
+
+ // for info on what this stuff is, see m_popup.h
+
+ PPOPUPDATAEX = ^TPOPUPDATAEX;
+ TPOPUPDATAEX = record
+ lchContact: HCONTACT;
+ lchIcon: THandle;
+ lpszContactName: array[0..MAX_CONTACTNAME-1] of Char;
+ lpszText: array[0..MAX_SECONDLINE-1] of Char;
+ colorBack: COLORREF;
+ colorForeText: COLORREF;
+ PluginWindowProc: Pointer; // must be a window procedure using stdcall
+ PluginData: Pointer;
+ iSeconds: int; //Custom delay time in seconds. -1 means "forever", 0 means "default time".
+ cZero: array[0..15] of Char; //16 unused bytes which may come useful in the future.
+ end;
+
+const
+
+(*
+ Creates, adds and shows a popup, given a (valid) POPUPDATA structure pointer.
+ wParam = (WPARAM)(*POPUPDATA)PopUpDataAddress
+ lParam = 0
+ Returns: > 0 on success, 0 if creation went bad, -1 if the PopUpData contained unacceptable values.
+ NOTE: it returns -1 if the PopUpData was not valid, if there were already too many popups, if the module was disabled.
+ Otherwise, it can return anything else...
+*)
+
+ MS_POPUP_ADDPOPUP = 'PopUp/AddPopUp';
+
+(*
+ The same, but with a POPUPDATAEX structure pointer.
+ wParam = (WPARAM)(*POPUPDATAEX)PopUpDataExAddress
+ lParam = 0
+*)
+
+ MS_POPUP_ADDPOPUPEX = 'PopUp/AddPopUpEx';
+
+(*
+ Returns the handle to the contact associated to the specified PopUpWindow.
+ You will probably need to know this handle inside your WNDPROC. Exampole: you want to open the MessageWindow. :-)
+ Call MS_POPUP_GETCONTACT on the hWnd you were given in the WNDPROC.
+ wParam = (WPARAM)(HWND)hPopUpWindow
+ lParam = 0;
+ Returns: the HANDLE of the contact. Can return NULL, meaning it's the main contact. -1 means failure.
+*)
+
+ MS_POPUP_GETCONTACT = 'PopUp/GetContact';
+
+(*
+ wParam = hPopUpWindow
+ lParam = PluginDataAddress;
+ Returns: the address of the PLUGINDATA structure. Can return NULL, meaning nothing was given. -1 means failure.
+ IMPORTANT NOTE: it doesn't seem to work if you do:
+ CallService(..., (LPARAM)aPointerToAStruct);
+ and then use that struct.
+ Do this, instead:
+ aPointerToStruct = CallService(..., (LPARAM)aPointerToAStruct);
+ and it will work. Just look at the example I've written above (PopUpDlgProc).
+*)
+ MS_POPUP_GETPLUGINDATA = 'PopUp/GetPluginData';
+
+(*
+ wParam = 0
+ lParam = 0
+ Returns: 0 if the user has chosen not to have the second line, 1 if he choose to have the second line.
+*)
+ MS_POPUP_ISSECONDLINESHOWN = 'PopUp/IsSecondLineShown';
+
+(*
+ UM_FREEPLUGINDATA
+ wParam = lParam = 0. Process this message if you have allocated your own memory. (i.e.: POPUPDATA.PluginData != NULL)
+*)
+ UM_FREEPLUGINDATA = ((*WM_USER*)$400 + $200);
+
+(*
+ UM_DESTROYPOPUP
+ wParam = lParam = 0. Send this message when you want to destroy the popup, or use the function below.
+*)
+ UM_DESTROYPOPUP = ((*WM_USER*)$400 + $201);
+
+(*
+ UM_INITPOPUP
+ wParam = (WPARAM)(HWND)hPopUpWindow (but this is useless, since I'll directly send it to your hPopUpWindow
+ lParam = 0.
+ This message is sent to the PopUp when its creation has been finished, so POPUPDATA (and thus your PluginData) is reachable.
+ Catch it if you needed to catch WM_CREATE or WM_INITDIALOG, which you'll never ever get in your entire popup-life.
+ Return value: if you process this message, return 0. If you don't process it, return 0. Do whatever you like ;-)
+*)
+ UM_INITPOPUP = ($400(*WM_USER*) + $202);
+
+(*
+ wParam = hPopUpWindow
+ lParam = lpzNewText
+ returns: > 0 for success, -1 for failure, 0 if the failure is due to second line not being shown. (but you could call PUIsSecondLineShown() before changing the text...)
+ Changes the text displayed in the second line of the popup.
+*)
+ MS_POPUP_CHANGETEXT = 'PopUp/Changetext';
+
+(*
+ This is mainly for developers.
+ Shows a warning message in a PopUp. It's useful if you need a "MessageBox" like function, but you don't want a modal window (which will interfere with a DialogProcedure. MessageBox steals focus and control, this one not.
+ wParam = lpzMessage
+ lParam = 0; Returns: 0 if the popup was shown, -1 in case of failure.
+*)
+ MS_POPUP_SHOWMESSAGE = 'PopUp/ShowMessage';
+
+
+ (* helper functions, will be inlined on FPC if you have the swithces enabled *)
+
+ function PUAddPopup(ppdp: PPOPUPDATA): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := CallService(MS_POPUP_ADDPOPUP, WPARAM(ppdp), 0);
+ end;
+
+ function PUGetContact(hPopUpWindow: THandle): THandle;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := CallService(MS_POPUP_GETCONTACT, WPARAM(hPopUpWindow), 0);
+ end;
+
+ function PUGetPluginData(hPopUpWindow: THandle): Pointer;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ var
+ dummy: pointer;
+ begin
+ dummy := nil;
+ Int(Result) := CallService(MS_POPUP_GETPLUGINDATA, WPARAM(hPopUpWindow), LPARAM(dummy));
+ end;
+
+ function PUIsSecondLineShown: BOOL;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Int(Result) := CallService(MS_POPUP_ISSECONDLINESHOWN, 0, 0);
+ end;
+
+ function PUDeletePopUp(hWndPopUp: THandle): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := SendMessage(hWndPopUp, UM_DESTROYPOPUP, 0, 0);
+ end;
+
+ function PUChangeText(hWndPopUp: THandle; lpzNewText: PChar): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := CallService(MS_POPUP_CHANGETEXT, WPARAM(hWndPopUp), LPARAM(lpzNewText));
+ end;
+
+ function PUShowMessage(lpzText: PChar; kind: Byte): int;
+ {$ifdef FPC}
+ inline;
+ {$endif}
+ begin
+ Result := CallService(MS_POPUP_SHOWMESSAGE, WPARAM(lpzText), LPARAM(kind));
+ end;
+
+{$endif}
+
diff --git a/include/delphi/m_protocols.inc b/include/delphi/m_protocols.inc new file mode 100644 index 0000000000..f198d40a8b --- /dev/null +++ b/include/delphi/m_protocols.inc @@ -0,0 +1,180 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_PROTOCOLS}
+{$DEFINE M_PROTOCOLS}
+
+const
+
+ ACKTYPE_MESSAGE = 0;
+ ACKTYPE_URL = 1;
+ ACKTYPE_FILE = 2;
+ ACKTYPE_CHAT = 3;
+ ACKTYPE_AWAYMSG = 4;
+ ACKTYPE_AUTHREQ = 5;
+ ACKTYPE_ADDED = 6;
+ ACKTYPE_GETINFO = 7;
+ ACKTYPE_SETINFO = 8;
+ ACKTYPE_LOGIN = 9;
+ ACKTYPE_SEARCH = 10;
+ ACKTYPE_NEWUSER = 11;
+ ACKTYPE_STATUS = 12;
+ ACKTYPE_CONTACTS = 13; //send/recv of contacts
+
+ ACKRESULT_SUCCESS = 0;
+ ACKRESULT_FAILED = 1;
+ //'in progress' result codes:
+ ACKRESULT_CONNECTING = 100;
+ ACKRESULT_CONNECTED = 101;
+ ACKRESULT_INITIALISING = 102;
+ ACKRESULT_SENTREQUEST = 103; // waiting for reply...
+ ACKRESULT_DATA = 104; // blob of file data sent/recved, or search result
+ ACKRESULT_NEXTFILE = 105; // file transfer went to next file
+ ACKRESULT_FILERESUME = 106; // a file is about to be received, see PS_FILERESUME
+ ACKRESULT_DENIED = 107; // a file send has been denied (0.3a + only)
+
+ // for PROTOCOLDESCRIPTOR.type
+
+ PROTOTYPE_PROTOCOL = 1000;
+ PROTOTYPE_ENCRYPTION = 2000;
+ PROTOTYPE_FILTER = 3000;
+ PROTOTYPE_TRANSLATION = 4000;
+ PROTOTYPE_OTHER = 10000;//avoid using this if at all possible
+
+type
+
+ PCCSDATA = ^TCCSDATA;
+ TCCSDATA = record
+ hContact: THandle;
+ szProtoService: PChar; // a PS_* constant
+ wParam: WPARAM;
+ lParam: LPARAM;
+ end;
+
+ PACKDATA = ^TACKDATA;
+ TACKDATA = record
+ cbSize: int;
+ szModule: PChar; // the name of the protocol module which initiated this ack
+ hContact: THandle;
+ type_: int; // an ACKTYPE_* constant
+ result_: int; // an ACKRESULT_* constant
+ hProcess: THandle; // caller defined seq, I mean process code
+ lParam: LPARAM; // caller defined data
+ end;
+
+ // when type=ACKTYPE_FILE and (result=ACKRESULT_DATA or result=ACKRESULT_FILERESUME)
+
+ PPROTOFILETRANSFERSTATUS = ^TPROTOFILETRANSFERSTATUS;
+ TPROTOFILETRANSFERSTATUS = record
+ cbSize: int;
+ hContact: THandle;
+ sending: int; // true if sending, false if receiving
+ files: PChar; // pointer to an array of pchar's
+ totalFiles: int;
+ currentFileNumber: int;
+ totalBytes: LongInt;
+ totalProgress: LongInt;
+ workingDir: PChar;
+ currentFile: PChar;
+ currentFileSize: LongInt;
+ currentFileProgress: LongInt;
+ currentFileTime: LongInt; // UNIX time
+ end;
+
+ // for registering a protocol, enumeration
+
+ PPROTOCOLDESCRIPTOR = ^TPROTOCOLDESCRIPTOR;
+ TPROTOCOLDESCRIPTOR = record
+ cbSize: int;
+ szName: PChar; // unique name of module
+ type_: int; // a PROTOTYPE_* constant
+ end;
+
+const
+
+ {
+ wParam : 0
+ lParam : Pointer to an initalised CSSDATA structure
+ Affect : Send a general request thru the protocol chain for a contact
+ Return : the return value documented in the PS_* def (m_protosvc.inc)
+ }
+ MS_PROTO_CALLCONTACTSERVICE = 'Proto/CallContactService';
+
+ {
+ wParam : 0
+ lParam : Pointer to an initalised TACKDATA structure
+ Affect : a general 'ack', see notes
+ Notes : Just because defs are here doesn't mean they will be sent
+ read the docs for the function you are calling to see what
+ replies you will get.
+ }
+ ME_PROTO_ACK = 'Proto/Ack';
+
+ {
+ wParam : pointer to an int to store number of protocols
+ lParam : Pointer to an an array of PPROTOCOLDESCRIPTOR pointers
+ Affect : Enumerate the currently running protocols, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : Neither wParam/lParam maybe NULL(0), the list returned by
+ this service is the protocol modules currently installed
+ and running, it is not a complete list of protocols that have
+ ever been installed.
+ -
+ A protocol module does not have to be a protocol running thru
+ the internet, it can be a vast number of things
+ }
+ MS_PROTO_ENUMPROTOCOLS = 'Proto/EnumProtocols';
+
+ {
+ wParam : 0
+ lParam : Pointer to null terminated string containing protocol name
+ Affect : Determines if a protocol is running or not.
+ Returns: A pointer to the PPROTOCOLDESCRIPTOR if the protocol is loaded
+ or NULL(0) if it isn't
+ }
+ MS_PROTO_ISPROTOCOLLOADED = 'Proto/IsProtocolLoaded';
+
+ {
+ wParam : HCONTACT
+ lParam : Pointer to a null terminated string containing a name
+ Affect : Determine whether the given contact has the given protocol
+ in it's chain.
+ Returns : 0 if the protocol isn't in the chain, [non zero] if it is
+ }
+ MS_PROTO_ISPROTOONCONTACT = 'Proto/IsProtoOnContact';
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affect : Gets the network-level protocol associated with a contact
+ Returns: a PChar pointing to the ASCIIZ name of the protocol or NULL(0)
+ if the contact has no protocol, There's no need to dispsose
+ the returned string.
+ -
+ This is the name of the module that actually accesses the network
+ for that contact.
+ }
+ MS_PROTO_GETCONTACTBASEPROTO = 'Proto/GetContactBaseProto';
+
+{$ENDIF}
\ No newline at end of file diff --git a/include/delphi/m_protomod.inc b/include/delphi/m_protomod.inc new file mode 100644 index 0000000000..3b790d42b7 --- /dev/null +++ b/include/delphi/m_protomod.inc @@ -0,0 +1,105 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_PROTOMOD}
+{$DEFINE M_PROTOMOD}
+
+ {$ifndef M_PROTOCOLS}
+ {$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 = 'Proto/RegisterModule';
+
+ {
+ wParam : HCONTACT
+ 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 = 'Proto/AddToContact';
+
+ {
+ wParam : HCONTACT
+ 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 = '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 = '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 = '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 = 'Proto/BroadcastAck';
+{$ENDIF}
diff --git a/include/delphi/m_protosvc.inc b/include/delphi/m_protosvc.inc new file mode 100644 index 0000000000..e546d5775b --- /dev/null +++ b/include/delphi/m_protosvc.inc @@ -0,0 +1,760 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_PROTOSVC}
+{$DEFINE M_PROTOSVC}
+
+{<</
+ none of these services should be used on there own (i.e. using CallService(), etc)
+ hence the PS_ prefix, instead use the services exposed in m_protocols.inc
+
+ these should be called with CallProtoService which prefixes the protocol module
+ name before calling.
+ -
+ Deleting contacts from protocols that store the contact list on the server:
+ If a contact is deleted while the protocol is online, it is expected that the
+ protocol will have hooked me_db_contact_deleted and take the appropriate
+ action by itself.
+ If a contact is deleted while the protocol is offline, the contact list will
+ display a message to the user about the problem, and set the byte setting
+ "CList"/"Delete" to 1. Each time such a protocol changes status from offline
+ or connecting to online the contact list will check for contacts with this
+ flag set and delete them at that time. Your hook for me_db_contact_deleted
+ will pick this up and everything will be good.
+/>>}
+
+const
+
+ PFLAGNUM_1 = $1;
+ PF1_IMSEND = $00000001; // supports IM sending
+ PF1_IMRECV = $00000002; // supports IM receiving
+ PF1_IM = (PF1_IMSEND or PF1_IMRECV);
+ PF1_URLSEND = $00000004; // supports separate URL sending
+ PF1_URLRECV = $00000008; // supports separate URL receiving
+ PF1_URL = (PF1_URLSEND or PF1_URLRECV);
+ PF1_FILESEND = $00000010; // supports file sending
+ PF1_FILERECV = $00000020; // supports file receiving
+ PF1_FILE = (PF1_FILESEND or PF1_FILERECV);
+ PF1_MODEMSGSEND = $00000040; // supports broadcasting away messages
+ PF1_MODEMSGRECV = $00000080; // supports reading others' away messages
+ PF1_MODEMSG = (PF1_MODEMSGSEND or PF1_MODEMSGRECV);
+ PF1_SERVERCLIST = $00000100; // contact lists are stored on the server, not locally. See notes below
+ PF1_AUTHREQ = $00000200; // will get authorisation requests for some or all contacts
+ PF1_ADDED = $00000400; // will get 'you were added' notifications
+ PF1_VISLIST = $00000800; // has an invisible list
+ PF1_INVISLIST = $00001000; // has a visible list for when in invisible mode
+ PF1_INDIVSTATUS = $00002000; // supports setting different status modes to each contact
+ PF1_EXTENSIBLE = $00004000; // the protocol is extensible and supports plugin-defined messages
+ PF1_PEER2PEER = $00008000; // supports direct (not server mediated) communication between clients
+ PF1_NEWUSER = $00010000; // supports creation of new user IDs
+ PF1_CHAT = $00020000; // has a realtime chat capability
+ PF1_INDIVMODEMSG = $00040000; // supports replying to a mode message request with different text depending on the contact requesting
+ PF1_BASICSEARCH = $00080000; // supports a basic user searching facility
+ PF1_EXTSEARCH = $00100000; // supports one or more protocol-specific extended search schemes
+ PF1_CANRENAMEFILE = $00200000; // supports renaming of incoming files as they are transferred
+ PF1_FILERESUME = $00400000; // can resume broken file transfers, see PS_FILERESUME below
+ PF1_ADDSEARCHRES = $00800000; // can add search results to the contact list
+ PF1_CONTACTSEND = $01000000; // can send contacts to other users
+ PF1_CONTACTRECV = $02000000; // can receive contacts from other users
+ PF1_CONTACT = (PF1_CONTACTSEND or PF1_CONTACTRECV);
+ PF1_CHANGEINFO = $04000000; // can change our user information stored on server
+ PF1_SEARCHBYEMAIL = $08000000; // supports a search by e-mail feature
+ PF1_USERIDISEMAIL = $10000000; // set if the uniquely identifying field of the network is the e-mail address
+ PF1_SEARCHBYNAME = $20000000; // supports searching by nick/first/last names
+ PF1_EXTSEARCHUI = $40000000; // has a dialog box to allow searching all the possible fields
+ PF1_NUMERICUSERID = $80000000; // the unique user IDs for this protocol are numeric
+
+ PFLAGNUM_2 = 2; // the status modes that the protocol supports
+ PF2_ONLINE = $00000001; // an unadorned online mode
+ PF2_INVISIBLE = $00000002;
+ PF2_SHORTAWAY = $00000004; // Away on ICQ, BRB on MSN
+ PF2_LONGAWAY = $00000008; // NA on ICQ, Away on MSN
+ PF2_LIGHTDND = $00000010; // Occupied on ICQ, Busy on MSN
+ PF2_HEAVYDND = $00000020; // DND on ICQ
+ PF2_FREECHAT = $00000040;
+ PF2_OUTTOLUNCH = $00000080;
+ PF2_ONTHEPHONE = $00000100;
+
+ PFLAGNUM_3 = 3; //the status modes that the protocol supports
+ //away-style messages for. Uses the PF2_ flags.
+ PFLAG_UNIQUEIDTEXT = 100; //returns a static buffer of text describing the unique field by which this protocol identifies users (already translated), or NULL
+
+ PFLAG_MAXCONTACTSPERPACKET = 200; //v0.1.2.2+: returns the maximum number of contacts which can be sent in a single PSS_CONTACTS.
+
+ PFLAGNUM_4 = 4; // v0.3+: flag asking a protocol plugin how auths are handled
+ PF4_FORCEAUTH = $00000001; // protocol has to send auth's for things to work
+ PF4_FORCEADDED = $00000002; // protocol has to tell people that they were added (otherwise things don't work)
+ PF4_NOCUSTOMAUTH = $00000004; // protocol can't send a custom message while asking others for auth
+ PF4_SUPPORTTYPING = $00000008; // protocol supports user is typing messages v0.3.3+
+ PF4_SUPPORTIDLE = $00000010; // protocol understands idle, added during v0.3.4+ (2004/09/13)
+ PF4_AVATARS = $00000020; // protocol has avatar support, added during v0.3.4 (2004/09/13)
+ PF4_OFFLINEFILES = $00000040; // protocols supports sending files to offline users (v0.5.2)
+ PF4_IMSENDUTF = $00000080; // protocol is able to process messages in utf-8 (v.0.7.0+)
+ PF4_IMSENDOFFLINE = $00000100; // protocol supports sending offline messages (v0.8.0+)
+ PF4_INFOSETTINGSVC = $00000200; // protocol supports user info translation services (v0.8.0+)
+
+ PFLAG_UNIQUEIDSETTING = 300; // v0.3+: returns the DB setting name (e.g. szProto=ICQ, szSetting=UIN) that has the ID which makes this user unique on that system (0.3a ONLY), the string is statically allocated so no need to free()
+
+ // for PS_SETSTATUS
+
+ LOGINERR_WRONGPASSWORD = 1;
+ LOGINERR_NONETWORK = 2;
+ LOGINERR_PROXYFAILURE = 3;
+ LOGINERR_BADUSERID = 4;
+ LOGINERR_NOSERVER = 5;
+ LOGINERR_TIMEOUT = 6;
+ LOGINERR_WRONGPROTOCOL = 7;
+
+ // flag for PS_ADDTOLIST
+
+ PALF_TEMPORARY = 1; // add the contact temporarily and invisibly, just to get user info or something
+
+ // flags for PS_GETINFO
+
+ SGIF_MINIMAL = 1; // get only the most basic information. This should
+ // contain at least a Nick and e-mail.
+
+ // for PSR_MESSAGE
+
+ PREF_CREATEREAD = 1; // create the database event with the 'read' flag set
+
+ // for PS_FILERESUME
+
+ FILERESUME_OVERWRITE= 1;
+ FILERESUME_RESUME = 2;
+ FILERESUME_RENAME = 3;
+ FILERESUME_SKIP = 4;
+
+type
+
+ PPROTOSEARCHRESULT = ^TPROTOSEARCHRESULT;
+ TPROTOSEARCHRESULT = record
+ cbSize: int;
+ nick: PChar;
+ firstName: PChar;
+ lastName: PChar;
+ email: PChar;
+ reserved: array [0..15] of Byte;
+ // Protocols may extend this structure with extra members at will and supply
+ // a larger cbSize to reflect the new information, but they must not change
+ // any elements above this comment
+ // The 'reserved' field is part of the basic structure, not space to
+ // overwrite with protocol-specific information.
+ // If modules do this, they should take steps to ensure that information
+ // they put there will be retained by anyone trying to save this structure.
+ end;
+
+ PPROTOSEARCHBYNAME = ^TPROTOSEARCHBYNAME;
+ TPROTOSEARCHBYNAME = record
+ pszNick: PChar;
+ pszFirstName: PChar;
+ pszLastName: PChar;
+ end;
+
+ PPROTORECVEVENT = ^TPROTORECVEVENT;
+ TPROTORECVEVENT = record
+ flags: DWORD;
+ timestamp: DWORD;
+ szMessage: PChar;
+ lParam: LPARAM;
+ end;
+
+ PPROTORECVFILE = ^TPROTORECVFILE;
+ TPROTORECVFILE = record
+ flags: DWORD;
+ timestamp: DWORD; // unix time
+ szDescription: PChar;
+ pFiles: PChar; // pointer to an array of pchar's
+ lParam: LPARAM;
+ end;
+
+ PPROTOFILERESUME = ^TPROTOFILERESUME;
+ TPROTOFILERESUME = record
+ action: int; // FILERESUME_* flag
+ szFilename: PChar; // full path, only valid if action=FILERESUME_RENAME
+ end;
+
+const
+
+ {
+ wParam : PFLAGNUM_* (see above)
+ lParam : 0
+ Affects: Returns a bitfield for settings corresponding to flag number, see notes
+ Returns: a bitfield of supported features -- or 0 if flag_num is not supported
+ Notes : this checks what sort of things are actively supported by a protocol
+ module
+ }
+ PS_GETCAPS = '/GetCaps';
+
+ {
+ wParam : cchName
+ lParam : Pointer to a buffer to fill with human-readable name
+ Affect : Get a human-readable name for the protocol, see notes
+ Result : 0 on success, [non zero] on failure
+ Notes : Should be translated before being returned, cchName
+ has the size of the buffer, example strings: "ICQ", "AIM"
+ }
+ PS_GETNAME = '/GetName';
+
+ {
+ wParam : whichIcon
+ lParam : 0
+ Affect : Loads one of the protocol-sspecific icons
+ Returns: the HICON or NULL on failure, the returned icon
+ must be DestroyIcon()ed, the UI should overlay
+ the online icon with further UI-specified icon to
+ repressent the exact status mode.
+ }
+ PLI_PROTOCOL = $1; // An icon representing the protocol (eg the multicoloured flower for ICQ)
+ PLI_ONLINE = $2; // Online state icon for that protocol (eg green flower for ICQ)
+ PLI_OFFLINE = $3; // Offline state icon for that protocol (eg red flower for ICQ)
+ PLIF_LARGE = $0; // Or with one of the above to get the large (32x32 by default) icon
+ PLIF_SMALL = $10000; // Or with one of the above to get the small (16x16 by default) icon
+
+ PS_LOADICON = '/LoadIcon';
+
+ {
+ wParam : status_mode
+ lParam : Pointer to a null terminated string containing message
+ Affect : Sets the status mode specific message for the user, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : This service is not available unless PF1_MODEMSGSEND is set,
+ and PF1_INDIVMODEMSG is *not* set.
+ If PF1_INDIVMODEMSG is set, then see PSS_AWAYMSSG for details
+ of operations of away messages.
+ -
+ Protocol modules smust support lParam=NULL, it may eithere mean
+ to use an empty message or (preferably) not to reply at all to
+ any requests.
+ }
+ PS_SETAWAYMSG = '/SetAwayMsg';
+
+ {
+ wParam : newMode from statusmodes.inc
+ lParam : 0
+ Affect : Change the protocol's status mode, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : Will send an ack with :
+ type=ACKTYPE_SUCCESS, result=ACKRESULT_SUCCESS, hProcess=previousMode, lParam=newMode
+ -
+ when the change completes. This ack is sent for all changes, not
+ just ones caused by calling this function.
+ -
+ NewMode can be ID_STATUS_CONNECTING<=newMode<ID_STATUS_CONNECTING+
+ MAX_CONNECT_RETRIES to signify that it's connecting and it's the nth retry.
+ -
+ Protocols are initially always in offline mode, if a protocol
+ doesn't support a specific status mode, it should pick the closest
+ ones that it does support, and change to that.
+
+ If a protocol has to switch from offline mode to online (or a substate
+ of online, like away) then it should report any errors in the
+ form of an additional ack :
+
+ type=ACKTYPE_LOGIN, result=ACKRESULT_FAILURE, hProcess=NULL, lParam=LOGINERR_*
+
+ SetStatus() is called when a protocol module is first loaded
+ with newMode=ID_STATUS_ONLINE.
+ -
+ Protocols can define their own LOGINERR_* starting at $1000, see
+ LOGINERR_* above
+ }
+ PS_SETSTATUS = '/SetStatus';
+
+ {
+ wParam : 0
+ lParam : 0
+ Affect : Get the status mode that a protocol is currently in, see notes
+ Returns: The current status mode
+ Notes : Only protocol modules need to implement this, non network level
+ protocol modules do not need to (but if you register as a protocol
+ you need to, Miranda will GPF otherwise)
+ }
+ PS_GETSTATUS = '/GetStatus';
+
+ {
+ wParam : HDBEVENT
+ lParam : 0
+ Affect : allow 'somebody' to add the user to their contact list, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : Auth request come in the form of an event added to the database
+ for the NULL(0) user, the form is:
+ -
+ protocolSpecific: DWORD;
+ nick, firstname, lastName, e-mail, requestReason: ASCIIZ;
+ -
+ HDBEVENT musts be the handle of such an event, one or more
+ fields may be empty if the protocol doesn't support them
+ }
+ PS_AUTHALLOW = '/Authorize';
+
+ {
+ wParam : HDBEVENT
+ lParam : Pointer to a null terminated string containing the reason, see notes
+ Affect : Deny an authorisation request
+ Returns: 0 on success, [non zero] on failure
+ Notes : Protocol modules must be able to cope with lParam=NULL(0)
+ }
+ PS_AUTHDENY = '/AuthDeny';
+
+ {
+ wParam : 0
+ lParam : Pointer to a null terminated string containing an ID to search for
+ Affect : Send a basic search request, see notes
+ Returns: A handle to the search request or NULL(0) on failure
+ Notes : All protocols identify users uniquely by a single field
+ this service will search by that field.
+ -
+ All search replies (even protocol-spec extended searches)
+ are replied by a series of ack's,-
+ -
+ Result acks are a series of:
+ type=ACKTYPE_SEARCH, result=ACKRESULT_DATA, lParam=Pointer to a TPROTOSEARCHRESULT structure
+ -
+ ending ack:
+ type=ACKTYPE_SEARCH, result=ACKRESULT_SUCCESS, lParam=0
+ -
+ The pointers in the structure are not guaranteed to be
+ valid after the ack is complete.
+ -
+ The structure to reply with search results can be extended
+ per protocol basis (see below)
+
+ }
+ PS_BASICSEARCH = '/BasicSearch';
+
+ {
+ wParam : 0
+ lParam : Pointer to a NULL terminated string containing the e-mail to search for
+ Affect : Search for user(s) by e-mail address, see notes
+ Returns: A HANDLE to the search, or NULL(0) on failure
+ Notes : Results are returned as for PS_BASICSEARCH, this service
+ is only available if the PF1_USERIDISEMAIL flag is set for caps --
+ -
+ This service with the above service should be mapped to the same
+ function if the aforementioned flag is set.
+ Version: v0.1.2.1+
+ }
+ PS_SEARCHBYEMAIL = '/SearchByEmail';
+
+ {
+ wParam : 0
+ lParam : Pointer to a TPROTOSEARCHBYNAME structure
+ Affect : Search for users by name, see notes
+ Returns: Handle to the search, NULL(0) on failure
+ Notes : this service is only available, if PF1_SEARCHBYNAME capability is set.
+ Results are returned in the same manner as PS_BASICSEEARCH
+ Version: v0.1.2.1+
+ }
+ PS_SEARCHBYNAME = '/SearchByName';
+
+ {
+ wParam : 0
+ lParam : Handle to window owner
+ Affect : Create the advanced search dialog box, see notes
+ Returns: A window handle, or NULL(0) on failure
+ Notes : this service is only available if PF1_EXTSEARCHUI capability is
+ set, advanced search is very protocol-spec'd so it is left to
+ the protocol itself to supply a dialog containing the options,
+ this dialog should not have a titlebar and contain only search
+ fields. the rest of the UI is supplied by Miranda.
+ -
+ The dialog should be created with CreateDialog() or it's kin
+ and still be hidden when this function returns,
+ -
+ The dialog will be destroyed when the find/add dialog is closed
+ Version: v0.1.2.1+
+ }
+ PS_CREATEADVSEARCHUI= '/CreateAdvSearchUI';
+
+ {
+ wParam : 0
+ lParam : Handle to advanced search window handle
+ Affect : Search using the advanced search dialog, see notes
+ Returns: A handle or NULL(0) on failure
+ Notes : Results are returned in the same manner as PS_BASICSEARCH,
+ this service is only available if PF1_EXTSEARCHUI capability is set
+ Version: v0.1.2.1+
+ }
+ PS_SEARCHBYADVANCED = '/SearchByAdvanced';
+
+ {
+ wParam : flags
+ lParam : Pointer to a TPROTOSEARCHRESULT structure
+ Affect : Adds a search result to the contact list, see notes
+ Returns: A handle to the new contact (HCONTACT) or NULL(0) on failure
+ Notes : The pointer MUST be a result returned by a search function
+ since there maybe extra protocol-spec data required by the protocol.
+ -
+ the protocol module should not allow duplicate contains to be added,
+ but if such a request *is* received it should return a HCONTACT
+ to the original user,
+ -
+ If flags is PALF_TEMPORARY set, the contact should be added
+ temorarily and invisiblely, just to get the user info (??)
+ -
+ }
+ PS_ADDTOLIST = '/AddToList';
+
+ {
+ wParam : MAKEWPARAM(flags, iContact)
+ lParam : HDBEVENT
+ Affects: Add a contact to the contact list given an auth/added/contacts events, see notes
+ Returns: A HCONTACT or NULL(0) on failure
+ Notes : HDBEVENT must be either EVENTTYPE_AUTHREQ or EVENTTYPE_ADDED
+ flags are the same as PS_ADDTOLIST,
+ -
+ iContacts is only used for contacts vents, it is 0-based index
+ of the contacts in the event to add, there's no way to add two or more
+ contacts at once, you should just call this as many times as needed.
+ }
+ PS_ADDTOLISTBYEVENT = '/AddToListByEvent';
+
+ {
+ wParam : InfoType
+ lParam : Pointer to InfoData
+ Affect : Changes user details as stored on the server, see notes
+ Returns: A Handle to the change request or NULL(0) on failure
+ Notes : the details stored on the server are very protocol spec'd
+ so this service just supplies an outline for protocols to use.
+ See protocol-specific documentation for what infoTypes are available
+ and what InfoData should be for each infoTypes.
+ -
+ Sends an ack type=ACKTYPE_SETINFO, result=ACKRESULT_SUCCESS/FAILURE, lParam=0
+ -
+ This description just leaves me cold.
+ Version: v0.1.2.0+
+ }
+ PS_CHANGEINFO = '/ChangeInfo';
+
+ {
+ wParam : HFILETRANSFER
+ lParam : Pointer to a initalised TPROTOFILERESUME
+ Affect : Informs the protocol of the user's chosen resume behaviour, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : If the protocol supports file resume (caps: PF1_FILERESUME) then before
+ each file receive begins it will broadcast an ack with :
+
+ type=ACKTYPE_FILE, result=ACKRESULT_RESUME, hProcess=hFileTransfer,
+ lParam = TPROTOFILETRANSFERSTATUS.
+
+ If the UI processes this ack it must return a [non zero] valuee from it's
+ hook, it all the hooks complete without returning [non zero] then the
+ protocol will assume that no resume UI was available and will continue
+ to receive the file with a default behaviour (default: overwrite)
+ -
+ If a hook does return [non zero] then that UI MUST call this service,
+ PS_FILERESUME at some point.
+ When the protocol module receives this call it will proceed wit the
+ file recieve usingg the given information.
+ -
+ Having sasid that, PS_FILERESUME MUST be called, it is also
+ acceptable to completely abort the transfer instead, i.e. the file
+ exists locally and the user doesn't want to overwrite or resume or
+ reget.
+ Version: v0.1.2.2+
+ }
+ PS_FILERESUME = '/FileResume';
+
+ // these should be called with CallContactService()
+
+ {<</
+ !IMPORTANT!
+ wParam, lParam data expected declarations should be treated with
+ one level of indirection, where it says (CCSDATA: Yes)
+ should be :
+
+ What you *actually* get in the service:
+
+ wParam = 0
+ lParam = pCCSDATA
+
+ CCSDATA contains the ..wParam, ..lParam, hContact data declared with each service,
+ so the wParam, lParam passed does not contain the data itself, but lParam
+ contains a pointer to a structure which contains the data.
+
+ />>}
+
+ {
+ CCSDATA: Yes
+ wParam : flags
+ Param : 0
+
+ Affect : Updates a contact's details from the server, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes :
+
+ flags which may have SGIF_MINIMAL set to only get
+ "basic" information, such as nickname, email address.
+
+ PCCSDATA(lParam)^.hContact has the HCONTACT handle to get user
+ information for.
+
+ Will update all the information in the database and then
+ send acks with :
+
+ type=ACKTYPE_GETINFO, result=ACKRESULT_SUCCESS, hProcess=nReplies, lParam=thisReply
+ -
+ Since some protocol do not allow the module to tell when it has
+ got all the information so it can send a final ack, one
+ ack will be sent after each chunk of data has been received,
+ -
+ nReplies contains the number of distinct acks
+ that will be sent to get all the information, 'thisReply'
+ is the zero based index of this ack.
+ When thisReply=0 the minimal information has just been received,
+ all other numbering is arbitrary.
+
+ }
+ PSS_GETINFO = '/GetInfo';
+
+ {
+ CCSDATA: Yes
+ wParam : flags
+ lParam : Pointer to a null terminated string
+ Affect : Send an instant message
+ Returns: an hProcess corresponding to an ACK which will be sent after
+ the hProcess.
+ Notes: type=ACKTYPE_MESSAGE, result=ACKRESULT_SUCCESS/FAILURE, lParam = 0
+ -
+ here's the deal, you must return a 'seq' from this service
+ which you have to ack when the message actually get's sent,
+ or send a fake ack sometime soon if you can't find out if the message
+ was successfully received with the protocol that you're using.
+ -
+ this event is NOT added to the database automatically.
+ }
+ PSS_MESSAGE = '/SendMsg';
+
+ {
+ CCSDATA: Yes
+ wParam : flags
+ lParam : null terminated string to the URL, see notes
+ Affect : Send a URL message, see notes
+ Returns: A hProcess which will be ack'd later
+ Notes : lParam may contain TWO strings, the first for URL, the second for
+ description, in the format :
+ <url>#0<desc>#0 or <url>#0#0
+ Will send an ack for hProcess when the URL actually gets sent
+ type=ACKTYPE_URL, result=ACKRESULT_SUCCESS/FAILURE, lParam=0
+ -
+ protocol modules are free to define flags starting at $10000
+ -
+ The event will *not* be added to the database automatically
+ }
+ PSS_URL = '/SendUrl';
+
+ {
+ CCSDATA: Yes
+ wParam : MAKEWPARAM(flags)
+ lParam : Pointer to hContactsList
+ Affect : Send a set of contacts, see notes
+ Returns: A hProcess which will be ack, NULL(0) on failure
+ Notes : hContactsList is an array of nContacts handles to contacts,
+ if this array includes one or more contains that can not be transferred
+ using this protocol the function will fail.
+ -
+ Will send an ack when the contacts actually get sent:
+
+ type=ACKTYPE_CONTACTS, result=ACKRESULT_SUCCESS/FAILURE, lParam=0
+ -
+ No flags have ben defined yet,
+ -
+ The event will *not* be added to the database automatically
+ }
+ PSS_CONTACTS = '/SendContacts';
+
+ {
+ CCSDATA: Yes
+ wParam : 0
+ lParam : 0
+ Affect : Send a request to retrieve HCONTACT's mode message, see notes
+ Returns: a hProcess which will be ack'd later, NULL(0) on failure
+ Notes : the reply will come in a form of an ack :
+
+ type=ACKTYPE_AWAYMSG, result=ACKRESULT_SUCCESS/FAILURE,
+ lParam=pointer to a null terminated string the containing message
+ }
+ PSS_GETAWAYMSG = '/GetAwayMsg';
+
+ {
+ CCSDATA: Yes
+ wParam : hProcess
+ lParam : pointer to a buffer to fill with away message to reply with
+ Affect : Sends an away message reply to a user, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : This service must only be called is caps has PF1_MODEMSGSEND set
+ as well as PF1_INDIVMODEMSG otherwise PS_SETAWAYMESSAGE should
+ be used.
+ -
+ Reply will be sent in the form of an ack :
+
+ type=ACKTYPE_AWAYMSG, result=ACKRESULT_SENTREQUEST, lParam=0
+ }
+ PSS_AWAYMSG = '/SendAwayMsg';
+
+ {
+ CCSDATA: Yes
+ wParam : status_mode
+ lParam : Pointer to a TPROTORECVEVENT structure
+ Affect : An away message reply has been received
+ }
+ PSR_AWAYMSG = '/RecvAwayMsg';
+
+ {
+ CCSDATA: Yes
+ wParam : status_mode
+ lParam : 0
+ Affect : Set the status mode the user will appear in to a user, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : If status_mode = 0 then revert to normal state for the user,
+ ID_STATUS_ONLINE is possible if PF1_VISLIST
+ ID_STATUS_ONLINE is possible if PF1_INDIVSTATUS
+ }
+ PSS_SETAPPARENTMODE = '/SetApparentMode';
+
+ // only valid if caps support IM xfers
+
+ {
+ CCSDATA: Yes
+ wParam : HTRANSFER
+ lParam : null terminated string containing the path
+ Affect : Allow a file transfer to begin, see notes
+ Returns: A handle to the transfer to be used from now on.
+ Notes : If the path does not point to a directory then:
+ if a single file is being transfered and the protocol supports
+ file renaming (PF1_CANRENAMEFILE) then the file is given
+ this name, othewise the file is removed and file(s) are placed
+ into the resulting directory.
+ -
+ File transfers are marked by a EVENTTYPE_FILE added to the database.
+ The format is :
+ hTransfer: DWORD
+ filename(s), description: ASCIIZ
+ }
+ PSS_FILEALLOW = '/FileAllow';
+
+ {
+ CCSDATA: Yes
+ wParam : HTRANSFER
+ lparam : Pointer to a buffer to be filled with reason
+ Affect : Refuses a file transfer request
+ Returns: 0 on success, [non zero] on failure
+ }
+ PSS_FILEDENY = '/FileDeny';
+
+ {
+ CCSDATA: Yes
+ wParam : HTRANSFER
+ lParam : 0
+ Affect : Cancel an in-progress file transfer
+ Returns: 0 on success, [non zero] on failure
+ }
+ PSS_FILECANCEL = '/FileCancel';
+
+ {
+ CCSDATA: Yes
+ wParam : null terminated string containing description
+ lParam : pointer to an array of pchar's containing file paths/directories
+ Affect : Start a file(s) send, see notes
+ Returns: A HTRANSFER handle on success, NULL(0) on failur
+ Notes : All notifications are done thru acks :
+ -
+ type=ACKTYPE_FILE, if result=ACKRESULT_FAILED then
+ lParam=null terminated string containing reason
+ }
+ PSS_FILE = '/SendFile';
+
+ // Receiving Services
+ {>>/
+ Receiving Services:
+ Before a message is sent to /RecvMessage it goes through a MS_PROTO_CHAINRECV
+ which allows any other module to change data (for decryption, etc),
+ this then reaches /RecvMessage.
+
+ This does not have to be the same structure/memory contained within that
+ structure that started the chain call.
+
+ /RecvMessage adds the event to the database, any other modules who
+ are interested in what message the user will see should hook at this point.
+ />>}
+
+ {
+ CCSDATA: Yes
+ wParam : 0
+ lParam : Pointer to a TPROTORECVEVENT
+ Affect : An instant message has beeen received, see notes
+ Returns: 0
+ Notes : lParam^.lParam^.szMessage has the message, see structure above
+ stored as DB event EVENTTYPE_MESSAGE, blob contains message
+ string without null termination.
+ }
+ PSR_MESSAGE = '/RecvMessage';
+
+ {
+ CCSDATA: Yes
+ wParam : 0
+ lParam : Pointer to a TPROTORECVEVENT, see notes
+ Affect : A URL has been received
+ Notes : szMessage is encoded the same as PSS_URL
+ -
+ Stored in the database : EVENTTYPE_URL, blob contains message
+ without null termination
+ }
+ PSR_URL = '/RecvUrl';
+
+ {
+ CCSDATA: Yes
+ wParam : 0
+ lParam : Pointer to a TPROTORECVEVENT
+ Affect : Contacts have been received, see notes
+ Notes : pre.szMessage is actually a PROTOSEARCHRESULT list
+ pre.lParam is the number of contains in that list.
+ -
+ PS_ADDTOLIST can be used to add contacts to the list
+ -
+ repeat [
+ ASCIIZ userNick
+ ASCIIZ userId
+ ]
+ userNick should be a human-readable description of the user. It need not
+ be the nick, or even confined to displaying just one type of
+ information.
+ userId should be a machine-readable representation of the unique
+ protocol identifying field of the user. Because of the need to be
+ zero-terminated, binary data should be converted to text.
+ Use PS_ADDTOLISTBYEVENT to add the contacts from one of these to the list.
+ }
+ PSR_CONTACTS = '/RecvContacts';
+
+ {
+ CCSDATA: Yes
+ wParam : 0
+ lParam : Pointer to a TPROTORECVFILE
+ Affect : File(s) have been received
+ }
+ PSR_FILE = '/RecvFile';
+
+{$ENDIF}
+
diff --git a/include/delphi/m_skin.inc b/include/delphi/m_skin.inc new file mode 100644 index 0000000000..dabbd00960 --- /dev/null +++ b/include/delphi/m_skin.inc @@ -0,0 +1,120 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_SKIN}
+{$DEFINE M_SKIN}
+
+const
+
+ // event icons
+
+ SKINICON_EVENT_MESSAGE = 100;
+ SKINICON_EVENT_URL = 101;
+ SKINICON_EVENT_FILE = 102;
+
+ // other icons
+ SKINICON_OTHER_MIRANDA = 200;
+ SKINICON_OTHER_EXIT = 201;
+ SKINICON_OTHER_SHOWHIDE = 202;
+ SKINICON_OTHER_GROUPOPEN = 203; // v0.1.1.0+
+ SKINICON_OTHER_GROUPSHUT = 205; // v0.1.1.0+
+ SKINICON_OTHER_USERONLINE = 204; // v0.1.0.1+
+
+ // menu icons are owned by the module that uses them so are not and should not
+ // be skinnable. Except exit and show/hide
+
+ // status mode icons. NOTE: These are deprecated in favour of LoadSkinnedProtoIcon()
+ SKINICON_STATUS_OFFLINE = 0;
+ SKINICON_STATUS_ONLINE = 1;
+ SKINICON_STATUS_AWAY = 2;
+ SKINICON_STATUS_NA = 3;
+ SKINICON_STATUS_OCCUPIED = 4;
+ SKINICON_STATUS_DND = 5;
+ SKINICON_STATUS_FREE4CHAT = 6;
+ SKINICON_STATUS_INVISIBLE = 7;
+ SKINICON_STATUS_ONTHEPHONE = 8;
+ SKINICON_STATUS_OUTTOLUNCH = 9;
+
+type
+
+ PSKINSOUNDDESC = ^TSKINSOUNDDESC;
+ TSKINSOUNDDESC = record
+ cbSize: int;
+ { name to refer to sound when playing and in DB }
+ pszName: PChar;
+ { description to use for it in options dialog }
+ pszDescription: PChar;
+ { the default sound file to use, WITHOUT path }
+ pszDefaultFile: PChar;
+ end;
+
+const
+
+ {
+ wParam : ICON_ID
+ lParam : 0
+ Affect : Load an icon from the user's custom skin lib, or from the exe
+ if there isn't one loaded, see notes
+ Return : HICON for the new icon, do *not* DestroyIcon() the return value
+ returns NULL(0) if ICON_ID is invalid, but always success for a valid
+ ID.
+ }
+ MS_SKIN_LOADICON = 'Skin/Icons/Load';
+
+ {
+ wParam : null terminated string containing the protocol name
+ lParam : status_wanted
+ Affect : Load an icon representing the status_wanted for a particular protocol, see notes
+ Returns: an HICON for the new icon, do NOT DestroyIcon() the return value
+ returns NULL(0) on failure.
+ Notes : If wParam is NULL(0) the service will load the user's selected
+ 'all protocols' status icon
+ }
+ MS_SKIN_LOADPROTOICON = 'Skin/Icons/LoadProto';
+
+ {
+ wParam : 0
+ lParam : Pointer to a initialised SKINSOUNDDESC
+ Affect : Add a new sound so it has a default and can be changed in the options dialog
+ Returns: 0 on success, [non zero] on failure
+ }
+ MS_SKIN_ADDNEWSOUND = 'Skin/Sounds/AddNew';
+
+ {
+ wParam : 0
+ lParam : Pointer to a null terminated string containing the name of the sound to play
+ Affect : play a named sound event, play name should of been added
+ with MS_SKIN_ADDNEWSOUND, see notes
+ Notes : function will not fail, it will play the Windows
+ }
+ MS_SKIN_PLAYSOUND = 'Skin/Sounds/Play';
+
+ {
+ wParam : 0
+ lParam : 0
+ Affect : Sent when the icons DLL has been changed in the options dialog
+ and everyone should remake their image lists.
+ }
+ ME_SKIN_ICONSCHANGED = 'Skin/IconsChanged';
+
+{$ENDIF}
diff --git a/include/delphi/m_system.inc b/include/delphi/m_system.inc new file mode 100644 index 0000000000..dff5909c86 --- /dev/null +++ b/include/delphi/m_system.inc @@ -0,0 +1,170 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_SYSTEM}
+{$DEFINE M_SYSTEM}
+
+type
+
+ TMM_INTERFACE = record
+ cbSize: int;
+ _malloc: function(cbSize: Integer): Pointer; cdecl;
+ _realloc: function (pb: Pointer; cbSize: Integer): Pointer; cdecl;
+ _free: procedure(pb: Pointer); cdecl;
+ end;
+
+const
+
+ MIRANDANAME = 'Miranda';
+
+ {
+ wParam : 0
+ lParam : 0
+ affect : called after all modules have been successfully initialised
+ used to resolve double-dependencies in the module load order, see notes
+ return : 0
+ notes : Can be used to call services, etc that have not yet loaded
+ when your module has.
+ }
+ ME_SYSTEM_MODULESLOADED = 'Miranda/System/ModulesLoaded';
+
+ {
+ wParam : 0
+ lParam : 0
+ affect : called just before Miranda terminates, the database is still running
+ during this hook
+ return : 0
+ }
+ ME_SYSTEM_SHUTDOWN = 'Miranda/System/Shutdown';
+
+ {
+ wParam : 0
+ lParam : 0
+ affect : called before Miranda actually shuts down -- everyone has to agree
+ or it is not shut down.
+ return : non zero to stop the shutdown
+ }
+ ME_SYSTEM_OKTOEXIT = 'Miranda/System/OkToExitEvent';
+
+ {
+ wParam : 0
+ lParam : 0
+ affect : service which sends everyone the ME_SYSTEM_OKTOEXIT event
+ return : true if everyone is okay to exit, otherwise false
+ }
+ MS_SYSTEM_OKTOEXIT = 'Miranda/System/OkToExit';
+
+ {
+ wParam : 0
+ lParam : 0
+ return : returns the version number -- each byte set with version index,
+ e.g. 1.2.3.4 $01020304
+ }
+ MS_SYSTEM_GETVERSION = 'Miranda/System/GetVersion';
+
+ {
+ wParam : size in bytes of the buffer to be filled
+ lParam : pointer to the buffer to be filled
+ affect : returns Miranda's version as text with build type such as '1.2.3.4 alpha'
+ return : 0 on success -- non zero on failure
+ }
+ MS_SYSTEM_GETVERSIONTEXT = 'Miranda/System/GetVersionText';
+
+ {
+ wParam : Handle of a wait object to be used
+ lParam : pointer to service name
+ affect : causes the service name to be called whenever the wait object
+ is signalled with CallService(Service, wParam=hWaitObjeect, lParam=0)
+ return : 0 on success, non zero on failure, will always fail if
+ more than 64 event objects are already being waited on because
+ of the limit imposed by Windows.
+ version: implemented after v0.1.2.0+
+ other : QueueUserAPC() can be used instead of this service to wait
+ for notifications, BUT *only* after v0.1.2.2+ since that deals
+ with APC's
+ }
+ MS_SYSTEM_WAITONHANDLE = 'Miranda/System/WaitOnHandle';
+
+ {
+ wParam : hWaitObject to be removed
+ lParam : 0
+ affect : removes the wait object from the list, see above.
+ returns: 0 on success, nonzero on failure
+ version: implemented after v0.1.2.0+
+ }
+ MS_SYSTEM_REMOVEWAIT = 'Miranda/System/RemoveWait';
+
+ {
+ wParam : 0
+ lParam : Pointer to an initialised TMM_INTERFACE
+ affect : Get function pointers to, malloc(), free() and realloc() used by Miranda
+ note : this should only be used carefully, make sure .cbSize is initialised with sizeof(TMM_INTERFACE)
+ version: 0.1.2.2+
+ }
+ MS_SYSTEM_GET_MMI = 'Miranda/System/GetMMI';
+
+ {
+ wParam=0
+ lParam=0
+
+ Add a thread to the unwind wait stack that Miranda will poll on
+ when it is tearing down modules.
+
+ This must be called in the context of the thread that is to be pushed
+ i.e. there are no args, it works out what thread is being called
+ and gets itself a handle to the calling thread.
+ }
+ MS_SYSTEM_THREAD_PUSH = 'Miranda/Thread/Push';
+
+ {
+ wParam=0
+ lParam=0
+
+ Remove a thread from the unwind wait stack -- it is expected
+ that the call be made in the context of the thread to be removed.
+
+ Miranda will begin to tear down modules and plugins if/when the
+ last thread from the unwind stack is removed.
+ }
+ MS_SYSTEM_THREAD_POP = 'Miranda/Thread/Pop';
+
+ {
+ wParam=0
+ lParam=0
+
+ This hook is fired just before the thread unwind stack is used,
+ it allows MT plugins to shutdown threads if they have any special
+ processing to do, etc.
+ }
+ ME_SYSTEM_PRESHUTDOWN = 'Miranda/System/PShutdown';
+
+ {
+ wParam=0
+ lParam=0
+
+ Returns TRUE when Miranda has got WM_QUIT and is in the process
+ of shutting down
+ }
+ MS_SYSTEM_TERMINATED = 'Miranda/SysTerm';
+
+{$ENDIF}
diff --git a/include/delphi/m_url.inc b/include/delphi/m_url.inc new file mode 100644 index 0000000000..c991d2a68c --- /dev/null +++ b/include/delphi/m_url.inc @@ -0,0 +1,39 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_URL}
+{$DEFINE M_URL}
+
+const
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affects: bring up the send URL dialogbox for a user
+ Returns: 0 on success, nonzero on failure, see notes
+ Notes : service returns before the URL is sent.
+ }
+ MS_URL_SENDURL = 'SRUrl/SendCommand';
+
+{$ENDIF}
diff --git a/include/delphi/m_userinfo.inc b/include/delphi/m_userinfo.inc new file mode 100644 index 0000000000..4ea8a90563 --- /dev/null +++ b/include/delphi/m_userinfo.inc @@ -0,0 +1,84 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_USERINFO}
+{$DEFINE M_USERINFO}
+
+const
+
+ {
+ wParam : HCONTACT
+ lParam : 0
+ Affects: Show the user details dialog box for a contact, see notes
+ Notes : I think this can be used to display "My User Details"... if NULL(0) is used
+ }
+ MS_USERINFO_SHOWDIALOG = 'UserInfo/ShowDialog';
+
+ {
+ wParam : 0
+ lParam : HCONTACT
+ Affects: The details dialog box was opened for a contact maybe NULL(0)
+ showing the user details -- see notes
+ Notes : The module should do whatever initialisation they need and
+ call MS_USERINFO_ADDPAGE one or more times if they want
+ pages displayed in the options dialog -- wParam should be passed
+ straight as the wParam of MS_USERINFO_ADDPAGE.
+ -
+ The builtin userinfo module is not loaded til after all plugins
+ have loaded -- therefore a HookEvent() for this event will fail,
+ use ME_SYSTEM_MODULESLOADED event to know when everything has
+ loaded and it's okay to hook this event.
+ Version: v0.1.2.0+
+ }
+ ME_USERINFO_INITIALISE = 'UserInfo/Initialise';
+
+ {
+ wParam : wParam from ME_USERINFO_INITIALISE
+ lParam : pointer to an initialised OPTIONSDIALOGPAGE (see m_options.inc)
+ Affects: Adds a page to the details dialog, see notes
+ Notes : this service should only be called within the ME_USERINFO_INITIALISE
+ event -- when the pages get (WM_INITDIALOG lParam=HCONTACT) strings
+ in the passed dialog structure can be freed soon as the service returns
+ icons must be kept around (not a problem if you're loading from resource).
+ -
+ The group elements within the OPTIONSDIALOGPAGE are ignored,
+ details dialog page should be 222x132 DLU's -- the details dialog
+ box currently has no cancel button, pages will be sent PSN_INFOCHANGED
+ thru WM_NOTIFY (idFrom=0) when a protocol ACK is broadcast for
+ the correct contact with the type ACKTYPE_GETINFO.
+ -
+ PSN_INFOCHANGED will also be sent just after the page is created
+ to help you out.
+ -
+ All PSN_* WM_NOTIFY messages have PSHNOTIFY.lParam=(LPARAM)hContact
+ Version: v0.1.2.0+
+ }
+
+ PSN_INFOCHANGED = 1;
+ { force-send a PSN_INFOCHANGED to all pages }
+ PSM_FORCECHANGED = ($0400 + 100);
+
+ MS_USERINFO_ADDPAGE = 'UserInfo/AddPage';
+
+{$ENDIF}
diff --git a/include/delphi/m_utils.inc b/include/delphi/m_utils.inc new file mode 100644 index 0000000000..b0cabfff44 --- /dev/null +++ b/include/delphi/m_utils.inc @@ -0,0 +1,279 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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_UTILS}
+{$DEFINE M_UTILS}
+
+const
+
+ RD_ANCHORX_CUSTOM = 0; // function did everything required to the x axis, do no more processing
+ RD_ANCHORX_LEFT = 0; // move the control to keep it constant distance from the left edge of the dialog
+ RD_ANCHORX_RIGHT = 1; // move the control to keep it constant distance from the right edge of the dialog
+ RD_ANCHORX_WIDTH = 2; // size the control to keep it constant distance from both edges of the dialog
+ RD_ANCHORX_CENTRE = 4; // move the control to keep it constant distance from the centre of the dialog
+ RD_ANCHORY_CUSTOM = 0;
+ RD_ANCHORY_TOP = 0;
+ RD_ANCHORY_BOTTOM = 8;
+ RD_ANCHORY_HEIGHT = 16;
+ RD_ANCHORY_CENTRE = 32;
+
+ // for MS_UTILS_RESTOREWINDOWPOSITION
+
+ RWPF_NOSIZE = 1; // don't use stored size info: leave dialog same size
+ RWPF_NOMOVE = 2; // don't use stored position
+
+ // for WNDCLASS_COLOURPICKER
+
+ CPM_SETCOLOUR = $1000;// lParam=new colour
+ CPM_GETCOLOUR = $1001;// returns colour
+ CPM_SETDEFAULTCOLOUR = $1002;// lParam=default, used as first custom colour
+ CPM_GETDEFAULTCOLOUR = $1003;// returns colour
+ CPN_COLOURCHANGED = 1; // sent through WM_COMMAND
+
+type
+
+ PUTILRESIZECONTROL = ^TUTILRESIZECONTROL;
+ TUTILRESIZECONTROL = record
+ cbSize: int;
+ wId: int; // control ID
+ rcItem: TRect; // original control rectangle, relative to dialog
+ // modify in-placee to specify the new position
+ dlgOriginalSize: TSize; // size of dialog client area in template
+ dlgNewSize: TSize; // current size of dialog client area
+ end;
+
+ TDIALOGRESIZERPROC = function(hwndDlg: THandle; lParam: LPARAM; urc: PUTILRESIZECONTROL): int; cdecl;
+
+ PUTILRESIZEDIALOG = ^TUTILRESIZEDIALOG;
+ TUTILRESIZEDIALOG = record
+ cbSize: int;
+ hwndDlg: THandle;
+ hInstance: THandle;
+ lpTemplate: PChar;
+ lParam: LPARAM;
+ pfnResizer: TDIALOGRESIZERPROC;
+ end;
+
+ PCountryListEntry = ^TCountryListEntry;
+ TCountryListEntry = record
+ id: int;
+ szName: PChar;
+ end;
+
+ PWINDOWLISTENTRY = ^TWINDOWLISTENTRY;
+ TWINDOWLISTENTRY = record
+ hList: THandle;
+ hWnd: THandle;
+ hContact: THandle;
+ end;
+
+ PSAVEWINDOWPOS = ^TSAVEWINDOWPOS;
+ TSAVEWINDOWPOS = record
+ hWnd: THandle;
+ hContact: THandle;
+ szModule: PChar; // module name eto store the settings in
+ szNamePrefix: PChar; // text to prefix on 'x', 'width', etc
+ end;
+
+const
+
+ {
+ wParam : bOpenInNewWindow
+ lParam : Pointer to a null terminated string containing Url
+ Affect : Open a URRL in the user's default web browser, see notes
+ Returns: 0 on success, [non zero on failure]
+ Notes : bOpenInWindow should be zero to open the URL in the browoser window
+ the user last used, or nonzero to open in a new browser window,
+ if there's no browser running, it will be started to show the URL
+ Version: v0.1.0.1+
+ }
+ MS_UTILS_OPENURL = 'Utils/OpenURL';
+
+ {
+ wParam : 0
+ lParam : Pointer to an initalised TUTILRESIZEDIALOG structure
+ Affect : Resize a dialog by calling a custom routine to move each control, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : Does not support DIALOGTEMPLATEEX dialogboxes, and will return
+ failure if you try to resize one.-
+ the dialog iteself should have been resized prior to calling this
+ service, .pfnResizer is called once for each control in the dialog
+ .pfnResizer should return a combination of one RD_ANCHORx_ and one RD_ANCHORy constant
+ Version: v0.1.0.1+
+ }
+ MS_UTILS_RESIZEDIALOG = 'Utils/ResizeDialog';
+
+ {
+ wParam : countryID
+ lParam : 0
+ Affect : Get the name of a country given it's number, e.g. 44 = UK
+ Returns: Returns a pointer to a string containing the country name on success
+ NULL(0) on failure
+ Version: v0.1.2.0+
+ }
+ MS_UTILS_GETCOUNTRYBYNUMBER = 'Utils/GetCountryByNumber';
+
+ {
+ 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
+ Returns: 0 always
+ Notes : the list is sorted alphabetically by name, on the assumption
+ it's quicker to search numbers that are out of outer, than strings
+ that are out of order. a NULL(0) entry terminates
+ -
+ Neither wParam or lParam can be NULL(0)
+ -
+ lParam is filled with the first entry, it can be accessed as a pointer,
+ to get the next entry, increment the pointer by sizeof(Pointer) NOT
+ sizeof(TCountryList), only increment the pointer as many times as
+ given by iCount.
+ -
+ this data can NOT be copied if an array of TCountryListEntry's is passed
+ so don't try it.
+ Version: v0.1.2.0+
+ }
+ MS_UTILS_GETCOUNTRYLIST = 'Utils/GetCountryList';
+
+ // see WindowList_* functions below
+
+ {
+ wParam : 0
+ lParam : 0
+ Affect : Allocate a window list
+ Returns: A handle to the new window list
+ Version: v0.1.0.1+
+ }
+ MS_UTILS_ALLOCWINDOWLIST = 'Utils/AllocWindowList';
+
+ {
+ wParam : 0
+ lParam : Pointer to an initalised TWINDOWLISTENTRY structure
+ Affect : Add a window to a given window list handle
+ Returns: 0 on success, [non zero] on failure
+ Version: v0.1.0.1+
+ }
+ MS_UTILS_ADDTOWINDOWLIST = 'Utils/AddToWindowList';
+
+ {
+ wParam : Handle to window list to remove from
+ lParam : Window handle to remove
+ Affect : Remove a window from the specified window list
+ Returns: 0 on success, [non zero] on failure
+ Version: v0.1.0.1+
+ }
+ MS_UTILS_REMOVEFROMWINDOWLIST = 'Utils/RemoveFromWindowList';
+
+ {
+ wParam : Handle to the window list to look in
+ lParam : Handle to a HCONTACT to find in the window list
+ Affect : Find a window handle given the hContact
+ Returns: The found window handle or NULL(0) on failure
+ Version: v0.1.0.1+
+ }
+ MS_UTILS_FINDWINDOWINLIST = 'Utils/FindWindowInList';
+
+ {
+ wParam : Handle to window list
+ lParam : Pointer to TMSG (initalised with what to broadcast)
+ Affect : Broadcast a message to all windows in a list, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : only TMSG.Message, .wParam, .lParam are used
+ Version: v0.1.0.1+
+ }
+ MS_UTILS_BROADCASTTOWINDOWLIST = 'Utils/BroadcastToWindowList';
+
+ {
+ There aren't any services here, there's no need for them, the control class
+ will obey the SS_LEFT (0), SS_CENTER (1), SS_RIGHT(2) styles
+ the control will send STN_CLICKED via WM_COMMAND when the link itself is clicked
+ -
+ These are defined by STATIC controls and STN_CLICKED is sent to standard
+ STATIC classes when they're clicked -- look at WINAPI docs for more info
+ }
+ WNDCLASS_HYPERLINK = 'Hyperlink';
+
+ {
+ wParam : 0
+ lParam : Pointer to a initialised TSAVEWINDOWPOS structure
+ Affect :
+ Returns: 0 on success, [non zero] on failure
+ Notes :
+ Version: v0.1.1.0+
+ }
+ MS_UTILS_SAVEWINDOWPOSITION = 'Utils/SaveWindowPos';
+
+ {
+ wParam : see RWPF_* flags
+ lParam : Pointer to a initalised TSAVEWINDOWPOS
+ Affect : Restores the position of a window from the database, see notes
+ Returns: 0 on success, [non zero] on failure
+ Notes : If no position info was found, the service will return 1.
+ The NoSize version won't use stored information size, the window
+ is left the same size
+ -
+ See Utils_RestoreWindowPosition() Helper function, this function is
+ a bit different from the C function (which can be inlined too! dammit)
+ that there's only one function and not three (which just passed different flags)
+ Version: v0.1.1.0+
+ }
+ MS_UTILS_RESTOREWINDOWPOSITION = 'Utils/RestoreWindowPos';
+
+ {
+ Colour picker control, see CPM_* and CPN_* constants above
+ }
+ WNDCLASS_COLOURPICKER = 'ColourPicker';
+
+ {
+ wParam : 0
+ lParam : Pointer to a null terminated string containing filename
+ Affect : Loads a bitmap (or other graphic type, see Notes
+ Returns: HBITMAP on success, NULL(0) on failure
+ Notes : This function also supports JPEG, GIF (and maybe PNG too)
+ For speed, if the file extention is .bmp or .rle it will use LoadImage()
+ and not load OLE for the extra image support
+ -
+ Remember to delete the returned handle with DeleteObject (see GDI documentation for WINAPI)
+ Version: v0.1.2.1+
+ }
+ MS_UTILS_LOADBITMAP = 'Utils/LoadBitmap';
+
+ {
+ wParam : byte length of buffer (not to be confused with byte range)
+ lParam : Pointer to buffer
+ Affect : Get the filter strings for use in the open file dialog, see notes
+ Returns: 0 on success [non zero] on failure
+ Notes : See the WINAPI under OPENFILENAME.lpStrFiler for formatting,
+ an 'All bitmaps' item is alway first, and 'All files' is always last
+ -
+ The returned string is always formatted
+ -
+ To build this filter, the filter string consists of
+ filter followed by a descriptive text
+ followed by more filters and their descriptive texts -- end with double NULL(0)
+ e.g. *.bmp' #0 'All bitmaps' #0 '*.*' #0 'All Files' #0 #0
+ }
+ MS_UTILS_GETBITMAPFILTERSTRINGS = 'Utils/GetBitmapFilterStrings';
+
+{$endif}
diff --git a/include/delphi/newpluginapi.inc b/include/delphi/newpluginapi.inc new file mode 100644 index 0000000000..687a3dbe2d --- /dev/null +++ b/include/delphi/newpluginapi.inc @@ -0,0 +1,94 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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 NEWPLUGINAPI}
+{$DEFINE NEWPLUGINAPI}
+
+const
+
+ MAXMODULELABELLENGTH = 64;
+
+type
+
+ PPLUGININFO = ^TPLUGININFO;
+ TPLUGININFO = record
+ cbSize: int;
+ shortName: PChar;
+ version: DWORD;
+ description: PChar;
+ author: PChar;
+ authorEmail: PChar;
+ copyright: PChar;
+ homepage: PChar;
+ isTransient: Byte; // leave zero for now
+ { one of the DEFMOD_* consts in m_plugin or zero, if non zero, this will
+ suppress loading of the specified builtin module }
+ replacesDefaultModule: int;
+ end;
+
+ { modules.h is never defined -- no check needed }
+
+ TMIRANDAHOOK = function(wParam: WPARAM; lParam: LPARAM): int; cdecl;
+ TMIRANDASERVICE = function(wParam: WPARAM; lParam: LPARAM): int; cdecl;
+
+ //see modules.h tor what all this stuff is
+
+ TCreateHookableEvent = function(const char: PChar): THandle; cdecl;
+ TDestroyHookableEvent = function(Handle: THandle): int; cdecl;
+ TNotifyEventHooks = function(Handle: THandle; wParam: WPARAM; lParam: LPARAM): int; cdecl;
+ THookEvent = function(const char: PChar; MIRANDAHOOK: TMIRANDAHOOK): THandle; cdecl;
+ THookEventMessage = function(const char: PChar; Wnd: THandle; wMsg: Integer): THandle; cdecl;
+ TUnhookEvent = function(Handle: THandle): int; cdecl;
+ TCreateServiceFunction = function(const char: PChar; MIRANDASERVICE: TMIRANDASERVICE): THandle; cdecl;
+ TCreateTransientServiceFunction = function(const char: PChar; MIRANDASERVICE: TMIRANDASERVICE): THandle; cdecl;
+ TDestroyServiceFunction = function(Handle: THandle): int; cdecl;
+ TCallService = function(const char: PChar; wParam: WPARAM; lParam: LPARAM): int; cdecl;
+ TServiceExists = function(const char: PChar): int; cdecl;
+
+ PPLUGINLINK = ^TPLUGINLINK;
+ TPLUGINLINK = record
+ CreateHookableEvent: TCreateHookableEvent;
+ DestroyHookableEvent: TDestroyHookableEvent;
+ NotifyEventHooks: TNotifyEventHooks;
+ HookEvent: THookEvent;
+ HookEventMessage: THookEventMessage;
+ UnhookEvent: TUnhookEvent;
+ CreateServiceFunction: TCreateServiceFunction;
+ CreateTransientServiceFunction: TCreateTransientServiceFunction;
+ DestroyServiceFunction: TDestroyServiceFunction;
+ CallService: TCallService;
+ ServiceExists: TServiceExists; // v0.1.0.1+
+ end;
+
+ { any module must export the below functions to be valid plugin
+ the export names MUST be 'MirandaPluginInfo' 'Load' 'Unload' }
+
+ TMirandaPluginInfo = function(mirandaVersion: DWORD): PPLUGININFO; cdecl;
+ TLoad = function(link: PPLUGINLINK): int; cdecl;
+ TUnload = function: int; cdecl;
+
+const
+
+ CALLSERVICE_NOTFOUND = $80000000;
+
+{$ENDIF}
diff --git a/include/delphi/statusmodes.inc b/include/delphi/statusmodes.inc new file mode 100644 index 0000000000..57facc8338 --- /dev/null +++ b/include/delphi/statusmodes.inc @@ -0,0 +1,54 @@ +(*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM 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 STATUSMODES}
+{$DEFINE STATUSMODES}
+
+const
+
+ // add 1 to the ID_STATUS_CONNECTING to mark retries (v0.1.0.1+)
+ // e.g. ID_STATUS_CONNECTING+2 is the third connection attempt, or the second retry
+
+ ID_STATUS_CONNECTING = 1;
+
+ // max retries is just a marker, so that the clist knows what
+ // numbers represent retries, it should set any kind of limit on the number
+ // of retries you can and/or should do
+
+ MAX_CONNECT_RETRIES = 10000;
+
+ // and the modes!
+
+ ID_STATUS_OFFLINE = 40071;
+ ID_STATUS_ONLINE = 40072;
+ ID_STATUS_AWAY = 40073;
+ ID_STATUS_DND = 40074;
+ ID_STATUS_NA = 40075;
+ ID_STATUS_OCCUPIED = 40076;
+ ID_STATUS_FREECHAT = 40077;
+ ID_STATUS_INVISIBLE = 40078;
+ ID_STATUS_ONTHEPHONE = 40079;
+ ID_STATUS_OUTTOLUNCH = 40080;
+
+{$ENDIF}
diff --git a/include/delphi/testdll.dpr b/include/delphi/testdll.dpr new file mode 100644 index 0000000000..478212d82c --- /dev/null +++ b/include/delphi/testdll.dpr @@ -0,0 +1,60 @@ +library testdll;
+
+uses
+
+ m_globaldefs, m_api, Windows;
+
+ {$include m_helpers.inc}
+
+ function MirandaPluginInfo(mirandaVersion: DWORD): PPLUGININFO; cdecl;
+ begin
+ Result := @PLUGININFO;
+ PLUGININFO.cbSize := sizeof(TPLUGININFO);
+ PLUGININFO.shortName := 'Plugin Template';
+ PLUGININFO.version := PLUGIN_MAKE_VERSION(0,0,0,1);
+ PLUGININFO.description := 'The long description of your plugin, to go in the plugin options dialog';
+ PLUGININFO.author := 'J. Random Hacker';
+ PLUGININFO.authorEmail := 'noreply@sourceforge.net';
+ PLUGININFO.copyright := '(c) 2003 J. Random Hacker';
+ PLUGININFO.homepage := 'http://miranda-icq.sourceforge.net/';
+ PLUGININFO.isTransient := 0;
+ PLUGININFO.replacesDefaultModule := 0;
+ end;
+
+ function PluginMenuCommand(wParam: WPARAM; lParam: LPARAM): Integer; cdecl;
+ begin
+ Result := 0;
+ // this is called by Miranda, thus has to use the cdecl calling convention
+ // all services and hooks need this.
+ MessageBox(0, 'Just groovy, baby!', 'Plugin-o-rama', MB_OK);
+ end;
+
+ function Load(link: PPLUGINLINK): int; cdecl;
+ var
+ mi: TCListMenuItem;
+ begin
+ // this line is VERY VERY important, if it's not present, expect crashes.
+ PLUGINLINK := Pointer(link);
+ pluginLink^.CreateServiceFunction('TestPlug/MenuCommand', @PluginMenuCommand);
+ FillChar(mi, sizeof(mi), 0);
+ mi.cbSize := sizeof(mi);
+ mi.position := $7FFFFFFF;
+ mi.flags := 0;
+ mi.hIcon := LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ mi.pszName := '&Test Plugin...';
+ mi.pszService := 'TestPlug/MenuCommand';
+ pluginLink^.CallService(MS_CLIST_ADDMAINMENUITEM, 0, lParam(@mi));
+ Result := 0;
+ end;
+
+ function Unload: int; cdecl;
+ begin
+ Result := 0;
+ end;
+
+ exports
+
+ MirandaPluginInfo, Load, Unload;
+
+begin
+end.
diff --git a/include/m_acc.h b/include/m_acc.h new file mode 100644 index 0000000000..9e88087c07 --- /dev/null +++ b/include/m_acc.h @@ -0,0 +1,120 @@ +/*
+Copyright (C) 2006 Ricardo Pescuma Domenecci, Nightwish
+
+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_ACC_H__
+# define __M_ACC_H__
+
+
+#define AVATAR_CONTROL_CLASS _T( "MAvatarControlClass" ) // Class of the control
+
+
+// Sets the contact that this avatar represents. This invalidates
+// a previous call of AVATAR_SETPROTCOL.
+// wParam = not used
+// lParam = (HANDLE) hContact
+// Usage: SendMessage(hwnd, AVATAR_SETCONTACT, 0, (LPARAM) hContact);
+// Only works on AVATAR_CONTROL_CLASS controls
+#define AVATAR_SETCONTACT (WM_USER+1)
+
+// Sets the user protocol that this avatar represents. This invalidates
+// a previous call of AVATAR_SETCONTACT.
+// wParam = not used
+// lParam = (char *) protcol name
+// Usage: SendMessage(hwnd, AVATAR_SETPROTOCOL, 0, (LPARAM) "MSN");
+// Only works on AVATAR_CONTROL_CLASS controls
+#define AVATAR_SETPROTOCOL (WM_USER+2)
+
+// Sets the background color of thr control
+// Default: transparent
+// wParam = not used
+// lParam = (COLORREF) color or -1 to transparent
+// Usage: SendMessage(hwnd, AVATAR_SETBKGCOLOR, 0, (LPARAM) RGB(0,0,0));
+// Only works on AVATAR_CONTROL_CLASS controls
+#define AVATAR_SETBKGCOLOR (WM_USER+3)
+
+// Sets the control border color
+// Default: no border
+// wParam = not used
+// lParam = (COLORREF) color or -1 to no border
+// Usage: SendMessage(hwnd, AVATAR_SETBKGCOLOR, 0, (LPARAM) RGB(0,0,0));
+// Only works on AVATAR_CONTROL_CLASS controls
+#define AVATAR_SETBORDERCOLOR (WM_USER+4)
+
+// Sets the avatar border color
+// Default: no border
+// wParam = not used
+// lParam = (COLORREF) color or -1 to no border
+// Usage: SendMessage(hwnd, AVATAR_SETBKGCOLOR, 0, (LPARAM) RGB(0,0,0));
+// Only works on AVATAR_CONTROL_CLASS controls
+#define AVATAR_SETAVATARBORDERCOLOR (WM_USER+5)
+
+// Sets the radius of the round corner of the avatar
+// Default: 0
+// wParam = not used
+// lParam = (int) radius or 0 to not use round corners
+// Usage: SendMessage(hwnd, AVATAR_SETAVATARROUNDCORNERRADIUS, 0, 4);
+// Only works on AVATAR_CONTROL_CLASS controls
+#define AVATAR_SETAVATARROUNDCORNERRADIUS (WM_USER+6)
+
+// Sets the text to be shown if no avatar is set. The font can be set using WM_SETFONT.
+// Default: ""
+// wParam = not used
+// lParam = (char *) text (it will be translated) - max 128 chars
+// Usage: SendMessage(hwnd, AVATAR_SETNOAVATARTEXT, 0, (LPARAM) "Contact has no avatar");
+// Only works on AVATAR_CONTROL_CLASS controls
+#define AVATAR_SETNOAVATARTEXT (WM_USER+7)
+
+// Sets if the hidden setting must be respected and hidden avatars shouldn't be draw
+// Default: TRUE
+// wParam = not used
+// lParam = (BOOL) respect?
+// Usage: SendMessage(hwnd, AVATAR_RESPECTHIDDEN, 0, (LPARAM) FALSE);
+// Only works on AVATAR_CONTROL_CLASS controls
+#define AVATAR_RESPECTHIDDEN (WM_USER+8)
+
+// Get the space inside the control that is really beeing used to display the avatar (the rest
+// is filled with background color). Set both to 0 if no avatar exists.
+// wParam = (int *) width
+// lParam = (int *) height
+// Usage: SendMessage(hwnd, AVATAR_GETUSEDSPACE, (WPARAM) &width, (LPARAM) &height);
+// Only works on AVATAR_CONTROL_CLASS controls
+#define AVATAR_GETUSEDSPACE (WM_USER+9)
+
+// Sets if the avatar will be resized when its smaller then the control size
+// Default: TRUE
+// wParam = not used
+// lParam = (BOOL) TRUE or FALSE
+// Usage: SendMessage(hwnd, AVATAR_SETRESIZEIFSMALLER, 0, (LPARAM) FALSE);
+// Only works on AVATAR_CONTROL_CLASS controls
+#define AVATAR_SETRESIZEIFSMALLER (WM_USER+10)
+
+// tell acc to paint avatar on aero surface (must draw with alpha channel, not
+// using BitBlt()
+// wParam = not used
+// lParam = (BOOL) TRUE -> enable, FALSE -> disable
+
+#define AVATAR_SETAEROCOMPATDRAWING (WM_USER+11)
+
+
+// Set to the parent throught WM_NOTIFY to notify when the avatar shown has changed
+#define NM_AVATAR_CHANGED (0U-200U)
+
+
+#endif // __M_ACC_H__
diff --git a/include/m_addcontact.h b/include/m_addcontact.h new file mode 100644 index 0000000000..00bf86c682 --- /dev/null +++ b/include/m_addcontact.h @@ -0,0 +1,65 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_ADDCONTACT_H__
+#define M_ADDCONTACT_H__ 1
+
+typedef struct{
+ int handleType; //one of the HANDLE_ constants
+ HANDLE handle; //hDbEvent if acs.handleType==HANDLE_EVENT, hContact if acs.handleType==HANDLE_CONTACT, ignored if acs.handleType==HANDLE_SEARCHRESULT
+ const char *szProto; //ignored if acs.handleType!=HANDLE_SEARCHRESULT
+ PROTOSEARCHRESULT *psr; //ignored if acs.handleType!=HANDLE_SEARCHRESULT
+}ADDCONTACTSTRUCT;
+
+/*
+ Description: Open the add contact dialog, see notes
+
+ wParam=[ (WPARAM)hWndParent ]
+ lParam=(LPARAM)(ADDCONTACTSTRUCT*)&acs
+
+ Notes:
+
+ During 0.3.0.0 development (circa 2003/06/08)
+
+ An entire copy of the ADDCONTACTSTRUCT structure is made,
+ the PROTOSEARCHRESULT is also copied at psr->cbSize, all default
+ strings are copied (even if they're not needed/used)
+ if you pass a structure that is bigger than PROTOSEARCHRESULT
+ then do not use pointers in the newly defined area because
+ they will not be copied.
+
+ passing wParam==NULL will result in a dialog that is created modeless
+
+ Before the circa, a modal dialog was *always* created and
+ strings within PROTOSEARCHRESULT were not copied.
+
+*/
+
+#define HANDLE_SEARCHRESULT 0
+#define HANDLE_EVENT 1
+#define HANDLE_CONTACT 2
+#define MS_ADDCONTACT_SHOW "AddContact/Show"
+
+#endif // M_ADDCONTACT_H__
+
+
diff --git a/include/m_avatars.h b/include/m_avatars.h new file mode 100644 index 0000000000..9462da99b2 --- /dev/null +++ b/include/m_avatars.h @@ -0,0 +1,415 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2012 Miranda ICQ/IM 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.
+
+Avatar service
+
+- load and maintain a cache of contact avatars.
+- draw avatars to a given target device context
+- maintain per protocol fallback images
+
+The avatar service builds on top of Mirandas core bitmap loading service (MS_UTILS_LOADBITMAP).
+However, if imgdecoder.dll is installed in mirandas main or Plugins directory, it can be used
+to support PNG images. The avatar service loads 32bit PNG images and peforms alpha channel
+premultiplication so that these images can be rendered by using the Win32 AlphaBlend() API.
+
+The cache grows on demand only, that is, no avatars are PREloaded. An avatar is only loaded
+if a plugin requests this by using the MS_AV_GETAVATAR service. Since avatars may update
+asynchronously, the avatar iamge may not be ready when a plugin calls the service. In that
+case, an event (ME_AV_AVATARCHANGED) is fired when a contacts avatar changes. This event
+is also fired, when a contact avatar changes automatically.
+
+The service takes care about protocol capabilites (does not actively fetch avatars for
+protocols which do not report avatar capabilities via PF4_AVATARS or for protocols which
+have been disabled in the option dialog). It also does not actively fetch avatars for
+protocols which are in invisible status mode (may cause privacy issues and some protocols
+like MSN don't allow any outbound client communication when in invisible status mode)
+unless AF_FETCHALWAYS is set.
+
+- TODO
+- maintain recent avatars (store the last hashes to avoid re-fetching)
+- cache expiration, based on least recently used algorithm.
+
+(c) 2005 by Nightwish, silvercircle@gmail.com
+
+*/
+
+#ifndef _M_AVATARS_H
+#define _M_AVATARS_H
+
+#define AVS_BITMAP_VALID 1
+#define AVS_BITMAP_EXPIRED 2 // the bitmap has been expired from the cache. (unused, currently.
+#define AVS_HIDEONCLIST 4
+#define AVS_PREMULTIPLIED 8 // set in the dwFlags member of the struct avatarCacheEntry for 32 bit transparent
+ // images when loaded with imgdecoder. These images can be rendered transparently
+ // using the AlphaBlend() API with AC_SRC_ALPHA
+#define AVS_PROTOPIC 16 // picture is a protocol picture
+#define AVS_CUSTOMTRANSPBKG 32 // Bitmap was changed to set the background color transparent
+#define AVS_HASTRANSPARENCY 64 // Bitmap has at least one pixel transparent
+#define AVS_OWNAVATAR 128 // is own avatar entry
+#define AVS_NOTREADY 4096
+
+typedef struct avatarCacheEntryA {
+ DWORD cbSize; // set to sizeof(struct)
+ HANDLE hContact; // contacts handle, 0, if it is a protocol avatar
+ HBITMAP hbmPic; // bitmap handle of the picutre itself
+ DWORD dwFlags; // see above for flag values
+ LONG bmHeight, bmWidth; // bitmap dimensions
+ DWORD t_lastAccess; // last access time (currently unused, but plugins should still
+ // use it whenever they access the avatar. may be used in the future
+ // to implement cache expiration
+ LPVOID lpDIBSection; // unused field
+ char szFilename[MAX_PATH]; // filename of the avatar (absolute path)
+} AVATARCACHEENTRYA;
+
+#if MIRANDA_VER >= 0x0A00
+typedef struct avatarCacheEntry {
+ DWORD cbSize; // set to sizeof(struct)
+ HANDLE hContact; // contacts handle, 0, if it is a protocol avatar
+ HBITMAP hbmPic; // bitmap handle of the picutre itself
+ DWORD dwFlags; // see above for flag values
+ LONG bmHeight, bmWidth; // bitmap dimensions
+ DWORD t_lastAccess; // last access time (currently unused, but plugins should still
+ // use it whenever they access the avatar. may be used in the future
+ // to implement cache expiration
+ LPVOID lpDIBSection; // unused field
+ TCHAR szFilename[MAX_PATH]; // filename of the avatar (absolute path)
+} AVATARCACHEENTRY;
+#else
+ #define avatarCacheEntry avatarCacheEntryA
+ #define AVATARCACHEENTRY AVATARCACHEENTRYA
+#endif
+
+struct CacheNode {
+ struct CacheNode *pNextNode;
+ struct avatarCacheEntry ace;
+ BOOL loaded;
+ int mustLoad;
+ DWORD dwFlags;
+ int pa_format;
+};
+
+#define AVDRQ_FALLBACKPROTO 0x0001 // use the protocol picture as fallback (currently not used)
+#define AVDRQ_FAILIFNOTCACHED 0x0002 // don't create a cache entry if it doesn't already exist. (currently not working)
+#define AVDRQ_ROUNDEDCORNER 0x0004 // draw with rounded corners
+#define AVDRQ_DRAWBORDER 0x0008 // draw a border around the picture
+#define AVDRQ_PROTOPICT 0x0010 // draw a protocol picture (if available).
+#define AVDRQ_HIDEBORDERONTRANSPARENCY 0x0020 // hide border if bitmap has transparency
+#define AVDRQ_OWNPIC 0x0040 // draw own avatar (szProto is valid - use "" for global avatar)
+#define AVDRQ_RESPECTHIDDEN 0x0080 // don't draw images marked as hidden
+#define AVDRQ_DONTRESIZEIFSMALLER 0x0100 // don't resize images that are smaller then the draw area
+#define AVDRQ_FORCEFASTALPHA 0x0200 // force rendering with simple AlphaBlend (will use FI_Resample otherwise)
+#define AVDRQ_FORCEALPHA 0x0400 // force with simple AlphaBlend (may use StretchBlt otherwise)
+#define AVDRQ_AERO 0x0800 // draw on aero surface
+
+// request to draw a contacts picture. See MS_AV_DRAWAVATAR service description
+
+typedef struct _avatarDrawRequest {
+ DWORD cbSize; // set this to sizeof(AVATARDRAWREQUEST) - mandatory, service will return failure code if
+ // cbSize is wrong
+ HANDLE hContact; // the contact for which the avatar should be drawn. set it to 0 to draw a protocol picture
+ HDC hTargetDC; // target device context
+ RECT rcDraw; // target rectangle. The avatar will be centered within the rectangle and scaled to fit.
+ DWORD dwFlags; // flags (see above for valid bitflags)
+ DWORD dwReserved; // for future use
+ DWORD dwInternal; // don't use it
+ COLORREF clrBorder; // color for the border (used with AVDRQ_DRAWBORDER)
+ UCHAR radius; // radius (used with AVDRQ_ROUNDEDCORNER)
+ UCHAR alpha; // alpha value for semi-transparent avatars (valid values form 1 to 255, if it is set to 0
+ // the avatar won't be transparent.
+ char *szProto; // only used when AVDRQ_PROTOPICT or AVDRQ_OWNPIC is set
+} AVATARDRAWREQUEST;
+
+#define CACHE_BLOCKSIZE 20
+
+#define AVS_MODULE "AVS_Settings" // db settings module path
+#define PPICT_MODULE "AVS_ProtoPics" // protocol pictures are saved here
+
+// obtain the bitmap handle of the avatar for the given contact
+// wParam = (HANDLE)hContact
+// lParam = 0;
+// returns: pointer to a struct avatarCacheEntry *, NULL on failure
+// if it returns a failure, the avatar may be ready later and the caller may receive
+// a notification via ME_AV_AVATARCHANGED
+// DONT modify the contents of the returned data structure
+
+#define MS_AV_GETAVATARBITMAP "SV_Avatars/GetAvatar"
+
+// obtain a avatar cache entry for one of my own avatars
+// wParam = 0
+// lParam = (char *)szProto (protocol for which we need to obtain the own avatar information). Use "" to global
+// returns: pointer to a struct avatarCacheEntry *, NULL on failure
+// DONT modify the contents of the returned data structure
+
+#define MS_AV_GETMYAVATAR "SV_Avatars/GetMyAvatar"
+
+// protect the current contact picture from being overwritten by automatic
+// avatar updates. Actually, it only backups the contact picture filename
+// and will used the backuped version until the contact picture gets unlocked
+// again. So this service does not disable avatar updates, but it "fakes"
+// a locked contact picture to the users of the GetAvatar service.
+//
+// wParam = (HANDLE)hContact
+// lParam = 1 -> lock the avatar, lParam = 0 -> unlock
+
+#define MS_AV_PROTECTAVATAR "SV_Avatars/ProtectAvatar"
+
+// set (and optionally protect) a local contact picture for the given hContact
+//
+// wParam = (HANDLE)hContact
+// lParam = either a full picture filename or NULL. If lParam == NULL, the service
+// will open a file selection dialog.
+
+#define MS_AV_SETAVATAR "SV_Avatars/SetAvatar"
+
+#if defined(_UNICODE) && MIRANDA_VER >= 0x0A00
+#define MS_AV_SETAVATARW "SV_Avatars/SetAvatarW"
+#define MS_AV_SETAVATART MS_AV_SETAVATARW
+#else
+#define MS_AV_SETAVATART MS_AV_SETAVATAR
+#endif
+
+// set a local picture for the given protocol
+//
+// wParam = (char *) protocol name or NULL for all protocols
+// lParam = either a full picture filename or NULL. If lParam == NULL, the service
+// will open a file selection dialog. If lParam == "" the avatar will be removed
+
+#define MS_AV_SETMYAVATAR "SV_Avatars/SetMyAvatar"
+
+#if defined(_UNICODE) && MIRANDA_VER >= 0x0A00
+#define MS_AV_SETMYAVATARW "SV_Avatars/SetMyAvatarW"
+#define MS_AV_SETMYAVATART MS_AV_SETMYAVATARW
+#else
+#define MS_AV_SETMYAVATART MS_AV_SETMYAVATAR
+#endif
+
+// see if is possible to set the avatar for the expecified protocol
+//
+// wParam = (char *) protocol name
+// lParam = 0
+// return = 1 if can set, 0 if can't
+
+#define MS_AV_CANSETMYAVATAR "SV_Avatars/CanSetMyAvatar"
+
+// Call avatar option dialog for contact
+//
+// wParam = (HANDLE)hContact
+
+#define MS_AV_CONTACTOPTIONS "SV_Avatars/ContactOptions"
+
+// draw an avatar picture
+//
+// wParam = 0 (not used)
+// lParam = AVATARDRAWREQUEST *avdr
+// draw a contact picture to a destination device context. see description of
+// the AVATARDRAWREQUEST structure for more information on how to use this
+// service.
+// return value: 0 -> failure, avatar probably not available, or not ready. The drawing
+// service DOES schedule an avatar update so your plugin will be notified by the ME_AV_AVATARCHANGED
+// event when the requested avatar is ready for use.
+// 1 -> success. avatar was found and drawing should be ok.
+// -1 -> global avatar is incosistent
+
+#define MS_AV_DRAWAVATAR "SV_Avatars/Draw"
+
+// fired when a contacts avatar cached by avs changes
+// it includes changes made by the user
+// wParam = hContact
+// lParam = struct avatarCacheEntry *cacheEntry
+// the event CAN pass a NULL pointer in lParam which means that the avatar has changed,
+// but is no longer valid (happens, when a contact removes his avatar, for example).
+// DONT DESTROY the bitmap handle passed in the struct avatarCacheEntry *
+//
+// It is also possible that this event passes 0 as wParam (hContact), in which case,
+// a protocol picture (pseudo - avatar) has been changed.
+
+#define ME_AV_AVATARCHANGED "SV_Avatars/AvatarChanged"
+
+typedef struct _contactAvatarChangedNotificationA {
+ int cbSize; // sizeof()
+ HANDLE hContact; // this might have to be set by the caller too
+ int format; // PA_FORMAT_*
+ char filename[MAX_PATH]; // full path to filename which contains the avatar
+ char hash[128]; // avatar hash
+} CONTACTAVATARCHANGEDNOTIFICATIONA;
+
+#if MIRANDA_VER >= 0x0A00
+typedef struct _contactAvatarChangedNotification {
+ int cbSize; // sizeof()
+ HANDLE hContact; // this might have to be set by the caller too
+ int format; // PA_FORMAT_*
+ TCHAR filename[MAX_PATH]; // full path to filename which contains the avatar
+ TCHAR hash[128]; // avatar hash
+} CONTACTAVATARCHANGEDNOTIFICATION;
+#else
+#define CONTACTAVATARCHANGEDNOTIFICATION CONTACTAVATARCHANGEDNOTIFICATIONA
+#endif
+
+// fired when the contacts avatar is changed by the contact
+// wParam = hContact
+// lParam = struct CONTACTAVATARCHANGENOTIFICATION *cacn
+// the event CAN pass a NULL pointer in lParam which means that the contact deleted its avatar
+
+#define ME_AV_CONTACTAVATARCHANGED "SV_Avatars/ContactAvatarChanged"
+
+// fired when one of our own avatars was changed
+// wParam = (char *)szProto (protocol for which a new avatar was set)
+// lParam = AVATARCACHEENTRY *ace (new cache entry, NULL if the new avatar is not valid)
+
+#define ME_AV_MYAVATARCHANGED "SV_Avatars/MyAvatarChanged"
+
+// Service to be called by protocols to report an avatar has changed. Some avatar changes
+// can be detected automatically, but some not (by now only Skype ones)
+// wParam = (char *)szProto (protocol for which a new avatar was set)
+// lParam = 0
+
+#define MS_AV_REPORTMYAVATARCHANGED "SV_Avatars/ReportMyAvatarChanged"
+
+
+
+// Bitmap services //////////////////////////////////////////////////////////////////////
+
+// Load an image
+// wParam = NULL
+// lParam = filename
+#define MS_AV_LOADBITMAP32 "SV_Avatars/LoadBitmap32"
+
+// Save an HBITMAP to an image
+// wParam = HBITMAP
+// lParam = full path of filename
+#define MS_AV_SAVEBITMAP "SV_Avatars/SaveBitmap"
+#define MS_AV_SAVEBITMAPW "SV_Avatars/SaveBitmapW"
+
+#ifdef _UNICODE
+
+#define MS_AV_SAVEBITMAPT MS_AV_SAVEBITMAPW
+
+#else
+
+#define MS_AV_SAVEBITMAPT MS_AV_SAVEBITMAP
+
+#endif
+
+// Returns != 0 if can save that type of image, = 0 if cant
+// wParam = 0
+// lParam = PA_FORMAT_* // image format
+#define MS_AV_CANSAVEBITMAP "SV_Avatars/CanSaveBitmap"
+
+// Returns a copy of the bitmap with the size especified or the original bitmap if nothing has to be changed
+// wParam = ResizeBitmap *
+// lParam = NULL
+#define MS_AV_RESIZEBITMAP "SV_Avatars/ResizeBitmap"
+
+/*
+* flags for internal use ONLY
+*/
+
+#define MC_ISMASTERCONTACT 0x01
+#define MC_ISSUBCONTACT 0x02
+#define AVH_MUSTNOTIFY 0x04 // node->dwFlags (loader thread must notify avatar history about change/delete event)
+#define AVS_DELETENODEFOREVER 0x08
+
+
+
+// Protocol services //////////////////////////////////////////////////////////////////////
+
+/*
+wParam=0
+lParam=(const char *)Avatar file name or NULL to remove the avatar
+return=0 for sucess
+*/
+#define PS_SETMYAVATAR "/SetMyAvatar"
+
+/*
+wParam=(char *)Buffer to file name
+lParam=(int)Buffer size
+return=0 for sucess
+*/
+#define PS_GETMYAVATAR "/GetMyAvatar"
+
+#ifdef _UNICODE
+
+#define PS_SETMYAVATARW "/SetMyAvatarW"
+#define PS_GETMYAVATARW "/GetMyAvatarW"
+
+#define PS_GETMYAVATART PS_GETMYAVATARW
+#define PS_SETMYAVATART PS_SETMYAVATARW
+
+#else
+
+#define PS_GETMYAVATART PS_GETMYAVATAR
+#define PS_SETMYAVATART PS_SETMYAVATAR
+
+#endif
+
+#define PIP_NONE 0
+#define PIP_SQUARE 1
+
+// Avatar image max size
+// lParam = (POINT*) maxSize (use -1 for no max)
+// return 0 for success
+#define AF_MAXSIZE 1
+
+// Avatar image proportion
+// lParam = 0
+// return or of PIP_*
+#define AF_PROPORTION 2
+
+// Avatar format supported when setting avatars
+// lParam = PA_FORMAT_*
+// return = 1 (supported) or 0 (not supported)
+#define AF_FORMATSUPPORTED 3
+
+// Avatars are enabled for protocol?
+// lParam = 0
+// return = 1 (avatars ready) or 0 (disabled)
+#define AF_ENABLED 4
+
+// This protocol don't need delays for fetching contact avatars
+// lParam = 0
+// return = 1 (don't need) or 0 (need)
+#define AF_DONTNEEDDELAYS 5
+
+// Avatar file max size
+// return size in bytes (0 for no limit)
+#define AF_MAXFILESIZE 6
+
+// The amount of time avs should wait after a download avatar failed for a contact
+// lParam = 0
+// return = the time, in ms
+#define AF_DELAYAFTERFAIL 7
+
+// Fetching avatars is always possible and allowed
+// lParam = 0
+// return = 1 (always) or 0 (depending on our or contacts status mode)
+#define AF_FETCHALWAYS 8
+
+
+/*
+Query avatar caps for a protocol
+wParam = One of AF_*
+lParam = See descr of each AF_*
+return = See descr of each AF_*. Return 0 by default
+*/
+#define PS_GETAVATARCAPS "/GetAvatarCaps"
+
+#endif
diff --git a/include/m_awaymsg.h b/include/m_awaymsg.h new file mode 100644 index 0000000000..363b12c395 --- /dev/null +++ b/include/m_awaymsg.h @@ -0,0 +1,48 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_AWAYMSG_H__
+#define M_AWAYMSG_H__ 1
+
+//show the away/na/etc message for a contact v0.1.0.1+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=0
+//returns 0 on success or nonzero on failure
+//returns immediately, without waiting for the message to retrieve
+#define MS_AWAYMSG_SHOWAWAYMSG "SRAway/GetMessage"
+
+//returns the default status message for a status
+//wParam=(int)status
+//lParam=(LPARAM)(char*)szProto
+//returns status msg. Remember to free the return value
+#define MS_AWAYMSG_GETSTATUSMSG "SRAway/GetStatusMessage"
+#define MS_AWAYMSG_GETSTATUSMSGW "SRAway/GetStatusMessageW"
+
+#ifdef _UNICODE
+#define MS_AWAYMSG_GETSTATUSMSGT MS_AWAYMSG_GETSTATUSMSGW
+#else
+#define MS_AWAYMSG_GETSTATUSMSGT MS_AWAYMSG_GETSTATUSMSG
+#endif
+
+#endif // M_AWAYMSG_H__
+
diff --git a/include/m_button.h b/include/m_button.h new file mode 100644 index 0000000000..3021c57f61 --- /dev/null +++ b/include/m_button.h @@ -0,0 +1,70 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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.
+*/
+// Added in 0.3.0.0+
+
+#ifndef M_BUTTON_H__
+#define M_BUTTON_H__ 1
+
+#define MIRANDABUTTONCLASS _T( "MButtonClass" ) // Class of the control
+
+
+// Sets whether a dropdown arrow is used
+// wParam = TRUE/FALSE turns arrow on or off
+// lParam = not used
+// Usage: SendMessage(hwndbutton,BUTTONSETARROW,1,0);
+// Only works on MButtonClass buttons
+#define BUTTONSETARROW (WM_USER+1)
+
+// Sets whether the button is a default button
+// wParam = TRUE/FALSE default on/off
+// lParam = not used
+// Usage: SendMessage(hwndbutton,BUTTONSETDEFAULT,1,0);
+// Only works on MButtonClass buttons
+#define BUTTONSETDEFAULT (WM_USER+2)
+
+// Sets the button as a push button
+// wParam = lParam = not used
+// Usage: SendMessage(hwndbutton,BUTTONSETASPUSHBTN,0,0);
+// Only works on MButtonClass buttons
+#define BUTTONSETASPUSHBTN (WM_USER+3)
+
+// Sets the button type as a flat button without borders v0.3.3+
+// Usage: SendMessage(hwndbutton,BUTTONSETASFLATBTN,0,0);
+// Only works on MButtonClass buttons
+#define BUTTONSETASFLATBTN (WM_USER+4)
+
+// Sets a tooltip for the button v0.3.3+
+// wParam = (WPARAM)(char *)szTip
+// lParam = not used
+// Usage: SendMessage(hwndButton,BUTTONADDTOOLTIP,(WPARAM)"My Tip",BATF_* flags);
+#define BATF_UNICODE 1
+#if defined( _UNICODE )
+ #define BATF_TCHAR BATF_UNICODE
+#else
+ #define BATF_TCHAR 0
+#endif
+
+#define BUTTONADDTOOLTIP (WM_USER+5)
+
+#endif // M_BUTTON_H__
+
diff --git a/include/m_chat.h b/include/m_chat.h new file mode 100644 index 0000000000..efa21e802c --- /dev/null +++ b/include/m_chat.h @@ -0,0 +1,685 @@ +/*
+Chat module plugin for Miranda IM
+
+Copyright (C) 2003 Jörgen Persson
+
+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.
+*/
+
+
+
+/*
+ This plugin provides event driven chat rooms for protocols that wish to use it.
+ It is built for IRC, which I also develop and is naturally biased towards IRC,
+ but it should work very well with other protocols too. I will try to explain as
+ careful as possible in this document how to use chat.dll
+
+ -- General guidelines --
+
+ There is ONE rule a protocol MUST follow to use this:
+
+ 1. Do NOT touch hContacts that has a byte "ChatRoom" set to ANYTHING other than 0! (Could be 1, 2, 3, ...)
+ This is because chat.dll adds contacts to the clist using the protocol name
+ supplied by the protocol. But this will naturally not work well if the
+ protocol also tampers with the contacts. The value of the BYTE indicates which type of
+ window/contact it is (see the GCW_* flags below). There is two exceptions to this rule:
+
+ * You should continue to handle the right click menu items of these
+ contacts as usual, by hooking the menu prebuild hook etc. Chat.dll can not
+ handle this in an efficient manner!
+
+ * You should also handle when the user deletes the contact/room from the
+ contact list, as the protocol will then most likely have to send some message
+ to the server that the user has left the room.
+
+ NOTE. Chat keeps its own copies of strings passed.
+
+
+ * * Example of implementing this rule * *:
+ * * This is a code snippet that is common in protocols * *:
+
+
+
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ while (hContact)
+ {
+ szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ if (szProto != NULL && !lstrcmpi(szProto, PROTONAME))
+ {
+ ... do something with the hContact here;
+ }
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ }
+
+
+
+ * * You should do this instead * *:
+
+
+
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ while (hContact)
+ {
+ szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ if (szProto != NULL && !lstrcmpi(szProto, PROTONAME))
+ {
+ if (DBGetContactSettingByte(hContact, PROTONAME, "ChatRoom", 0) == 0)
+ {
+ ... do something with the hContact here;
+ }
+ }
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ }
+
+
+ There is not more to it than that! To recapitulate: do NOT touch contacts where the
+ BYTE "ChatRoom" is set to anything other than 0,
+
+
+
+
+
+
+ OK, enough of the precautions, HOW DO YOU USE CHAT? In short you need to do FOUR things:
+
+ 1. REGISTER your protocol with Chat
+ Only registered protocols can use Chat
+
+ 2. CREATE SESSIONS when your protocol are joining a group chat room. (One per room joined)
+ These sessions will be put on the contact-list and are managed totally by chat.
+ This is the reason you must obey to the "precautions" I mentioned above.
+ Do not tamper directly with Chat's hContacts. Use Services provided by Chat instead.
+
+ 3. SEND EVENTS to the sessions created in #3.
+ These events reflect users joining/leaving/speaking etc.
+
+ 4. DESTROY SESSIONS when the user leaves the room (ie the session is not needed anymore).
+
+ These four points are implemented in three services: MS_GC_REGISTER, MS_GC_NEWSESSION
+ and MS_GC_EVENT.
+*/
+
+
+//------------------------- SERVICES ------------------------
+/*
+ Step 1. -- REGISTER with Chat --
+
+ The first thing that a protocol need to do is register with Chat. This is best done
+ when ALL modules has loaded (ME_SYSTEM_MODULESLOADED). The registration is
+ needed to make sure that the protocol obey rule 1 mentioned above, but also to
+ set protocol specific preferences.
+
+ * Use MS_GC_REGISTER like this: CallService(MS_GC_REGISTER, 0, (LPARAM)(GCREGISTER *) &gcr;
+
+ * returns 0 on success or error code on failure.
+*/
+
+// Flags
+#define GC_BOLD 0x0001 //enable the 'bold' button
+#define GC_ITALICS 0x0002 //enable the 'italics' button
+#define GC_UNDERLINE 0x0004 //enable the 'underline' button
+#define GC_COLOR 0x0008 //enable the 'foreground color' button
+#define GC_BKGCOLOR 0x0010 //enable the 'background color' button
+#define GC_ACKMSG 0x0020 //the protocol must acknowlege messages sent
+#define GC_TYPNOTIF 0x0040 //NOT SUPPORTED YET! Enable typing notifications.
+#define GC_CHANMGR 0x0080 //enable the 'channel settings' button
+#define GC_SINGLEFORMAT 0x0100 //the protocol supports only 1 formatting per message
+#define GC_FONTSIZE 0x0200 //enable font size selection
+
+#define GC_UNICODE 0x01000 //NOT SUPPORTED YET! Enable unicode (if chat supports it),
+ //Pass UNICODE instead of ASCII. Note that
+ //registration will fail if the unicode version of chat is not installed
+#if defined( _UNICODE )
+ #define GC_TCHAR GC_UNICODE
+#else
+ #define GC_TCHAR 0
+#endif
+
+// Error messages
+#define GC_REGISTER_WRONGVER 1 //You appear to be using the wrong version of this API. Registration failed.
+#define GC_REGISTER_ERROR 2 //An internal error occurred. Registration failed.
+#define GC_REGISTER_NOUNICODE 3 //MS_GC_REGISTER returns this error if the Unicode version of chat
+ //is not installed and GC_UNICODE is set. Registration failed
+
+// GCREGISTER struct
+typedef struct {
+ int cbSize; //Set to sizeof(GCREGISTER);
+ DWORD dwFlags; //Use GC_* flags above to indicate features supported
+ const char* pszModule; //This MUST be the protocol name as registered with Miranda IM
+ union {
+ const char* pszModuleDispName; //This is the protocol's real name as it will be displayed to the user
+ const TCHAR* ptszModuleDispName; // used if GC_TCHAR flag is passed
+ };
+ int iMaxText; //Max message length the protocol supports. Will limit the typing area input. 0 = no limit
+ int nColors; //Number of colors in the colorchooser menu for the color buttons. Max = 100
+ COLORREF* pColors; //pointer to the first item in a static COLORREF array containing the colors
+ //that should be showed in the colorchooser menu.
+ //ie: COLORREF crCols[nColors];
+ // pColors = &crCols[0];
+}
+ GCREGISTER;
+
+#define MS_GC_REGISTER "GChat/Register"
+
+/*
+ Step 2. -- CREATE a new SESSION --
+
+ Create a new session (chat room) and set various settings related to it.
+ The chat room will not be shown to the user until the 'set up' phase is
+ completed and SESSION_INITDONE is sent. See the MS_GC_EVENT for that.
+
+ * Use MS_GC_NEWSESSION like this: CallService(MS_GC_NEWSESSION, 0, (LPARAM)(GCSESSION *) &gcr;
+
+ * returns 0 on success or error code on failure
+*/
+
+
+// Session type
+#define GCW_CHATROOM 1 // the session is a dedicated multi user chat room. ex "IRC channels".
+ // A hContact will be added for the session
+#define GCW_SERVER 2 // the session is used as a network console. ex "IRC server window"
+ // A hContact will be added for the session, but it will default to being hidden (on the CList)
+#define GCW_PRIVMESS 3 // NOT SUPPORTED YET! the session is a 1 to 1 session, but with additional
+ // support for adding more users etc. ex "MSN session".
+
+
+
+// Error messages
+#define GC_NEWSESSION_WRONGVER 1 //You appear to be using the wrong version of this API.
+#define GC_NEWSESSION_ERROR 2 //An internal error occurred.
+
+
+// GCREGISTER structure
+typedef struct {
+ int cbSize; //Set to sizeof(GCSESSION);
+ int iType; //Use one of the GCW_* flags above to set the type of session
+ const char *pszModule; //The name of the protocol owning the session (the same as pszModule when you register)
+ union {
+ const char* pszName; //The name of the session as it will be displayed to the user
+ const TCHAR* ptszName;
+ };
+ union {
+ const char* pszID; //The unique identifier for the session.
+ const TCHAR* ptszID;
+ };
+ union {
+ const char* pszStatusbarText; //Optional text to set in the statusbar of the chat room window, or NULL.
+ const TCHAR* ptszStatusbarText;
+ };
+ DWORD dwFlags;
+ DWORD dwItemData; //Set user defined data for this session. Retrieve it by using the GC_EVENT_GETITEMDATA event
+ } GCSESSION;
+#define MS_GC_NEWSESSION "GChat/NewChat"
+
+
+
+
+
+
+/*
+ Step 3 -- SEND an EVENT --
+
+ Events is what drives Chat! After having created the session in Step 2
+ it is time to make it work for real. Follow these guidelines:
+
+ 1. Start off by telling Chat what possible statuses a user can have (in the nicklist)
+ by sending GC_EVENT_ADDGROUP as many times as needed. Also supply an icon
+ to go with this status. Ex "Voice status" on IRC
+
+ 2.Then send "JOIN" events (GC_EVENT_JOIN) to populate the user list.
+ You will need to send one event per user that should be added. As long as
+ SESSION_INITDONE has not been sent these events will not show up in the log.
+
+ 3.When you are done with filling the user list it is a good time to end
+ the set up phase and make the window visible by calling GC_EVENT_CONTROL event
+ with wParam = SESSION_INITDONE.
+
+ 4.You will also want to send a GC_EVENT_CONTROL with wParam = SESSION_ONLINE to
+ make the statusbar and the CList item go to "online" status
+
+ You have now set up the session and made it active. A CList hContact has been added
+ to the contact list and a chat room window is associated to the session. Send EVENTS to
+ Chat users speaking, users joining and so on. See below for full
+ list of what events are possible.
+
+ IMPORTANT: For sending events you'll use the GCEVENT and GCDEST structures. A GCDEST
+ structure pointer is passed inside GCEVENT and it tells Chat what event type it is
+ and what session it is related to. The GCDEST structure and its members are ALWAYS
+ used (but the members can be NULL in some occasions). Depending on what type of event
+ you are sending, the members of GCEVENT have different usage. Each event and how to
+ use the members are discussed below. The "bAddToLog" and "time" members are always valid
+ and always mean the same. bAddToLog = TRUE means that the event is added to the disk log
+ (at least when this makes sense). This can be used by Jabber for instance, when
+ it needs to add channel history to the window, but without logging to disk.
+ The "time" member is the timestamp of the event.(Tip. use the function time(NULL)
+ to set the current time)
+
+ NOTE. It is possible to send formatted text (bold, italics, underlined, foreground color
+ and background color) to Chat by using the following identifiers in the text (pszText):
+
+ %cXX - set the foreground color ( XX is the zero based decimal index of the color registered in MS_GC_REGISTER.. Always use two digits )
+ %C - reset foreground color to default
+ %fXX - set the background color ( XX is the zero based decimal index of the color registered in MS_GC_REGISTER.. Always use two digits )
+ %F - reset the background color to default
+ %b - enable bold
+ %B - disable bold
+ %u - enable underlined
+ %U - disable underlined
+ %i - enable italics
+ %I - disable italics
+ %r - reset all to default
+ %% - escape the formatting. Translates to %
+
+ IMPORTANT. If you have specified GC_COLOR or GC_BKGCOLOR when you registered you can expect to
+ get these identifiers in the text you receive from Chat as well. Make sure % is ALWAYS
+ translated to %% in text you send to Chat to avoid accidental formatting.
+ NOTE. You will not get %cRRRGGGBBB back, instead you will get the index of the colour as
+ registered with GC_REGISTER. Eg %c3 (the fourth colour of your index)
+
+ * Use MS_GC_EVENT like this: CallService(MS_GC_EVENT, 0, (LPARAM)(GCEVENT *) &gce;
+
+ * returns 0 on success or error code on failure
+
+*/
+
+// * List of possible events to send to Chat. Unlisted members are not valid *
+// * for the event. Listed members are mandatory unless otherwise specified *
+
+
+// GC_EVENT_JOIN - "<pszNick> has joined" (A user is joining the session)
+// pszNick - Display name
+// pszUID - Unique identifier of the user
+// pszStatus - Which status does the user have. Should be a status previously
+// registered with GC_EVENT_ADDGROUP. Ex "Voice" in IRC
+// bIsMe - Set to TRUE if it is the Miranda user
+// Chat needs to know which user in the userlist that is "self"
+// It cannot highlight a message containing the "own" nick without this info
+// NOTE. if time == NULL, then the event will not be shown in the message log
+#define GC_EVENT_JOIN 0x0001
+
+// GC_EVENT_PART - "<pszNick> has left: <pszText>" (A user left the session)
+// pszNick - Display name
+// pszUID - Unique identifier
+// pszText - Optional part message, can be NULL
+#define GC_EVENT_PART 0x0002
+
+// GC_EVENT_QUIT - "<pszNick> disconnected: pszText" (A user disconnected from the network)
+// pszID(in GCDEST) - Should be NULL as a disconnect event is global.
+// pszNick - Display name
+// pszUID - Unique identifier
+// pszText - Optional disconnect message, can be NULL
+#define GC_EVENT_QUIT 0x0004
+
+// GC_EVENT_KICK - "<pszStatus> kicked <pszNick>: <pszText>" (A user is kicking another user from the room)
+// pszNick - Display name of the one being being kicked
+// pszUID - Unique identifier of the one being kicked
+// pszStatus - Name of user who is doing the kicking
+// pszText - Optional kick message, can be NULL
+#define GC_EVENT_KICK 0x0008
+
+// GC_EVENT_NICK - "<pszNick> is now known as <pszText>" (A user changed his name)
+// NOTE, see GC_EVENT_CHUID also
+// pszID(in GCDEST) - Should be NULL as a nick change event is global.
+// pszNick - Old display name
+// pszUID - Unique identifier
+// pszText - New display name of the user. Color codes are not valid
+#define GC_EVENT_NICK 0x0010
+
+// GC_EVENT_NOTICE - "Notice from <pszNick>: <pszText>" (An IRC type notice)
+// pszID(in GCDEST) - Should be NULL to send to the active window
+// pszNick - Display name
+// pszUID - Unique identifier
+// pszText - Notice text
+#define GC_EVENT_NOTICE 0x0020
+
+// GC_EVENT_MESSAGE - "<pszNick>: <pszText> (A user is speaking)
+// pszNick - Display name
+// pszUID - Unique identifier
+// bIsMe - Set to TRUE if it is the Miranda user
+// pszText - Message text.
+#define GC_EVENT_MESSAGE 0x0040
+
+// GC_EVENT_TOPIC - "Topic is <pszText> (Set by: <pszNick>" (The room topic was changed/set)
+// pszNick - Optional display name of who set the topic, can be NULL
+// pszUID - Optional unique identifier of who set the topic, can be NULL
+// pszText - Topic text
+#define GC_EVENT_TOPIC 0x0080
+
+// GC_EVENT_INFORMATION (Informational text) Ex a server response to a /WHO command in IRC
+// pszID(in GCDEST) - NULL to send to the active window
+// pszText - Information text
+#define GC_EVENT_INFORMATION 0x0100
+
+// GC_EVENT_ACTION - "<pszNick> <pszText>" (An IRC Style action event)
+// pszNick - Display name
+// pszUID - Unique identifier
+// bIsMe - Set to TRUE if it is the Miranda user
+// pszText - Message text.
+#define GC_EVENT_ACTION 0x0200
+
+// GC_EVENT_ADDSTATUS - "<pszText> enables '<pszStatus>' for <pszNick>" (A status change has occured for a user)
+// NOTE. Status changes are cumulative. The user will show in the nicklist with the highest status received.
+// Ex, IRC users can have "Op" and "Voice" statuses simultaneously but s/he will be displayed as "Op"
+// pszNick - Display name of the one who receives a new status
+// pszUID - Unique identifier of the one who receives a new status
+// pszText - The display name of the one who is setting the status. Color codes are not valid
+// pszStatus - The status. Should be a status previously
+// registered with GC_EVENT_ADDGROUP. Ex "Voice" in IRC
+#define GC_EVENT_ADDSTATUS 0x0400
+
+// GC_EVENT_REMOVESTATUS - "<pszText> disables '<pszStatus>' for <pszNick>" (A status change has occured for a user)
+// NOTE. Status changes are cumulative. The user will show in the nicklist with the highest status received.
+// Ex, IRC users can have "Op" and "Voice" statuses simultaneously but s/he will be displayed as "Op"
+// pszNick - Display name of the one who got a status mode disabled
+// pszUID - Unique identifier of the one who got a status mode disabled
+// pszText - The display name of the one disabling the status. Color codes are not valid
+// pszStatus - The status. Should be a status previously
+// registered with GC_EVENT_ADDGROUP. Ex "Voice" in IRC
+#define GC_EVENT_REMOVESTATUS 0x0800
+
+// GC_EVENT_CHUID - not shown in the log (Change the unique identifier of a contact)
+// pszID(in GCDEST) - Should be NULL as a unique id's are global.
+// pszUID - The current unique identifier
+// pszText - The new unique identifier. Color codes are not valid
+#define GC_EVENT_CHUID 0x1000
+
+// GC_EVENT_CHANGESESSIONAME - not shown in the log (Change the display name of a session)
+// pszText - The new name. Color codes are not valid
+#define GC_EVENT_CHANGESESSIONAME 0x1001
+
+// GC_EVENT_ADDGROUP - not shown in the log (Add a possible status mode to the nicklist, ex IRC uses "Op", "Voice", "Normal" etc )
+// NOTE. When adding several statuses, start with the highest status
+// pszStatus - The new group name
+// dwItemData - Optional HICON handle to a 10x10 icon. Set to NULL to use the built in icons.
+#define GC_EVENT_ADDGROUP 0x1002
+
+// GC_EVENT_SETITEMDATA & GC_EVENT_SETITEMDATA - not shown in the log (Get/Set the user defined data of a session)
+// dwItemData - The itemdata to set or get
+#define GC_EVENT_SETITEMDATA 0x1003
+#define GC_EVENT_GETITEMDATA 0x1004
+
+// GC_EVENT_SETSBTEXT - not shown in the log (Set the text of the statusbar for a chat room window)
+// pszText - Statusbar text. Color codes are not valid
+#define GC_EVENT_SETSBTEXT 0x1006
+
+// GC_EVENT_ACK - not shown in the log (Acknowledge a outgoing message, when GC_ACKMSG is set
+#define GC_EVENT_ACK 0x1007
+
+// GC_EVENT_SENDMESSAGE - not shown in the log ("Fake" a message from a chat room as if the user had typed it). Used by IRC to broadcast /AME and /AMSG messages
+// pszText - The text
+#define GC_EVENT_SENDMESSAGE 0x1008
+
+// GC_EVENT_SETSTATUSEX - not shown in the log (Space or tab delimited list of pszUID's to indicate as away).
+// Used by IRC to mark users as away in the nicklist. If UIDs can contain spaces, use tabs
+// pszText - Space or tab delimited list of pszUID's
+
+#define GC_SSE_ONLYLISTED 0x0001 // processes only listed contacts, resets all contacts otherwise
+#define GC_SSE_ONLINE 0x0002 // displays a contact online, otherwise away
+#define GC_SSE_TABDELIMITED 0x0004 // use tabs as delimiters
+
+#define GC_EVENT_SETSTATUSEX 0x1009
+
+// GC_EVENT_SETCONTACTSTATUS - sets status icon for contact
+// pszUID - Unique identifier of the one who receives a new status
+// dwItemData - (DWORD)ID_STATUS_* or zero to remove status icon
+#define GC_EVENT_SETCONTACTSTATUS 0x100A
+
+// GC_EVENT_CONTROL - not shown in the log (Control window associated to a session and the session itself)
+// NOTE 1: No members of GCEVENT are used, send one of the below flags in wParam instead,
+// Ex CallService(GC_EVENT_CONTROL, SESSION_INITDONE, (LPARAM)&gce);
+// NOTE 2: The first four control events are the only ones you should use most likely!
+// The ones below them are used by IRC to join channels hidden or maximized and show the server window from the system menu.
+// The SESSION_VISIBLE, SESSION_HIDDEN, SESSION_MAXIMIZE and SESSION_MINIMIZE events CAN replace SESSION_INITDONE but I urge you not to
+// do that as it will override any settings the user has made in the Chat options
+// NOTE 3: If pszID (of GCDEST) = NULL then this message will be broadcasted to all sessions, which can be usefule for terminating
+// all sessions when the protocol was disconnected
+#define SESSION_INITDONE 1 //send this when the session is fully set up (all users have ben added to the nicklist)
+#define SESSION_TERMINATE 7 //send to terminate a session and close the window associated with it
+#define SESSION_OFFLINE 8 //send to set the session as "online" (hContact is set to Online etc)
+#define SESSION_ONLINE 9 //send to set the session as "offline" (hContact is set to Offline etc)
+//------------
+#define WINDOW_VISIBLE 2 //make the room window visible
+#define WINDOW_HIDDEN 3 //close the room window. Session is not terminated.
+#define WINDOW_MAXIMIZE 4 //make the room window maximized
+#define WINDOW_MINIMIZE 5 //make the room window minimized
+#define WINDOW_CLEARLOG 6 //clear the log of the room window
+
+#define GC_EVENT_CONTROL 0x1005
+
+// Error messages
+#define GC_EVENT_WRONGVER 1 //You appear to be using the wrong version of this API.
+#define GC_EVENT_ERROR 2 //An internal error occurred.
+
+// The GCDEST structure. It is passed to Chat inside GCEVENT.
+typedef struct {
+ char* pszModule; //Name of the protocol (same as you registered with)
+ union {
+ char* pszID; //Unique identifier of the session, or NULL to broadcast to all sessions as specified above
+ TCHAR* ptszID;
+ };
+ int iType; //Use GC_EVENT_* as defined above. Only one event per service call.
+} GCDEST;
+
+
+// The GCEVENT structure
+typedef struct {
+ int cbSize; // Set to sizeof(GCEVENT);
+ GCDEST* pDest; // pointer to a GCDEST structure which specifies the session to receive the event
+ union {
+ const char *pszText; // usage depends on type of event, max 2048 characters
+ const TCHAR *ptszText;
+ };
+ union {
+ const char* pszNick; // usage depends on type of event
+ const TCHAR* ptszNick;
+ };
+ union {
+ const char* pszUID; // usage depends on type of event, Do NOT use spaces for unique user identifiers.
+ const TCHAR* ptszUID;
+ };
+ union {
+ const char* pszStatus; // usage depends on type of event
+ const TCHAR* ptszStatus;
+ };
+ union {
+ const char* pszUserInfo; // Additional user information that is displayed after the nickname.
+ const TCHAR* ptszUserInfo;
+ };
+ // IRC use it to display a hostmask for JOIN, PART (and more) events.
+ BOOL bIsMe; // Is this event from the Miranda user?
+ DWORD dwFlags; // event flags: GCEF_ADDTOLOG, GC_UNICODE
+
+ // FALSE any other time than when initializing the window (before sending SESSION_INITDONE)
+ DWORD_PTR dwItemData; // User specified data.
+ DWORD time; // Timestamp of the event
+}
+ GCEVENT;
+
+#define MS_GC_EVENT "GChat/NewEvent"
+
+#define GCEF_ADDTOLOG 0x0001
+
+// OK! That was about everything that you need to know about for operating Chat in a basic way.
+// There are however some more things you will need to know about. Some you may use and some you may not need,
+
+/*
+ -- GETTING info about a SESSION or session data --
+
+ Use this service to get information on different aspects of the sessions that are registered with Chat.
+
+ * Use MS_GC_GETINFO like this: CallService(MS_GC_GETSESSIONCOUNT, 0, (LPARAM)(char *) pszModule);
+
+ * returns -1 on failure and the sessioncount on success
+*/
+
+#define MS_GC_GETSESSIONCOUNT "GChat/GetCount"
+
+/*
+ -- GETTING info about a SESSION or session data --
+
+ Use this service to get information on different aspects of the sessions that are registered with Chat.
+
+ * Use MS_GC_GETINFO like this: CallService(MS_GC_GETINFO, 0, (LPARAM)(GC_INFO *) &gci;
+
+ * returns 0 on success or error code on failure
+*/
+
+// Flags
+#define BYINDEX 0x0001 // iItem is valid and should contain the index of the session to get
+#define BYID 0x0002 // pszID is valid and should contain the ID of the session to get. This is the default if no
+#define HCONTACT 0x0004 // hContact is valid
+#define DATA 0x0008 // wItemData is valid
+#define ID 0x0010 // pszID is valid.
+#define NAME 0x0020 // pszName is valid
+#define TYPE 0x0040 // iType is valid
+#define COUNT 0x0080 // iCount is valid
+#define USERS 0x0100 // pszUsers is valid
+
+
+// The GC_INFO structure
+typedef struct {
+ DWORD Flags; // use a combination of the above flags
+ int iItem; // session type (GCW_*)
+ int iType; // session type (GCW_*)
+ char* pszModule; // the module name as registered in MS_GC_REGISTER
+ TCHAR* pszID; // unique ID of the session
+ TCHAR* pszName; // display name of the session
+ DWORD_PTR dwItemData; // user specified data.
+ int iCount; // count of users in the nicklist
+ char* pszUsers; // space separated string containing the UID's of the users in the user list.
+ // NOTE. Use Mirandas mmi_free() on the returned string.
+ HANDLE hContact; // hContact for the session (can be NULL)
+}
+ GC_INFO;
+
+#define MS_GC_GETINFO "GChat/GetInfo"
+
+//------------------------- HOOKS ------------------------
+/*
+ -- user interaction --
+ Hook this to receive notifications about when user take actions in a chat room window.
+ Check for the below flags to find out what type of user interaction it is. See the
+ to find out which members of GCHOOK that are valid.
+
+ * wParam=0
+ * lParam=(LPARAM)(GCEVENT *)pgch
+
+ * Returning nonzero from your hook will stop other hooks from being called.
+*/
+#define GC_USER_MESSAGE 1 // user sent a message, with \n delimiting lines, pszText contains the text.
+#define GC_USER_CHANMGR 2 // user clicked the settings button in a chat room
+#define GC_USER_LOGMENU 3 // user has selected a message log menu item, dwData is valid. See ME_GC_BUILDMENU
+#define GC_USER_NICKLISTMENU 4 // user has selected a userlist menu item, valid members: dwData. See ME_GC_BUILDMENU
+#define GC_USER_TYPNOTIFY 5 // NOT IMPLEMENTED YET! user is typing
+#define GC_USER_PRIVMESS 6 // user requests to send a private message to a user. pszUID is valid
+#define GC_USER_LEAVE 8 // user requests to leave the session
+#define GC_USER_CLOSEWND 9 // user closed the window (this is usually not an indication that the protocol
+ // should take action, but MSN may want to terminate the session here)
+#define GC_SESSION_TERMINATE 7 // the session is about to be terminated, the "user defined data" is passed in dwData, which can be good free'ing any allocated memory.
+#define ME_GC_EVENT "GChat/OutgoingEvent"
+
+typedef struct {
+ GCDEST* pDest; // pointer to a GCDEST structure which specifies from which session the hook was triggered
+ union {
+ char* pszText; // usage depends on type of event
+ TCHAR* ptszText;
+ };
+ union {
+ char* pszUID; // unique identifier, usage depends on type of event
+ TCHAR* ptszUID;
+ };
+ DWORD_PTR dwData; // user defined data, usage depends on type of event
+}
+ GCHOOK;
+
+/*
+ -- Build the pop up menus --
+ The user wants to show a right click (popup) menu and your protocol should tell what
+ items should be added to the menu. You should create a static array of struct gc_item's.
+ When you get this notification you should set "nItems" to the number of gc_item's
+ you want to show on the user's popup menu and then set the "Item" member to point to that array.
+
+ * wParam=0
+ * lParam=(LPARAM)(GCMENUITEM *)gcmi
+
+ Returning nonzero from your hook will stop other hooks from being called.
+
+*/
+
+// type of item to add to the popup menu
+#define MENU_NEWPOPUP 1 // add submenu
+#define MENU_POPUPITEM 2 // add item to current submenu
+#define MENU_POPUPSEPARATOR 3 // add separator to current submenu
+#define MENU_SEPARATOR 4 // add separator to menu
+#define MENU_ITEM 5 // add item
+
+// Added in Miranda IM 0.8.0.6+
+#define MENU_POPUPCHECK 6 // add checked item to current submenu
+#define MENU_CHECK 7 // add checked item
+#define MENU_POPUPHMENU 8 // add custom submenu to current submenu, use dwID to specify HMENU
+#define MENU_HMENU 9 // add custom submenu, use dwID to specify HMENU
+
+// type of menu that is being requested
+#define MENU_ON_LOG 1 // pop up menu on the message log
+#define MENU_ON_NICKLIST 2 // pop up menu on the user list
+
+// contains info on a menuitem to be added
+struct gc_item {
+ TCHAR* pszDesc; // Textual description of the menu item to add
+ DWORD dwID; // when/if the user selects this menu item this
+ // value will be returned via the above hook, GC_USER_LOGMENU
+ // or GC_USER_NICKLISTMENU. Must not be 0 and must be unique.
+ int uType; // What kind of menu item is it? Use MENU_* flags above
+ BOOL bDisabled; // should the menu item be shown as disabled
+};
+
+typedef struct {
+ char * pszModule; // Contains the protocol name, do NOT change.
+ TCHAR* pszID; // The unique identifier of the session that triggered the hook, do NOT change.
+ TCHAR* pszUID; // Contains the unique identifier if Type = MENU_ON_NICKLIST. do NOT change.
+ int Type; // Type of menu. MENU_ON_* flags used. do NOT change.
+ int nItems; // Set this to the number of menu items you want to add
+ struct gc_item* Item; // pointer to the first in the array of gc_item's
+}
+ GCMENUITEMS;
+
+#define ME_GC_BUILDMENU "GChat/BuildMenu"
+
+/*
+ * Example of how to add 2 items to the popup menu for the userlist *
+
+ GCMENUITEMS *gcmi= (GCMENUITEMS*) lParam;
+ if (gcmi->Type == MENU_ON_NICKLIST)
+ {
+ static struct gc_item Item[] = {
+ {Translate("User &details"), 1, MENU_ITEM, FALSE},
+ {Translate("&Op"), 2, MENU_POPUPITEM, FALSE},
+ };
+
+ gcmi->nItems = sizeof(Item)/sizeof(Item[0]);
+ gcmi->Item = &Item[0];
+ gcmi->Item[gcmi->nItems-1].bDisabled = bFlag;
+
+ return 0;
+ }
+*/
+
+//////////////////////////////////////////////////////////////////////////
+// Get Chat ToolTip Text for buddy
+// wParam = (WPARAM)(TCHAR*) roomID parentdat->ptszID
+// lParam = (WPARAM)(TCHAR*) userID ui1->pszUID
+// result (int)(TCHAR*)mir_tstrdup("tooltip text")
+// returns pointer to text of tooltip and starts owns it
+#define MS_GC_PROTO_GETTOOLTIPTEXT "/GetChatToolTipText"
diff --git a/include/m_clc.h b/include/m_clc.h new file mode 100644 index 0000000000..36a16e898b --- /dev/null +++ b/include/m_clc.h @@ -0,0 +1,281 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_CLC_H__
+#define M_CLC_H__ 1
+
+//This module is new in 0.1.2.1
+
+#define CLISTCONTROL_CLASS _T("CListControl")
+
+//styles
+#define CLS_MANUALUPDATE 0x0001 //todo
+#define CLS_SHOWHIDDEN 0x0002
+#define CLS_HIDEOFFLINE 0x0004 //hides all offline users
+#define CLS_CHECKBOXES 0x0008
+#define CLS_MULTICOLUMN 0x0010 //not true multi-column, just for ignore/vis options
+#define CLS_HIDEEMPTYGROUPS 0x0020 //note: this flag will be spontaneously removed if the 'new subgroup' menu item is clicked, for obvious reasons
+#define CLS_USEGROUPS 0x0040
+#define CLS_NOHIDEOFFLINE 0x0080 //overrides CLS_HIDEOFFLINE and the per-group hideoffline setting
+#define CLS_GREYALTERNATE 0x0100 //make every other line slightly grey
+#define CLS_GROUPCHECKBOXES 0x0200 //put checkboxes on groups too (managed by CLC)
+#define CLS_CONTACTLIST 0x0400 //this control will be the main contact list (v. 0.3.4.3+ 2004/11/02)
+
+#define CLS_EX_DISABLEDRAGDROP 0x00000001
+#define CLS_EX_EDITLABELS 0x00000002
+#define CLS_EX_SHOWSELALWAYS 0x00000004
+#define CLS_EX_TRACKSELECT 0x00000008
+#define CLS_EX_SHOWGROUPCOUNTS 0x00000010
+#define CLS_EX_DIVIDERONOFF 0x00000020
+#define CLS_EX_HIDECOUNTSWHENEMPTY 0x00000040
+#define CLS_EX_NOTRANSLUCENTSEL 0x00000080
+#define CLS_EX_LINEWITHGROUPS 0x00000100
+#define CLS_EX_QUICKSEARCHVISONLY 0x00000200
+#define CLS_EX_SORTGROUPSALPHA 0x00000400
+#define CLS_EX_NOSMOOTHSCROLLING 0x00000800
+
+#define CLM_FIRST 0x1000 //this is the same as LVM_FIRST
+#define CLM_LAST 0x1100
+
+//messages, compare with equivalent TVM_s in the MSDN
+#define CLM_ADDCONTACT (CLM_FIRST+0) //wParam=hContact
+#define CLM_ADDGROUP (CLM_FIRST+1) //wParam=hGroup
+#define CLM_AUTOREBUILD (CLM_FIRST+2)
+#define CLM_DELETEITEM (CLM_FIRST+3) //wParam=hItem
+#define CLM_EDITLABEL (CLM_FIRST+4) //wParam=hItem
+#define CLM_ENDEDITLABELNOW (CLM_FIRST+5) //wParam=cancel, 0 to save
+#define CLM_ENSUREVISIBLE (CLM_FIRST+6) //wParam=hItem, lParam=partialOk
+#define CLE_TOGGLE -1
+#define CLE_COLLAPSE 0
+#define CLE_EXPAND 1
+#define CLE_INVALID 0xFFFF
+#define CLM_EXPAND (CLM_FIRST+7) //wParam=hItem, lParam=CLE_
+#define CLM_FINDCONTACT (CLM_FIRST+8) //wParam=hContact, returns an hItem
+#define CLM_FINDGROUP (CLM_FIRST+9) //wParam=hGroup, returns an hItem
+#define CLM_GETBKCOLOR (CLM_FIRST+10) //returns a COLORREF
+#define CLM_GETCHECKMARK (CLM_FIRST+11) //wParam=hItem, returns 1 or 0
+#define CLM_GETCOUNT (CLM_FIRST+12) //returns the total number of items
+#define CLM_GETEDITCONTROL (CLM_FIRST+13) //returns the HWND, or NULL
+#define CLM_GETEXPAND (CLM_FIRST+14) //wParam=hItem, returns a CLE_, CLE_INVALID if not a group
+#define CLM_GETEXTRACOLUMNS (CLM_FIRST+15) //returns number of extra columns
+#define CLM_GETEXTRAIMAGE (CLM_FIRST+16) //wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),0), returns iImage or 0xFF
+#define CLM_GETEXTRAIMAGELIST (CLM_FIRST+17) //returns HIMAGELIST
+#define CLM_GETFONT (CLM_FIRST+18) //wParam=fontId, see clm_setfont. returns hFont.
+#define CLM_GETINDENT (CLM_FIRST+19) //wParam=new group indent
+#define CLM_GETISEARCHSTRING (CLM_FIRST+20) //lParam=(char*)pszStr, max 120 bytes, returns number of chars in string
+#define CLM_GETITEMTEXT (CLM_FIRST+21) //wParam=hItem, lParam=(TCHAR*)pszStr, max 120 bytes
+#define CLM_GETSCROLLTIME (CLM_FIRST+22) //returns time in ms
+#define CLM_GETSELECTION (CLM_FIRST+23) //returns hItem
+#define CLCHT_ABOVE 0x0001 //above client area
+#define CLCHT_BELOW 0x0002 //below client area
+#define CLCHT_TOLEFT 0x0004 //left of client area
+#define CLCHT_TORIGHT 0x0008 //right of client area
+#define CLCHT_NOWHERE 0x0010 //in client area, not on an item
+#define CLCHT_ONITEMICON 0x0020
+#define CLCHT_ONITEMCHECK 0x0040
+#define CLCHT_ONITEMLABEL 0x0080
+#define CLCHT_ONITEMINDENT 0x0100 //to the left of an item icon
+#define CLCHT_ONITEMEXTRA 0x0200 //on an extra icon, HIBYTE(HIWORD()) says which
+#define CLCHT_ONITEM 0x03E0
+#define CLCHT_INLEFTMARGIN 0x0400
+#define CLCHT_BELOWITEMS 0x0800 //in client area but below last item
+#define CLM_HITTEST (CLM_FIRST+25) //lParam=MAKELPARAM(x,y) (relative to control), wParam=(PDWORD)&hitTest (see encoding of HitTest() in clc.h, can be NULL) returns hItem or NULL
+#define CLM_SELECTITEM (CLM_FIRST+26) //wParam=hItem
+#define CLB_TOPLEFT 0
+#define CLB_STRETCHV 1
+#define CLB_STRETCHH 2 //and tile vertically
+#define CLB_STRETCH 3
+#define CLBM_TYPE 0x00FF
+#define CLBF_TILEH 0x1000
+#define CLBF_TILEV 0x2000
+#define CLBF_PROPORTIONAL 0x4000
+#define CLBF_SCROLL 0x8000
+#define CLM_SETBKBITMAP (CLM_FIRST+27) //wParam=mode, lParam=hBitmap (don't delete it), NULL for none
+#define CLM_SETBKCOLOR (CLM_FIRST+28) //wParam=a COLORREF, default is GetSysColor(COLOR_3DFACE)
+#define CLM_SETCHECKMARK (CLM_FIRST+29) //wParam=hItem, lParam=1 or 0
+#define CLM_SETEXTRACOLUMNS (CLM_FIRST+30) //wParam=number of extra columns (zero to MAXEXTRACOLUMNS from clc.h, currently 16)
+#define CLM_SETEXTRAIMAGE (CLM_FIRST+31) //wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),iImage). iImage=0xFF is a blank
+#define CLM_SETEXTRAIMAGELIST (CLM_FIRST+32) //lParam=HIMAGELIST, wParam=WideImageList
+
+#define FONTID_CONTACTS 0
+#define FONTID_INVIS 1
+#define FONTID_OFFLINE 2
+#define FONTID_NOTONLIST 3
+#define FONTID_GROUPS 4
+#define FONTID_GROUPCOUNTS 5
+#define FONTID_DIVIDERS 6
+#define FONTID_OFFINVIS 7
+#define FONTID_STATUSMSG 8
+#define FONTID_GROUPSCLOSED 9
+#define FONTID_CONTACTSHOVER 10
+#define FONTID_MAX 18
+
+#define CLM_SETFONT (CLM_FIRST+33) //wParam=hFont, lParam=MAKELPARAM(fRedraw,fontId)
+#define CLM_SETINDENT (CLM_FIRST+34) //wParam=new indent, default is 3 pixels
+#define CLM_SETITEMTEXT (CLM_FIRST+35) //wParam=hItem, lParam=(char*)pszNewText
+#define CLM_SETSCROLLTIME (CLM_FIRST+36) //wParam=time in ms, default 200
+
+#define CLM_SETHIDEEMPTYGROUPS (CLM_FIRST+38) //wParam=TRUE/FALSE
+#define GREYF_UNFOCUS 0x80000000
+#define MODEF_OFFLINE 0x40000000
+//and use the PF2_ #defines from m_protosvc.h
+#define CLM_SETGREYOUTFLAGS (CLM_FIRST+39) //wParam=new flags
+#define CLM_GETHIDEOFFLINEROOT (CLM_FIRST+40) //returns TRUE/FALSE
+#define CLM_SETHIDEOFFLINEROOT (CLM_FIRST+41) //wParam=TRUE/FALSE
+#define CLM_SETUSEGROUPS (CLM_FIRST+42) //wParam=TRUE/FALSE
+#define CLM_SETOFFLINEMODES (CLM_FIRST+43) //for 'hide offline', wParam=PF2_ flags and MODEF_OFFLINE
+#define CLM_GETEXSTYLE (CLM_FIRST+44) //returns CLS_EX_ flags
+#define CLM_SETEXSTYLE (CLM_FIRST+45) //wParam=CLS_EX_ flags
+#define CLM_GETLEFTMARGIN (CLM_FIRST+46) //returns count of pixels
+#define CLM_SETLEFTMARGIN (CLM_FIRST+47) //wParam=pixels
+typedef struct {
+ int cbSize;
+ const TCHAR *pszText;
+ HANDLE hParentGroup;
+ DWORD flags;
+ HICON hIcon; //todo
+} CLCINFOITEM;
+#define CLCIIF_BELOWGROUPS 1 //put it between groups and contacts, default is at top
+#define CLCIIF_BELOWCONTACTS 2 //put it at the bottom
+#define CLCIIF_CHECKBOX 0x40 //give this item a check box
+#define CLCIIF_GROUPFONT 0x80 //draw the item using FONTID_GROUPS
+
+#define CLM_ADDINFOITEMA (CLM_FIRST+48) //lParam=&cii, returns hItem
+#define CLM_ADDINFOITEMW (CLM_FIRST+53) //lParam=&cii, returns hItem
+#if defined( _UNICODE )
+ #define CLM_ADDINFOITEM CLM_ADDINFOITEMW
+#else
+ #define CLM_ADDINFOITEM CLM_ADDINFOITEMA
+#endif
+
+ //the order of info items is never changed, so make sure you add them in the
+ // order you want them to remain
+#define CLCIT_INVALID -1
+#define CLCIT_GROUP 0
+#define CLCIT_CONTACT 1
+#define CLCIT_DIVIDER 2
+#define CLCIT_INFO 3
+#define CLM_GETITEMTYPE (CLM_FIRST+49) //wParam=hItem, returns a CLCIT_
+#define CLGN_ROOT 0
+#define CLGN_CHILD 1
+#define CLGN_PARENT 2
+#define CLGN_NEXT 3
+#define CLGN_PREVIOUS 4
+#define CLGN_NEXTCONTACT 5
+#define CLGN_PREVIOUSCONTACT 6
+#define CLGN_NEXTGROUP 7
+#define CLGN_PREVIOUSGROUP 8
+#define CLM_GETNEXTITEM (CLM_FIRST+50) //wParam=flag, lParam=hItem, returns an hItem
+#define CLM_GETTEXTCOLOR (CLM_FIRST+51) //wParam=FONTID_, returns COLORREF
+#define CLM_SETTEXTCOLOR (CLM_FIRST+52) //wParam=FONTID_, lParam=COLORREF
+
+//DO NOT USE IT EXTERNALLY CAN BE NOT SUPPORTED BY CLIST
+#define CLM_SETWIDEEXTRAIMAGE (CLM_FIRST+60) //wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),iImage). iImage=0xFFFF is a blank
+#define CLM_GETWIDEEXTRAIMAGE (CLM_FIRST+61) //wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),0), returns iImage or 0xFF
+#define CLM_GETWIDEEXTRAIMAGELIST (CLM_FIRST+62) //returns HWIDEIMAGELIST
+
+//notifications (most are omitted because the control processes everything)
+#define CLNF_ISGROUP 1
+#define CLNF_ISINFO 2
+typedef struct {
+ NMHDR hdr;
+ HANDLE hItem;
+ int action;
+ int iColumn; //-1 if not on an extra column
+ DWORD flags;
+ POINT pt;
+} NMCLISTCONTROL;
+#define CLN_FIRST (0U-100U)
+#define CLN_EXPANDED (CLN_FIRST-0) //hItem=hGroup, action=CLE_*
+#define CLN_LISTREBUILT (CLN_FIRST-1)
+#define CLN_ITEMCHECKED (CLN_FIRST-2) //todo //hItem,action,flags valid
+#define CLN_DRAGGING (CLN_FIRST-3) //hItem,pt,flags valid. only sent when cursor outside window, return nonzero if processed
+#define CLN_DROPPED (CLN_FIRST-4) //hItem,pt,flags valid. only sent when cursor outside window, return nonzero if processed
+#define CLN_LISTSIZECHANGE (CLN_FIRST-5) //pt.y valid. the vertical height of the visible items in the list has changed.
+#define CLN_OPTIONSCHANGED (CLN_FIRST-6) //nothing valid. If you set some extended options they have been overwritten and should be re-set
+#define CLN_DRAGSTOP (CLN_FIRST-7) //hItem,flags valid. sent when cursor goes back in to the window having been outside, return nonzero if processed
+#define CLN_NEWCONTACT (CLN_FIRST-8) //hItem,flags valid. sent when a new contact is added without a full list rebuild
+#define CLN_CONTACTMOVED (CLN_FIRST-9) //hItem,flags valid. sent when contact is moved without a full list rebuild
+#define CLN_CHECKCHANGED (CLN_FIRST-10) //hItem,flags valid. sent when any check mark is changed, but only for one change if there are many
+//NM_CLICK //hItem,iColumn,pt,flags valid
+//NM_KEYDOWN //NMKEY structure, only sent when key is not already processed, return nonzero to prevent further processing
+
+//an infotip for an item should be shown now
+//wParam=0
+//lParam=(LPARAM)(CLCINFOTIP*)&it
+//Return nonzero if you process this, because it makes no sense for more than
+//one plugin to grab it.
+//It is up to the plugin to decide the best place to put the infotip. Normally
+//it's a few pixels below and to the right of the cursor
+//This event is called after the mouse has been stationary over a contact for
+//(by default) 200ms, but see below.
+//Everything is in screen coordinates.
+typedef struct {
+ int cbSize;
+ int isTreeFocused; //so the plugin can provide an option
+ int isGroup; //0 if it's a contact, 1 if it's a group
+ HANDLE hItem; //handle to group or contact
+ POINT ptCursor;
+ RECT rcItem;
+} CLCINFOTIP;
+#define ME_CLC_SHOWINFOTIP "CLC/ShowInfoTip"
+
+typedef struct {
+ int cbSize;
+ int isTreeFocused; //so the plugin can provide an option
+ HANDLE hItem; //handle to group or contact
+ POINT ptCursor;
+ RECT rcItem;
+ int extraIndex;
+ HWND hwnd;
+} CLCEXTRAINFOTIP;
+#define ME_CLC_SHOWEXTRAINFOTIP "CLC/ShowExtraInfoTip"
+
+//it's time to destroy an infotip
+//wParam=0
+//lParam=(LPARAM)(CLCINFOTIP*)&it
+//Only cbSize, isGroup and hItem are set
+//Return nonzero if you process this.
+//This is sent when the mouse moves off a contact when clc/showinfotip has
+//previously been called.
+//If you don't want this behaviour, you should have grabbed the mouse capture
+//yourself and made your own arrangements.
+#define ME_CLC_HIDEINFOTIP "CLC/HideInfoTip"
+
+//set the hover time before the infotip hooks are called
+//wParam=newTime
+//lParam=0
+//Returns 0 on success or nonzero on failure
+//The value of this setting is applied to all current CLC windows, and saved
+//to be applied to all future windows, including after restarts.
+//newTime is in ms.
+//The default is 750ms.
+#define MS_CLC_SETINFOTIPHOVERTIME "CLC/SetInfoTipHoverTime"
+
+//get the hover time before the infotip hooks are called
+//wParam=lParam=0
+//Returns the time in ms
+#define MS_CLC_GETINFOTIPHOVERTIME "CLC/GetInfoTipHoverTime"
+
+#endif // M_CLC_H__
+
diff --git a/include/m_clist.h b/include/m_clist.h new file mode 100644 index 0000000000..334e7d986c --- /dev/null +++ b/include/m_clist.h @@ -0,0 +1,640 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_CLIST_H__
+#define M_CLIST_H__ 1
+
+#ifdef _MSC_VER
+ #pragma warning(disable:4201 4204)
+#endif
+
+#include "statusmodes.h"
+
+#if defined _STATIC
+ typedef struct _tagIntMenuItem* HGENMENU;
+#else
+ DECLARE_HANDLE(HGENMENU);
+#endif
+
+//sent when the user asks to change their status
+//wParam=new status, from statusmodes.h
+//lParam=protocol name, NULL if for all protocols (added in v0.3.1alpha)
+//also sent due to a ms_clist_setstatusmode call
+#define ME_CLIST_STATUSMODECHANGE "CList/StatusModeChange"
+
+//force a change of status mode
+//wParam=new status, from statusmodes.h
+#define MS_CLIST_SETSTATUSMODE "CList/SetStatusMode"
+
+//get the current status mode
+//wParam=lParam=0
+//returns the current status
+//This is the status *as set by the user*, not any protocol-specific status
+//All protocol modules will attempt to conform to this setting at all times
+#define MS_CLIST_GETSTATUSMODE "CList/GetStatusMode"
+
+//gets a textual description of the given status mode (v0.1.0.1+)
+//wParam=status mode, from statusmodes.h
+//lParam=flags, below
+//returns a static buffer of the description of the given status mode
+//returns NULL if the status mode was unknown
+#define GSMDF_PREFIXONLINE 1 //prefix "Online: " to all status modes that
+ //imply online, eg "Online: Away"
+#define GSMDF_UNICODE 2 //will return TCHAR* instead of char*
+#if defined( _UNICODE )
+ #define GSMDF_TCHAR GSMDF_UNICODE //will return TCHAR* instead of char*
+#else
+ #define GSMDF_TCHAR 0 //will return char*, as usual
+#endif
+#define GSMDF_UNTRANSLATED 4
+#define MS_CLIST_GETSTATUSMODEDESCRIPTION "CList/GetStatusModeDescription"
+
+//add a new item to the main menu
+//wParam=0
+//lParam=(LPARAM)(CLISTMENUITEM*)&mi
+//returns a handle to the new item, or NULL on failure
+//the service that is called when the item is clicked is called with
+//wParam=0, lParam=hwndContactList
+//dividers are inserted every 100000 positions
+//pszContactOwner is ignored for this service.
+//there is a #define PUTPOSITIONSINMENU in clistmenus.c which, when set, will
+//cause the position numbers to be placed in brackets after the menu items
+
+// WARNING: do not use Translate(TS) for p(t)szName or p(t)szPopupName as they
+// are translated by the core, which may lead to double translation.
+// Use LPGEN instead which are just dummy wrappers/markers for "lpgen.pl".
+typedef struct {
+ int cbSize; //size in bytes of this structure
+ union {
+ char* pszName; //[TRANSLATED-BY-CORE] text of the menu item
+ TCHAR* ptszName; //Unicode text of the menu item
+ };
+ DWORD flags; //set of CMIF_* flags
+ int position; //approx position on the menu. lower numbers go nearer the top
+ union {
+ HICON hIcon; //icon to put by the item. If this was not loaded from
+ //a resource, you can delete it straight after the call
+ HANDLE icolibItem; //set CMIF_ICONFROMICOLIB to pass this value
+ };
+ char* pszService; //name of service to call when the item gets selected
+ union {
+ char* pszPopupName; //[TRANSLATED-BY-CORE] name of the popup menu that this item is on. If this
+ TCHAR* ptszPopupName; //is NULL the item is on the root of the menu
+ HGENMENU hParentMenu; // valid if CMIF_ROOTHANDLE is set. NULL or (HGENMENU)-1 means the root menu
+ };
+
+ int popupPosition; //position of the popup menu on the root menu. Ignored
+ //if pszPopupName is NULL or the popup menu already
+ //existed
+ DWORD hotKey; //keyboard accelerator, same as lParam of WM_HOTKEY,0 for none
+ char *pszContactOwner; //contact menus only. The protocol module that owns
+ //the contacts to which this menu item applies. NULL if it
+ //applies to all contacts. If it applies to multiple but not all
+ //protocols, add multiple menu items or use ME_CLIST_PREBUILDCONTACTMENU
+} CLISTMENUITEM;
+
+#define HGENMENU_ROOT (( HGENMENU )-1)
+
+#define CMIF_GRAYED 1
+#define CMIF_CHECKED 2
+#define CMIF_HIDDEN 4 //only works on contact menus
+#define CMIF_NOTOFFLINE 8 //item won't appear for contacts that are offline
+#define CMIF_NOTONLINE 16 // " online
+#define CMIF_NOTONLIST 32 //item won't appear on standard contacts
+#define CMIF_NOTOFFLIST 64 //item won't appear on contacts that have the 'NotOnList' setting
+#define CMIF_ROOTHANDLE 384 //means that hParentMenu member is set
+
+#define CMIF_UNICODE 512 //will return TCHAR* instead of char*
+#if defined( _UNICODE )
+ #define CMIF_TCHAR CMIF_UNICODE //will return TCHAR* instead of char*
+#else
+ #define CMIF_TCHAR 0 //will return char*, as usual
+#endif
+
+#define CMIF_KEEPUNTRANSLATED 1024 // don't translate a menu item
+#define CMIF_ICONFROMICOLIB 2048 // use icolibName instead of hIcon
+#define CMIF_DEFAULT 4096 // this menu item is the default one
+
+// for compatibility. since 0.8.0 they both mean nothing
+#define CMIF_ROOTPOPUP 128 //root item for new popup(save return id for childs)
+#define CMIF_CHILDPOPUP 256 //child for rootpopup menu
+
+#define MS_CLIST_ADDMAINMENUITEM "CList/AddMainMenuItem"
+
+//add a new item to the user contact menus
+//identical to clist/addmainmenuitem except when item is selected the service
+//gets called with wParam=(WPARAM)(HANDLE)hContact
+//pszContactOwner is obeyed.
+//popup menus are not supported. pszPopupName and popupPosition are ignored.
+//If ctrl is held down when right clicking, the menu position numbers will be
+//displayed in brackets after the menu item text. This only works in debug
+//builds.
+#define MS_CLIST_ADDCONTACTMENUITEM "CList/AddContactMenuItem"
+#define MS_CLIST_ADDSTATUSMENUITEM "CList/AddStatusMenuItem"
+
+//adds a protocol menu item v0.9+
+#define MS_CLIST_ADDPROTOMENUITEM "CList/AddProtoMenuItem"
+
+//modify an existing menu item v0.1.0.1+
+//wParam=(WPARAM)(HANDLE)hMenuItem
+//lParam=(LPARAM)(CLISTMENUITEM*)&clmi
+//returns 0 on success, nonzero on failure
+//hMenuItem will have been returned by clist/add*menuItem
+//clmi.flags should contain cmim_ constants below specifying which fields to
+//update. Fields without a mask flag cannot be changed and will be ignored
+#define CMIM_NAME 0x80000000
+#define CMIM_FLAGS 0x40000000
+#define CMIM_ICON 0x20000000
+#define CMIM_HOTKEY 0x10000000
+#define CMIM_ALL 0xF0000000
+#define MS_CLIST_MODIFYMENUITEM "CList/ModifyMenuItem"
+
+//the context menu for a contact is about to be built v0.1.0.1+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=0
+//modules should use this to change menu items that are specific to the
+//contact that has them
+#define ME_CLIST_PREBUILDCONTACTMENU "CList/PreBuildContactMenu"
+
+//sets the service to call when a contact is double-clicked
+//wParam=0
+//lParam=(LPARAM)(CLISTDOUBLECLICKACTION*)&dca
+//contactType is one or more of the constants below
+//pszService is called with wParam=hContact, lParam=0
+//pszService will only be called if there is no outstanding event on the
+//selected contact
+//returns 0 on success, nonzero on failure
+//in case of conflicts, the first module to have registered will get the
+//double click, no others will. This service will return success even for
+//duplicates.
+/*
+ Note: During development of 0.3.0.0 (2003/02/15) this service was completely dropped
+ by default it always returns 1 to mark failure, see ME_CLIST_DOUBLECLICKED for
+ a better implementation as a hook.
+*/
+typedef struct {
+ int cbSize;
+ char *pszContactOwner; //name of protocol owning contact, or NULL for all
+ DWORD flags; //any of the CMIF_NOT... flags above
+ char *pszService; //service to call on double click
+} CLISTDOUBLECLICKACTION;
+#define MS_CLIST_SETDOUBLECLICKACTION "CList/SetDoubleClickAction"
+
+/*
+wParam=(WPARAM)hContact
+lParam=0
+
+Event is fired when there is a double click on a CList contact,
+it is upto the caller to check for the protocol & status
+of the HCONTACT, it's not done for you anymore since it didn't make
+sense to store all this information in memory, etc.
+
+*/
+#define ME_CLIST_DOUBLECLICKED "CList/DoubleClicked"
+//gets the string that the contact list will use to represent a contact
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=flags
+//returns a pointer to the name, will always succeed, even if it needs to
+//return "(Unknown Contact)"
+//this pointer is to a statically allocated buffer which will be overwritten
+//on every call to this service. Callers should make sure that they copy the
+//information before they call this service again.
+#define GCDNF_NOMYHANDLE 1 //will never return the user's custom name
+#define GCDNF_UNICODE 2 //will return TCHAR* instead of char*
+#define GCDNF_NOCACHE 4 //will not use the cache
+
+#if defined( _UNICODE )
+ #define GCDNF_TCHAR GCDNF_UNICODE //will return TCHAR* instead of char*
+#else
+ #define GCDNF_TCHAR 0 //will return char*, as usual
+#endif
+
+ //even if it's the one that should be displayed. v0.1.2.0+
+ //v0.3.0.0+ if using GCDNF_NOMYHANDLE you must free your string
+#define MS_CLIST_GETCONTACTDISPLAYNAME "CList/GetContactDisplayName"
+
+// Invalidates the display name cache
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=not used
+#define MS_CLIST_INVALIDATEDISPLAYNAME "CList/InvalidateDiplayName"
+
+//adds an event to the contact list's queue
+//wParam=0
+//lParam=(LPARAM)(CLISTEVENT*)cle
+//The contact list will flash hIcon next to the contact hContact (use NULL for
+//a system message). szServiceName will be called when the user double clicks
+//the icon, at which point the event will be removed from the contact list's
+//queue automatically
+//pszService is called with wParam=(WPARAM)(HWND)hwndContactList,
+//lParam=(LPARAM)(CLISTEVENT*)cle. Its return value is ignored. cle is
+//invalidated when your service returns, so take copies of any important
+//information in it.
+//hDbEvent should be unique since it and hContact are the identifiers used by
+//clist/removeevent if, for example, your module implements a 'read next' that
+//bypasses the double-click.
+typedef struct {
+ int cbSize; //size in bytes of this structure
+ HANDLE hContact; //handle to the contact to put the icon by
+ HICON hIcon; //icon to flash
+ DWORD flags; //...of course
+ union
+ {
+ HANDLE hDbEvent; //caller defined but should be unique for hContact
+ char * lpszProtocol;
+ };
+ LPARAM lParam; //caller defined
+ char *pszService; //name of the service to call on activation
+ union {
+ char *pszTooltip; //short description of the event to display as a
+ TCHAR *ptszTooltip; //tooltip on the system tray
+ };
+} CLISTEVENT;
+#define CLEF_URGENT 1 //flashes the icon even if the user is occupied,
+ //and puts the event at the top of the queue
+#define CLEF_ONLYAFEW 2 //the icon will not flash for ever, only a few
+ //times. This is for eg online alert
+#define CLEF_UNICODE 4 //set pszTooltip as unicode
+
+#define CLEF_PROTOCOLGLOBAL 8 //set event globally for protocol, hContact has to be NULL,
+ //lpszProtocol the protocol ID name to be set
+
+#if defined( _UNICODE )
+ #define CLEF_TCHAR CLEF_UNICODE //will use TCHAR* instead of char*
+#else
+ #define CLEF_TCHAR 0 //will return char*, as usual
+#endif
+
+#define MS_CLIST_ADDEVENT "CList/AddEvent"
+
+//removes an event from the contact list's queue
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=(LPARAM)(HANDLE)hDbEvent
+//returns 0 if the event was successfully removed, or nonzero if the event
+//was not found
+#define MS_CLIST_REMOVEEVENT "Clist/RemoveEvent"
+
+//gets the details of an event in the queue v0.1.2.1+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=iEvent
+//returns a CLISTEVENT* on success, NULL on failure
+//Returns the iEvent-th event from the queue for hContact, so iEvent=0 will
+//get the event that will be got when the user clicks on that contact.
+//Use hContact=INVALID_HANDLE_VALUE to search over all contacts, so iEvent=0
+//will get the event that will be got if the user clicks the systray icon.
+#define MS_CLIST_GETEVENT "CList/GetEvent"
+
+//process a WM_MEASUREITEM message for user context menus v0.1.1.0+
+//wParam, lParam, return value as for WM_MEASUREITEM
+//This is for displaying the icons by the menu items. If you don't call this
+//and clist/menudrawitem whne drawing a menu returned by one of the three menu
+//services below then it'll work but you won't get any icons
+#define MS_CLIST_MENUMEASUREITEM "CList/MenuMeasureItem"
+
+//process a WM_DRAWITEM message for user context menus v0.1.1.0+
+//wParam, lParam, return value as for WM_MEASUREITEM
+//See comments for clist/menumeasureitem
+#define MS_CLIST_MENUDRAWITEM "CList/MenuDrawItem"
+
+//builds the context menu for a specific contact v0.1.1.0+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=0
+//returns a HMENU identifying the menu. This should be DestroyMenu()ed when
+//finished with.
+#define MS_CLIST_MENUBUILDCONTACT "CList/MenuBuildContact"
+
+//gets the image list with all the useful icons in it v0.1.1.0+
+//wParam=lParam=0
+//returns a HIMAGELIST
+//the members of this image list are opaque, and you should trust what you
+//are given
+#define MS_CLIST_GETICONSIMAGELIST "CList/GetIconsImageList"
+#define IMAGE_GROUPOPEN 11
+#define IMAGE_GROUPSHUT 12
+
+//get the icon that should be associated with a contact v0.1.2.0+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=0
+//returns an index into the contact list imagelist. See clist/geticonsimagelist
+//If the contact is flashing an icon, this function will not return that
+//flashing icon. Use me_clist_contacticonchanged to get info about that.
+#define MS_CLIST_GETCONTACTICON "CList/GetContactIcon"
+
+//The icon of a contact in the contact list has changed v0.1.2.0+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=iconId
+//iconId is an offset into the clist's imagelist. See clist/geticonsimagelist
+#define ME_CLIST_CONTACTICONCHANGED "CList/ContactIconChanged"
+
+/******************************* CLUI only *********************************/
+
+// Stuff below here is ideally for the use of a CList UI module only.
+
+//get a handle to the main Miranda menu v0.1.1.0+
+//wParam=lParam=0
+//returns a HMENU. This need not be freed since it's owned by clist
+#define MS_CLIST_MENUGETMAIN "CList/MenuGetMain"
+
+//get a handle to the Miranda status menu v0.1.1.0+
+//wParam=lParam=0
+//returns a HMENU. This need not be freed since it's owned by clist
+#define MS_CLIST_MENUGETSTATUS "CList/MenuGetStatus"
+
+
+
+
+//processes a menu selection from a menu v0.1.1.0+
+//wParam=MAKEWPARAM(LOWORD(wParam from WM_COMMAND),flags)
+//lParam=(LPARAM)(HANDLE)hContact
+//returns TRUE if it processed the command, FALSE otherwise
+//hContact is the currently selected contact. It it not used if this is a main
+//menu command. If this is NULL and the command is a contact menu one, the
+//command is ignored
+
+#define CLISTMENUIDMIN 0x4000 // reserved range for clist menu ids
+#define CLISTMENUIDMAX 0x7fff
+//////////////////////////////////////////////////////////////////////////
+// NOTE: v0.7.0.26+
+// Due to it is generic practice to handle menu command via WM_COMMAND
+// window message handle and practice to process it via calling service
+// in form: CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM) hContact))
+// to ensure that WM_COMMAND was realy from clist menu not from other menu
+// it is reserved range of menu ids from CLISTMENUIDMIN to CLISTMENUIDMAX
+// the menu items with ids outside from such range will not be processed by service.
+// Moreover if you process WM_COMMAND youself and your window contains self menu
+// please be sure that you will not call service for non-clist menu items.
+// The simplest way is to ensure that your menus are not use item ids from such range.
+// Otherwise, you HAVE TO distinguish WM_COMMAND from clist menus and from youê internal menu and
+// DO NOT call MS_CLIST_MENUPROCESSCOMMAND for non clist menus.
+
+
+#define MPCF_CONTACTMENU 1 //test commands from a contact menu
+#define MPCF_MAINMENU 2 //test commands from the main menu
+#define MS_CLIST_MENUPROCESSCOMMAND "CList/MenuProcessCommand"
+
+//processes a menu hotkey v0.1.1.0+
+//wParam=virtual key code
+//lParam=MPCF_ flags
+//returns TRUE if it processed the command, FALSE otherwise
+//this should be called in WM_KEYDOWN
+#define MS_CLIST_MENUPROCESSHOTKEY "CList/MenuProcessHotkey"
+
+//process all the messages required for docking v0.1.1.0+
+//wParam=(WPARAM)(MSG*)&msg
+//lParam=(LPARAM)(LRESULT*)&lResult
+//returns TRUE if the message should not be processed further, FALSE otherwise
+//only msg.hwnd, msg.message, msg.wParam and msg.lParam are used
+//your wndproc should return lResult if and only if TRUE is returned
+#define MS_CLIST_DOCKINGPROCESSMESSAGE "CList/DockingProcessMessage"
+
+//determines whether the contact list is docked v0.1.1.0+
+//wParam=lParam=0
+//returns nonzero if the contact list is docked, of 0 if it is not
+#define MS_CLIST_DOCKINGISDOCKED "CList/DockingIsDocked"
+
+//process all the messages required for the tray icon v0.1.1.0+
+//wParam=(WPARAM)(MSG*)&msg
+//lParam=(LPARAM)(LRESULT*)&lResult
+//returns TRUE if the message should not be processed further, FALSE otherwise
+//only msg.hwnd, msg.message, msg.wParam and msg.lParam are used
+//your wndproc should return lResult if and only if TRUE is returned
+#define MS_CLIST_TRAYICONPROCESSMESSAGE "CList/TrayIconProcessMessage"
+
+//process all the messages required for hotkeys v0.1.1.0+
+//wParam=(WPARAM)(MSG*)&msg
+//lParam=(LPARAM)(LRESULT*)&lResult
+//returns TRUE if the message should not be processed further, FALSE otherwise
+//only msg.hwnd, msg.message, msg.wParam and msg.lParam are used
+//your wndproc should return lResult if and only if TRUE is returned
+#define MS_CLIST_HOTKEYSPROCESSMESSAGE "CList/HotkeysProcessMessage"
+
+//toggles the show/hide status of the contact list v0.1.1.0+
+//wParam=lParam=0
+//returns 0 on success, nonzero on failure
+#define MS_CLIST_SHOWHIDE "CList/ShowHide"
+
+//temporarily disable the autohide feature v0.1.2.1+
+//wParam=lParam=0
+//returns 0 on success, nonzero on failure
+//This service will restart the autohide timer, so if you need to keep the
+//window visible you'll have to be getting user input regularly and calling
+//this function each time
+#define MS_CLIST_PAUSEAUTOHIDE "CList/PauseAutoHide"
+
+//sent when the group get modified (created, renamed or deleted)
+//or contact is moving from group to group
+//wParam=hContact - NULL if operation on group
+//lParam=pointer to CLISTGROUPCHANGE
+typedef struct {
+ int cbSize; //size in bytes of this structure
+ TCHAR* pszOldName; //old group name
+ TCHAR* pszNewName; //new group name
+} CLISTGROUPCHANGE;
+
+#define ME_CLIST_GROUPCHANGE "CList/GroupChange"
+
+//creates a new group and calls CLUI to display it v0.1.1.0+
+//wParam=hParentGroup
+//lParam=groupName
+//returns a handle to the new group
+//hParentGroup is NULL to create the new group at the root, or can be the
+//handle of the group of which the new group should be a subgroup.
+//groupName is a TCHAR* pointing to the group name to create or NULL for
+//API to create unique name by itself
+#define MS_CLIST_GROUPCREATE "CList/GroupCreate"
+
+//deletes a group and calls CLUI to display the change v0.1.1.0+
+//wParam=(WPARAM)(HANDLE)hGroup
+//lParam=0
+//returns 0 on success, nonzero on failure
+#define MS_CLIST_GROUPDELETE "CList/GroupDelete"
+
+//change the expanded state flag for a group internally v0.1.1.0+
+//wParam=(WPARAM)(HANDLE)hGroup
+//lParam=newState
+//returns 0 on success, nonzero on failure
+//newState is nonzero if the group is expanded, 0 if it's collapsed
+//CLUI is not called when this change is made
+#define MS_CLIST_GROUPSETEXPANDED "CList/GroupSetExpanded"
+
+//changes the flags for a group v0.1.2.1+
+//wParam=(WPARAM)(HANDLE)hGroup
+//lParam=MAKELPARAM(flags,flagsMask)
+//returns 0 on success, nonzero on failure
+//Only the flags given in flagsMask are altered.
+//CLUI is called on changes to GROUPF_HIDEOFFLINE.
+#define MS_CLIST_GROUPSETFLAGS "CList/GroupSetFlags"
+
+//get the name of a group v0.1.1.0+
+//wParam=(WPARAM)(HANDLE)hGroup
+//lParam=(LPARAM)(int*)&isExpanded
+//returns a static buffer pointing to the name of the group
+//returns NULL if hGroup is invalid.
+//this buffer is only valid until the next call to this service
+//&isExpanded can be NULL if you don't want to know if the group is expanded
+//or not.
+#define MS_CLIST_GROUPGETNAME "CList/GroupGetName"
+
+//get the name of a group v0.1.2.1+
+//wParam=(WPARAM)(HANDLE)hGroup
+//lParam=(LPARAM)(DWORD*)&flags
+//returns a static buffer pointing to the name of the group
+//returns NULL if hGroup is invalid.
+//this buffer is only valid until the next call to this service
+//&flags can be NULL if you don't want any of that info.
+#define GROUPF_EXPANDED 0x04
+#define GROUPF_HIDEOFFLINE 0x08
+#define MS_CLIST_GROUPGETNAME2 "CList/GroupGetName2"
+
+//move a group to directly before another group v0.1.2.1+
+//wParam=(WPARAM)(HANDLE)hGroup
+//lParam=(LPARAM)(HANDLE)hBeforeGroup
+//returns the new handle of the group on success, NULL on failure
+//The order is represented by the order in which MS_CLUI_GROUPADDED is called,
+//however UIs are free to ignore this order and sort alphabetically if they
+//wish.
+#define MS_CLIST_GROUPMOVEBEFORE "CList/GroupMoveBefore"
+
+//rename a group internally v0.1.1.0+
+//wParam=(WPARAM)(HANDLE)hGroup
+//lParam=(LPARAM)(char*)szNewName
+//returns 0 on success, nonzero on failure
+//this will fail if the group name is a duplicate of an existing name
+//CLUI is not called when this change is made
+#define MS_CLIST_GROUPRENAME "CList/GroupRename"
+
+//build a menu of the group tree v0.1.2.1+
+//wParam=0
+//lParam=0
+//returns a HMENU on success, or NULL on failure
+//The return value must be DestroyMenu()ed when you're done with it.
+//NULL will be returned if the user doesn't have any groups
+//The dwItemData of every menu item is the handle to that group.
+//Menu item IDs are assigned starting at 100, in no particular order.
+#define MS_CLIST_GROUPBUILDMENU "CList/GroupBuildMenu"
+
+//changes the 'hide offline contacts' flag and call CLUI v0.1.1.0+
+//wParam=newValue
+//lParam=0
+//returns 0 on success, nonzero on failure
+//newValue is 0 to show all contacts, 1 to only show online contacts
+//or -1 to toggle the value
+#define MS_CLIST_SETHIDEOFFLINE "CList/SetHideOffline"
+
+//do the message processing associated with double clicking a contact v0.1.1.0+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=0
+//returns 0 on success, nonzero on failure
+#define MS_CLIST_CONTACTDOUBLECLICKED "CList/ContactDoubleClicked"
+
+//do the processing for when some files are dropped on a contact v0.1.2.1+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=(LPARAM)(char**)ppFiles
+//returns 0 on success, nonzero on failure
+//ppFiles is an array of fully qualified filenames, ending with a NULL.
+#define MS_CLIST_CONTACTFILESDROPPED "CList/ContactFilesDropped"
+
+//change the group a contact belongs to v0.1.1.0+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=(LPARAM)(HANDLE)hGroup
+//returns 0 on success, nonzero on failure
+//use hGroup=NULL to put the contact in no group
+#define MS_CLIST_CONTACTCHANGEGROUP "CList/ContactChangeGroup"
+
+//determines the ordering of two contacts v0.1.1.0+
+//wParam=(WPARAM)(HANDLE)hContact1
+//lParam=(LPARAM)(HANDLE)hContact2
+//returns 0 if hContact1 is the same as hContact2
+//returns +1 if hContact2 should be displayed after hContact1
+//returns -1 if hContact1 should be displayed after hContact2
+#define MS_CLIST_CONTACTSCOMPARE "CList/ContactsCompare"
+
+/*
+ wParam=0 (not used)
+ lParam=(LPARAM) &MIRANDASYSTRAYNOTIFY
+
+ Affects: Show a message in a ballon tip against a protocol icon (if installed)
+ Returns: 0 on success, non zero on failure
+ Notes : This service will not be created on systems that haven't got the Windows
+ support for ballontips, also note that it's upto Windows if it shows your
+ message and it keeps check of delays (don't be stupid about showing messages)
+
+ Version: 0.3.1a
+*/
+#define NIIF_INFO 0x00000001
+#define NIIF_WARNING 0x00000002
+#define NIIF_ERROR 0x00000003
+#define NIIF_ICON_MASK 0x0000000F
+#define NIIF_NOSOUND 0x00000010
+#define NIIF_INTERN_UNICODE 0x00000100
+
+
+typedef struct {
+ int cbSize; // sizeof(MIRANDASYSTRAY)
+ char *szProto; // protocol to show under (may have no effect)
+ union {
+ char *szInfoTitle; // only 64chars of it will be used
+ TCHAR *tszInfoTitle; // used if NIIF_INTERN_UNICODE is specified
+ };
+ union {
+ char *szInfo; // only 256chars of it will be used
+ TCHAR *tszInfo; // used if NIIF_INTERN_UNICODE is specified
+ };
+ DWORD dwInfoFlags; // see NIIF_* stuff
+ UINT uTimeout; // how long to show the tip for
+} MIRANDASYSTRAYNOTIFY;
+#define MS_CLIST_SYSTRAY_NOTIFY "Miranda/Systray/Notify"
+
+#define SETTING_TOOLWINDOW_DEFAULT 1
+#define SETTING_SHOWMAINMENU_DEFAULT 1
+#define SETTING_SHOWCAPTION_DEFAULT 1
+#define SETTING_CLIENTDRAG_DEFAULT 1
+#define SETTING_ONTOP_DEFAULT 0
+#define SETTING_MIN2TRAY_DEFAULT 1
+#define SETTING_TRAY1CLICK_DEFAULT (IsWinVer7Plus()?1:0)
+#define SETTING_HIDEOFFLINE_DEFAULT 0
+#define SETTING_HIDEEMPTYGROUPS_DEFAULT 0
+#define SETTING_USEGROUPS_DEFAULT 1
+#define SETTING_SORTBYSTATUS_DEFAULT 0
+#define SETTING_SORTBYPROTO_DEFAULT 0
+#define SETTING_TRANSPARENT_DEFAULT 0
+#define SETTING_ALPHA_DEFAULT 200
+#define SETTING_AUTOALPHA_DEFAULT 150
+#define SETTING_CONFIRMDELETE_DEFAULT 1
+#define SETTING_AUTOHIDE_DEFAULT 0
+#define SETTING_HIDETIME_DEFAULT 30
+#define SETTING_CYCLETIME_DEFAULT 4
+#define SETTING_TRAYICON_DEFAULT SETTING_TRAYICON_SINGLE
+#define SETTING_ALWAYSSTATUS_DEFAULT 0
+#define SETTING_ALWAYSMULTI_DEFAULT 0
+
+#define SETTING_TRAYICON_SINGLE 0
+#define SETTING_TRAYICON_CYCLE 1
+#define SETTING_TRAYICON_MULTI 2
+
+#define SETTING_STATE_HIDDEN 0
+#define SETTING_STATE_MINIMIZED 1
+#define SETTING_STATE_NORMAL 2
+
+#define SETTING_BRINGTOFRONT_DEFAULT 0
+
+#endif // M_CLIST_H__
diff --git a/include/m_clistint.h b/include/m_clistint.h new file mode 100644 index 0000000000..1e88b13148 --- /dev/null +++ b/include/m_clistint.h @@ -0,0 +1,416 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_CLISTINT_H__
+#define M_CLISTINT_H__ 1
+
+#include "m_genmenu.h"
+#include "m_protocols.h"
+
+#define HCONTACT_ISGROUP 0x80000000
+#define HCONTACT_ISINFO 0xFFFF0000
+#define IsHContactGroup(h) (((UINT_PTR)(h)^HCONTACT_ISGROUP)<(HCONTACT_ISGROUP^HCONTACT_ISINFO))
+#define IsHContactInfo(h) (((UINT_PTR)(h)&HCONTACT_ISINFO)==HCONTACT_ISINFO)
+#define IsHContactContact(h) (((UINT_PTR)(h)&HCONTACT_ISGROUP)==0)
+#define MAXEXTRACOLUMNS 16
+
+#define MAX_TIP_SIZE 2048
+
+#define INTM_NAMECHANGED (WM_USER+10)
+#define INTM_ICONCHANGED (WM_USER+11)
+#define INTM_GROUPCHANGED (WM_USER+12)
+#define INTM_GROUPSCHANGED (WM_USER+13)
+#define INTM_CONTACTADDED (WM_USER+14)
+#define INTM_CONTACTDELETED (WM_USER+15)
+#define INTM_HIDDENCHANGED (WM_USER+16)
+#define INTM_INVALIDATE (WM_USER+17)
+#define INTM_APPARENTMODECHANGED (WM_USER+18)
+#define INTM_SETINFOTIPHOVERTIME (WM_USER+19)
+#define INTM_NOTONLISTCHANGED (WM_USER+20)
+#define INTM_RELOADOPTIONS (WM_USER+21)
+#define INTM_NAMEORDERCHANGED (WM_USER+22)
+#define INTM_IDLECHANGED (WM_USER+23)
+#define INTM_SCROLLBARCHANGED (WM_USER+24)
+#define INTM_PROTOCHANGED (WM_USER+25)
+
+#define TIMERID_RENAME 10
+#define TIMERID_DRAGAUTOSCROLL 11
+#define TIMERID_INFOTIP 13
+#define TIMERID_REBUILDAFTER 14
+#define TIMERID_DELAYEDRESORTCLC 15
+#define TIMERID_TRAYHOVER 16
+#define TIMERID_TRAYHOVER_2 17
+
+
+#define GROUP_ALLOCATE_STEP 8
+
+struct ClcContact;
+struct ClcData;
+struct CListEvent;
+
+/* templates, where are you... */
+
+typedef struct
+{
+ struct ClcContact** items;
+ int count, limit, increment;
+ void* sortFunc;
+}
+ ContactList;
+
+typedef struct
+{
+ struct CListEvent** items;
+ int count, limit, increment;
+ void* sortFunc;
+}
+ EventList;
+
+struct ClcGroup
+{
+ ContactList cl;
+ int expanded,hideOffline,groupId;
+ struct ClcGroup *parent;
+ int scanIndex;
+ int totalMembers;
+};
+
+struct ClcFontInfo
+{
+ HFONT hFont;
+ int fontHeight,changed;
+ COLORREF colour;
+};
+
+struct trayIconInfo_t
+{
+ int id;
+ char* szProto;
+ HICON hBaseIcon;
+ int isBase;
+ TCHAR* ptszToolTip;
+};
+
+typedef struct _menuProto
+{
+ char* szProto; //This is DLL-based unique name
+ HGENMENU pMenu;
+ HICON hIcon;
+}
+ MenuProto;
+
+/* constants */
+
+#define DRAGSTAGE_NOTMOVED 0
+#define DRAGSTAGE_ACTIVE 1
+#define DRAGSTAGEM_STAGE 0x00FF
+#define DRAGSTAGEF_MAYBERENAME 0x8000
+#define DRAGSTAGEF_OUTSIDE 0x4000
+
+#define CONTACTF_ONLINE 1
+#define CONTACTF_INVISTO 2
+#define CONTACTF_VISTO 4
+#define CONTACTF_NOTONLIST 8
+#define CONTACTF_CHECKED 16
+#define CONTACTF_IDLE 32
+
+#define DROPTARGET_OUTSIDE 0
+#define DROPTARGET_ONSELF 1
+#define DROPTARGET_ONNOTHING 2
+#define DROPTARGET_ONGROUP 3
+#define DROPTARGET_ONCONTACT 4
+#define DROPTARGET_INSERTION 5
+
+#define CLCDEFAULT_ROWHEIGHT 16
+#define CLCDEFAULT_EXSTYLE (CLS_EX_EDITLABELS|CLS_EX_TRACKSELECT|CLS_EX_SHOWGROUPCOUNTS|CLS_EX_HIDECOUNTSWHENEMPTY|CLS_EX_TRACKSELECT|CLS_EX_NOTRANSLUCENTSEL) //plus CLS_EX_NOSMOOTHSCROLL is got from the system
+#define CLCDEFAULT_SCROLLTIME 150
+#define CLCDEFAULT_GROUPINDENT 5
+#define CLCDEFAULT_BKCOLOUR GetSysColor(COLOR_3DFACE)
+#define CLCDEFAULT_USEBITMAP 0
+#define CLCDEFAULT_BKBMPUSE CLB_STRETCH
+#define CLCDEFAULT_OFFLINEMODES MODEF_OFFLINE
+#define CLCDEFAULT_GREYOUTFLAGS 0
+#define CLCDEFAULT_FULLGREYOUTFLAGS (MODEF_OFFLINE|PF2_INVISIBLE|GREYF_UNFOCUS)
+#define CLCDEFAULT_SELBLEND 1
+#define CLCDEFAULT_SELBKCOLOUR GetSysColor(COLOR_HIGHLIGHT)
+#define CLCDEFAULT_TEXTCOLOUR GetSysColor(COLOR_WINDOWTEXT)
+#define CLCDEFAULT_SELTEXTCOLOUR GetSysColor(COLOR_HIGHLIGHTTEXT)
+#define CLCDEFAULT_HOTTEXTCOLOUR (IsWinVer98Plus()?RGB(0,0,255):GetSysColor(COLOR_HOTLIGHT))
+#define CLCDEFAULT_QUICKSEARCHCOLOUR RGB(255,255,0)
+#define CLCDEFAULT_LEFTMARGIN 0
+#define CLCDEFAULT_GAMMACORRECT 1
+#define CLCDEFAULT_SHOWIDLE 1
+#define CLCDEFAULT_USEWINDOWSCOLOURS 0
+
+#define TRAYICON_ID_BASE 100
+#define TIM_CALLBACK (WM_USER+1857)
+#define TIM_CREATE (WM_USER+1858)
+
+// Miranda 0.4.3.0+
+// retrieves the pointer to a CLIST_INTERFACE structure
+// NOTE: valid only for the clist clone building, not for the regular use
+
+#define MS_CLIST_RETRIEVE_INTERFACE "CList/RetrieveInterface"
+
+/***************************************************************************
+ * CLIST_INTERFACE structure definition
+ ***************************************************************************/
+
+typedef struct {
+ char *szProto;
+ DWORD dwStatus;
+}
+ ClcProtoStatus;
+
+typedef struct
+{
+ HANDLE hContact;
+ TCHAR* name;
+ #if defined( _UNICODE )
+ char* szName;
+ #endif
+ TCHAR* group;
+ int isHidden;
+}
+ ClcCacheEntryBase;
+
+typedef struct
+{
+ int version;
+
+ HWND hwndContactList, hwndContactTree, hwndStatus;
+ HMENU hMenuMain;
+ HMODULE hInst;
+
+ int hClcProtoCount;
+ ClcProtoStatus *clcProto;
+
+ /* clc.h */
+ void ( *pfnClcOptionsChanged )( void );
+ void ( *pfnClcBroadcast )( int, WPARAM, LPARAM );
+ HMENU ( *pfnBuildGroupPopupMenu )( struct ClcGroup* );
+
+ LRESULT ( CALLBACK *pfnContactListControlWndProc )( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
+
+ /* clcfiledrop.c */
+ void ( *pfnRegisterFileDropping )( HWND hwnd );
+ void ( *pfnUnregisterFileDropping )( HWND hwnd );
+
+ /* clcidents.c */
+ int ( *pfnGetRowsPriorTo )( struct ClcGroup *group, struct ClcGroup *subgroup, int contactIndex );
+ int ( *pfnFindItem )( HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **contact, struct ClcGroup **subgroup, int *isVisible );
+ int ( *pfnGetRowByIndex )( struct ClcData *dat, int testindex, struct ClcContact **contact, struct ClcGroup **subgroup );
+ HANDLE ( *pfnContactToHItem )( struct ClcContact* contact );
+ HANDLE ( *pfnContactToItemHandle )( struct ClcContact * contact, DWORD * nmFlags );
+
+ /* clcitems.c */
+ struct ClcContact* ( *pfnCreateClcContact )( void );
+ struct ClcGroup* ( *pfnAddGroup )( HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers );
+ struct ClcGroup* ( *pfnRemoveItemFromGroup )(HWND hwnd, struct ClcGroup *group, struct ClcContact *contact, int updateTotalCount);
+
+ void ( *pfnFreeContact )( struct ClcContact *contact );
+ void ( *pfnFreeGroup )( struct ClcGroup *group );
+
+ int ( *pfnAddInfoItemToGroup )(struct ClcGroup *group, int flags, const TCHAR *pszText);
+ int ( *pfnAddItemToGroup )( struct ClcGroup *group,int iAboveItem );
+ int ( *pfnAddContactToGroup )( struct ClcData *dat, struct ClcGroup *group, HANDLE hContact );
+ void ( *pfnAddContactToTree )( HWND hwnd, struct ClcData *dat, HANDLE hContact, int updateTotalCount, int checkHideOffline);
+ void ( *pfnDeleteItemFromTree )( HWND hwnd, HANDLE hItem );
+ void ( *pfnRebuildEntireList )( HWND hwnd, struct ClcData *dat );
+ int ( *pfnGetGroupContentsCount )( struct ClcGroup *group, int visibleOnly );
+ void ( *pfnSortCLC )( HWND hwnd, struct ClcData *dat, int useInsertionSort );
+ void ( *pfnSaveStateAndRebuildList )(HWND hwnd, struct ClcData *dat);
+
+ /* clcmsgs.c */
+ LRESULT ( *pfnProcessExternalMessages )(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam );
+
+ /* clcpaint.c */
+ void ( *pfnPaintClc )( HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint );
+
+ /* clcutils.c */
+ char* ( *pfnGetGroupCountsText )(struct ClcData *dat, struct ClcContact *contact );
+ int ( *pfnHitTest )( HWND hwnd, struct ClcData *dat, int testx, int testy, struct ClcContact **contact, struct ClcGroup **group, DWORD * flags );
+ void ( *pfnScrollTo )( HWND hwnd, struct ClcData *dat, int desty, int noSmooth );
+ void ( *pfnEnsureVisible )(HWND hwnd, struct ClcData *dat, int iItem, int partialOk );
+ void ( *pfnRecalcScrollBar )( HWND hwnd, struct ClcData *dat );
+ void ( *pfnSetGroupExpand )( HWND hwnd, struct ClcData *dat, struct ClcGroup *group, int newState );
+ void ( *pfnDoSelectionDefaultAction )( HWND hwnd, struct ClcData *dat );
+ int ( *pfnFindRowByText )(HWND hwnd, struct ClcData *dat, const TCHAR *text, int prefixOk );
+ void ( *pfnEndRename )(HWND hwnd, struct ClcData *dat, int save );
+ void ( *pfnDeleteFromContactList )( HWND hwnd, struct ClcData *dat );
+ void ( *pfnBeginRenameSelection )( HWND hwnd, struct ClcData *dat );
+ void ( *pfnCalcEipPosition )( struct ClcData *dat, struct ClcContact *contact, struct ClcGroup *group, POINT *result);
+ int ( *pfnGetDropTargetInformation )( HWND hwnd, struct ClcData *dat, POINT pt );
+ int ( *pfnClcStatusToPf2 )( int status );
+ int ( *pfnIsHiddenMode )( struct ClcData *dat, int status );
+ void ( *pfnHideInfoTip )( HWND hwnd, struct ClcData *dat );
+ void ( *pfnNotifyNewContact )( HWND hwnd, HANDLE hContact );
+ DWORD ( *pfnGetDefaultExStyle )( void );
+ void ( *pfnGetDefaultFontSetting )( int i, LOGFONT* lf, COLORREF* colour );
+ void ( *pfnGetFontSetting )( int i, LOGFONT* lf, COLORREF* colour );
+ void ( *pfnLoadClcOptions )( HWND hwnd, struct ClcData *dat );
+ void ( *pfnRecalculateGroupCheckboxes )( HWND hwnd, struct ClcData *dat );
+ void ( *pfnSetGroupChildCheckboxes )( struct ClcGroup *group, int checked );
+ void ( *pfnInvalidateItem )( HWND hwnd, struct ClcData *dat, int iItem );
+
+ int ( *pfnGetRowBottomY )(struct ClcData *dat, int item);
+ int ( *pfnGetRowHeight )(struct ClcData *dat, int item);
+ int ( *pfnGetRowTopY )(struct ClcData *dat, int item);
+ int ( *pfnGetRowTotalHeight )(struct ClcData *dat);
+ int ( *pfnRowHitTest )(struct ClcData *dat, int y);
+
+ /* clistevents.c */
+ int ( *pfnEventsProcessContactDoubleClick )( HANDLE hContact );
+ int ( *pfnEventsProcessTrayDoubleClick )( int );
+
+ /* clistmod.c */
+ int ( *pfnIconFromStatusMode )( const char *szProto, int status, HANDLE hContact );
+ int ( *pfnShowHide )( WPARAM, LPARAM );
+ TCHAR* ( *pfnGetStatusModeDescription )( int mode, int flags );
+
+ /* clistsettings.c */
+ ClcCacheEntryBase* ( *pfnGetCacheEntry )( HANDLE hContact );
+ ClcCacheEntryBase* ( *pfnCreateCacheItem )( HANDLE hContact );
+ void ( *pfnCheckCacheItem )( ClcCacheEntryBase* );
+ void ( *pfnFreeCacheItem )( ClcCacheEntryBase* );
+
+ TCHAR* ( *pfnGetContactDisplayName )( HANDLE hContact, int mode );
+ void ( *pfnInvalidateDisplayNameCacheEntry )( HANDLE hContact );
+
+ /* clisttray.c */
+ void ( *pfnTrayIconUpdateWithImageList )( int iImage, const TCHAR *szNewTip, char *szPreferredProto );
+ void ( *pfnTrayIconUpdateBase )( const char *szChangedProto );
+ void ( *pfnTrayIconSetToBase )( char *szPreferredProto );
+ void ( *pfnTrayIconIconsChanged )( void );
+ int ( *pfnTrayIconPauseAutoHide )( WPARAM wParam, LPARAM lParam );
+ INT_PTR ( *pfnTrayIconProcessMessage )( WPARAM wParam, LPARAM lParam );
+ int ( *pfnCListTrayNotify )( MIRANDASYSTRAYNOTIFY* );
+
+ /* clui.c */
+ LRESULT ( CALLBACK *pfnContactListWndProc )( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
+
+ void ( *pfnCluiProtocolStatusChanged )( int status, const char* szProto );
+ void ( *pfnDrawMenuItem )( LPDRAWITEMSTRUCT, HICON, HICON );
+ void ( *pfnLoadCluiGlobalOpts )( void );
+ BOOL ( *pfnInvalidateRect )( HWND hwnd, CONST RECT* lpRect,BOOL bErase );
+ void ( *pfnOnCreateClc )( void );
+
+ /* contact.c */
+ void ( *pfnChangeContactIcon )( HANDLE hContact, int iIcon, int add );
+ void ( *pfnLoadContactTree )( void );
+ int ( *pfnCompareContacts )( const struct ClcContact *contact1, const struct ClcContact *contact2 );
+ void ( *pfnSortContacts )( void );
+ int ( *pfnSetHideOffline )( WPARAM wParam, LPARAM lParam );
+
+ /* docking.c */
+ int ( *pfnDocking_ProcessWindowMessage )( WPARAM wParam, LPARAM lParam );
+
+ /* group.c */
+ TCHAR* ( *pfnGetGroupName )( int idx, DWORD* pdwFlags );
+ int ( *pfnRenameGroup )( int groupID, TCHAR* newName );
+
+ /* keyboard.c */
+ int ( *pfnHotKeysRegister )( HWND hwnd );
+ void ( *pfnHotKeysUnregister )( HWND hwnd );
+ int ( *pfnHotKeysProcess )( HWND hwnd, WPARAM wParam, LPARAM lParam );
+ int ( *pfnHotkeysProcessMessage )( WPARAM wParam, LPARAM lParam );
+
+ /*************************************************************************************
+ * version 2 - events processing
+ *************************************************************************************/
+
+ EventList events;
+
+ struct CListEvent* ( *pfnCreateEvent )( void );
+ void ( *pfnFreeEvent )( struct CListEvent* );
+
+ struct CListEvent* ( *pfnAddEvent )( CLISTEVENT* );
+ CLISTEVENT* ( *pfnGetEvent )( HANDLE hContact, int idx );
+
+ int ( *pfnRemoveEvent )( HANDLE hContact, HANDLE hDbEvent );
+ int ( *pfnGetImlIconIndex )( HICON hIcon );
+
+ /*************************************************************************************
+ * version 3 additions
+ *************************************************************************************/
+
+ int ( *pfnGetWindowVisibleState )( HWND hWnd, int iStepX, int iStepY );
+
+ /*************************************************************************************
+ * version 4 additions (0.7.0.x) - genmenu
+ *************************************************************************************/
+
+ MenuProto* menuProtos;
+ int menuProtoCount;
+
+ HANDLE hPreBuildStatusMenuEvent;
+ int currentStatusMenuItem, currentDesiredStatusMode;
+ BOOL bDisplayLocked;
+
+ HGENMENU ( *pfnGetProtocolMenu )( const char* );
+ int ( *pfnStub2 )( int );
+
+ int ( *pfnGetProtocolVisibility )( const char* );
+ int ( *pfnGetProtoIndexByPos )( PROTOCOLDESCRIPTOR** proto, int protoCnt, int Pos);
+ void ( *pfnReloadProtoMenus )( void );
+
+ /*************************************************************************************
+ * version 5 additions (0.7.0.x) - tray icons
+ *************************************************************************************/
+
+ struct trayIconInfo_t* trayIcon;
+ int trayIconCount;
+ int shellVersion;
+ UINT_PTR cycleTimerId;
+ int cycleStep;
+ TCHAR* szTip;
+ BOOL bTrayMenuOnScreen;
+
+ HICON ( *pfnGetIconFromStatusMode )( HANDLE hContact, const char *szProto, int status );
+
+ void ( *pfnInitTray )( void );
+ int ( *pfnTrayIconAdd )( HWND hwnd, const char *szProto, const char *szIconProto, int status );
+ int ( *pfnTrayIconDestroy )( HWND hwnd );
+ int ( *pfnTrayIconInit )( HWND hwnd );
+ TCHAR* ( *pfnTrayIconMakeTooltip )( const TCHAR *szPrefix, const char *szProto );
+ void ( *pfnTrayIconRemove )( HWND hwnd, const char *szProto );
+ int ( *pfnTrayIconSetBaseInfo )( HICON hIcon, const char *szPreferredProto );
+ void ( *pfnTrayIconTaskbarCreated )( HWND hwnd );
+ int ( *pfnTrayIconUpdate )( HICON hNewIcon, const TCHAR *szNewTip, const char *szPreferredProto, int isBase );
+
+ void ( *pfnUninitTray )( void );
+ void ( *pfnLockTray )( void );
+ void ( *pfnUnlockTray )( void );
+
+ VOID ( CALLBACK *pfnTrayCycleTimerProc )( HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime );
+
+ /*************************************************************************************
+ * version 6 additions (0.8.0.x) - accounts
+ *************************************************************************************/
+ int ( *pfnGetAccountIndexByPos )( int pos );
+}
+ CLIST_INTERFACE;
+
+extern CLIST_INTERFACE cli, *pcli;
+
+#endif // M_CLISTINT_H__
diff --git a/include/m_clui.h b/include/m_clui.h new file mode 100644 index 0000000000..c811feedc4 --- /dev/null +++ b/include/m_clui.h @@ -0,0 +1,183 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_CLUI_H__
+#define M_CLUI_H__ 1
+
+//this module was created in 0.1.1.0
+//you probably shouldn't need to call anything in here. Look in
+//ui/contactlist/m_clist.h instead
+
+//gets the handle for the contact list window
+//wParam=lParam=0
+//returns the HWND
+//This call has a few very specific purposes internally in Miranda, and
+//shouldn't be gratuitously used. In almost all cases there's another call to
+//do whatever it is you are trying to do.
+#define MS_CLUI_GETHWND "CLUI/GetHwnd"
+
+//get ContactTree hwnd
+#define MS_CLUI_GETHWNDTREE "CLUI/GetHwndTree"
+
+//change protocol-specific status indicators
+//wParam=new status
+//lParam=(LPARAM)(const char*)szProtocolID
+//returns 0 on success, nonzero on failure
+//protocol modules don't want to call this. They want
+//clist/protocolstatuschanged instead
+#define MS_CLUI_PROTOCOLSTATUSCHANGED "CLUI/ProtocolStatusChanged"
+
+//a new group was created. Add it to the list
+//wParam=(WPARAM)(HANDLE)hGroup
+//lParam=newGroup
+//returns 0 on success, nonzero on failure
+//newGroup is set to 1 if the user just created the group, and 0 otherwise
+//this is also called when the contact list is being rebuilt
+//new groups are always created with the name "New Group"
+#define MS_CLUI_GROUPADDED "CLUI/GroupCreated"
+
+//change the icon for a contact
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=iconid
+//returns 0 on sucess, nonzero on failure
+//iconid is an offset in the image list. see clist/geticonsimagelist
+#define MS_CLUI_CONTACTSETICON "CLUI/ContactSetIcon"
+
+//remove a contact from the list
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=0
+//returns 0 on success, nonzero on failure
+//this is not necessarily the same as a contact being actually deleted, since
+//if a contact goes offline while 'hide offline' is on, this will be called
+#define MS_CLUI_CONTACTDELETED "CLUI/ContactDeleted"
+
+//add a contact to the list
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=iconId
+//returns 0 on success, nonzero on failure
+//The caller processes the 'hide offline' setting, so the callee should not do
+//further processing based on the value of this setting.
+//warning: this will be called to re-add a contact when they come online if
+//'hide offline' is on, but it cannot determine if the contact is already on
+//the list, so you may get requests to add a contact when it is already on the
+//list, which you should ignore.
+//You'll also get this whenever an event is added for a contact, since if the
+//contact was offline it needs to be shown to display the message, even if hide
+//offline is on.
+//You should not re-sort the list on this call. A separate resort request will
+//be sent
+//iconid is an offset in the image list. see clist/geticonsimagelist
+#define MS_CLUI_CONTACTADDED "CLUI/ContactAdded"
+
+//rename a contact in the list
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=0
+//returns 0 on success, nonzero on failure
+//you should not re-sort the list on this call. A separate resort request will
+//be sent
+//you get the new name from clist/getcontactdisplayname
+#define MS_CLUI_CONTACTRENAMED "CLUI/ContactRenamed"
+
+//start a rebuild of the contact list
+//wParam=lParam=0
+//returns 0 on success, nonzero on failure
+//this is the cue to clear the existing contents of the list
+//expect to get a series of clui/groupadded calls followed by a series of
+//clui/contactadded calls, then a clui/resortlist
+#define MS_CLUI_LISTBEGINREBUILD "CLUI/ListBeginRebuild"
+
+//end a rebuild of the contact list
+//wParam=lParam=0
+//returns 0 on success, nonzero on failure
+//if you displayed an hourglass in beginrebuild, set it back here
+//you do not need to explicitly sort the list
+#define MS_CLUI_LISTENDREBUILD "CLUI/ListEndRebuild"
+
+//sort the contact list now
+//wParam=lParam=0
+//returns 0 on success, nonzero on failure
+//sorts are buffered so you won't get this message lots of times if the list
+//needs to be re-sorted many times rapidly.
+#define MS_CLUI_SORTLIST "CLUI/SortList"
+
+//Gets a load of capabilities for the loaded CLUI v0.1.2.1+
+//wParam=capability, CLUICAPS_*
+//lParam=0
+//returns the requested value, 0 if wParam is an unknown value
+//If this service is not implemented, it is assumed to return 0 to all input
+
+#define CLUICAPS_FLAGS1 0
+#define CLUIF_HIDEEMPTYGROUPS 1 //the clist has a checkbox in its options
+ //to set this, which will be hidden if this flag is not set. It is
+ //up to the CLUI to provide support for it, but it just seemed insane
+ //to me to have hide offline and hide empty in different pages.
+ //The setting is "CList"/"HideEmptyGroups", a byte. A complete list
+ //reload is sent whenever the user changes it.
+#define CLUIF_DISABLEGROUPS 2 //can show list without groups. Adds option
+ //to change "CList"/"UseGroups", a byte.
+#define CLUIF_HASONTOPOPTION 4 //the clui options page provides a way to
+ //change "CList"/"OnTop", a byte. When it is changed the clui should
+ //also set the topmost flag on the window using SetWindowPos().
+#define CLUIF_HASAUTOHIDEOPTION 8 //the clui options page provides a way to
+ //change the list auto hide options. It should read and write the
+ //byte "CList"/"AutoHide" and the word "CList"/"HideTime". No other
+ //action is needed.
+
+#define CLUICAPS_FLAGS2 1 //Returns info about extra icons
+ //HIWORD is the first extra icon number, LOWORD is the extra icons count
+
+//LPARAMS for CLUICAPS_FLAGS2
+#define CLUIF2_PLUGININFO 1 //returns pointer to plugininfo
+#define CLUIF2_CLISTTYPE 2 // the genaration of list in chronologic
+// modern layered return 0x07 (assuming classic, mw, meta, nicer1, modern1, nicer++, modernLayered)
+// +0x0100 for unicode
+#define CLUIF2_EXTRACOLUMNCOUNT 3 // return max number of extra icon available to be set in main window
+#define CLUIF2_USEREXTRASTART 4 // return index of first 'advanced' image except Adv1 and Adv2
+
+#define MS_CLUI_GETCAPS "CLUI/GetCaps"
+
+//a contact is being dragged outside the main window v0.1.2.0+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=MAKELPARAM(screenX,screenY)
+//return nonzero to make the cursor a 'can drop here', or zero for 'no'
+#define ME_CLUI_CONTACTDRAGGING "CLUI/ContactDragging"
+
+//a contact has just been dropped outside the main window v0.1.2.0+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=MAKELPARAM(screenX,screenY)
+//return nonzero if your hook processed this, so no other hooks get it
+#define ME_CLUI_CONTACTDROPPED "CLUI/ContactDropped"
+
+//a contact that was being dragged outside the main window has gone back in to
+//the main window. v0.1.2.1+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=0
+//return zero
+#define ME_CLUI_CONTACTDRAGSTOP "CLUI/ContactDragStop"
+
+// return TRUE if Clist Module Support Metacontacts
+#define MS_CLUI_METASUPPORT "CLUI/MetaContactSupport"
+
+
+#endif // M_CLUI_H__
+
diff --git a/include/m_cluiframes.h b/include/m_cluiframes.h new file mode 100644 index 0000000000..dbed148cea --- /dev/null +++ b/include/m_cluiframes.h @@ -0,0 +1,318 @@ +/*
+Miranda ICQ: the free icq client for MS Windows
+Copyright (C) 2000-2 Richard Hughes, Roland Rabien & Tristan Van de Vreede
+
+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.
+*/
+
+//Extra columns type.
+//column arranged in this way
+//
+// [statusicon] ContactName [WEB][ADV1][ADV2][SMS][EMAIL][PROTO][CLIENT]
+//
+#define EXTRA_ICON_RES0 0 // only used by nicer
+#define EXTRA_ICON_EMAIL 1
+#define EXTRA_ICON_PROTO 2 // used by mwclist and modern
+#define EXTRA_ICON_RES1 2 // only used by nicer
+#define EXTRA_ICON_SMS 3
+#define EXTRA_ICON_ADV1 4
+#define EXTRA_ICON_ADV2 5
+#define EXTRA_ICON_WEB 6
+#define EXTRA_ICON_CLIENT 7
+#define EXTRA_ICON_VISMODE 8 // only used by modern
+#define EXTRA_ICON_RES2 8 // only used by nicer
+#define EXTRA_ICON_ADV3 9
+#define EXTRA_ICON_ADV4 10
+
+#ifndef EXTRA_ICON_COUNT
+#define EXTRA_ICON_COUNT 10 // define this inside clist-plugin depending on used icon slots
+#endif
+
+typedef struct
+{
+ int cbSize; //must be sizeof(IconExtraColumn)
+ int ColumnType;
+ HANDLE hImage; //return value from MS_CLIST_EXTRA_ADD_ICON
+}IconExtraColumn,*pIconExtraColumn;
+
+//Set icon for contact at needed column
+//wparam=hContact
+//lparam=pIconExtraColumn
+//return 0 on success,-1 on failure
+//
+//See above for supported columns
+#define MS_CLIST_EXTRA_SET_ICON "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
+#define MS_CLIST_EXTRA_ADD_ICON "CListFrames/AddIconToExtraImageList"
+
+#define ME_CLIST_EXTRA_LIST_REBUILD "CListFrames/OnExtraListRebuild"
+
+//called with wparam=hContact
+#define ME_CLIST_EXTRA_IMAGE_APPLY "CListFrames/OnExtraImageApply"
+
+//called with wparam=hContact lparam=extra
+#define ME_CLIST_EXTRA_CLICK "CListFrames/OnExtraClick"
+
+//End of extra images header. TODO move it to separate m_extraimages.h file
+//Cause it has not any relationship to cluiframes engine
+
+
+/************************************************************************/
+/* CLUI Frames Support */
+/************************************************************************/
+
+
+// Constants used below
+typedef struct tagCLISTFrame {
+ DWORD cbSize;
+ HWND hWnd ;
+ HICON hIcon;
+ int align; //al flags below
+ union {
+ int height;
+ int minSize; //the actual meaning depends from type of frame
+ };
+ int Flags; //F_flags below
+ union {
+ char *name; //frame window name indentifier (DO NOT TRANSLATE)
+ wchar_t *wname;
+ LPTSTR tname;
+ };
+ union {
+ char *TBname; //titlebar & menu caption
+ wchar_t *TBwname;
+ LPTSTR TBtname;
+ };
+} CLISTFrame;
+
+#define F_VISIBLE 1 //Frame visible
+#define F_SHOWTB 2 //Show TitleBar
+#define F_UNCOLLAPSED 4 //UnCollapse frame
+#define F_LOCKED 8 //Lock Frame
+#define F_NOBORDER 16 //Dont apply WS_BORDER style for window
+#define F_SHOWTBTIP 32 //Show titlebar tooltip
+#define F_CANBEVERTICAL 64 //frames can be vertical
+#define F_CANNOTBEHORIZONTAL 128 //frames can NOT be horizontal F_CANBEVERTICAL have to be set
+#define F_NO_SUBCONTAINER 1024 //Support skining no subcontainer needed
+#define F_SKINNED 2048 // skinned frame (for owned subframe only)
+#define F_UNICODE 32768 //Use unicode text
+#ifdef _UNICODE
+# define F_TCHAR F_UNICODE
+#else
+# define F_TCHAR 0
+#endif
+
+// frame alignment
+#define alTop 0x00000001
+#define alBottom 0x00000002
+#define alClient 0x00000004 //only one alClient frame
+
+// since 0.7.0.20
+#define alLeft 0x00000011 // frame is vertical
+#define alRight 0x00000012
+
+#define alVertFrameMask 0x00000010
+
+#define FU_TBREDRAW 1 //redraw titlebar
+#define FU_FMREDRAW 2 //redraw Frame
+#define FU_FMPOS 4 //update Frame position
+
+#define FO_FLAGS 0x0001 //return set of F_VISIBLE,F_SHOWTB,F_UNCOLLAPSED,F_LOCKED,F_NOBORDER,F_SHOWTBTIP
+#define FO_NAME 0x0002 //Change m_cacheTName
+#define FO_TBNAME 0x0003 //Change TB caption
+#define FO_TBSTYLE 0x0004 //Change TB style
+#define FO_TBEXSTYLE 0x0005 //Change TB exstyle
+#define FO_ICON 0x0006 //Change icon
+#define FO_HEIGHT 0x0007 //Change height
+#define FO_ALIGN 0x0008 //Change align
+#define FO_TBTIPNAME 0x0009 //Change TB tooltip
+#define FO_FLOATING 0x000a //Change floating mode
+
+#define FO_UNICODETEXT 0x8000 // flag for FO_NAME,FO_TBNAME, FO_TBTIPNAME set/get lPAram as unicode wchar_t
+#ifdef _UNICODE
+ #define FO_TCHAR FO_UNICODETEXT
+#else
+ #define FO_TCHAR 0x0000
+#endif
+
+
+//////////////////////////////////////////////////////////////////////////
+//want show tooltip for statusbar
+//wparam=(char *)protocolname
+//lparam=0
+#define ME_CLIST_FRAMES_SB_SHOW_TOOLTIP "CListFrames/StatusBarShowToolTip"
+
+//////////////////////////////////////////////////////////////////////////
+//want hide tooltip for statusbar
+//wparam=lparam=0
+#define ME_CLIST_FRAMES_SB_HIDE_TOOLTIP "CListFrames/StatusBarHideToolTip"
+
+//////////////////////////////////////////////////////////////////////////
+//adds a frame window
+//wParam=(CLISTFrame*)
+//lParam=0
+//returns an integer, the frame id.
+#define MS_CLIST_FRAMES_ADDFRAME "CListFrames/AddFrame"
+
+//////////////////////////////////////////////////////////////////////////
+// remove frame. It destroy your window
+//
+#define MS_CLIST_FRAMES_REMOVEFRAME "CListFrames/RemoveFrame"
+
+//////////////////////////////////////////////////////////////////////////
+//shows all frames
+//wParam=lParam=0
+//returns 0 on success, -1 on failure
+#define MS_CLIST_FRAMES_SHOWALLFRAMES "CListFrames/ShowALLFrames"
+
+//////////////////////////////////////////////////////////////////////////
+//shows the titlebars of all frames
+//wParam=lParam=0
+//returns 0 on success, -1 on failure
+#define MS_CLIST_FRAMES_SHOWALLFRAMESTB "CListFrames/ShowALLFramesTB"
+
+//////////////////////////////////////////////////////////////////////////
+//hides the titlebars of all frames
+//wParam=lParam=0
+//returns 0 on success, -1 on failure
+#define MS_CLIST_FRAMES_HIDEALLFRAMESTB "CListFrames/HideALLFramesTB"
+
+//////////////////////////////////////////////////////////////////////////
+//shows the frame if it is hidden,
+//hides the frame if it is shown
+//wParam = FrameId
+//lParam = Frame number (can be shown in profile in CLUIFrames key)
+//returns 0 on success, -1 on failure
+//note that Frame number will be taken only if wParam == 0
+#define MS_CLIST_FRAMES_SHFRAME "CListFrames/SHFrame"
+
+//////////////////////////////////////////////////////////////////////////
+//shows the frame titlebar if it is hidden,
+//hides the frame titlebar if it is shown
+//wParam=FrameId
+//lParam = Frame number (can be shown in profile in CLUIFrames key)
+//returns 0 on success, -1 on failure
+//note that Frame number will be taken only if wParam == 0
+#define MS_CLIST_FRAMES_SHFRAMETITLEBAR "CListFrame/SHFrameTitleBar"
+
+//////////////////////////////////////////////////////////////////////////
+//locks the frame if it is unlocked,
+//unlock the frame if it is locked
+//wParam=FrameId
+//lParam = Frame number (can be shown in profile in CLUIFrames key)
+//returns 0 on success, -1 on failure
+//note that Frame number will be taken only if wParam == 0
+#define MS_CLIST_FRAMES_ULFRAME "CListFrame/ULFrame"
+
+//////////////////////////////////////////////////////////////////////////
+//collapses the frame if it is uncollapsed,
+//uncollapses the frame if it is collapsed
+//wParam=FrameId
+//lParam = Frame number (can be shown in profile in CLUIFrames key)
+//returns 0 on success, -1 on failure
+//note that Frame number will be taken only if wParam == 0
+#define MS_CLIST_FRAMES_UCOLLFRAME "CListFrame/UCOLLFrame"
+
+//////////////////////////////////////////////////////////////////////////
+//trigger border flags
+//wparam=frameid
+//lParam = Frame number (can be shown in profile in CLUIFrames key)
+//returns 0 on success, -1 on failure
+//note that Frame number will be taken only if wParam == 0
+#define MS_CLIST_FRAMES_SETUNBORDER "CListFrame/SetUnBorder"
+
+//////////////////////////////////////////////////////////////////////////
+//trigger skinned flags
+//wparam=frameid
+//lparam=0
+#define MS_CLIST_FRAMES_SETSKINNED "CListFrame/SetSkinnedFrame"
+
+//////////////////////////////////////////////////////////////////////////
+//redraws the frame
+//wParam=FrameId, -1 for all frames
+//lparam=FU_flags
+//returns a pointer to option, -1 on failure
+#define MS_CLIST_FRAMES_UPDATEFRAME "CListFrame/UpdateFrame"
+
+//////////////////////////////////////////////////////////////////////////
+//gets the frame options
+//(HIWORD)wParam=FrameId
+//(LOWORD)wParam=FO_flag
+//lParam=0
+//returns a pointer to option, -1 on failure
+#define MS_CLIST_FRAMES_GETFRAMEOPTIONS "CListFrame/GetFrameOptions"
+
+//sets the frame options
+//(HIWORLD)wParam=FrameId
+//(LOWORD)wParam=FO_flag
+//lParam=value
+//returns 0 on success, -1 on failure
+#define MS_CLIST_FRAMES_SETFRAMEOPTIONS "CListFrame/SetFrameOptions"
+
+//////////////////////////////////////////////////////////////////////////
+//Frames related menu stuff
+//////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////
+//add a new item to the context frame menu
+//wParam=0
+//lParam=(LPARAM)(CLISTMENUITEM*)&mi
+//returns a handle to the new item
+//popupposition=frameid
+//contactowner=advanced parameter
+#define MS_CLIST_ADDCONTEXTFRAMEMENUITEM "CList/AddContextFrameMenuItem"
+
+//////////////////////////////////////////////////////////////////////////
+//remove a item from context frame menu
+//wParam=hMenuItem returned by MS_CLIST_ADDCONTACTMENUITEM
+//lParam=0
+//returns 0 on success, nonzero on failure
+#define MS_CLIST_REMOVECONTEXTFRAMEMENUITEM "CList/RemoveContextFrameMenuItem"
+
+//////////////////////////////////////////////////////////////////////////
+//builds the context menu for a frame
+//wparam=frameid
+//lParam=0
+//returns a HMENU on success, or NULL on failure
+#define MS_CLIST_MENUBUILDFRAMECONTEXT "CList/BuildContextFrameMenu"
+
+//////////////////////////////////////////////////////////////////////////
+// the frame menu is about to be built
+// wparam=frameid
+// lparam=
+// -1 for build from titlebar,
+// use
+// MS_CLIST_ADDCONTEXTFRAMEMENUITEM
+// MS_CLIST_REMOVECONTEXTFRAMEMENUITEM
+//
+// >0 for build in main menu,
+// must be popupname=lparam to place your items in right popup of main menu.
+// use
+// MS_CLIST_ADDMAINMENUITEM
+// MS_CLIST_REMOVEMAINMENUITEM
+//
+#define ME_CLIST_PREBUILDFRAMEMENU "CList/PreBuildFrameMenu"
+
+//////////////////////////////////////////////////////////////////////////
+//needed by cluiframes module to add frames menu to main menu.
+//it just calls NotifyEventHooks(hPreBuildFrameMenuEvent,wParam,lParam);
+#define MS_CLIST_FRAMEMENUNOTIFY "CList/ContextFrameMenuNotify"
+
diff --git a/include/m_contactdir.h b/include/m_contactdir.h new file mode 100644 index 0000000000..805fa27d64 --- /dev/null +++ b/include/m_contactdir.h @@ -0,0 +1,162 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2005 Miranda ICQ/IM 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_CONTACTDIR_H__
+#define M_CONTACTDIR_H__ 1
+
+/* Contactdir module was created on 2005/05/17, 0.4.0.1
+
+ -- How you use this module as a protocol --
+
+ On Load() Register your protocol with the setting name that stores unique IDs, example:
+
+ if ( ContactDir_SupportExists() ) g_Atom=ContactDir_Register("ICQ", "UIN");
+
+ This will register your protocol and walk the database looking for all contacts on PROTOCOL_NAME which have
+ a "UIN" setting and store it in memory (converting to a string as needed) You of course have to
+ provide fallback if the services don't exist, it's an idea to keep existing code for that.
+
+ -
+
+ When you add a new contact via MS_DB_CONTACT_ADD, you must register it with your protocol atom too, via
+ ContactDir_AddContact(atom, "UIN #", hContact) and when it is deleted ContactDir_RemoveContact(atom, "UIN #")
+
+ -
+
+ To find a contact, use ContactDir_Lookup(atom, "ICQ #") which will return the hContact.
+
+*/
+
+typedef struct {
+ int cbSize;
+ char * szProto;
+ char * szSetting;
+ HANDLE atom; // out arg
+} CONTACTDIRECTORYDESCRIPTOR;
+
+/*
+ wParam: 0
+ lParam: (LPARAM) &CONTACTDIRECTORYDESCRIPTOR;
+ Affect: Register a given protocol and it's setting name which contains the unique key entry. e.g. ("ICQ", "UIN")
+ and return a HANDLE for use with other lookup services.
+ Returns: 0 on success, non zero on failure -- a returned handle is in .atom
+ Note: The directory will convert dword values into string representations but will not do this for bytes or words
+ used as IDs -- the protocol has to convert the IDs itself (:
+ Note: See ContactDir_Register() for a quicker way.
+ *** WARNING ***: This service does not expect the given module name to have registered as a protocol module, it
+ completely bypasses this information.
+ Version: 0.4.0.1 (2005/05/17+)
+*/
+#define MS_CONTACTDIR_REGISTER "ContactDir/Register"
+
+typedef struct {
+ int cbSize;
+ HANDLE atom; // Atom handle from MS_CONTACTDIR_REGISTER
+ char * szID; // in: value you wish to find (makes its own copy if needed)
+ HANDLE hContact; // out: hContact associated with szID, if any.
+} CONTACTDIRECTORYLOOKUP;
+
+/*
+
+ wParam: 0
+ lParam: (LPARAM) &CONTACTDIRECTORYLOOKUP;
+ Affect: Given an atom and string ID, will find the associated DB hContact value
+ Returns: 0 on success, non zero on failure
+ Version: 0.4.0.1 (2005/05/17+)
+ Note: ContactDir_Lookup() helper macro might be of use.
+*/
+
+#define MS_CONTACTDIR_LOOKUP "ContactDir/Lookup"
+
+/*
+ wParam: 0
+ lParam: (LPARAM)&CONTACTDIRECTORYLOOKUP;
+ Affect: Add a contact to a protocol atom association.
+ Returns: 0 on success, non zero on failure
+ Version: 0.4.0.1 (2005/05/17+)
+ Note: You must call this when you create a contact with MS_DB_CONTACT_ADD, see ContactDir_AddContact()
+*/
+#define MS_CONTACTDIR_ADDCONTACT "ContactDir/AddContact"
+
+/*
+ wParam: 0
+ lParam: (LPARAM)&CONTACTDIRECTORYLOOKUP;
+ Affect: Remove a contact to a protocol atom association.
+ Returns: 0 on success, non zero on failure
+ Version: 0.4.0.1 (2005/05/17+)
+ Note: see ContactDir_RemoveContact()
+*/
+#define MS_CONTACTDIR_REMOVECONTACT "ContactDir/RemoveContact"
+
+
+/* -- Helper functions -- */
+
+static int ContactDir_SupportExists(void)
+{
+ return ServiceExists(MS_CONTACTDIR_REGISTER);
+}
+
+// Only take as valid if ContactDir_SupportExists() returns true.
+static HANDLE ContactDir_Register(char * szProto, char * szSetting)
+{
+ CONTACTDIRECTORYDESCRIPTOR cd;
+ cd.cbSize=sizeof(CONTACTDIRECTORYDESCRIPTOR);
+ cd.szProto=szProto;
+ cd.szSetting=szSetting;
+ cd.atom=NULL;
+ CallService(MS_CONTACTDIR_REGISTER, 0, (LPARAM)&cd);
+ return cd.atom;
+}
+
+static __inline HANDLE ContactDir_Lookup(HANDLE atom, char * szID)
+{
+ CONTACTDIRECTORYLOOKUP f;
+ f.cbSize=sizeof(f);
+ f.atom=atom;
+ f.szID=szID;
+ f.hContact=NULL;
+ CallService(MS_CONTACTDIR_LOOKUP, 0, (LPARAM)&f);
+ return f.hContact;
+}
+
+static __inline void ContactDir_AddContact(HANDLE atom, char * szID, HANDLE hContact)
+{
+ CONTACTDIRECTORYLOOKUP c = {0};
+ c.cbSize=sizeof(CONTACTDIRECTORYLOOKUP);
+ c.atom=atom;
+ c.szID=szID;
+ c.hContact=hContact;
+ CallService(MS_CONTACTDIR_ADDCONTACT, 0, (LPARAM)&c);
+}
+
+static __inline void ContactDir_RemoveContact(HANDLE atom, char * szID)
+{
+ CONTACTDIRECTORYLOOKUP c = {0};
+ c.cbSize=sizeof(CONTACTDIRECTORYLOOKUP);
+ c.atom=atom;
+ c.szID=szID;
+ c.hContact=NULL;
+ CallService(MS_CONTACTDIR_REMOVECONTACT, 0, (LPARAM)&c);
+}
+
+#endif /* M_CONTACTDIR_H__ */
\ No newline at end of file diff --git a/include/m_contacts.h b/include/m_contacts.h new file mode 100644 index 0000000000..5b3e9980cc --- /dev/null +++ b/include/m_contacts.h @@ -0,0 +1,113 @@ +/*
+Miranda IM
+
+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_CONTACTS_H__
+#define M_CONTACTS_H__ 1
+
+typedef struct {
+ int cbSize;
+ BYTE dwFlag;
+ HANDLE hContact;
+ char *szProto;
+ BYTE type;
+ union {
+ BYTE bVal;
+ WORD wVal;
+ DWORD dVal;
+ TCHAR *pszVal;
+ WORD cchVal;
+ };
+} CONTACTINFO;
+
+// Types of information you can retreive by setting the dwFlag in CONTACTINFO
+#define CNF_FIRSTNAME 1 // returns first name (string)
+#define CNF_LASTNAME 2 // returns last name (string)
+#define CNF_NICK 3 // returns nick name (string)
+#define CNF_CUSTOMNICK 4 // returns custom nick name, clist name (string)
+#define CNF_EMAIL 5 // returns email (string)
+#define CNF_CITY 6 // returns city (string)
+#define CNF_STATE 7 // returns state (string)
+#define CNF_COUNTRY 8 // returns country (string)
+#define CNF_PHONE 9 // returns phone (string)
+#define CNF_HOMEPAGE 10 // returns homepage (string)
+#define CNF_ABOUT 11 // returns about info (string)
+#define CNF_GENDER 12 // returns gender (byte,'M','F' character)
+#define CNF_AGE 13 // returns age (byte, 0==unspecified)
+#define CNF_FIRSTLAST 14 // returns first name + last name (string)
+#define CNF_UNIQUEID 15 // returns uniqueid, protocol username (must check type for type of return)
+#define CNF_FAX 18 // returns fax (string)
+#define CNF_CELLULAR 19 // returns cellular (string)
+#define CNF_TIMEZONE 20 // returns timezone (string)
+#define CNF_MYNOTES 21 // returns user specified notes (string)
+#define CNF_BIRTHDAY 22 // returns birthday day of month (byte)
+#define CNF_BIRTHMONTH 23 // returns birthday month (byte)
+#define CNF_BIRTHYEAR 24 // returns birthday year (word)
+#define CNF_STREET 25 // returns street (string)
+#define CNF_ZIP 26 // returns zip code (string)
+#define CNF_LANGUAGE1 27 // returns language1 (string)
+#define CNF_LANGUAGE2 28 // returns language2 (string)
+#define CNF_LANGUAGE3 29 // returns language3 (string)
+#define CNF_CONAME 30 // returns company name (string)
+#define CNF_CODEPT 31 // returns company department (string)
+#define CNF_COPOSITION 32 // returns company position (string)
+#define CNF_COSTREET 33 // returns company street (string)
+#define CNF_COCITY 34 // returns company city (string)
+#define CNF_COSTATE 35 // returns company state (string)
+#define CNF_COZIP 36 // returns company zip code (string)
+#define CNF_COCOUNTRY 37 // returns company country (string)
+#define CNF_COHOMEPAGE 38 // returns company homepage (string)
+#define CNF_DISPLAYUID 39 // returns uniqueid to display in interface (must check type for type of return)
+
+// Special types
+// Return the custom name using the name order setting
+// IMPORTANT: When using CNF_DISPLAY you MUST free the string returned
+// You must **NOT** do this from your version of free() you have to use Miranda's free()
+// you can get a function pointer to Miranda's free() via MS_SYSTEM_GET_MMI, see m_system.h
+#define CNF_DISPLAY 16
+// Same as CNF_DISPLAY except the custom handle is not used
+// IMPORTANT: When using CNF_DISPLAYNC you MUST free the string returned
+// You must **NOT** do this from your version of free() you have to use Miranda's free()
+// you can get a function pointer to Miranda's free() via MS_SYSTEM_GET_MMI, see m_system.h
+#define CNF_DISPLAYNC 17
+
+// Add this flag if you want to get the Unicode info
+#define CNF_UNICODE 0x80
+
+#if defined( _UNICODE )
+ #define CNF_TCHAR CNF_UNICODE // will use TCHAR* instead of char*
+#else
+ #define CNF_TCHAR 0 // will return char*, as usual
+#endif
+
+// If MS_CONTACT_GETCONTACTINFO returns 0 (valid), then one of the following
+// types is setting telling you what type of info you received
+#define CNFT_BYTE 1
+#define CNFT_WORD 2
+#define CNFT_DWORD 3
+#define CNFT_ASCIIZ 4
+
+// Get contact information
+// wParam = not used
+// lParam = (CONTACTINFO *)
+// Returns 1 on failure to retrieve the info and 0 on success. If
+// sucessful, the type is set and the result is put into the associated
+// member of CONTACTINFO
+#define MS_CONTACT_GETCONTACTINFO "Miranda/Contact/GetContactInfo"
+
+#endif // M_CONTACTS_H__
+
diff --git a/include/m_crypto.h b/include/m_crypto.h new file mode 100644 index 0000000000..1b7751180b --- /dev/null +++ b/include/m_crypto.h @@ -0,0 +1,50 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2010 Miranda ICQ/IM 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_CRYPTO_H__
+#define M_CRYPTO_H__ 1
+
+typedef struct tagCRYPTOAPI
+{
+ DWORD dwVersion;
+
+ void (__cdecl *pfnSetKey)( const char* ); // sets the master password
+ void (__cdecl *pfnSetKeyT)( const TCHAR* );
+
+ void (__cdecl *pfnPurgeKey)( void ); // purges a key from memory
+
+ void (__cdecl *pfnEncodeString)( const char* src, char* buf, size_t buf_len);
+ void (__cdecl *pfnEncodeStringT)( const TCHAR* src, char* buf, size_t buf_len);
+
+ void (__cdecl *pfnDecodeString)( const char* src, char* buf, size_t buf_len);
+ void (__cdecl *pfnDecodeStringT)( const char* src, TCHAR* buf, size_t buf_len);
+}
+ CRYPTO_INTERFACE;
+
+//retrieves the crypto interface v0.10.0.2+
+//wParam=0
+//lParam=0
+//returns CRYPTO_INTERFACE* on success or NULL on failure
+#define MS_CRYPTO_GETINTERFACE "SRCrypto/GetInterface"
+
+#endif // M_CRYPTO_H__
diff --git a/include/m_database.h b/include/m_database.h new file mode 100644 index 0000000000..bf83d31d0e --- /dev/null +++ b/include/m_database.h @@ -0,0 +1,1212 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_DATABASE_H__
+#define M_DATABASE_H__ 1
+
+/******************* DATABASE MODULE ***************************/
+
+/* Notes (as I think of them):
+- The module is 100% thread-safe
+- The database is the main routing point for the vast majority of Miranda.
+ Events are sent from the protocol module to here, and the send/recv message
+ module (for example) hooks the db/event/added event. Events like 'contact
+ online status changed' do not come through here - icqlib will send that one.
+- contacts work much the same. the find/add users module calls db/contact/add
+ and db/contact/writesetting and the contact list will get db/contact/added
+ and db/contact/settingchanged events
+- The user is just a special contact. A hcontact of NULL in most functions
+ means the user. Functions in which it cannot be used will be stated
+- events attached to the user are things like system messages
+- also in this module are crypt/decrypt functions for stuff that should be
+ obfuscated on the disk, and some time functions for dealing with timestamps
+ in events.
+- the contactsettings system is designed for being read by many different
+ modules. eg lots of people will be interested in "ICQ"/"UIN", but the module
+ name passed to contact/writesetting should always be your own. The Mirabilis
+ ICQ database importer clearly has to be an exception to this rule, along with
+ a few other bits.
+- the current database format means that geteventcontact is exceptionally slow.
+ It should be avoidable in most cases so I'm not too concerned, but if people
+ really need to use it a lot, I'll sort it out.
+- handles do not need to be closed unless stated
+- the database is loaded as a memory mapped file. This has various
+ disadvantages but a massive advantage in speed for random access.
+- The database is optimised for reading. Write performance is fairly bad,
+ except for adding events which is the most common activity and pretty good.
+- I'll work on caching to improve this later
+- Deleted items are left as empty space and never reused. All new items are
+ put at the end. A count is kept of this slack space and at some point a
+ separate programme will need to be written to repack the database when the
+ slack gets too high. It's going to be a good few months of usage before this
+ can happen to anyone though, so no rush.
+*/
+
+/******************** GENERALLY USEFUL STUFF***********************/
+
+#include <tchar.h>
+
+#if !defined(M_SYSTEM_H__)
+ #include "m_system.h"
+#endif
+
+#if !defined(M_UTILS_H__)
+ #include "m_utils.h"
+#endif
+
+#ifdef _MSC_VER
+ #pragma warning(disable:4201 4204)
+#endif
+
+//DBVARIANT: used by db/contact/getsetting and db/contact/writesetting
+#define DBVT_DELETED 0 //this setting just got deleted, no other values are valid
+#define DBVT_BYTE 1 //bVal and cVal are valid
+#define DBVT_WORD 2 //wVal and sVal are valid
+#define DBVT_DWORD 4 //dVal and lVal are valid
+#define DBVT_ASCIIZ 255 //pszVal is valid
+#define DBVT_BLOB 254 //cpbVal and pbVal are valid
+#define DBVT_UTF8 253 //pszVal is valid
+#define DBVT_WCHAR 252 //pszVal is valid
+#if defined( _UNICODE )
+ #define DBVT_TCHAR DBVT_WCHAR
+#else
+ #define DBVT_TCHAR DBVT_ASCIIZ
+#endif
+#define DBVTF_VARIABLELENGTH 0x80
+#define DBVTF_DENYUNICODE 0x10000
+typedef struct {
+ BYTE type;
+ union {
+ BYTE bVal; char cVal;
+ WORD wVal; short sVal;
+ DWORD dVal; long lVal;
+ struct {
+ union {
+ char *pszVal;
+ TCHAR *ptszVal;
+ WCHAR *pwszVal;
+ };
+ WORD cchVal; //only used for db/contact/getsettingstatic
+ };
+ struct {
+ WORD cpbVal;
+ BYTE *pbVal;
+ };
+ };
+} DBVARIANT;
+
+/******************************************************************/
+/************************* SERVICES *******************************/
+/******************************************************************/
+
+/* DB/Contact/GetProfileName service
+Gets the name of the profile currently being used by the database module. This
+is the same as the filename of the database
+ wParam=(WPARAM)(UINT)cbName
+ lParam=(LPARAM)(char*)pszName
+pszName is a pointer to the buffer that receives the name of the profile
+cbName is the size in bytes of the pszName buffer
+Returns 0 on success or nonzero otherwise
+*/
+#define MS_DB_GETPROFILENAME "DB/GetProfileName"
+#define MS_DB_GETPROFILENAMEW "DB/GetProfileNameW"
+
+/* DB/Contact/GetProfilePath service
+Get the path of the base folder where Miranda will store all individual profiles
+The returned path does NOT include a trailing backslash.
+Essentially this is what has been set in mirandaboot.ini as ProfileDir.
+For more options to retrieve profile paths check MS_UTILS_REPLACEVARS
+ wParam=(WPARAM)(UINT)cbName
+ lParam=(LPARAM)(char*)pszName
+pszName is a pointer to the buffer that receives the path of the profile
+cbName is the size in bytes of the pszName buffer
+Returns 0 on success or nonzero otherwise
+*/
+#define MS_DB_GETPROFILEPATH "DB/GetProfilePath"
+#define MS_DB_GETPROFILEPATHW "DB/GetProfilePathW"
+
+#if defined( _UNICODE )
+ #define MS_DB_GETPROFILEPATHT MS_DB_GETPROFILEPATHW
+ #define MS_DB_GETPROFILENAMET MS_DB_GETPROFILENAMEW
+#else
+ #define MS_DB_GETPROFILEPATHT MS_DB_GETPROFILEPATH
+ #define MS_DB_GETPROFILENAMET MS_DB_GETPROFILENAME
+#endif
+
+/************************* Contact ********************************/
+
+/* DB/Contact/GetSetting service
+Look up the value of a named setting for a specific contact in the database
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=(LPARAM)(DBCONTACTGETSETTING*)&dbcgs
+hContact should have been returned by find*contact or addcontact
+Caller is responsible for free()ing dbcgs.pValue->pszVal and pbVal if they are
+returned. This should be done with db/contact/freevariant if you have your own
+heap (like DLLs do).
+Note that DBCONTACTGETSETTING takes a pointer to a DBVARIANT, whereas
+DBCONTACTWRITESETTING contains a DBVARIANT.
+Returns 0 on success or nonzero if the setting name was not found or hContact
+was invalid
+Because this is such a common function there are some short helper function at
+the bottom of this header that use it.
+
+(Added during 0.3.3+ development!!)
+
+If a setting is queried under for contact and it is deleted it will
+not be returned as a successful attempt, prior to 0.3.3 a *deleted*
+setting would be successfully read (which was a bug because the pValue
+was often garbage and maybe not even NULL terminated)
+
+To test for existing but 'deleted' settings, the return value will
+be 2, and pValue->type==DBVT_DELETED, at this point pValue is undefined.
+*/
+typedef struct {
+ const char *szModule; // pointer to name of the module that wrote the
+ // setting to get
+ const char *szSetting; // pointer to name of the setting to get
+ DBVARIANT *pValue; // pointer to variant to receive the value
+} DBCONTACTGETSETTING;
+#define MS_DB_CONTACT_GETSETTING "DB/Contact/GetSetting"
+
+/* DB/Contact/GetSettingString service 0.4.3+
+Same as DB/Contact/GetSetting, but also gets the required string type inside
+the dbcgs->type parameter
+*/
+#define MS_DB_CONTACT_GETSETTING_STR "DB/Contact/GetSettingStr"
+
+/* DB/Contact/GetSettingStatic service
+Look up the value of a named setting for a specific contact in the database
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=(LPARAM)(DBCONTACTGETSETTING*)&dbcgs
+hContact should have been returned by find*contact or addcontact
+This service differs from db/contact/getsetting in that it won't malloc()
+memory for the return value if it needs to do so. This introduces some extra
+constraints:
+Upon calling dbcgs.pValue->type should be initialised to the expected type of
+the setting. If the setting is of an integral type it won't matter if it's
+wrong and the service will correct it before returning, however if the setting
+is a string or a blob the service needs to know where to put the data and will
+fail if type is set wrongly.
+If dbcgs.pValue->type is DBVT_ASCIIZ or DBVT_BLOB upon calling, the
+corresponding data field (pszVal or pbVal) must point to a buffer allocated by
+the caller and the length field (cchVal or cpbVal) must contain the size of
+that buffer in bytes.
+If the setting type is variable length (DBVT_ASCIIZ or DBVT_BLOB), on exit the
+length field (cchVal or cpbVal) will be filled with the full length of the
+setting's value (excluding the terminating nul if it's DBVT_ASCIIZ).
+This service exists as well as db/contact/getsetting because malloc()/free()
+can be too slow for frequently queried settings.
+Returns 0 on success or nonzero if the setting name was not found or hContact
+was invalid.
+*/
+#define MS_DB_CONTACT_GETSETTINGSTATIC "DB/Contact/GetSettingStatic"
+
+/* DB/Contact/FreeVariant service
+Free the memory in a DBVARIANT that is allocated by a call to
+db/contact/getsetting
+ wParam=0
+ lParam=(LPARAM)(DBVARIANT*)&dbv
+Returns 0 on success, nonzero otherwise
+This service is actually just a wrapper around a call to free() and a test to
+check that it is a string or a blob in the variant. It exists because DLLs have
+their own heap and cannot free the memory allocated in db/contact/getsetting.
+Thus it need not be called if you know the variant contains some form of int,
+and you will often see free() used instead in code written before I noticed
+this problem.
+Good style, of course, dictates that it should be present to match all calls to
+db/contact/getsetting, but that's not going to happen of course.
+There's a helper function for this at the bottom of this header too.
+*/
+#define MS_DB_CONTACT_FREEVARIANT "DB/Contact/FreeVariant"
+
+/* DB/Contact/WriteSetting service
+Change the value of, or create a new value with, a named setting for a specific
+contact in the database to the given value
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=(LPARAM)(DBCONTACTWRITESETTING*)&dbcws
+hContact should have been returned by find*contact or addcontact
+Returns 0 on success or nonzero if hContact was invalid
+Note that DBCONTACTGETSETTING takes a pointer to a DBVARIANT, whereas
+DBCONTACTWRITESETTING contains a DBVARIANT.
+Because this is such a common function there are some short helper function at
+the bottom of this header that use it.
+Triggers a db/contact/settingchanged event just before it returns.
+*/
+typedef struct {
+ const char *szModule; // pointer to name of the module that wrote the
+ // setting to get
+ const char *szSetting; // pointer to name of the setting to get
+ DBVARIANT value; // variant containing the value to set
+} DBCONTACTWRITESETTING;
+#define MS_DB_CONTACT_WRITESETTING "DB/Contact/WriteSetting"
+
+/* DB/Contact/DeleteSetting service
+Removes a named setting for a specific contact from the database
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=(LPARAM)(DBCONTACTGETSETTING*)&dbcgs
+hContact should have been returned by find*contact or addcontact
+pValue from dbcgs is not used.
+Returns 0 on success or nonzero if the setting was not present or hContact was
+invalid
+Triggers a db/contact/settingchanged event before it deletes the setting. The
+'new value' of the setting is set to type=0 and all the other fields are
+undefined.
+*/
+#define MS_DB_CONTACT_DELETESETTING "DB/Contact/DeleteSetting"
+
+/* db/contact/enumsettings v0.1.0.1+
+Lists all the settings a specific modules has stored in the database for a
+specific contact.
+wParam=(WPARAM)(HANDLE)hContact
+lParam=(LPARAM)(DBCONTACTENUMSETTINGS*)&dbces
+Returns the return value of the last call to pfnEnumProc, or -1 if there are
+no settings for that module/contact pair
+Writing to or deleting from the database while enumerating will have
+unpredictable results for the enumeration, but the write will succeed.
+Use db/modules/enum to get a complete list of module names
+szSetting is only guaranteed to be valid for the duration of the callback. If
+you want to keep it for longer you must allocation your own storage.
+*/
+typedef int (*DBSETTINGENUMPROC)(const char *szSetting,LPARAM lParam);
+typedef struct {
+ DBSETTINGENUMPROC pfnEnumProc;
+ LPARAM lParam; //passed direct to pfnEnumProc
+ const char *szModule; //name of the module to get settings for
+ DWORD ofsSettings; //filled by the function to contain the offset from
+ //the start of the database of the requested settings group.
+} DBCONTACTENUMSETTINGS;
+#define MS_DB_CONTACT_ENUMSETTINGS "DB/Contact/EnumSettings"
+
+/* DB/Contact/GetCount service
+Gets the number of contacts in the database, which does not count the user
+ wParam=lParam=0
+Returns the number of contacts. They can be retrieved using contact/findfirst
+and contact/findnext
+*/
+#define MS_DB_CONTACT_GETCOUNT "DB/Contact/GetCount"
+
+/* DB/Contact/FindFirst service
+Gets the handle of the first contact in the database. This handle can be used
+with loads of functions. It does not need to be closed.
+ wParam=lParam=0
+Returns a handle to the first contact in the db on success, or NULL if there
+are no contacts in the db.
+*/
+#define MS_DB_CONTACT_FINDFIRST "DB/Contact/FindFirst"
+
+/* DB/Contact/FindNext service
+Gets the handle of the next contact after hContact in the database. This handle
+can be used with loads of functions. It does not need to be closed.
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=0
+Returns a handle to the contact after hContact in the db on success or NULL if
+hContact was the last contact in the db or hContact was invalid.
+*/
+#define MS_DB_CONTACT_FINDNEXT "DB/Contact/FindNext"
+
+/* DB/Contact/Delete
+Deletes the contact hContact from the database and all events and settings
+associated with it.
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=0
+Returns 0 on success or nonzero if hContact was invalid
+Please don't try to delete the user contact (hContact=NULL)
+Triggers a db/contact/deleted event just *before* it removes anything
+Because all events are deleted, lots of people may end up with invalid event
+handles from this operation, which they should be prepared for.
+*/
+#define MS_DB_CONTACT_DELETE "DB/Contact/Delete"
+
+/* DB/Contact/Add
+Adds a new contact to the database. New contacts initially have no settings
+whatsoever, they must all be added with db/contacts/writesetting.
+ wParam=lParam=0
+Returns a handle to the newly created contact on success, or NULL otherwise.
+Triggers a db/contact/added event just before it returns.
+*/
+#define MS_DB_CONTACT_ADD "DB/Contact/Add"
+
+/* DB/Contact/Is
+Checks if a given value is a valid contact handle, note that due
+to the nature of multiple threading, a valid contact can still become
+invalid after a call to this service.
+ wParam=(WPARAM)hContact
+ lParam=0
+Returns 1 if the contact is a contact, or 0 if the contact is not valid.
+*/
+#define MS_DB_CONTACT_IS "DB/Contact/Is"
+
+/************************** Event *********************************/
+
+/* DB/EventType/Register service (0.7+)
+Registers the specified database event type, with module, id & description.
+When someone needs to retrieve an event's text, a service named Module/GetEventText<id>
+will be called. For example, for module named 'foo' and event id 2000 a service
+foo/GetEventText2000 should be defined to process this request. That handler should
+decode a blob and return the event text in the required format, its prototype is identical
+to a call of MS_DB_EVENT_GETTEXT (see below)
+ wParam=0
+ lParam=(LPARAM)(DBEVENTTYPEDESCR*)
+Always returns 0.
+*/
+
+typedef struct
+{
+ int cbSize; // structure size in bytes
+ char* module; // event module name
+ int eventType; // event id, unique for this module
+ char* descr; // event type description (i.e. "File Transfer")
+ char* textService; // service name for MS_DB_EVENT_GETTEXT (0.8+, default Module+'/GetEventText'+EvtID)
+ char* iconService; // service name for MS_DB_EVENT_GETICON (0.8+, default Module+'/GetEventIcon'+EvtID)
+ HANDLE eventIcon; // icolib handle to eventicon (0.8+, default 'eventicon_'+Module+EvtID)
+ DWORD flags; // flags, combination of the DETF_*
+}
+ DBEVENTTYPEDESCR;
+
+#define DBEVENTTYPEDESCR_SIZE sizeof(DBEVENTTYPEDESCR)
+#define DBEVENTTYPEDESCR_SIZE_V1 (offsetof(DBEVENTTYPEDESCR, textService))
+
+// constants for default event behaviour
+#define DETF_HISTORY 1 // show event in history
+#define DETF_MSGWINDOW 2 // show event in message window
+#define DETF_NONOTIFY 4 // block event notify (e.g. Popups)
+
+
+#define MS_DB_EVENT_REGISTERTYPE "DB/EventType/Register"
+
+/* DB/EventType/Get service (0.7+)
+Retrieves the previously registered database event type, by module & id.
+ wParam=(WPARAM)(char*)szModule
+ lParam=(LPARAM)(int)eventType
+Returns DBEVENTTYPEDESCR* or NULL, if an event isn't found.
+*/
+
+#define MS_DB_EVENT_GETTYPE "DB/EventType/Get"
+
+/* DB/Event/GetCount service
+Gets the number of events in the chain belonging to a contact in the database.
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=0
+Returns the number of events in the chain owned by hContact or -1 if hContact
+is invalid. They can be retrieved using the event/find* services.
+*/
+#define MS_DB_EVENT_GETCOUNT "DB/Event/GetCount"
+
+/* DB/Event/Add
+Adds a new event to a contact's event list
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=(LPARAM)(DBEVENTINFO*)&dbe
+Returns a handle to the newly added event, or NULL on failure
+Triggers a db/event/added event just before it returns.
+Events are sorted chronologically as they are entered, so you cannot guarantee
+that the new hEvent is the last event in the chain, however if a new event is
+added that has a timestamp less than 90 seconds *before* the event that should
+be after it, it will be added afterwards, to allow for protocols that only
+store times to the nearest minute, and slight delays in transports.
+There are a few predefined eventTypes below for easier compatibility, but
+modules are free to define their own, beginning at 2000
+DBEVENTINFO.timestamp is in GMT, as returned by time(). There are services
+db/time/x below with useful stuff for dealing with it.
+*/
+#define DBEF_FIRST 1 //this is the first event in the chain;
+ //internal only: *do not* use this flag
+#define DBEF_SENT 2 //this event was sent by the user. If not set this
+ //event was received.
+#define DBEF_READ 4 //event has been read by the user. It does not need
+ //to be processed any more except for history.
+#define DBEF_RTL 8 //event contains the right-to-left aligned text
+#define DBEF_UTF 16 //event contains a text in utf-8
+
+typedef struct {
+ int cbSize; //size of the structure in bytes
+ char *szModule; //pointer to name of the module that 'owns' this
+ //event, ie the one that is in control of the data format
+ DWORD timestamp; //seconds since 00:00, 01/01/1970. Gives us times until
+ //2106 unless you use the standard C library which is
+ //signed and can only do until 2038. In GMT.
+ DWORD flags; //the omnipresent flags
+ WORD eventType; //module-defined event type field
+ DWORD cbBlob; //size of pBlob in bytes
+ PBYTE pBlob; //pointer to buffer containing module-defined event data
+} DBEVENTINFO;
+#define EVENTTYPE_MESSAGE 0
+#define EVENTTYPE_URL 1
+#define EVENTTYPE_CONTACTS 2 //v0.1.2.2+
+#define EVENTTYPE_ADDED 1000 //v0.1.1.0+: these used to be module-
+#define EVENTTYPE_AUTHREQUEST 1001 //specific codes, hence the module-
+#define EVENTTYPE_FILE 1002 //specific limit has been raised to 2000
+#define MS_DB_EVENT_ADD "DB/Event/Add"
+
+/* DB/Event/Delete
+Removes a single event from the database
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=(LPARAM)(HANDLE)hDbEvent
+hDbEvent should have been returned by db/event/add or db/event/find*event
+Returns 0 on success, or nonzero if hDbEvent was invalid
+Triggers a db/event/deleted event just *before* the event is deleted
+*/
+#define MS_DB_EVENT_DELETE "DB/Event/Delete"
+
+/* DB/Event/GetBlobSize
+Retrieves the space in bytes required to store the blob in hDbEvent
+ wParam=(WPARAM)(HANDLE)hDbEvent
+ lParam=0
+hDbEvent should have been returned by db/event/add or db/event/find*event
+Returns the space required in bytes, or -1 if hDbEvent is invalid
+*/
+#define MS_DB_EVENT_GETBLOBSIZE "DB/Event/GetBlobSize"
+
+/* DB/Event/Get
+Retrieves all the information stored in hDbEvent
+ wParam=(WPARAM)(HANDLE)hDbEvent
+ lParam=(LPARAM)(DBEVENTINFO*)&dbe
+hDbEvent should have been returned by db/event/add or db/event/find*event
+Returns 0 on success or nonzero if hDbEvent is invalid
+Don't forget to set dbe.cbSize, dbe.pBlob and dbe.cbBlob before calling this
+service
+The correct value dbe.cbBlob can be got using db/event/getblobsize
+If successful, all the fields of dbe are filled. dbe.cbBlob is set to the
+actual number of bytes retrieved and put in dbe.pBlob
+If dbe.cbBlob is too small, dbe.pBlob is filled up to the size of dbe.cbBlob
+and then dbe.cbBlob is set to the required size of data to go in dbe.pBlob
+On return, dbe.szModule is a pointer to the database module's own internal list
+of modules. Look but don't touch.
+*/
+#define MS_DB_EVENT_GET "DB/Event/Get"
+
+/* DB/Event/GetText (0.7.0+)
+Retrieves the event's text
+ wParam=(WPARAM)0 (unused)
+ lParam=(LPARAM)(DBEVENTGETTEXT*)egt - pointer to structure with parameters
+ egt->dbei should be the valid database event read via MS_DB_EVENT_GET
+ egt->datatype = DBVT_WCHAR or DBVT_ASCIIZ or DBVT_TCHAR. If a caller wants to
+suppress Unicode part of event in answer, add DBVTF_DENYUNICODE to this field.
+ egt->codepage is any valid codepage, CP_ACP by default.
+
+Function returns a pointer to a string in the required format.
+This string should be freed by a call of mir_free
+*/
+typedef struct {
+ DBEVENTINFO* dbei;
+ int datatype;
+ int codepage;
+} DBEVENTGETTEXT;
+
+#define MS_DB_EVENT_GETTEXT "DB/Event/GetText"
+
+__inline static char* DbGetEventTextA( DBEVENTINFO* dbei, int codepage )
+{ DBEVENTGETTEXT temp = { dbei, DBVT_ASCIIZ, codepage };
+ return (char*)CallService(MS_DB_EVENT_GETTEXT,0,(LPARAM)&temp);
+}
+
+__inline static WCHAR* DbGetEventTextW( DBEVENTINFO* dbei, int codepage )
+{ DBEVENTGETTEXT temp = { dbei, DBVT_WCHAR, codepage };
+ return (WCHAR*)CallService(MS_DB_EVENT_GETTEXT,0,(LPARAM)&temp);
+}
+
+__inline static TCHAR* DbGetEventTextT( DBEVENTINFO* dbei, int codepage )
+{ DBEVENTGETTEXT temp = { dbei, DBVT_TCHAR, codepage };
+ return (TCHAR*)CallService(MS_DB_EVENT_GETTEXT,0,(LPARAM)&temp);
+}
+
+/* DB/Event/GetIcon (0.7.0.1+)
+Retrieves the event's icon
+ wParam=(WPARAM)(int)flags - use LR_SHARED for shared HICON
+ lParam=(LPARAM)(DBEVENTINFO*)dbei
+dbei should be a valid database event read via MS_DB_EVENT_GET
+
+Function returns HICON (use DestroyIcon to release resources if not LR_SHARED)
+
+A plugin can register the standard event icon in IcoLib named
+'eventicon_'+Module+EvtID, like eventicon_ICQ2001. Otherwise, to declare an icon
+with the non-standard name, you can declare the special service, Module/GetEventIcon<id>,
+which will retrieve the custom icon handle (HICON). This service function has the
+same parameters MS_DB_EVENT_GETICON does.
+*/
+#define MS_DB_EVENT_GETICON "DB/Event/GetIcon"
+
+/* DB/Event/GetString (0.9.0+)
+Converts the event's string to TCHAR* depending on the event's format
+ wParam=(LPARAM)(DBEVENTINFO*)dbei
+ lParam=(WPARAM)(char*)str - string to be converted
+ returns TCHAR* - the converted string
+Caller must free the result using mir_free
+*/
+
+#define MS_DB_EVENT_GETSTRINGT "DB/Event/GetStringT"
+
+__inline static TCHAR* DbGetEventStringT( DBEVENTINFO* dbei, const char* str )
+{
+ return (TCHAR*)CallService( MS_DB_EVENT_GETSTRINGT, (WPARAM)dbei, (LPARAM)str );
+}
+
+/* DB/Event/MarkRead
+Changes the flags for an event to mark it as read.
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=(LPARAM)(HANDLE)hDbEvent
+hDbEvent should have been returned by db/event/add or db/event/find*event
+Returns the entire flag DWORD for the event after the change, or -1 if hDbEvent
+is invalid.
+This is the one database write operation that does not trigger an event.
+Modules should not save flags states for any length of time.
+*/
+#define MS_DB_EVENT_MARKREAD "DB/Event/MarkRead"
+
+/* DB/Event/GetContact
+Retrieves a handle to the contact that owns hDbEvent.
+ wParam=(WPARAM)(HANDLE)hDbEvent
+ lParam=0
+hDbEvent should have been returned by db/event/add or db/event/find*event
+NULL is a valid return value, meaning, as usual, the user.
+Returns (HANDLE)(-1) if hDbEvent is invalid, or the handle to the contact on
+success
+This service is exceptionally slow. Use only when you have no other choice at
+all.
+*/
+#define MS_DB_EVENT_GETCONTACT "DB/Event/GetContact"
+
+/* DB/Event/FindFirst
+Retrieves a handle to the first event in the chain for hContact
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=0
+Returns the handle, or NULL if hContact is invalid or has no events
+Events in a chain are sorted chronologically automatically
+*/
+#define MS_DB_EVENT_FINDFIRST "DB/Event/FindFirst"
+
+/* DB/Event/FindFirstUnread
+Retrieves a handle to the first unread event in the chain for hContact
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=0
+Returns the handle, or NULL if hContact is invalid or all its events have been
+read
+Events in a chain are sorted chronologically automatically, but this does not
+necessarily mean that all events after the first unread are unread too. They
+should be checked individually with event/findnext and event/get
+This service is designed for startup, reloading all the events that remained
+unread from last time
+*/
+#define MS_DB_EVENT_FINDFIRSTUNREAD "DB/Event/FindFirstUnread"
+
+/* DB/Event/FindLast
+Retrieves a handle to the last event in the chain for hContact
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=0
+Returns the handle, or NULL if hContact is invalid or has no events
+Events in a chain are sorted chronologically automatically
+*/
+#define MS_DB_EVENT_FINDLAST "DB/Event/FindLast"
+
+/* DB/Event/FindNext
+Retrieves a handle to the next event in a chain after hDbEvent
+ wParam=(WPARAM)(HANDLE)hDbEvent
+ lParam=0
+Returns the handle, or NULL if hDbEvent is invalid or is the last event
+Events in a chain are sorted chronologically automatically
+*/
+#define MS_DB_EVENT_FINDNEXT "DB/Event/FindNext"
+
+/* DB/Event/FindPrev
+Retrieves a handle to the previous event in a chain before hDbEvent
+ wParam=(WPARAM)(HANDLE)hDbEvent
+ lParam=0
+Returns the handle, or NULL if hDbEvent is invalid or is the first event
+Events in a chain are sorted chronologically automatically
+*/
+#define MS_DB_EVENT_FINDPREV "DB/Event/FindPrev"
+
+/************************** Encryption ****************************/
+
+/* DB/Crypt/EncodeString
+Scrambles pszString in-place using a strange encryption algorithm
+ wParam=(WPARAM)(int)cbString
+ lParam=(LPARAM)(char*)pszString
+cbString is the size of the buffer pointed to by pszString, *not* the length
+of pszString. This service may be changed at a later date such that it
+increases the length of pszString
+Returns 0 always
+*/
+#define MS_DB_CRYPT_ENCODESTRING "DB/Crypt/EncodeString"
+
+/* DB/Crypt/DecodeString
+Descrambles pszString in-place using the strange encryption algorithm
+ wParam=(WPARAM)(int)cbString
+ lParam=(LPARAM)(char*)pszString
+Reverses the operation done by crypt/encodestring
+cbString is the size of the buffer pointed to by pszString, *not* the length
+of pszString.
+Returns 0 always
+*/
+#define MS_DB_CRYPT_DECODESTRING "DB/Crypt/DecodeString"
+
+/**************************** Time ********************************/
+
+/* DB/Time/TimestampToLocal
+Converts a GMT timestamp into local time
+ wParam=(WPARAM)(DWORD)timestamp
+ lParam=0
+Returns the converted value
+Timestamps have zero at midnight 1/1/1970 GMT, this service converts such a
+value to be based at midnight 1/1/1970 local time.
+This service does not use a simple conversion based on the current offset
+between GMT and local. Rather, it figures out whether daylight savings time
+would have been in place at the time of the stamp and gives the local time as
+it would have been at the time and date the stamp contains.
+This service isn't nearly as useful as db/time/TimestampToString below and I
+recommend avoiding its use when possible so that you don't get your timezones
+mixed up (like I did. Living at GMT makes things easier for me, but has certain
+disadvantages :-) ).
+*/
+#define MS_DB_TIME_TIMESTAMPTOLOCAL "DB/Time/TimestampToLocal"
+
+/* DB/Time/TimestampToString
+Converts a GMT timestamp into a customisable local time string
+ wParam=(WPARAM)(DWORD)timestamp
+ lParam=(LPARAM)(DBTIMETOSTRING*)&tts
+Returns 0 always
+Uses db/time/timestamptolocal for the conversion so read that description to
+see what's going on.
+The string is formatted according to the current user's locale, language and
+preferences.
+szFormat can have the following special characters:
+ t Time without seconds, eg hh:mm
+ s Time with seconds, eg hh:mm:ss
+ m Time without minutes, eg hh
+ d Short date, eg dd/mm/yyyy
+ D Long date, eg d mmmm yyyy
+ I ISO 8061 Time yyyy-mm-ddThh:mm:ssZ
+All other characters are copied across to szDest as-is
+*/
+typedef struct {
+ char *szFormat; // format string, as above
+ char *szDest; // place to put the output string
+ int cbDest; // maximum number of bytes to put in szDest
+} DBTIMETOSTRING;
+#define MS_DB_TIME_TIMESTAMPTOSTRING "DB/Time/TimestampToString"
+
+typedef struct {
+ TCHAR *szFormat; // format string, as above
+ TCHAR *szDest; // place to put the output string
+ int cbDest; // maximum number of bytes to put in szDest
+} DBTIMETOSTRINGT;
+#define MS_DB_TIME_TIMESTAMPTOSTRINGT "DB/Time/TimestampToStringT"
+
+/*************************** Random *******************************/
+
+/*
+Switches safety settings on or off
+wParam=(WPARAM)(BOOL)newSetting
+lParam=0
+returns 0 always
+newSetting is TRUE initially.
+Miranda's database is normally protected against corruption by agressively
+flushing data to the disk on writes. If you're doing a lot of writes (eg in
+an import plugin) it can sometimes be desirable to switch this feature off to
+speed up the process. If you do switch it off, you must remember that crashes
+are far more likely to be catastrophic, so switch it back on at the earliest
+possible opportunity.
+Note that if you're doing a lot of setting writes, the flush is already delayed
+so you need not use this service for that purpose.
+*/
+#define MS_DB_SETSAFETYMODE "DB/SetSafetyMode"
+
+/*************************** Modules ******************************/
+
+/* db/modules/enum v0.1.0.1+
+Enumerates the names of all modules that have stored or requested information
+from the database.
+wParam=lParam
+lParam=(WPARAM)(DBMODULEENUMPROC)dbmep
+Returns the value returned by the last call to dbmep
+This service is only really useful for debugging, in conjunction with
+db/contact/enumsettings
+lParam is passed directly to dbmep
+dbmep should return 0 to continue enumeration, or nonzero to stop.
+ofsModuleName is the offset of the module name from the start of the profile
+database, and is only useful for really heavyweight debugging
+Modules names will be enumerated in no particular order
+Writing to the database while module names are being enumerated will cause
+unpredictable results in the enumeration, but the write will work.
+szModuleName is only guaranteed to be valid for the duration of the callback.
+If you want to keep it for longer you must allocation your own storage.
+**BUG**: Prior to 0.1.2.0 dbmep was called as (lParam)(szMod,ofsMod,lParam).
+ This means that the lParam parameter to dbmep was useless, and explains the
+ slightly odd 'wParam=lParam' in the definition.
+*/
+typedef int (*DBMODULEENUMPROC)(const char *szModuleName,DWORD ofsModuleName,LPARAM lParam);
+#define MS_DB_MODULES_ENUM "DB/Modules/Enum"
+
+/* DB/Module/Delete 0.8.0+
+
+Removes all settings for the specified module.
+wParam=0 (unused)
+lParam=(LPARAM)(char*)szModuleName - the module name to be deleted
+*/
+
+#define MS_DB_MODULE_DELETE "DB/Module/Delete"
+
+/******************************************************************/
+/************************** EVENTS ********************************/
+/******************************************************************/
+
+/* DB/Event/Added event
+Called when a new event has been added to the event chain for a contact
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=(LPARAM)(HANDLE)hDbEvent
+hDbEvent is a valid handle to the event. hContact is a valid handle to the
+contact to which hDbEvent refers.
+Since events are sorted chronologically, you cannot guarantee that hDbEvent is
+at any particular position in the chain.
+*/
+#define ME_DB_EVENT_ADDED "DB/Event/Added"
+
+/* DB/Event/FilterAdd (NOTE: Added during 0.3.3+ development!)
+Called **before** a new event is made of a DBEVENTINFO structure, this
+hook is not SAFE unless you know what you're doing with it, the arguments
+are passed as-is (with errors, pointer problems, if any) from any arguments
+passed to MS_DB_EVENT_ADD.
+
+The point of this hook is to stop any unwanted database events, to stop
+an event being added, return 1, to allow the event to pass through return
+0.
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=(LPARAM)&DBEVENTINFO
+
+Any changed made to the said DBEVENTINFO are also passed along to the database,
+therefore it is possible to shape the data, however DO NOT DO THIS.
+*/
+#define ME_DB_EVENT_FILTER_ADD "DB/Event/FilterAdd"
+
+/* DB/Event/Deleted event
+Called when an event is about to be deleted from the event chain for a contact
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=(LPARAM)(HANDLE)hDbEvent
+hDbEvent is a valid handle to the event which is about to be deleted, but it
+won't be once your hook has returned.
+hContact is a valid handle to the contact to which hDbEvent refers, and will
+remain valid.
+Returning nonzero from your hook will not stop the deletion, but it will, as
+usual, stop other hooks from being called.
+*/
+#define ME_DB_EVENT_DELETED "DB/Event/Deleted"
+
+/* DB/Contact/Added event
+Called when a new contact has been added to the database
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=0
+hContact is a valid handle to the new contact.
+Contacts are initially created without any settings, so if you hook this event
+you will almost certainly also want to hook db/contact/settingchanged as well.
+*/
+#define ME_DB_CONTACT_ADDED "DB/Contact/Added"
+
+/* DB/Contact/Deleted event
+Called when an contact is about to be deleted
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=0
+hContact is a valid handle to the contact which is about to be deleted, but it
+won't be once your hook has returned.
+Returning nonzero from your hook will not stop the deletion, but it will, as
+usual, stop other hooks from being called.
+Deleting a contact invalidates all events in its chain.
+*/
+#define ME_DB_CONTACT_DELETED "DB/Contact/Deleted"
+
+/* DB/Contact/SettingChanged event
+Called when a contact has had one of its settings changed
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=(LPARAM)(DBCONTACTWRITESETTING*)&dbcws
+hContact is a valid handle to the contact that has changed.
+This event will be triggered many times rapidly when a whole bunch of values
+are set.
+Modules which hook this should be aware of this fact and quickly return if they
+are not interested in the value that has been changed.
+Careful not to get into infinite loops with this event.
+The structure dbcws is the same one as is passed to the original service, so
+don't change any of the members.
+*/
+#define ME_DB_CONTACT_SETTINGCHANGED "DB/Contact/SettingChanged"
+
+/* DB/Contact/SetSettingResident service (0.6+)
+Disables a setting saving to the database.
+ wParam=(WPARAM)(BOOL)bIsResident
+ lParam=(LPARAM)(char*)pszSettingName
+*/
+#define MS_DB_SETSETTINGRESIDENT "DB/SetSettingResident"
+
+/******************************************************************/
+/********************* SETTINGS HELPER FUNCTIONS ******************/
+/******************************************************************/
+
+#ifndef DB_NOHELPERFUNCTIONS
+
+#define db_byte_get(a,b,c,d) DBGetContactSettingByte(a,b,c,d)
+#define db_word_get(a,b,c,d) DBGetContactSettingWord(a,b,c,d)
+#define db_dword_get(a,b,c,d) DBGetContactSettingDword(a,b,c,d)
+#define db_get(a,b,c,d) DBGetContactSetting(a,b,c,d)
+
+#define db_byte_set(a,b,c,d) DBWriteContactSettingByte(a,b,c,d)
+#define db_word_set(a,b,c,d) DBWriteContactSettingWord(a,b,c,d)
+#define db_dword_set(a,b,c,d) DBWriteContactSettingDword(a,b,c,d)
+#define db_string_set(a,b,c,d) DBWriteContactSettingString(a,b,c,d)
+
+#define db_unset(a,b,c) DBDeleteContactSetting(a,b,c);
+
+#ifdef _DEBUG
+ #define DBGetContactSettingByte(a,b,c,d) DBGetContactSettingByte_Helper(a,b,c,d,__FILE__,__LINE__)
+ #define DBGetContactSettingWord(a,b,c,d) DBGetContactSettingWord_Helper(a,b,c,d,__FILE__,__LINE__)
+ #define DBGetContactSettingDword(a,b,c,d) DBGetContactSettingDword_Helper(a,b,c,d,__FILE__,__LINE__)
+ #define DBGetContactSetting(a,b,c,d) DBGetContactSetting_Helper(a,b,c,d,__FILE__,__LINE__)
+ #define DBGetContactSettingString(a,b,c,d) DBGetContactSettingString_Helper(a,b,c,d,__FILE__,__LINE__,DBVT_ASCIIZ)
+ #define DBGetContactSettingWString(a,b,c,d) DBGetContactSettingString_Helper(a,b,c,d,__FILE__,__LINE__,DBVT_WCHAR)
+ #define DBGetContactSettingUTF8String(a,b,c,d) DBGetContactSettingString_Helper(a,b,c,d,__FILE__,__LINE__,DBVT_UTF8)
+#else
+ #define DBGetContactSettingByte(a,b,c,d) DBGetContactSettingByte_Helper(a,b,c,d)
+ #define DBGetContactSettingWord(a,b,c,d) DBGetContactSettingWord_Helper(a,b,c,d)
+ #define DBGetContactSettingDword(a,b,c,d) DBGetContactSettingDword_Helper(a,b,c,d)
+ #define DBGetContactSetting(a,b,c,d) DBGetContactSetting_Helper(a,b,c,d)
+ #define DBGetContactSettingString(a,b,c,d) DBGetContactSettingString_Helper(a,b,c,d,DBVT_ASCIIZ)
+ #define DBGetContactSettingWString(a,b,c,d) DBGetContactSettingString_Helper(a,b,c,d,DBVT_WCHAR)
+ #define DBGetContactSettingUTF8String(a,b,c,d) DBGetContactSettingString_Helper(a,b,c,d,DBVT_UTF8)
+#endif
+
+#ifdef _UNICODE
+#define DBGetContactSettingTString DBGetContactSettingWString
+#else
+#define DBGetContactSettingTString DBGetContactSettingString
+#endif
+
+#define db_msg_dbg(s) MessageBoxA(0,(s),"",0);
+
+/* Deprecated & bizarre aliases */
+#define DBGetContactSettingStringUtf DBGetContactSettingUTF8String
+#define DBWriteContactSettingStringUtf DBWriteContactSettingUTF8String
+#ifdef _DEBUG
+ #define DBGetContactSettingW(a,b,c,d) DBGetContactSettingString_Helper(a,b,c,d,__FILE__,__LINE__,0)
+#else
+ #define DBGetContactSettingW(a,b,c,d) DBGetContactSettingString_Helper(a,b,c,d,0)
+#endif
+
+#ifdef _DEBUG
+#include <stdio.h>
+#endif
+
+__inline static int DBGetContactSettingByte_Helper(HANDLE hContact, const char *szModule, const char *szSetting, int errorValue
+#ifdef _DEBUG
+ ,const char *szFile, const int nLine
+#endif
+)
+{
+ DBVARIANT dbv;
+ DBCONTACTGETSETTING cgs;
+
+ cgs.szModule=szModule;
+ cgs.szSetting=szSetting;
+ cgs.pValue=&dbv;
+ if(CallService(MS_DB_CONTACT_GETSETTING,(WPARAM)hContact,(LPARAM)&cgs))
+ return errorValue;
+#ifdef _DEBUG
+ if(dbv.type!=DBVT_BYTE) {
+ char buf[128];
+ _snprintf(buf,sizeof(buf),"%s:%d for %s/%s not a byte, return: %d",szFile,nLine,szModule,szSetting,dbv.type);
+ buf[sizeof(buf)-1]=0;
+ db_msg_dbg(buf);
+ }
+#endif
+ return dbv.bVal;
+}
+
+__inline static int DBGetContactSettingWord_Helper(HANDLE hContact,const char *szModule,const char *szSetting,int errorValue
+#ifdef _DEBUG
+ ,const char *szFile, const int nLine
+#endif
+)
+{
+ DBVARIANT dbv;
+ DBCONTACTGETSETTING cgs;
+
+ cgs.szModule=szModule;
+ cgs.szSetting=szSetting;
+ cgs.pValue=&dbv;
+ if(CallService(MS_DB_CONTACT_GETSETTING,(WPARAM)hContact,(LPARAM)&cgs))
+ return errorValue;
+#ifdef _DEBUG
+ if(dbv.type!=DBVT_WORD) {
+ char buf[128];
+ _snprintf(buf,sizeof(buf),"%s:%d for %s/%s not a word, return: %d",szFile,nLine,szModule,szSetting,dbv.type);
+ buf[sizeof(buf)-1]=0;
+ db_msg_dbg(buf);
+ }
+#endif
+ return dbv.wVal;
+}
+
+__inline static DWORD DBGetContactSettingDword_Helper(HANDLE hContact,const char *szModule, const char *szSetting, DWORD errorValue
+#ifdef _DEBUG
+ ,const char *szFile, const int nLine
+#endif
+)
+{
+ DBVARIANT dbv;
+ DBCONTACTGETSETTING cgs;
+
+ cgs.szModule=szModule;
+ cgs.szSetting=szSetting;
+ cgs.pValue=&dbv;
+ if(CallService(MS_DB_CONTACT_GETSETTING,(WPARAM)hContact,(LPARAM)&cgs))
+ return errorValue;
+#ifdef _DEBUG
+ if(dbv.type!=DBVT_DWORD) {
+ char buf[128];
+ _snprintf(buf,sizeof(buf),"%s:%d for %s/%s not a dword, return: %d",szFile,nLine,szModule,szSetting,dbv.type);
+ buf[sizeof(buf)-1]=0;
+ db_msg_dbg(buf);
+ }
+#endif
+ return dbv.dVal;
+}
+
+__inline static INT_PTR DBGetContactSetting_Helper(HANDLE hContact,const char *szModule,const char *szSetting,DBVARIANT *dbv
+#if defined(_DEBUG)
+ ,const char *szFile, const int nLine
+#endif
+)
+{
+ INT_PTR rc;
+ DBCONTACTGETSETTING cgs;
+ cgs.szModule=szModule;
+ cgs.szSetting=szSetting;
+ cgs.pValue=dbv;
+
+ rc=CallService(MS_DB_CONTACT_GETSETTING,(WPARAM)hContact,(LPARAM)&cgs);
+#if defined(_DEBUG) && defined(DBCHECKSETTINGS)
+ if (rc != 0) {
+ char buf[128];
+ _snprintf(buf,sizeof(buf),"%s:%d failed to fetch %s/%s",szFile,nLine,szModule,szSetting);
+ db_msg_dbg(buf);
+ }
+#endif
+ return rc;
+}
+
+__inline static INT_PTR DBGetContactSettingString_Helper(HANDLE hContact,const char *szModule,const char *szSetting,DBVARIANT *dbv,
+#if defined(_DEBUG)
+ const char *szFile, const int nLine,
+#endif
+ const int nType)
+{
+ INT_PTR rc;
+ DBCONTACTGETSETTING cgs;
+ cgs.szModule=szModule;
+ cgs.szSetting=szSetting;
+ cgs.pValue=dbv;
+ dbv->type=(BYTE)nType;
+
+ rc=CallService(MS_DB_CONTACT_GETSETTING_STR,(WPARAM)hContact,(LPARAM)&cgs);
+#if defined(_DEBUG) && defined(DBCHECKSETTINGS)
+ if (rc != 0) {
+ char buf[128];
+ _snprintf(buf,sizeof(buf),"%s:%d failed to fetch %s/%s",szFile,nLine,szModule,szSetting);
+ db_msg_dbg(buf);
+ }
+#endif
+ return rc;
+}
+
+__inline static INT_PTR DBFreeVariant(DBVARIANT *dbv)
+{
+ return CallService(MS_DB_CONTACT_FREEVARIANT,0,(LPARAM)dbv);
+}
+
+__inline static char *DBGetString(HANDLE hContact,const char *szModule,const char *szSetting)
+{
+ char *str=NULL;
+ DBVARIANT dbv={0};
+ DBGetContactSettingString(hContact,szModule,szSetting,&dbv);
+ if(dbv.type==DBVT_ASCIIZ)
+ str=mir_strdup(dbv.pszVal);
+ DBFreeVariant(&dbv);
+ return str;
+}
+
+#define DBGetStringA DBGetString
+
+__inline static wchar_t *DBGetStringW(HANDLE hContact,const char *szModule,const char *szSetting)
+{
+ wchar_t *str=NULL;
+ DBVARIANT dbv={0};
+ DBGetContactSettingWString(hContact,szModule,szSetting,&dbv);
+ if(dbv.type==DBVT_WCHAR)
+ str=mir_wstrdup(dbv.pwszVal);
+ DBFreeVariant(&dbv);
+ return str;
+}
+
+#ifdef _UNICODE
+#define DBGetStringT DBGetStringW
+#else
+#define DBGetStringT DBGetString
+#endif
+
+__inline static INT_PTR DBDeleteContactSetting(HANDLE hContact,const char *szModule,const char *szSetting)
+{
+ DBCONTACTGETSETTING cgs;
+ cgs.szModule=szModule;
+ cgs.szSetting=szSetting;
+ return CallService(MS_DB_CONTACT_DELETESETTING,(WPARAM)hContact,(LPARAM)&cgs);
+}
+
+__inline static INT_PTR DBWriteContactSettingByte(HANDLE hContact,const char *szModule,const char *szSetting,BYTE val)
+{
+ DBCONTACTWRITESETTING cws;
+
+ cws.szModule=szModule;
+ cws.szSetting=szSetting;
+ cws.value.type=DBVT_BYTE;
+ cws.value.bVal=val;
+ return CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws);
+}
+
+__inline static INT_PTR DBWriteContactSettingWord(HANDLE hContact,const char *szModule,const char *szSetting,WORD val)
+{
+ DBCONTACTWRITESETTING cws;
+
+ cws.szModule=szModule;
+ cws.szSetting=szSetting;
+ cws.value.type=DBVT_WORD;
+ cws.value.wVal=val;
+ return CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws);
+}
+
+__inline static INT_PTR DBWriteContactSettingDword(HANDLE hContact,const char *szModule,const char *szSetting,DWORD val)
+{
+ DBCONTACTWRITESETTING cws;
+
+ cws.szModule=szModule;
+ cws.szSetting=szSetting;
+ cws.value.type=DBVT_DWORD;
+ cws.value.dVal=val;
+ return CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws);
+}
+
+__inline static INT_PTR DBWriteContactSettingString(HANDLE hContact,const char *szModule,const char *szSetting,const char *val)
+{
+ DBCONTACTWRITESETTING cws;
+
+ cws.szModule=szModule;
+ cws.szSetting=szSetting;
+ cws.value.type=DBVT_ASCIIZ;
+ cws.value.pszVal=(char*)val;
+ return CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws);
+}
+
+__inline static INT_PTR DBWriteContactSettingWString(HANDLE hContact,const char *szModule,const char *szSetting,const WCHAR *val)
+{
+ DBCONTACTWRITESETTING cws;
+
+ cws.szModule=szModule;
+ cws.szSetting=szSetting;
+ cws.value.type=DBVT_WCHAR;
+ cws.value.pwszVal=(WCHAR*)val;
+ return CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws);
+}
+
+#ifdef _UNICODE
+#define DBWriteContactSettingTString DBWriteContactSettingWString
+#else
+#define DBWriteContactSettingTString DBWriteContactSettingString
+#endif
+
+__inline static INT_PTR DBWriteContactSettingUTF8String(HANDLE hContact,const char *szModule,const char *szSetting,const char *val)
+{
+ DBCONTACTWRITESETTING cws;
+
+ cws.szModule=szModule;
+ cws.szSetting=szSetting;
+ cws.value.type=DBVT_UTF8;
+ cws.value.pszVal=(char*)val;
+ return CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws);
+}
+
+__inline static INT_PTR DBWriteContactSettingBlob(HANDLE hContact,const char *szModule,const char *szSetting,void *val,unsigned len)
+{
+ DBCONTACTWRITESETTING cws;
+
+ cws.szModule=szModule;
+ cws.szSetting=szSetting;
+ cws.value.type=DBVT_BLOB;
+ cws.value.cpbVal = (WORD)len;
+ cws.value.pbVal=(unsigned char*)val;
+ return CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws);
+}
+
+/* inlined range tolerate versions */
+
+__inline static BYTE DBGetContactSettingRangedByte(HANDLE hContact, const char *szModule, const char *szSetting, BYTE errorValue, BYTE minValue, BYTE maxValue) {
+ BYTE bVal = (BYTE)DBGetContactSettingByte(hContact, szModule, szSetting, errorValue);
+
+ if (bVal < minValue || bVal > maxValue) {
+#ifdef _DEBUG
+ char szBuf[MAX_PATH];
+ _snprintf(szBuf,sizeof(szBuf),"(%s:%s) not in range of %d..%d",szModule,szSetting,minValue,maxValue);
+ szBuf[sizeof(szBuf)-1]=0;
+ MessageBoxA(0,szBuf,"DBGetContactSettingRangedByte failed",MB_ICONERROR);
+#endif
+ return errorValue;
+ }
+ return bVal;
+}
+
+__inline static WORD DBGetContactSettingRangedWord(HANDLE hContact, const char *szModule, const char *szSetting, WORD errorValue, WORD minValue, WORD maxValue) {
+ WORD wVal = (WORD)DBGetContactSettingWord(hContact, szModule, szSetting, errorValue);
+
+ if (wVal < minValue || wVal > maxValue) {
+#ifdef _DEBUG
+ char szBuf[MAX_PATH];
+ _snprintf(szBuf,sizeof(szBuf),"(%s:%s) not in range of %d..%d",szModule,szSetting,minValue,maxValue);
+ szBuf[sizeof(szBuf)-1]=0;
+ MessageBoxA(0,szBuf,"DBGetContactSettingRangedWord failed",MB_ICONERROR);
+#endif
+ return errorValue;
+ }
+ return wVal;
+}
+
+__inline static DWORD DBGetContactSettingRangedDword(HANDLE hContact, const char *szModule, const char *szSetting, DWORD errorValue, DWORD minValue, DWORD maxValue) {
+ DWORD dVal = DBGetContactSettingDword(hContact, szModule, szSetting, errorValue);
+
+ if (dVal < minValue || dVal > maxValue) {
+#ifdef _DEBUG
+ char szBuf[MAX_PATH];
+ _snprintf(szBuf,sizeof(szBuf),"(%s:%s) not in range of %d..%d",szModule,szSetting,minValue,maxValue);
+ szBuf[sizeof(szBuf)-1]=0;
+ MessageBoxA(0,szBuf,"DBGetContactSettingRangedDword failed",MB_ICONERROR);
+#endif
+ return errorValue;
+ }
+ return dVal;
+}
+
+#endif
+
+#endif // M_DATABASE_H__
diff --git a/include/m_descbutton.h b/include/m_descbutton.h new file mode 100644 index 0000000000..bfe11ab53a --- /dev/null +++ b/include/m_descbutton.h @@ -0,0 +1,55 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2007 Artem Shpynov
+Copyright 2000-2007 Miranda ICQ/IM 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_DESCBUTTON_H__
+#define M_DESCBUTTON_H__ 1
+
+#define MIRANDADESCBUTTONCLASS _T("MirandaDescButtonClass")
+
+#define MDBCF_SHAREDICON 0x01
+#define MDBCF_UNICODE 0x02
+#ifdef _UNICODE
+ #define MDBCF_TCHAR MDBCF_UNICODE
+#else
+ #define MDBCF_TCHAR 0
+#endif
+
+#define DBCM_FIRST (WM_USER+1024)
+#define DBCM_LAST (ITCM_FIRST+64)
+
+#define DBCM_SETTITLE (DBCM_FIRST+1) //WPARAM is set of flags, LPARAM is string pointer
+#define DBCM_SETDESCRIPTION (DBCM_FIRST+2) //WPARAM is set of flags, LPARAM is string pointer
+#define DBCM_SETICON (DBCM_FIRST+3) //WPARAM is set of flags, LPARAM icon handle
+
+#define MDescButton_SetTitle(hwnd, title) \
+ (SendMessage((hwnd), DBCM_SETTITLE, MDBCF_TCHAR, (LPARAM)(title)))
+#define MDescButton_SetDescription(hwnd, title) \
+ (SendMessage((hwnd), DBCM_SETDESCRIPTION, MDBCF_TCHAR, (LPARAM)(title)))
+#define MDescButton_SetIcon(hwnd, hicon) \
+ (SendMessage((hwnd), DBCM_SETICON, 0, (LPARAM)(hicon)))
+#define MDescButton_SetIconShared(hwnd, hicon) \
+ (SendMessage((hwnd), DBCM_SETICON, MDBCF_SHAREDICON, (LPARAM)(hicon)))
+
+#endif // M_DESCBUTTON_H__
diff --git a/include/m_email.h b/include/m_email.h new file mode 100644 index 0000000000..db963a877f --- /dev/null +++ b/include/m_email.h @@ -0,0 +1,36 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_EMAIL_H__
+#define M_EMAIL_H__ 1
+
+//send an e-mail to the specified contact v0.1.0.1+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=0
+//returns 0 on success or nonzero on failure
+//if an error occurs the service will display a message box with the error
+//text, so this service should not be used if you do not want this behaviour.
+#define MS_EMAIL_SENDEMAIL "SREMail/SendCommand"
+
+#endif // M_EMAIL_H__
+
diff --git a/include/m_errors.h b/include/m_errors.h new file mode 100644 index 0000000000..c19e76dfe7 --- /dev/null +++ b/include/m_errors.h @@ -0,0 +1,154 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_ERRORS_H__
+#define M_ERRORS_H__ 1
+
+#define MERR_UNICODE 0x01
+#define MERR_DEFAULT_INFO 0x02
+#define MERR_DEFAULT_WARNING 0x04
+#define MERR_DEFAULT_ERROR 0x08
+#define MERR_DEFAULT_ALL 0x0E
+
+#ifdef _UNICODE
+ #define MERR_TCHAR MERR_UNICODE
+#else
+ #define MERR_TCHAR 0
+#endif
+
+// Error notifications are sorted according to this level
+#define MERR_LEVEL_INFO 1
+#define MERR_LEVEL_WARNING 2
+#define MERR_LEVEL_ERROR 3
+
+// Predefined error types (no need to call MS_ERROR_REGISTER)
+#define MERR_TYPE_INFO "Core/Info"
+#define MERR_TYPE_SRV_INFO "Core/SrvInfo"
+#define MERR_TYPE_WARNING "Core/Warning"
+#define MERR_TYPE_SRV_WARNING "Core/SrvWarning"
+#define MERR_TYPE_SRV_ERROR "Core/SrvError"
+#define MERR_TYPE_NETWORK "Core/Network"
+#define MERR_TYPE_LOGIN "Core/Login"
+
+// Specify set of buttons to make query box
+#define MERR_BTN_NONE 0
+#define MERR_BTN_YESNO 1
+#define MERR_BTN_YESNOCANCEL 2
+#define MERR_BTN_ABORTRETRYIGNORE 4
+
+// General-purpose error definition
+typedef struct
+{
+ int cbSize;
+ DWORD flags;
+ int level;
+ char *name;
+
+ union {
+ TCHAR *ptszTitle;
+ char *pszTitle;
+ WCHAR *pwszTitle;
+ };
+} MIRANDAERROR_TYPE;
+
+// General-purpose error definition
+typedef struct
+{
+ int cbSize;
+ DWORD flags;
+ char *type;
+
+ union {
+ TCHAR *ptszModuleTitle;
+ char *pszModuleTitle;
+ WCHAR *pwszModuleTitle;
+ };
+
+ int buttons;
+ int btnDefault;
+ char *pszQueryName; // to save answer in DB
+ char *pszSvcCallback;
+ LPARAM lParam;
+
+ // information itself
+ HANDLE hContact;
+ union {
+ TCHAR *ptszTitle;
+ char *pszTitle;
+ WCHAR *pwszTitle;
+ };
+ union {
+ TCHAR *ptszText;
+ char *pszText;
+ WCHAR *pwszText;
+ };
+
+ // filled by core and may be used in handlers.
+ MIRANDAERROR_TYPE *typeInfo;
+ DWORD dwTimestamp;
+} MIRANDAERROR;
+
+// Information about particular error handler for options UI
+typedef struct
+{
+ int cbSize;
+ DWORD flags;
+ char *pszDbModule;
+
+ HANDLE hIcolibIcon;
+ union {
+ TCHAR *ptszTitle;
+ char *pszTitle;
+ WCHAR *pwszTitle;
+ };
+} MIRANDAERROR_HANDLER;
+
+#define MS_ERROR_REGISTER "Errors/Register"
+#define MS_ERROR_ADDHANDLER "Errors/AddHandler"
+#define MS_ERROR_PROCESS "Errors/Process"
+#define ME_ERROR_ONPROCESS "Errors/OnProcess"
+
+#ifndef MIRANDA_ERRORS_NOHELPERS
+ #ifdef __cplusplus
+ #define DEFVAL(x) = x
+ #else
+ #define DEFVAL(x)
+ #endif
+
+ static __forceinline void mir_ReportError(HANDLE hContact, TCHAR *ptszModuleTitle, char *pszType, TCHAR *ptszText, TCHAR *ptszTitle DEFVAL(NULL))
+ {
+ MIRANDAERROR err = {0};
+ err.cbSize = sizeof(err);
+ err.flags = MERR_TCHAR;
+ err.type = pszType;
+ err.ptszModuleTitle = ptszModuleTitle;
+ err.hContact = hContact;
+ err.ptszText = ptszText;
+ err.ptszTitle = ptszTitle;
+ CallServiceSync(MS_ERROR_PROCESS, 0, (LPARAM)&err);
+ }
+
+ #undef DEFVAL
+#endif // MIRANDA_ERRORS_NOHELPERS
+
+#endif // M_ERRORS_H__
diff --git a/include/m_file.h b/include/m_file.h new file mode 100644 index 0000000000..73cd51d5a5 --- /dev/null +++ b/include/m_file.h @@ -0,0 +1,69 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_FILE_H__
+#define M_FILE_H__ 1
+
+//brings up the send file dialog for a contact
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=0
+//returns 0 on success or nonzero on failure
+//returns immediately, without waiting for the send
+#define MS_FILE_SENDFILE "SRFile/SendCommand"
+
+//brings up the send file dialog with the specified files already chosen
+//v0.1.2.1+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=(LPARAM)(const char**)ppFiles
+//returns 0 on success or nonzero on failure
+//returns immediately, without waiting for the send
+//the user is not prevented from changing the filename with the 'choose again'
+//button
+//ppFiles is a NULL-terminated array of fully qualified filenames.
+//To send subdirectories, include their name in the list without a trailing
+//backslash. In order to keep contained files in their correct place on
+//receiving, the subdirectory they're in must preceed the file. This applies
+//to subdirectories themselves too: they must be preceeded by their container
+//if you want to send the container and keep the original directory inside it.
+#define MS_FILE_SENDSPECIFICFILES "SRFile/SendSpecificFiles"
+
+//v0.9.0+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=(LPARAM)(const TCHAR**)ppFiles
+//returns 0 on success or nonzero on failure
+//returns immediately, without waiting for the send
+#define MS_FILE_SENDSPECIFICFILEST "SRFile/SendSpecificFilesT"
+
+//get the received files folder v0.1.2.2+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=(LPARAM)(char *)pszOutput
+//returns 0 on success or nonzero on failure
+//pszOutput must be at least MAX_PATH characters long
+//If hContact is NULL this function will retrieve the received files folder
+//name without any appended user names.
+//Note that the directory name returned by this function does not necessarily
+//exist.
+#define MS_FILE_GETRECEIVEDFILESFOLDER "SRFile/GetReceivedFilesFolder"
+
+#endif // M_FILE_H__
+
diff --git a/include/m_findadd.h b/include/m_findadd.h new file mode 100644 index 0000000000..2ea19815f0 --- /dev/null +++ b/include/m_findadd.h @@ -0,0 +1,35 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_FINDADD_H__
+#define M_FINDADD_H__ 1
+
+/* Opens the find/add users dialog box, or gives it the focus if it's already
+open.
+wParam=lParam=0
+returns 0 always
+*/
+#define MS_FINDADD_FINDADD "FindAdd/FindAddCommand"
+
+#endif // M_FINDADD_H__
+
diff --git a/include/m_fontservice.h b/include/m_fontservice.h new file mode 100644 index 0000000000..b1561b2d5a --- /dev/null +++ b/include/m_fontservice.h @@ -0,0 +1,292 @@ +// Copyright Scott Ellis (mail@scottellis.com.au) 2005
+// This software is licenced under the GPL (General Public Licence)
+// available at http://www.gnu.org/copyleft/gpl.html
+
+#ifndef _FONT_SERVICE_API_INC
+#define _FONT_SERVICE_API_INC
+
+// style flags
+#define DBFONTF_BOLD 1
+#define DBFONTF_ITALIC 2
+#define DBFONTF_UNDERLINE 4
+#define DBFONTF_STRIKEOUT 8
+
+// flags for compatibility
+#define FIDF_APPENDNAME 1 // append 'Name' to the setting used to store font face (as CLC settings require)
+#define FIDF_NOAS 2 // disable the <prefix>As setting to prevent 'same as' behaviour
+#define FIDF_SAVEACTUALHEIGHT 4 // write the actual height of a test string to the db
+#define FIDF_SAVEPOINTSIZE 8 // write the font point size to the db
+
+// additional flags
+#define FIDF_DEFAULTVALID 32 // the default font settings are valid - else, just use generic default
+#define FIDF_NEEDRESTART 64 // setting changes will not take effect until miranda is restarted
+#define FIDF_ALLOWREREGISTER 128 // allow plugins to register this font again (i.e. override already registered settings such as flags)
+#define FIDF_ALLOWEFFECTS 256 // allow setting of font effects (i.e. underline and strikeout)
+#define FIDF_DISABLESTYLES 512 // don't allow to select font attributes (bold/underline/italics)
+ // FIDF_ALLOWEFFECTS has priority and will override this flag!
+
+// font class
+#define FIDF_CLASSMASK 0x70000000
+#define FIDF_CLASSHEADER 0x10000000
+#define FIDF_CLASSGENERAL 0x20000000
+#define FIDF_CLASSSMALL 0x30000000
+
+// settings to be used for the value of 'deffontsettings' in the FontID structure below - i.e. defaults
+typedef struct FontSettings_tag
+{
+ COLORREF colour;
+ char size;
+ BYTE style; // see the DBFONTF_* flags above
+ BYTE charset;
+ char szFace[LF_FACESIZE];
+}
+ FontSettings;
+
+typedef struct FontSettingsW_tag
+{
+ COLORREF colour;
+ char size;
+ BYTE style; // see the DBFONTF_* flags above
+ BYTE charset;
+ wchar_t szFace[LF_FACESIZE];
+}
+ FontSettingsW;
+
+#define FontID_SIZEOF_V2A 372
+#define FontID_SIZEOF_V2U 660
+
+#if defined( _UNICODE )
+ #define FontSettingsT FontSettingsW
+ #define FontID_SIZEOF_V2 FontID_SIZEOF_V2U
+#else
+ #define FontSettingsT FontSettings
+ #define FontID_SIZEOF_V2 FontID_SIZEOF_V2A
+#endif
+
+// a font identifier structure - used for registering a font, and getting one out again
+
+// WARNING: do not use Translate(TS) for name or group as they
+// are translated by the core, which may lead to double translation.
+// Use LPGEN instead which are just dummy wrappers/markers for "lpgen.pl".
+typedef struct FontID_tag {
+ int cbSize;
+ char group[64]; // [TRANSLATED-BY-CORE] group the font belongs to - this is the 'Font Group' list in the options page
+ char name[64]; // [TRANSLATED-BY-CORE] this is the name of the font setting - e.g. 'contacts' in the 'contact list' group
+ char dbSettingsGroup[32]; // the 'module' in the database where the font data is stored
+ char prefix[32]; // this is prepended to the settings used to store this font's data in the db
+ DWORD flags; // bitwise OR of the FIDF_* flags above
+ FontSettings deffontsettings; // defaults, valid if flags & FIDF_DEFAULTVALID
+ int order; // controls the order in the font group in which the fonts are listed in the UI (if order fields are equal,
+ // they will be ordered alphabetically by name)
+ char backgroundGroup[64];
+ char backgroundName[64];
+}
+ FontID;
+
+typedef struct FontIDW_tag {
+ int cbSize;
+ wchar_t group[64]; // [TRANSLATED-BY-CORE] group the font belongs to - this is the 'Font Group' list in the options page
+ wchar_t name[64]; // [TRANSLATED-BY-CORE] this is the name of the font setting - e.g. 'contacts' in the 'contact list' group
+ char dbSettingsGroup[32]; // the 'module' in the database where the font data is stored
+ char prefix[32]; // this is prepended to the settings used to store this font's data in the db
+ DWORD flags; // bitwise OR of the FIDF_* flags above
+ FontSettingsW deffontsettings; // defaults, valid if flags & FIDF_DEFAULTVALID
+ int order; // controls the order in the font group in which the fonts are listed in the UI (if order fields are equal,
+ // they will be ordered alphabetically by name)
+ wchar_t backgroundGroup[64];
+ wchar_t backgroundName[64];
+}
+ FontIDW;
+
+#if defined( _UNICODE )
+ #define FontIDT FontIDW
+#else
+ #define FontIDT FontID
+#endif
+
+// WARNING: do not use Translate(TS) for name or group as they
+// are translated by the core, which may lead to double translation.
+// Use LPGEN instead which are just dummy wrappers/markers for "lpgen.pl".
+typedef struct ColourID_tag {
+ int cbSize;
+ char group[64]; // [TRANSLATED-BY-CORE]
+ char name[64]; // [TRANSLATED-BY-CORE]
+ char dbSettingsGroup[32];
+ char setting[32];
+ DWORD flags; // not used
+ COLORREF defcolour; // default value
+ int order;
+}
+ ColourID;
+
+// a font identifier structure - used for registering a font, and getting one out again
+typedef struct ColourIDW_tag {
+ int cbSize;
+ wchar_t group[64]; // [TRANSLATED-BY-CORE]
+ wchar_t name[64]; // [TRANSLATED-BY-CORE]
+ char dbSettingsGroup[32];
+ char setting[32];
+ DWORD flags; // not used
+ COLORREF defcolour; // default value
+ int order;
+}
+ ColourIDW;
+
+#if defined( _UNICODE )
+ #define ColourIDT ColourIDW
+#else
+ #define ColourIDT ColourID
+#endif
+
+// register a font
+// wparam = (FontID *)&font_id
+// lparam = 0
+#define MS_FONT_REGISTER "Font/Register"
+#define MS_FONT_REGISTERW "Font/RegisterW"
+
+__forceinline void FontRegister( FontID* pFontID )
+{ CallService( MS_FONT_REGISTER, (WPARAM)pFontID, 0 );
+}
+
+__forceinline void FontRegisterW( FontIDW* pFontID )
+{ CallService( MS_FONT_REGISTERW, (WPARAM)pFontID, 0 );
+}
+
+#if defined( _UNICODE )
+ #define MS_FONT_REGISTERT MS_FONT_REGISTERW
+ #define FontRegisterT FontRegisterW
+#else
+ #define MS_FONT_REGISTERT MS_FONT_REGISTER
+ #define FontRegisterT FontRegister
+#endif
+
+// get a font
+// will fill the logfont structure passed in with the user's choices, or the default if it was set and the user has not chosen a font yet,
+// or the global default font settings otherwise (i.e. no user choice and default set, or font not registered)
+// global default font is gotten using SPI_GETICONTITLELOGFONT, color COLOR_WINDOWTEXT, size 8.
+// wparam = (FontID *)&font_id (only name and group matter)
+// lParam = (LOGFONT *)&logfont
+// returns the font's colour
+#define MS_FONT_GET "Font/Get"
+#define MS_FONT_GETW "Font/GetW"
+
+#if defined( _UNICODE )
+ #define MS_FONT_GETT MS_FONT_GETW
+#else
+ #define MS_FONT_GETT MS_FONT_GET
+#endif
+
+// fired when a user modifies font settings, so reload your fonts
+// wparam = lparam = 0
+#define ME_FONT_RELOAD "Font/Reload"
+
+// register a colour (this should be used for everything except actual text colour for registered fonts)
+// [note - a colour with name 'Background' [translated!] has special meaning and will be used as the background colour of
+// the font list box in the options, for the given group]
+// wparam = (ColourID *)&colour_id
+// lparam = 0
+#define MS_COLOUR_REGISTER "Colour/Register"
+#define MS_COLOUR_REGISTERW "Colour/RegisterW"
+
+#if defined( _UNICODE )
+ #define MS_COLOUR_REGISTERT MS_COLOUR_REGISTERW
+#else
+ #define MS_COLOUR_REGISTERT MS_COLOUR_REGISTER
+#endif
+
+// get a colour
+// wparam = (ColourID *)&colour_id (only name and group matter)
+// rerturns the colour (as COLORREF), or -1 if not found
+#define MS_COLOUR_GET "Colour/Get"
+#define MS_COLOUR_GETW "Colour/GetW"
+
+#if defined( _UNICODE )
+ #define MS_COLOUR_GETT MS_COLOUR_GETW
+#else
+ #define MS_COLOUR_GETT MS_COLOUR_GET
+#endif
+
+// fired when a user modifies font settings, so reget your fonts and colours
+// wparam = lparam = 0
+#define ME_COLOUR_RELOAD "Colour/Reload"
+
+
+//////////////////////////////////////////////////////////////////////////
+//
+// EFFECTS
+//
+typedef struct FONTEFFECT_tag
+{
+ BYTE effectIndex;
+ DWORD baseColour; // ARGB
+ DWORD secondaryColour; // ARGB
+}
+ FONTEFFECT;
+
+typedef struct EffectID_tag
+{
+ int cbSize;
+ char group[64];
+ char name[64];
+ char dbSettingsGroup[32];
+ char setting[32];
+ DWORD flags;
+ FONTEFFECT defeffect;
+ int order;
+
+ FONTEFFECT value;
+}
+ EffectID;
+
+typedef struct EffectIDW_tag
+{
+ int cbSize;
+ wchar_t group[64];
+ wchar_t name[64];
+ char dbSettingsGroup[32];
+ char setting[32];
+ DWORD flags;
+ FONTEFFECT defeffect;
+ int order;
+
+ FONTEFFECT value;
+}
+ EffectIDW;
+
+#if defined( _UNICODE )
+ #define EffectIDT EffectIDW
+#else
+ #define EffectIDT EffectID
+#endif
+
+// register an effect
+// wparam = (EffectID *)&effect_id
+// lparam = 0
+#define MS_EFFECT_REGISTER "Effect/Register"
+#define MS_EFFECT_REGISTERW "Effect/RegisterW"
+
+#if defined( _UNICODE )
+ #define MS_EFFECT_REGISTERT MS_EFFECT_REGISTERW
+#else
+ #define MS_EFFECT_REGISTERT MS_EFFECT_REGISTER
+#endif
+
+// get a effect
+// wparam = (EffectID *)&effect_id (only name and group matter)
+// lparam = (FONTEFFECT *)&effect
+// rerturns 0, or -1 if not found
+#define MS_EFFECT_GET "Effect/Get"
+#define MS_EFFECT_GETW "Effect/GetW"
+
+#if defined( _UNICODE )
+ #define MS_EFFECT_GETT MS_EFFECT_GETW
+#else
+ #define MS_EFFECT_GETT MS_EFFECT_GET
+#endif
+
+// fired when a user modifies font settings, so reget your fonts and colours
+// wparam = lparam = 0
+#define ME_EFFECT_RELOAD "Effect/Reload"
+
+
+#endif // _FONT_SERVICE_API_INC
diff --git a/include/m_freeimage.h b/include/m_freeimage.h new file mode 100644 index 0000000000..17e471a820 --- /dev/null +++ b/include/m_freeimage.h @@ -0,0 +1,1091 @@ +// ==========================================================
+// FreeImage 3
+//
+// Design and implementation by
+// - Floris van den Berg (flvdberg@wxs.nl)
+// - Hervé Drolon (drolon@infonie.fr)
+//
+// Contributors:
+// - Adam Gates (radad@xoasis.com)
+// - Alex Kwak
+// - Alexander Dymerets (sashad@te.net.ua)
+// - Detlev Vendt (detlev.vendt@brillit.de)
+// - Jan L. Nauta (jln@magentammt.com)
+// - Jani Kajala (janik@remedy.fi)
+// - Juergen Riecker (j.riecker@gmx.de)
+// - Karl-Heinz Bussian (khbussian@moss.de)
+// - Laurent Rocher (rocherl@club-internet.fr)
+// - Luca Piergentili (l.pierge@terra.es)
+// - Machiel ten Brinke (brinkem@uni-one.nl)
+// - Markus Loibl (markus.loibl@epost.de)
+// - Martin Weber (martweb@gmx.net)
+// - Matthias Wandel (mwandel@rim.net)
+// - Michal Novotny (michal@etc.cz)
+// - Petr Pytelka (pyta@lightcomp.com)
+// - Riley McNiff (rmcniff@marexgroup.com)
+// - Ryan Rubley (ryan@lostreality.org)
+// - Volker Gärtner (volkerg@gmx.at)
+//
+// This file is part of FreeImage 3
+//
+// COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY
+// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
+// THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
+// OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED
+// CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT
+// THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
+// SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL
+// PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+// THIS DISCLAIMER.
+//
+// Use at your own risk!
+// ==========================================================
+
+#ifndef FREEIMAGE_H
+#define FREEIMAGE_H
+
+// Version information ------------------------------------------------------
+
+#define FREEIMAGE_MAJOR_VERSION 3
+#define FREEIMAGE_MINOR_VERSION 13
+#define FREEIMAGE_RELEASE_SERIAL 1
+
+// Compiler options ---------------------------------------------------------
+
+#include <wchar.h> // needed for UNICODE functions
+
+#if defined(FREEIMAGE_LIB)
+ #define DLL_API
+ #define DLL_CALLCONV
+#else
+ #if defined(_WIN32) || defined(__WIN32__)
+ #define DLL_CALLCONV __stdcall
+ // The following ifdef block is the standard way of creating macros which make exporting
+ // from a DLL simpler. All files within this DLL are compiled with the FREEIMAGE_EXPORTS
+ // symbol defined on the command line. this symbol should not be defined on any project
+ // that uses this DLL. This way any other project whose source files include this file see
+ // DLL_API functions as being imported from a DLL, wheras this DLL sees symbols
+ // defined with this macro as being exported.
+ #ifdef FREEIMAGE_EXPORTS
+ #define DLL_API __declspec(dllexport)
+ #else
+ #define DLL_API __declspec(dllimport)
+ #endif // FREEIMAGE_EXPORTS
+ #else
+ // try the gcc visibility support (see http://gcc.gnu.org/wiki/Visibility)
+ #if defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+ #ifndef GCC_HASCLASSVISIBILITY
+ #define GCC_HASCLASSVISIBILITY
+ #endif
+ #endif // __GNUC__
+ #define DLL_CALLCONV
+ #if defined(GCC_HASCLASSVISIBILITY)
+ #define DLL_API __attribute__ ((visibility("default")))
+ #else
+ #define DLL_API
+ #endif
+ #endif // WIN32 / !WIN32
+#endif // FREEIMAGE_LIB
+
+// Some versions of gcc may have BYTE_ORDER or __BYTE_ORDER defined
+// If your big endian system isn't being detected, add an OS specific check
+#if (defined(BYTE_ORDER) && BYTE_ORDER==BIG_ENDIAN) || \
+ (defined(__BYTE_ORDER) && __BYTE_ORDER==__BIG_ENDIAN) || \
+ defined(__BIG_ENDIAN__)
+#define FREEIMAGE_BIGENDIAN
+#endif // BYTE_ORDER
+
+// This really only affects 24 and 32 bit formats, the rest are always RGB order.
+#define FREEIMAGE_COLORORDER_BGR 0
+#define FREEIMAGE_COLORORDER_RGB 1
+#if defined(FREEIMAGE_BIGENDIAN)
+#define FREEIMAGE_COLORORDER FREEIMAGE_COLORORDER_RGB
+#else
+#define FREEIMAGE_COLORORDER FREEIMAGE_COLORORDER_BGR
+#endif
+
+// Ensure 4-byte enums if we're using Borland C++ compilers
+#if defined(__BORLANDC__)
+#pragma option push -b
+#endif
+
+// For C compatibility --------------------------------------------------------
+
+#ifdef __cplusplus
+#define FI_DEFAULT(x)
+#define FI_ENUM(x) enum x
+#define FI_STRUCT(x) struct x
+#else
+#define FI_DEFAULT(x)
+#define FI_ENUM(x) typedef int x; enum x
+#define FI_STRUCT(x) typedef struct x x; struct x
+#endif
+
+// Bitmap types -------------------------------------------------------------
+
+FI_STRUCT (FIBITMAP) { void *data; };
+FI_STRUCT (FIMULTIBITMAP) { void *data; };
+
+// Types used in the library (directly copied from Windows) -----------------
+
+#if defined(__MINGW32__) && defined(_WINDOWS_H)
+#define _WINDOWS_ // prevent a bug in MinGW32
+#endif // __MINGW32__
+
+#ifndef _WINDOWS_
+#define _WINDOWS_
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef NULL
+#define NULL 0
+#endif
+
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#define SEEK_CUR 1
+#define SEEK_END 2
+#endif
+
+#ifndef _MSC_VER
+// define portable types for 32-bit / 64-bit OS
+#include <inttypes.h>
+typedef int32_t BOOL;
+typedef uint8_t BYTE;
+typedef uint16_t WORD;
+typedef uint32_t DWORD;
+typedef int32_t LONG;
+#else
+// MS is not C99 ISO compliant
+typedef long BOOL;
+typedef unsigned char BYTE;
+typedef unsigned short WORD;
+typedef unsigned long DWORD;
+typedef long LONG;
+#endif // _MSC_VER
+
+#if (defined(_WIN32) || defined(__WIN32__))
+#pragma pack(push, 1)
+#else
+#pragma pack(1)
+#endif // WIN32
+
+typedef struct tagRGBQUAD {
+#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
+ BYTE rgbBlue;
+ BYTE rgbGreen;
+ BYTE rgbRed;
+#else
+ BYTE rgbRed;
+ BYTE rgbGreen;
+ BYTE rgbBlue;
+#endif // FREEIMAGE_COLORORDER
+ BYTE rgbReserved;
+} RGBQUAD;
+
+typedef struct tagRGBTRIPLE {
+#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
+ BYTE rgbtBlue;
+ BYTE rgbtGreen;
+ BYTE rgbtRed;
+#else
+ BYTE rgbtRed;
+ BYTE rgbtGreen;
+ BYTE rgbtBlue;
+#endif // FREEIMAGE_COLORORDER
+} RGBTRIPLE;
+
+#if (defined(_WIN32) || defined(__WIN32__))
+#pragma pack(pop)
+#else
+#pragma pack()
+#endif // WIN32
+
+typedef struct tagBITMAPINFOHEADER{
+ DWORD biSize;
+ LONG biWidth;
+ LONG biHeight;
+ WORD biPlanes;
+ WORD biBitCount;
+ DWORD biCompression;
+ DWORD biSizeImage;
+ LONG biXPelsPerMeter;
+ LONG biYPelsPerMeter;
+ DWORD biClrUsed;
+ DWORD biClrImportant;
+} BITMAPINFOHEADER, *PBITMAPINFOHEADER;
+
+typedef struct tagBITMAPINFO {
+ BITMAPINFOHEADER bmiHeader;
+ RGBQUAD bmiColors[1];
+} BITMAPINFO, *PBITMAPINFO;
+
+#endif // _WINDOWS_
+
+// Types used in the library (specific to FreeImage) ------------------------
+
+#if (defined(_WIN32) || defined(__WIN32__))
+#pragma pack(push, 1)
+#else
+#pragma pack(1)
+#endif // WIN32
+
+/** 48-bit RGB
+*/
+typedef struct tagFIRGB16 {
+ WORD red;
+ WORD green;
+ WORD blue;
+} FIRGB16;
+
+/** 64-bit RGBA
+*/
+typedef struct tagFIRGBA16 {
+ WORD red;
+ WORD green;
+ WORD blue;
+ WORD alpha;
+} FIRGBA16;
+
+/** 96-bit RGB Float
+*/
+typedef struct tagFIRGBF {
+ float red;
+ float green;
+ float blue;
+} FIRGBF;
+
+/** 128-bit RGBA Float
+*/
+typedef struct tagFIRGBAF {
+ float red;
+ float green;
+ float blue;
+ float alpha;
+} FIRGBAF;
+
+/** Data structure for COMPLEX type (complex number)
+*/
+typedef struct tagFICOMPLEX {
+ /// real part
+ double r;
+ /// imaginary part
+ double i;
+} FICOMPLEX;
+
+#if (defined(_WIN32) || defined(__WIN32__))
+#pragma pack(pop)
+#else
+#pragma pack()
+#endif // WIN32
+
+// Indexes for byte arrays, masks and shifts for treating pixels as words ---
+// These coincide with the order of RGBQUAD and RGBTRIPLE -------------------
+
+#ifndef FREEIMAGE_BIGENDIAN
+#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
+// Little Endian (x86 / MS Windows, Linux) : BGR(A) order
+#define FI_RGBA_RED 2
+#define FI_RGBA_GREEN 1
+#define FI_RGBA_BLUE 0
+#define FI_RGBA_ALPHA 3
+#define FI_RGBA_RED_MASK 0x00FF0000
+#define FI_RGBA_GREEN_MASK 0x0000FF00
+#define FI_RGBA_BLUE_MASK 0x000000FF
+#define FI_RGBA_ALPHA_MASK 0xFF000000
+#define FI_RGBA_RED_SHIFT 16
+#define FI_RGBA_GREEN_SHIFT 8
+#define FI_RGBA_BLUE_SHIFT 0
+#define FI_RGBA_ALPHA_SHIFT 24
+#else
+// Little Endian (x86 / MaxOSX) : RGB(A) order
+#define FI_RGBA_RED 0
+#define FI_RGBA_GREEN 1
+#define FI_RGBA_BLUE 2
+#define FI_RGBA_ALPHA 3
+#define FI_RGBA_RED_MASK 0x000000FF
+#define FI_RGBA_GREEN_MASK 0x0000FF00
+#define FI_RGBA_BLUE_MASK 0x00FF0000
+#define FI_RGBA_ALPHA_MASK 0xFF000000
+#define FI_RGBA_RED_SHIFT 0
+#define FI_RGBA_GREEN_SHIFT 8
+#define FI_RGBA_BLUE_SHIFT 16
+#define FI_RGBA_ALPHA_SHIFT 24
+#endif // FREEIMAGE_COLORORDER
+#else
+#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
+// Big Endian (PPC / none) : BGR(A) order
+#define FI_RGBA_RED 2
+#define FI_RGBA_GREEN 1
+#define FI_RGBA_BLUE 0
+#define FI_RGBA_ALPHA 3
+#define FI_RGBA_RED_MASK 0x0000FF00
+#define FI_RGBA_GREEN_MASK 0x00FF0000
+#define FI_RGBA_BLUE_MASK 0xFF000000
+#define FI_RGBA_ALPHA_MASK 0x000000FF
+#define FI_RGBA_RED_SHIFT 8
+#define FI_RGBA_GREEN_SHIFT 16
+#define FI_RGBA_BLUE_SHIFT 24
+#define FI_RGBA_ALPHA_SHIFT 0
+#else
+// Big Endian (PPC / Linux, MaxOSX) : RGB(A) order
+#define FI_RGBA_RED 0
+#define FI_RGBA_GREEN 1
+#define FI_RGBA_BLUE 2
+#define FI_RGBA_ALPHA 3
+#define FI_RGBA_RED_MASK 0xFF000000
+#define FI_RGBA_GREEN_MASK 0x00FF0000
+#define FI_RGBA_BLUE_MASK 0x0000FF00
+#define FI_RGBA_ALPHA_MASK 0x000000FF
+#define FI_RGBA_RED_SHIFT 24
+#define FI_RGBA_GREEN_SHIFT 16
+#define FI_RGBA_BLUE_SHIFT 8
+#define FI_RGBA_ALPHA_SHIFT 0
+#endif // FREEIMAGE_COLORORDER
+#endif // FREEIMAGE_BIGENDIAN
+
+#define FI_RGBA_RGB_MASK (FI_RGBA_RED_MASK|FI_RGBA_GREEN_MASK|FI_RGBA_BLUE_MASK)
+
+// The 16bit macros only include masks and shifts, since each color element is not byte aligned
+
+#define FI16_555_RED_MASK 0x7C00
+#define FI16_555_GREEN_MASK 0x03E0
+#define FI16_555_BLUE_MASK 0x001F
+#define FI16_555_RED_SHIFT 10
+#define FI16_555_GREEN_SHIFT 5
+#define FI16_555_BLUE_SHIFT 0
+#define FI16_565_RED_MASK 0xF800
+#define FI16_565_GREEN_MASK 0x07E0
+#define FI16_565_BLUE_MASK 0x001F
+#define FI16_565_RED_SHIFT 11
+#define FI16_565_GREEN_SHIFT 5
+#define FI16_565_BLUE_SHIFT 0
+
+// ICC profile support ------------------------------------------------------
+
+#define FIICC_DEFAULT 0x00
+#define FIICC_COLOR_IS_CMYK 0x01
+
+FI_STRUCT (FIICCPROFILE) {
+ WORD flags; // info flag
+ DWORD size; // profile's size measured in bytes
+ void *data; // points to a block of contiguous memory containing the profile
+};
+
+// Important enums ----------------------------------------------------------
+
+/** I/O image format identifiers.
+*/
+FI_ENUM(FREE_IMAGE_FORMAT) {
+ FIF_UNKNOWN = -1,
+ FIF_BMP = 0,
+ FIF_ICO = 1,
+ FIF_JPEG = 2,
+ FIF_JNG = 3,
+ FIF_KOALA = 4,
+ FIF_LBM = 5,
+ FIF_IFF = FIF_LBM,
+ FIF_MNG = 6,
+ FIF_PBM = 7,
+ FIF_PBMRAW = 8,
+ FIF_PCD = 9,
+ FIF_PCX = 10,
+ FIF_PGM = 11,
+ FIF_PGMRAW = 12,
+ FIF_PNG = 13,
+ FIF_PPM = 14,
+ FIF_PPMRAW = 15,
+ FIF_RAS = 16,
+ FIF_TARGA = 17,
+ FIF_TIFF = 18,
+ FIF_WBMP = 19,
+ FIF_PSD = 20,
+ FIF_CUT = 21,
+ FIF_XBM = 22,
+ FIF_XPM = 23,
+ FIF_DDS = 24,
+ FIF_GIF = 25,
+ FIF_HDR = 26,
+ FIF_FAXG3 = 27,
+ FIF_SGI = 28,
+ FIF_EXR = 29,
+ FIF_J2K = 30,
+ FIF_JP2 = 31,
+ FIF_PFM = 32,
+ FIF_PICT = 33,
+ FIF_RAW = 34
+};
+
+/** Image type used in FreeImage.
+*/
+FI_ENUM(FREE_IMAGE_TYPE) {
+ FIT_UNKNOWN = 0, // unknown type
+ FIT_BITMAP = 1, // standard image : 1-, 4-, 8-, 16-, 24-, 32-bit
+ FIT_UINT16 = 2, // array of unsigned short : unsigned 16-bit
+ FIT_INT16 = 3, // array of short : signed 16-bit
+ FIT_UINT32 = 4, // array of unsigned long : unsigned 32-bit
+ FIT_INT32 = 5, // array of long : signed 32-bit
+ FIT_FLOAT = 6, // array of float : 32-bit IEEE floating point
+ FIT_DOUBLE = 7, // array of double : 64-bit IEEE floating point
+ FIT_COMPLEX = 8, // array of FICOMPLEX : 2 x 64-bit IEEE floating point
+ FIT_RGB16 = 9, // 48-bit RGB image : 3 x 16-bit
+ FIT_RGBA16 = 10, // 64-bit RGBA image : 4 x 16-bit
+ FIT_RGBF = 11, // 96-bit RGB float image : 3 x 32-bit IEEE floating point
+ FIT_RGBAF = 12 // 128-bit RGBA float image : 4 x 32-bit IEEE floating point
+};
+
+/** Image color type used in FreeImage.
+*/
+FI_ENUM(FREE_IMAGE_COLOR_TYPE) {
+ FIC_MINISWHITE = 0, // min value is white
+ FIC_MINISBLACK = 1, // min value is black
+ FIC_RGB = 2, // RGB color model
+ FIC_PALETTE = 3, // color map indexed
+ FIC_RGBALPHA = 4, // RGB color model with alpha channel
+ FIC_CMYK = 5 // CMYK color model
+};
+
+/** Color quantization algorithms.
+Constants used in FreeImage_ColorQuantize.
+*/
+FI_ENUM(FREE_IMAGE_QUANTIZE) {
+ FIQ_WUQUANT = 0, // Xiaolin Wu color quantization algorithm
+ FIQ_NNQUANT = 1 // NeuQuant neural-net quantization algorithm by Anthony Dekker
+};
+
+/** Dithering algorithms.
+Constants used in FreeImage_Dither.
+*/
+FI_ENUM(FREE_IMAGE_DITHER) {
+ FID_FS = 0, // Floyd & Steinberg error diffusion
+ FID_BAYER4x4 = 1, // Bayer ordered dispersed dot dithering (order 2 dithering matrix)
+ FID_BAYER8x8 = 2, // Bayer ordered dispersed dot dithering (order 3 dithering matrix)
+ FID_CLUSTER6x6 = 3, // Ordered clustered dot dithering (order 3 - 6x6 matrix)
+ FID_CLUSTER8x8 = 4, // Ordered clustered dot dithering (order 4 - 8x8 matrix)
+ FID_CLUSTER16x16= 5, // Ordered clustered dot dithering (order 8 - 16x16 matrix)
+ FID_BAYER16x16 = 6 // Bayer ordered dispersed dot dithering (order 4 dithering matrix)
+};
+
+/** Lossless JPEG transformations
+Constants used in FreeImage_JPEGTransform
+*/
+FI_ENUM(FREE_IMAGE_JPEG_OPERATION) {
+ FIJPEG_OP_NONE = 0, // no transformation
+ FIJPEG_OP_FLIP_H = 1, // horizontal flip
+ FIJPEG_OP_FLIP_V = 2, // vertical flip
+ FIJPEG_OP_TRANSPOSE = 3, // transpose across UL-to-LR axis
+ FIJPEG_OP_TRANSVERSE = 4, // transpose across UR-to-LL axis
+ FIJPEG_OP_ROTATE_90 = 5, // 90-degree clockwise rotation
+ FIJPEG_OP_ROTATE_180 = 6, // 180-degree rotation
+ FIJPEG_OP_ROTATE_270 = 7 // 270-degree clockwise (or 90 ccw)
+};
+
+/** Tone mapping operators.
+Constants used in FreeImage_ToneMapping.
+*/
+FI_ENUM(FREE_IMAGE_TMO) {
+ FITMO_DRAGO03 = 0, // Adaptive logarithmic mapping (F. Drago, 2003)
+ FITMO_REINHARD05 = 1, // Dynamic range reduction inspired by photoreceptor physiology (E. Reinhard, 2005)
+ FITMO_FATTAL02 = 2 // Gradient domain high dynamic range compression (R. Fattal, 2002)
+};
+
+/** Upsampling / downsampling filters.
+Constants used in FreeImage_Rescale.
+*/
+FI_ENUM(FREE_IMAGE_FILTER) {
+ FILTER_BOX = 0, // Box, pulse, Fourier window, 1st order (constant) b-spline
+ FILTER_BICUBIC = 1, // Mitchell & Netravali's two-param cubic filter
+ FILTER_BILINEAR = 2, // Bilinear filter
+ FILTER_BSPLINE = 3, // 4th order (cubic) b-spline
+ FILTER_CATMULLROM = 4, // Catmull-Rom spline, Overhauser spline
+ FILTER_LANCZOS3 = 5 // Lanczos3 filter
+};
+
+/** Color channels.
+Constants used in color manipulation routines.
+*/
+FI_ENUM(FREE_IMAGE_COLOR_CHANNEL) {
+ FICC_RGB = 0, // Use red, green and blue channels
+ FICC_RED = 1, // Use red channel
+ FICC_GREEN = 2, // Use green channel
+ FICC_BLUE = 3, // Use blue channel
+ FICC_ALPHA = 4, // Use alpha channel
+ FICC_BLACK = 5, // Use black channel
+ FICC_REAL = 6, // Complex images: use real part
+ FICC_IMAG = 7, // Complex images: use imaginary part
+ FICC_MAG = 8, // Complex images: use magnitude
+ FICC_PHASE = 9 // Complex images: use phase
+};
+
+// Metadata support ---------------------------------------------------------
+
+/**
+ Tag data type information (based on TIFF specifications)
+
+ Note: RATIONALs are the ratio of two 32-bit integer values.
+*/
+FI_ENUM(FREE_IMAGE_MDTYPE) {
+ FIDT_NOTYPE = 0, // placeholder
+ FIDT_BYTE = 1, // 8-bit unsigned integer
+ FIDT_ASCII = 2, // 8-bit bytes w/ last byte null
+ FIDT_SHORT = 3, // 16-bit unsigned integer
+ FIDT_LONG = 4, // 32-bit unsigned integer
+ FIDT_RATIONAL = 5, // 64-bit unsigned fraction
+ FIDT_SBYTE = 6, // 8-bit signed integer
+ FIDT_UNDEFINED = 7, // 8-bit untyped data
+ FIDT_SSHORT = 8, // 16-bit signed integer
+ FIDT_SLONG = 9, // 32-bit signed integer
+ FIDT_SRATIONAL = 10, // 64-bit signed fraction
+ FIDT_FLOAT = 11, // 32-bit IEEE floating point
+ FIDT_DOUBLE = 12, // 64-bit IEEE floating point
+ FIDT_IFD = 13, // 32-bit unsigned integer (offset)
+ FIDT_PALETTE = 14 // 32-bit RGBQUAD
+};
+
+/**
+ Metadata models supported by FreeImage
+*/
+FI_ENUM(FREE_IMAGE_MDMODEL) {
+ FIMD_NODATA = -1,
+ FIMD_COMMENTS = 0, // single comment or keywords
+ FIMD_EXIF_MAIN = 1, // Exif-TIFF metadata
+ FIMD_EXIF_EXIF = 2, // Exif-specific metadata
+ FIMD_EXIF_GPS = 3, // Exif GPS metadata
+ FIMD_EXIF_MAKERNOTE = 4, // Exif maker note metadata
+ FIMD_EXIF_INTEROP = 5, // Exif interoperability metadata
+ FIMD_IPTC = 6, // IPTC/NAA metadata
+ FIMD_XMP = 7, // Abobe XMP metadata
+ FIMD_GEOTIFF = 8, // GeoTIFF metadata
+ FIMD_ANIMATION = 9, // Animation metadata
+ FIMD_CUSTOM = 10 // Used to attach other metadata types to a dib
+};
+
+/**
+ Handle to a metadata model
+*/
+FI_STRUCT (FIMETADATA) { void *data; };
+
+/**
+ Handle to a FreeImage tag
+*/
+FI_STRUCT (FITAG) { void *data; };
+
+// File IO routines ---------------------------------------------------------
+
+#ifndef FREEIMAGE_IO
+#define FREEIMAGE_IO
+
+typedef void* fi_handle;
+typedef unsigned (DLL_CALLCONV *FI_ReadProc) (void *buffer, unsigned size, unsigned count, fi_handle handle);
+typedef unsigned (DLL_CALLCONV *FI_WriteProc) (void *buffer, unsigned size, unsigned count, fi_handle handle);
+typedef int (DLL_CALLCONV *FI_SeekProc) (fi_handle handle, long offset, int origin);
+typedef long (DLL_CALLCONV *FI_TellProc) (fi_handle handle);
+
+#if (defined(_WIN32) || defined(__WIN32__))
+#pragma pack(push, 1)
+#else
+#pragma pack(1)
+#endif // WIN32
+
+FI_STRUCT(FreeImageIO) {
+ FI_ReadProc read_proc; // pointer to the function used to read data
+ FI_WriteProc write_proc; // pointer to the function used to write data
+ FI_SeekProc seek_proc; // pointer to the function used to seek
+ FI_TellProc tell_proc; // pointer to the function used to aquire the current position
+};
+
+#if (defined(_WIN32) || defined(__WIN32__))
+#pragma pack(pop)
+#else
+#pragma pack()
+#endif // WIN32
+
+/**
+Handle to a memory I/O stream
+*/
+FI_STRUCT (FIMEMORY) { void *data; };
+
+#endif // FREEIMAGE_IO
+
+// Plugin routines ----------------------------------------------------------
+
+#ifndef PLUGINS
+#define PLUGINS
+
+typedef const char *(DLL_CALLCONV *FI_FormatProc)(void);
+typedef const char *(DLL_CALLCONV *FI_DescriptionProc)(void);
+typedef const char *(DLL_CALLCONV *FI_ExtensionListProc)(void);
+typedef const char *(DLL_CALLCONV *FI_RegExprProc)(void);
+typedef void *(DLL_CALLCONV *FI_OpenProc)(FreeImageIO *io, fi_handle handle, BOOL read);
+typedef void (DLL_CALLCONV *FI_CloseProc)(FreeImageIO *io, fi_handle handle, void *data);
+typedef int (DLL_CALLCONV *FI_PageCountProc)(FreeImageIO *io, fi_handle handle, void *data);
+typedef int (DLL_CALLCONV *FI_PageCapabilityProc)(FreeImageIO *io, fi_handle handle, void *data);
+typedef FIBITMAP *(DLL_CALLCONV *FI_LoadProc)(FreeImageIO *io, fi_handle handle, int page, int flags, void *data);
+typedef BOOL (DLL_CALLCONV *FI_SaveProc)(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void *data);
+typedef BOOL (DLL_CALLCONV *FI_ValidateProc)(FreeImageIO *io, fi_handle handle);
+typedef const char *(DLL_CALLCONV *FI_MimeProc)(void);
+typedef BOOL (DLL_CALLCONV *FI_SupportsExportBPPProc)(int bpp);
+typedef BOOL (DLL_CALLCONV *FI_SupportsExportTypeProc)(FREE_IMAGE_TYPE type);
+typedef BOOL (DLL_CALLCONV *FI_SupportsICCProfilesProc)(void);
+
+FI_STRUCT (Plugin) {
+ FI_FormatProc format_proc;
+ FI_DescriptionProc description_proc;
+ FI_ExtensionListProc extension_proc;
+ FI_RegExprProc regexpr_proc;
+ FI_OpenProc open_proc;
+ FI_CloseProc close_proc;
+ FI_PageCountProc pagecount_proc;
+ FI_PageCapabilityProc pagecapability_proc;
+ FI_LoadProc load_proc;
+ FI_SaveProc save_proc;
+ FI_ValidateProc validate_proc;
+ FI_MimeProc mime_proc;
+ FI_SupportsExportBPPProc supports_export_bpp_proc;
+ FI_SupportsExportTypeProc supports_export_type_proc;
+ FI_SupportsICCProfilesProc supports_icc_profiles_proc;
+};
+
+typedef void (DLL_CALLCONV *FI_InitProc)(Plugin *plugin, int format_id);
+
+#endif // PLUGINS
+
+
+// Load / Save flag constants -----------------------------------------------
+
+#define BMP_DEFAULT 0
+#define BMP_SAVE_RLE 1
+#define CUT_DEFAULT 0
+#define DDS_DEFAULT 0
+#define EXR_DEFAULT 0 // save data as half with piz-based wavelet compression
+#define EXR_FLOAT 0x0001 // save data as float instead of as half (not recommended)
+#define EXR_NONE 0x0002 // save with no compression
+#define EXR_ZIP 0x0004 // save with zlib compression, in blocks of 16 scan lines
+#define EXR_PIZ 0x0008 // save with piz-based wavelet compression
+#define EXR_PXR24 0x0010 // save with lossy 24-bit float compression
+#define EXR_B44 0x0020 // save with lossy 44% float compression - goes to 22% when combined with EXR_LC
+#define EXR_LC 0x0040 // save images with one luminance and two chroma channels, rather than as RGB (lossy compression)
+#define FAXG3_DEFAULT 0
+#define GIF_DEFAULT 0
+#define GIF_LOAD256 1 // Load the image as a 256 color image with ununsed palette entries, if it's 16 or 2 color
+#define GIF_PLAYBACK 2 // 'Play' the GIF to generate each frame (as 32bpp) instead of returning raw frame data when loading
+#define HDR_DEFAULT 0
+#define ICO_DEFAULT 0
+#define ICO_MAKEALPHA 1 // convert to 32bpp and create an alpha channel from the AND-mask when loading
+#define IFF_DEFAULT 0
+#define J2K_DEFAULT 0 // save with a 16:1 rate
+#define JP2_DEFAULT 0 // save with a 16:1 rate
+#define JPEG_DEFAULT 0 // loading (see JPEG_FAST); saving (see JPEG_QUALITYGOOD|JPEG_SUBSAMPLING_420)
+#define JPEG_FAST 0x0001 // load the file as fast as possible, sacrificing some quality
+#define JPEG_ACCURATE 0x0002 // load the file with the best quality, sacrificing some speed
+#define JPEG_CMYK 0x0004 // load separated CMYK "as is" (use | to combine with other load flags)
+#define JPEG_EXIFROTATE 0x0008 // load and rotate according to Exif 'Orientation' tag if available
+#define JPEG_QUALITYSUPERB 0x80 // save with superb quality (100:1)
+#define JPEG_QUALITYGOOD 0x0100 // save with good quality (75:1)
+#define JPEG_QUALITYNORMAL 0x0200 // save with normal quality (50:1)
+#define JPEG_QUALITYAVERAGE 0x0400 // save with average quality (25:1)
+#define JPEG_QUALITYBAD 0x0800 // save with bad quality (10:1)
+#define JPEG_PROGRESSIVE 0x2000 // save as a progressive-JPEG (use | to combine with other save flags)
+#define JPEG_SUBSAMPLING_411 0x1000 // save with high 4x1 chroma subsampling (4:1:1)
+#define JPEG_SUBSAMPLING_420 0x4000 // save with medium 2x2 medium chroma subsampling (4:2:0) - default value
+#define JPEG_SUBSAMPLING_422 0x8000 // save with low 2x1 chroma subsampling (4:2:2)
+#define JPEG_SUBSAMPLING_444 0x10000 // save with no chroma subsampling (4:4:4)
+#define KOALA_DEFAULT 0
+#define LBM_DEFAULT 0
+#define MNG_DEFAULT 0
+#define PCD_DEFAULT 0
+#define PCD_BASE 1 // load the bitmap sized 768 x 512
+#define PCD_BASEDIV4 2 // load the bitmap sized 384 x 256
+#define PCD_BASEDIV16 3 // load the bitmap sized 192 x 128
+#define PCX_DEFAULT 0
+#define PFM_DEFAULT 0
+#define PICT_DEFAULT 0
+#define PNG_DEFAULT 0
+#define PNG_IGNOREGAMMA 1 // loading: avoid gamma correction
+#define PNG_Z_BEST_SPEED 0x0001 // save using ZLib level 1 compression flag (default value is 6)
+#define PNG_Z_DEFAULT_COMPRESSION 0x0006 // save using ZLib level 6 compression flag (default recommended value)
+#define PNG_Z_BEST_COMPRESSION 0x0009 // save using ZLib level 9 compression flag (default value is 6)
+#define PNG_Z_NO_COMPRESSION 0x0100 // save without ZLib compression
+#define PNG_INTERLACED 0x0200 // save using Adam7 interlacing (use | to combine with other save flags)
+#define PNM_DEFAULT 0
+#define PNM_SAVE_RAW 0 // If set the writer saves in RAW format (i.e. P4, P5 or P6)
+#define PNM_SAVE_ASCII 1 // If set the writer saves in ASCII format (i.e. P1, P2 or P3)
+#define PSD_DEFAULT 0
+#define RAS_DEFAULT 0
+#define RAW_DEFAULT 0 // load the file as linear RGB 48-bit
+#define RAW_PREVIEW 1 // try to load the embedded JPEG preview with included Exif Data or default to RGB 24-bit
+#define RAW_DISPLAY 2 // load the file as RGB 24-bit
+#define SGI_DEFAULT 0
+#define TARGA_DEFAULT 0
+#define TARGA_LOAD_RGB888 1 // If set the loader converts RGB555 and ARGB8888 -> RGB888.
+#define TIFF_DEFAULT 0
+#define TIFF_CMYK 0x0001 // reads/stores tags for separated CMYK (use | to combine with compression flags)
+#define TIFF_PACKBITS 0x0100 // save using PACKBITS compression
+#define TIFF_DEFLATE 0x0200 // save using DEFLATE compression (a.k.a. ZLIB compression)
+#define TIFF_ADOBE_DEFLATE 0x0400 // save using ADOBE DEFLATE compression
+#define TIFF_NONE 0x0800 // save without any compression
+#define TIFF_CCITTFAX3 0x1000 // save using CCITT Group 3 fax encoding
+#define TIFF_CCITTFAX4 0x2000 // save using CCITT Group 4 fax encoding
+#define TIFF_LZW 0x4000 // save using LZW compression
+#define TIFF_JPEG 0x8000 // save using JPEG compression
+#define WBMP_DEFAULT 0
+#define XBM_DEFAULT 0
+#define XPM_DEFAULT 0
+
+// Background filling options ---------------------------------------------------------
+// Constants used in FreeImage_FillBackground and FreeImage_EnlargeCanvas
+
+#define FI_COLOR_IS_RGB_COLOR 0x00 // RGBQUAD color is a RGB color (contains no valid alpha channel)
+#define FI_COLOR_IS_RGBA_COLOR 0x01 // RGBQUAD color is a RGBA color (contains a valid alpha channel)
+#define FI_COLOR_FIND_EQUAL_COLOR 0x02 // For palettized images: lookup equal RGB color from palette
+#define FI_COLOR_ALPHA_IS_INDEX 0x04 // The color's rgbReserved member (alpha) contains the palette index to be used
+#define FI_COLOR_PALETTE_SEARCH_MASK (FI_COLOR_FIND_EQUAL_COLOR | FI_COLOR_ALPHA_IS_INDEX) // No color lookup is performed
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Init / Error routines ----------------------------------------------------
+
+DLL_API void DLL_CALLCONV FreeImage_Initialise(BOOL load_local_plugins_only FI_DEFAULT(FALSE));
+DLL_API void DLL_CALLCONV FreeImage_DeInitialise(void);
+
+// Version routines ---------------------------------------------------------
+
+DLL_API const char *DLL_CALLCONV FreeImage_GetVersion(void);
+DLL_API const char *DLL_CALLCONV FreeImage_GetCopyrightMessage(void);
+
+// Message output functions -------------------------------------------------
+
+typedef void (*FreeImage_OutputMessageFunction)(FREE_IMAGE_FORMAT fif, const char *msg);
+typedef void (DLL_CALLCONV *FreeImage_OutputMessageFunctionStdCall)(FREE_IMAGE_FORMAT fif, const char *msg);
+
+DLL_API void DLL_CALLCONV FreeImage_SetOutputMessageStdCall(FreeImage_OutputMessageFunctionStdCall omf);
+DLL_API void DLL_CALLCONV FreeImage_SetOutputMessage(FreeImage_OutputMessageFunction omf);
+DLL_API void DLL_CALLCONV FreeImage_OutputMessageProc(int fif, const char *fmt, ...);
+
+// Allocate / Clone / Unload routines ---------------------------------------
+
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Allocate(int width, int height, int bpp, unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0));
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_AllocateT(FREE_IMAGE_TYPE type, int width, int height, int bpp FI_DEFAULT(8), unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0));
+DLL_API FIBITMAP * DLL_CALLCONV FreeImage_Clone(FIBITMAP *dib);
+DLL_API void DLL_CALLCONV FreeImage_Unload(FIBITMAP *dib);
+
+// Load / Save routines -----------------------------------------------------
+
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Load(FREE_IMAGE_FORMAT fif, const char *filename, int flags FI_DEFAULT(0));
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadU(FREE_IMAGE_FORMAT fif, const wchar_t *filename, int flags FI_DEFAULT(0));
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
+DLL_API BOOL DLL_CALLCONV FreeImage_Save(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, const char *filename, int flags FI_DEFAULT(0));
+DLL_API BOOL DLL_CALLCONV FreeImage_SaveU(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, const wchar_t *filename, int flags FI_DEFAULT(0));
+DLL_API BOOL DLL_CALLCONV FreeImage_SaveToHandle(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
+
+// Memory I/O stream routines -----------------------------------------------
+
+DLL_API FIMEMORY *DLL_CALLCONV FreeImage_OpenMemory(BYTE *data FI_DEFAULT(0), DWORD size_in_bytes FI_DEFAULT(0));
+DLL_API void DLL_CALLCONV FreeImage_CloseMemory(FIMEMORY *stream);
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadFromMemory(FREE_IMAGE_FORMAT fif, FIMEMORY *stream, int flags FI_DEFAULT(0));
+DLL_API BOOL DLL_CALLCONV FreeImage_SaveToMemory(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, FIMEMORY *stream, int flags FI_DEFAULT(0));
+DLL_API long DLL_CALLCONV FreeImage_TellMemory(FIMEMORY *stream);
+DLL_API BOOL DLL_CALLCONV FreeImage_SeekMemory(FIMEMORY *stream, long offset, int origin);
+DLL_API BOOL DLL_CALLCONV FreeImage_AcquireMemory(FIMEMORY *stream, BYTE **data, DWORD *size_in_bytes);
+DLL_API unsigned DLL_CALLCONV FreeImage_ReadMemory(void *buffer, unsigned size, unsigned count, FIMEMORY *stream);
+DLL_API unsigned DLL_CALLCONV FreeImage_WriteMemory(const void *buffer, unsigned size, unsigned count, FIMEMORY *stream);
+DLL_API FIMULTIBITMAP *DLL_CALLCONV FreeImage_LoadMultiBitmapFromMemory(FREE_IMAGE_FORMAT fif, FIMEMORY *stream, int flags FI_DEFAULT(0));
+
+// Plugin Interface ---------------------------------------------------------
+
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_RegisterLocalPlugin(FI_InitProc proc_address, const char *format FI_DEFAULT(0), const char *description FI_DEFAULT(0), const char *extension FI_DEFAULT(0), const char *regexpr FI_DEFAULT(0));
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_RegisterExternalPlugin(const char *path, const char *format FI_DEFAULT(0), const char *description FI_DEFAULT(0), const char *extension FI_DEFAULT(0), const char *regexpr FI_DEFAULT(0));
+DLL_API int DLL_CALLCONV FreeImage_GetFIFCount(void);
+DLL_API int DLL_CALLCONV FreeImage_SetPluginEnabled(FREE_IMAGE_FORMAT fif, BOOL enable);
+DLL_API int DLL_CALLCONV FreeImage_IsPluginEnabled(FREE_IMAGE_FORMAT fif);
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFormat(const char *format);
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromMime(const char *mime);
+DLL_API const char *DLL_CALLCONV FreeImage_GetFormatFromFIF(FREE_IMAGE_FORMAT fif);
+DLL_API const char *DLL_CALLCONV FreeImage_GetFIFExtensionList(FREE_IMAGE_FORMAT fif);
+DLL_API const char *DLL_CALLCONV FreeImage_GetFIFDescription(FREE_IMAGE_FORMAT fif);
+DLL_API const char *DLL_CALLCONV FreeImage_GetFIFRegExpr(FREE_IMAGE_FORMAT fif);
+DLL_API const char *DLL_CALLCONV FreeImage_GetFIFMimeType(FREE_IMAGE_FORMAT fif);
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFilename(const char *filename);
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFilenameU(const wchar_t *filename);
+DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsReading(FREE_IMAGE_FORMAT fif);
+DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsWriting(FREE_IMAGE_FORMAT fif);
+DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsExportBPP(FREE_IMAGE_FORMAT fif, int bpp);
+DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsExportType(FREE_IMAGE_FORMAT fif, FREE_IMAGE_TYPE type);
+DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsICCProfiles(FREE_IMAGE_FORMAT fif);
+
+// Multipaging interface ----------------------------------------------------
+
+DLL_API FIMULTIBITMAP * DLL_CALLCONV FreeImage_OpenMultiBitmap(FREE_IMAGE_FORMAT fif, const char *filename, BOOL create_new, BOOL read_only, BOOL keep_cache_in_memory FI_DEFAULT(FALSE), int flags FI_DEFAULT(0));
+DLL_API FIMULTIBITMAP * DLL_CALLCONV FreeImage_OpenMultiBitmapU(FREE_IMAGE_FORMAT fif, const wchar_t *filename, BOOL create_new, BOOL read_only, BOOL keep_cache_in_memory FI_DEFAULT(FALSE), int flags FI_DEFAULT(0));
+DLL_API FIMULTIBITMAP * DLL_CALLCONV FreeImage_OpenMultiBitmapFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
+DLL_API BOOL DLL_CALLCONV FreeImage_CloseMultiBitmap(FIMULTIBITMAP *bitmap, int flags FI_DEFAULT(0));
+DLL_API int DLL_CALLCONV FreeImage_GetPageCount(FIMULTIBITMAP *bitmap);
+DLL_API void DLL_CALLCONV FreeImage_AppendPage(FIMULTIBITMAP *bitmap, FIBITMAP *data);
+DLL_API void DLL_CALLCONV FreeImage_InsertPage(FIMULTIBITMAP *bitmap, int page, FIBITMAP *data);
+DLL_API void DLL_CALLCONV FreeImage_DeletePage(FIMULTIBITMAP *bitmap, int page);
+DLL_API FIBITMAP * DLL_CALLCONV FreeImage_LockPage(FIMULTIBITMAP *bitmap, int page);
+DLL_API void DLL_CALLCONV FreeImage_UnlockPage(FIMULTIBITMAP *bitmap, FIBITMAP *data, BOOL changed);
+DLL_API BOOL DLL_CALLCONV FreeImage_MovePage(FIMULTIBITMAP *bitmap, int target, int source);
+DLL_API BOOL DLL_CALLCONV FreeImage_GetLockedPageNumbers(FIMULTIBITMAP *bitmap, int *pages, int *count);
+
+// Filetype request routines ------------------------------------------------
+
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileType(const char *filename, int size FI_DEFAULT(0));
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeU(const wchar_t *filename, int size FI_DEFAULT(0));
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeFromHandle(FreeImageIO *io, fi_handle handle, int size FI_DEFAULT(0));
+DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeFromMemory(FIMEMORY *stream, int size FI_DEFAULT(0));
+
+// Image type request routine -----------------------------------------------
+
+DLL_API FREE_IMAGE_TYPE DLL_CALLCONV FreeImage_GetImageType(FIBITMAP *dib);
+
+// FreeImage helper routines ------------------------------------------------
+
+DLL_API BOOL DLL_CALLCONV FreeImage_IsLittleEndian(void);
+DLL_API BOOL DLL_CALLCONV FreeImage_LookupX11Color(const char *szColor, BYTE *nRed, BYTE *nGreen, BYTE *nBlue);
+DLL_API BOOL DLL_CALLCONV FreeImage_LookupSVGColor(const char *szColor, BYTE *nRed, BYTE *nGreen, BYTE *nBlue);
+
+// Pixel access routines ----------------------------------------------------
+
+DLL_API BYTE *DLL_CALLCONV FreeImage_GetBits(FIBITMAP *dib);
+DLL_API BYTE *DLL_CALLCONV FreeImage_GetScanLine(FIBITMAP *dib, int scanline);
+
+DLL_API BOOL DLL_CALLCONV FreeImage_GetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value);
+DLL_API BOOL DLL_CALLCONV FreeImage_GetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value);
+DLL_API BOOL DLL_CALLCONV FreeImage_SetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value);
+DLL_API BOOL DLL_CALLCONV FreeImage_SetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value);
+
+// DIB info routines --------------------------------------------------------
+
+DLL_API unsigned DLL_CALLCONV FreeImage_GetColorsUsed(FIBITMAP *dib);
+DLL_API unsigned DLL_CALLCONV FreeImage_GetBPP(FIBITMAP *dib);
+DLL_API unsigned DLL_CALLCONV FreeImage_GetWidth(FIBITMAP *dib);
+DLL_API unsigned DLL_CALLCONV FreeImage_GetHeight(FIBITMAP *dib);
+DLL_API unsigned DLL_CALLCONV FreeImage_GetLine(FIBITMAP *dib);
+DLL_API unsigned DLL_CALLCONV FreeImage_GetPitch(FIBITMAP *dib);
+DLL_API unsigned DLL_CALLCONV FreeImage_GetDIBSize(FIBITMAP *dib);
+DLL_API RGBQUAD *DLL_CALLCONV FreeImage_GetPalette(FIBITMAP *dib);
+
+DLL_API unsigned DLL_CALLCONV FreeImage_GetDotsPerMeterX(FIBITMAP *dib);
+DLL_API unsigned DLL_CALLCONV FreeImage_GetDotsPerMeterY(FIBITMAP *dib);
+DLL_API void DLL_CALLCONV FreeImage_SetDotsPerMeterX(FIBITMAP *dib, unsigned res);
+DLL_API void DLL_CALLCONV FreeImage_SetDotsPerMeterY(FIBITMAP *dib, unsigned res);
+
+DLL_API BITMAPINFOHEADER *DLL_CALLCONV FreeImage_GetInfoHeader(FIBITMAP *dib);
+DLL_API BITMAPINFO *DLL_CALLCONV FreeImage_GetInfo(FIBITMAP *dib);
+DLL_API FREE_IMAGE_COLOR_TYPE DLL_CALLCONV FreeImage_GetColorType(FIBITMAP *dib);
+
+DLL_API unsigned DLL_CALLCONV FreeImage_GetRedMask(FIBITMAP *dib);
+DLL_API unsigned DLL_CALLCONV FreeImage_GetGreenMask(FIBITMAP *dib);
+DLL_API unsigned DLL_CALLCONV FreeImage_GetBlueMask(FIBITMAP *dib);
+
+DLL_API unsigned DLL_CALLCONV FreeImage_GetTransparencyCount(FIBITMAP *dib);
+DLL_API BYTE * DLL_CALLCONV FreeImage_GetTransparencyTable(FIBITMAP *dib);
+DLL_API void DLL_CALLCONV FreeImage_SetTransparent(FIBITMAP *dib, BOOL enabled);
+DLL_API void DLL_CALLCONV FreeImage_SetTransparencyTable(FIBITMAP *dib, BYTE *table, int count);
+DLL_API BOOL DLL_CALLCONV FreeImage_IsTransparent(FIBITMAP *dib);
+DLL_API void DLL_CALLCONV FreeImage_SetTransparentIndex(FIBITMAP *dib, int index);
+DLL_API int DLL_CALLCONV FreeImage_GetTransparentIndex(FIBITMAP *dib);
+
+DLL_API BOOL DLL_CALLCONV FreeImage_HasBackgroundColor(FIBITMAP *dib);
+DLL_API BOOL DLL_CALLCONV FreeImage_GetBackgroundColor(FIBITMAP *dib, RGBQUAD *bkcolor);
+DLL_API BOOL DLL_CALLCONV FreeImage_SetBackgroundColor(FIBITMAP *dib, RGBQUAD *bkcolor);
+
+
+// ICC profile routines -----------------------------------------------------
+
+DLL_API FIICCPROFILE *DLL_CALLCONV FreeImage_GetICCProfile(FIBITMAP *dib);
+DLL_API FIICCPROFILE *DLL_CALLCONV FreeImage_CreateICCProfile(FIBITMAP *dib, void *data, long size);
+DLL_API void DLL_CALLCONV FreeImage_DestroyICCProfile(FIBITMAP *dib);
+
+// Line conversion routines -------------------------------------------------
+
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To4(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To4(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To4_555(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To4_565(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To4(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To4(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To8(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To8(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To8_555(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To8_565(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To8(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To8(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16_565_To16_555(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To16_555(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To16_555(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16_555_To16_565(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To16_565(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To16_565(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To24_555(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To24_565(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To24(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To32_555(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To32_565(BYTE *target, BYTE *source, int width_in_pixels);
+DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To32(BYTE *target, BYTE *source, int width_in_pixels);
+
+// Smart conversion routines ------------------------------------------------
+
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo4Bits(FIBITMAP *dib);
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo8Bits(FIBITMAP *dib);
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToGreyscale(FIBITMAP *dib);
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo16Bits555(FIBITMAP *dib);
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo16Bits565(FIBITMAP *dib);
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo24Bits(FIBITMAP *dib);
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo32Bits(FIBITMAP *dib);
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ColorQuantize(FIBITMAP *dib, FREE_IMAGE_QUANTIZE quantize);
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ColorQuantizeEx(FIBITMAP *dib, FREE_IMAGE_QUANTIZE quantize FI_DEFAULT(FIQ_WUQUANT), int PaletteSize FI_DEFAULT(256), int ReserveSize FI_DEFAULT(0), RGBQUAD *ReservePalette FI_DEFAULT(NULL));
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Threshold(FIBITMAP *dib, BYTE T);
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Dither(FIBITMAP *dib, FREE_IMAGE_DITHER algorithm);
+
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertFromRawBits(BYTE *bits, int width, int height, int pitch, unsigned bpp, unsigned red_mask, unsigned green_mask, unsigned blue_mask, BOOL topdown FI_DEFAULT(FALSE));
+DLL_API void DLL_CALLCONV FreeImage_ConvertToRawBits(BYTE *bits, FIBITMAP *dib, int pitch, unsigned bpp, unsigned red_mask, unsigned green_mask, unsigned blue_mask, BOOL topdown FI_DEFAULT(FALSE));
+
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToRGBF(FIBITMAP *dib);
+
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToStandardType(FIBITMAP *src, BOOL scale_linear FI_DEFAULT(TRUE));
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToType(FIBITMAP *src, FREE_IMAGE_TYPE dst_type, BOOL scale_linear FI_DEFAULT(TRUE));
+
+// tone mapping operators
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ToneMapping(FIBITMAP *dib, FREE_IMAGE_TMO tmo, double first_param FI_DEFAULT(0), double second_param FI_DEFAULT(0));
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoDrago03(FIBITMAP *src, double gamma FI_DEFAULT(2.2), double exposure FI_DEFAULT(0));
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoReinhard05(FIBITMAP *src, double intensity FI_DEFAULT(0), double contrast FI_DEFAULT(0));
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoReinhard05Ex(FIBITMAP *src, double intensity FI_DEFAULT(0), double contrast FI_DEFAULT(0), double adaptation FI_DEFAULT(1), double color_correction FI_DEFAULT(0));
+
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoFattal02(FIBITMAP *src, double color_saturation FI_DEFAULT(0.5), double attenuation FI_DEFAULT(0.85));
+
+// ZLib interface -----------------------------------------------------------
+
+DLL_API DWORD DLL_CALLCONV FreeImage_ZLibCompress(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
+DLL_API DWORD DLL_CALLCONV FreeImage_ZLibUncompress(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
+DLL_API DWORD DLL_CALLCONV FreeImage_ZLibGZip(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
+DLL_API DWORD DLL_CALLCONV FreeImage_ZLibGUnzip(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
+DLL_API DWORD DLL_CALLCONV FreeImage_ZLibCRC32(DWORD crc, BYTE *source, DWORD source_size);
+
+// --------------------------------------------------------------------------
+// Metadata routines --------------------------------------------------------
+// --------------------------------------------------------------------------
+
+// tag creation / destruction
+DLL_API FITAG *DLL_CALLCONV FreeImage_CreateTag(void);
+DLL_API void DLL_CALLCONV FreeImage_DeleteTag(FITAG *tag);
+DLL_API FITAG *DLL_CALLCONV FreeImage_CloneTag(FITAG *tag);
+
+// tag getters and setters
+DLL_API const char *DLL_CALLCONV FreeImage_GetTagKey(FITAG *tag);
+DLL_API const char *DLL_CALLCONV FreeImage_GetTagDescription(FITAG *tag);
+DLL_API WORD DLL_CALLCONV FreeImage_GetTagID(FITAG *tag);
+DLL_API FREE_IMAGE_MDTYPE DLL_CALLCONV FreeImage_GetTagType(FITAG *tag);
+DLL_API DWORD DLL_CALLCONV FreeImage_GetTagCount(FITAG *tag);
+DLL_API DWORD DLL_CALLCONV FreeImage_GetTagLength(FITAG *tag);
+DLL_API const void *DLL_CALLCONV FreeImage_GetTagValue(FITAG *tag);
+
+DLL_API BOOL DLL_CALLCONV FreeImage_SetTagKey(FITAG *tag, const char *key);
+DLL_API BOOL DLL_CALLCONV FreeImage_SetTagDescription(FITAG *tag, const char *description);
+DLL_API BOOL DLL_CALLCONV FreeImage_SetTagID(FITAG *tag, WORD id);
+DLL_API BOOL DLL_CALLCONV FreeImage_SetTagType(FITAG *tag, FREE_IMAGE_MDTYPE type);
+DLL_API BOOL DLL_CALLCONV FreeImage_SetTagCount(FITAG *tag, DWORD count);
+DLL_API BOOL DLL_CALLCONV FreeImage_SetTagLength(FITAG *tag, DWORD length);
+DLL_API BOOL DLL_CALLCONV FreeImage_SetTagValue(FITAG *tag, const void *value);
+
+// iterator
+DLL_API FIMETADATA *DLL_CALLCONV FreeImage_FindFirstMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, FITAG **tag);
+DLL_API BOOL DLL_CALLCONV FreeImage_FindNextMetadata(FIMETADATA *mdhandle, FITAG **tag);
+DLL_API void DLL_CALLCONV FreeImage_FindCloseMetadata(FIMETADATA *mdhandle);
+
+// metadata setter and getter
+DLL_API BOOL DLL_CALLCONV FreeImage_SetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG *tag);
+DLL_API BOOL DLL_CALLCONV FreeImage_GetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG **tag);
+
+// helpers
+DLL_API unsigned DLL_CALLCONV FreeImage_GetMetadataCount(FREE_IMAGE_MDMODEL model, FIBITMAP *dib);
+DLL_API BOOL DLL_CALLCONV FreeImage_CloneMetadata(FIBITMAP *dst, FIBITMAP *src);
+
+// tag to C string conversion
+DLL_API const char* DLL_CALLCONV FreeImage_TagToString(FREE_IMAGE_MDMODEL model, FITAG *tag, char *Make FI_DEFAULT(NULL));
+
+// --------------------------------------------------------------------------
+// Image manipulation toolkit -----------------------------------------------
+// --------------------------------------------------------------------------
+
+// rotation and flipping
+/// @deprecated see FreeImage_Rotate
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_RotateClassic(FIBITMAP *dib, double angle);
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Rotate(FIBITMAP *dib, double angle, const void *bkcolor FI_DEFAULT(NULL));
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_RotateEx(FIBITMAP *dib, double angle, double x_shift, double y_shift, double x_origin, double y_origin, BOOL use_mask);
+DLL_API BOOL DLL_CALLCONV FreeImage_FlipHorizontal(FIBITMAP *dib);
+DLL_API BOOL DLL_CALLCONV FreeImage_FlipVertical(FIBITMAP *dib);
+DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransform(const char *src_file, const char *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(FALSE));
+DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformU(const wchar_t *src_file, const wchar_t *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(FALSE));
+
+// upsampling / downsampling
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Rescale(FIBITMAP *dib, int dst_width, int dst_height, FREE_IMAGE_FILTER filter);
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_MakeThumbnail(FIBITMAP *dib, int max_pixel_size, BOOL convert FI_DEFAULT(TRUE));
+
+// color manipulation routines (point operations)
+DLL_API BOOL DLL_CALLCONV FreeImage_AdjustCurve(FIBITMAP *dib, BYTE *LUT, FREE_IMAGE_COLOR_CHANNEL channel);
+DLL_API BOOL DLL_CALLCONV FreeImage_AdjustGamma(FIBITMAP *dib, double gamma);
+DLL_API BOOL DLL_CALLCONV FreeImage_AdjustBrightness(FIBITMAP *dib, double percentage);
+DLL_API BOOL DLL_CALLCONV FreeImage_AdjustContrast(FIBITMAP *dib, double percentage);
+DLL_API BOOL DLL_CALLCONV FreeImage_Invert(FIBITMAP *dib);
+DLL_API BOOL DLL_CALLCONV FreeImage_GetHistogram(FIBITMAP *dib, DWORD *histo, FREE_IMAGE_COLOR_CHANNEL channel FI_DEFAULT(FICC_BLACK));
+DLL_API int DLL_CALLCONV FreeImage_GetAdjustColorsLookupTable(BYTE *LUT, double brightness, double contrast, double gamma, BOOL invert);
+DLL_API BOOL DLL_CALLCONV FreeImage_AdjustColors(FIBITMAP *dib, double brightness, double contrast, double gamma, BOOL invert FI_DEFAULT(FALSE));
+DLL_API unsigned DLL_CALLCONV FreeImage_ApplyColorMapping(FIBITMAP *dib, RGBQUAD *srccolors, RGBQUAD *dstcolors, unsigned count, BOOL ignore_alpha, BOOL swap);
+DLL_API unsigned DLL_CALLCONV FreeImage_SwapColors(FIBITMAP *dib, RGBQUAD *color_a, RGBQUAD *color_b, BOOL ignore_alpha);
+DLL_API unsigned DLL_CALLCONV FreeImage_ApplyPaletteIndexMapping(FIBITMAP *dib, BYTE *srcindices, BYTE *dstindices, unsigned count, BOOL swap);
+DLL_API unsigned DLL_CALLCONV FreeImage_SwapPaletteIndices(FIBITMAP *dib, BYTE *index_a, BYTE *index_b);
+
+// channel processing routines
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetChannel(FIBITMAP *dib, FREE_IMAGE_COLOR_CHANNEL channel);
+DLL_API BOOL DLL_CALLCONV FreeImage_SetChannel(FIBITMAP *dib, FIBITMAP *dib8, FREE_IMAGE_COLOR_CHANNEL channel);
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetComplexChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);
+DLL_API BOOL DLL_CALLCONV FreeImage_SetComplexChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);
+
+// copy / paste / composite routines
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Copy(FIBITMAP *dib, int left, int top, int right, int bottom);
+DLL_API BOOL DLL_CALLCONV FreeImage_Paste(FIBITMAP *dst, FIBITMAP *src, int left, int top, int alpha);
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Composite(FIBITMAP *fg, BOOL useFileBkg FI_DEFAULT(FALSE), RGBQUAD *appBkColor FI_DEFAULT(NULL), FIBITMAP *bg FI_DEFAULT(NULL));
+DLL_API BOOL DLL_CALLCONV FreeImage_JPEGCrop(const char *src_file, const char *dst_file, int left, int top, int right, int bottom);
+DLL_API BOOL DLL_CALLCONV FreeImage_JPEGCropU(const wchar_t *src_file, const wchar_t *dst_file, int left, int top, int right, int bottom);
+DLL_API BOOL DLL_CALLCONV FreeImage_PreMultiplyWithAlpha(FIBITMAP *dib);
+
+// background filling routines
+DLL_API BOOL DLL_CALLCONV FreeImage_FillBackground(FIBITMAP *dib, const void *color, int options FI_DEFAULT(0));
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_EnlargeCanvas(FIBITMAP *src, int left, int top, int right, int bottom, const void *color, int options FI_DEFAULT(0));
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_AllocateEx(int width, int height, int bpp, const RGBQUAD *color, int options FI_DEFAULT(0), const RGBQUAD *palette FI_DEFAULT(NULL), unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0));
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_AllocateExT(FREE_IMAGE_TYPE type, int width, int height, int bpp, const void *color, int options FI_DEFAULT(0), const RGBQUAD *palette FI_DEFAULT(NULL), unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0));
+
+// miscellaneous algorithms
+DLL_API FIBITMAP *DLL_CALLCONV FreeImage_MultigridPoissonSolver(FIBITMAP *Laplacian, int ncycle FI_DEFAULT(3));
+
+// restore the borland-specific enum size option
+#if defined(__BORLANDC__)
+#pragma option pop
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // FREEIMAGE_H
diff --git a/include/m_fuse.h b/include/m_fuse.h new file mode 100644 index 0000000000..8a2ff8169f --- /dev/null +++ b/include/m_fuse.h @@ -0,0 +1,32 @@ +#ifdef _ALPHA_FUSE_
+#ifndef _M_FUSE_
+#define _M_FUSE_
+
+#define CALLSERVICE_NOTFOUND ((int)0x80000000)
+#define MAXMODULELABELLENGTH 64
+typedef int (*MIRANDAHOOK)(WPARAM,LPARAM);
+typedef INT_PTR (*MIRANDASERVICE)(WPARAM,LPARAM);
+
+#define FUSE_INIT 0 // core started, Param=**FUSE_LINK
+#define FUSE_DEINIT 1 // core stopped
+#define FUSE_DEFMOD 3 // LoadDefaultModules() return code, Param=*int
+#define FUSE_DEATH 4 // DestroyingModularEngine() just got called
+
+typedef struct {
+ int cbSize;
+ HANDLE (*CreateHookableEvent)(const char *);
+ int (*DestroyHookableEvent)(HANDLE);
+ int (*NotifyEventHooks)(HANDLE,WPARAM,LPARAM);
+ HANDLE (*HookEvent)(const char *,MIRANDAHOOK);
+ HANDLE (*HookEventMessage)(const char *,HWND,UINT);
+ int (*UnhookEvent)(HANDLE);
+ HANDLE (*CreateServiceFunction)(const char *,MIRANDASERVICE);
+ HANDLE (*CreateTransientServiceFunction)(const char *,MIRANDASERVICE);
+ int (*DestroyServiceFunction)(HANDLE);
+ int (*CallService)(const char *,WPARAM,LPARAM);
+ int (*ServiceExists)(const char *); //v0.1.0.1+
+ int (*CallServiceSync)(const char*,WPARAM,LPARAM); //v0.1.2.2+
+} FUSE_LINK;
+
+#endif
+#endif
\ No newline at end of file diff --git a/include/m_genmenu.h b/include/m_genmenu.h new file mode 100644 index 0000000000..cea3107730 --- /dev/null +++ b/include/m_genmenu.h @@ -0,0 +1,406 @@ +#ifndef M_GENMENU_H
+#define M_GENMENU_H
+
+#ifndef M_CLIST_H__
+ #include <m_clist.h>
+#endif
+
+/*
+ Main features:
+ 1) Independet from clist,may be used in any module.
+ 2) Module defined Exec and Check services.
+ 3) Menu with any level of popups,icons for root of popup.
+ 4) You may use measure/draw/processcommand even if menuobject is unknown.
+
+ Idea of GenMenu module consists of that,
+ it must be independet and offers only general menu purpose services:
+ MO_CREATENEWMENUOBJECT
+ MO_REMOVEMENUOBJECT
+ MO_ADDNEWMENUITEM
+ MO_REMOVEMENUITEM
+ ...etc
+
+ And then each module that want use and offer to others menu handling
+ must create own services.For example i rewrited mainmenu and
+ contactmenu code in clistmenus.c.If you look at code all functions
+ are very identical, and vary only in check/exec services.
+
+ So template set of function will like this:
+ Remove<NameMenu>Item
+ Add<NameMenu>Item
+ Build<NameMenu>
+ <NameMenu>ExecService
+ <NameMenu>CheckService
+
+ ExecService and CheckService used as callbacks when GenMenu must
+ processcommand for menu item or decide to show or not item.This make
+ GenMenu independet of which params must passed to service when user
+ click on menu,this decide each module.
+ 28-04-2003 Bethoven
+
+*/
+
+
+
+/*
+Analog to CLISTMENUITEM,but invented two params root and ownerdata.
+root is used for creating any level popup menus,set to -1 to build
+at first level and root=MenuItemHandle to place items in submenu
+of this item.Must be used two new flags CMIF_ROOTPOPUP and CMIF_CHILDPOPUP
+(defined in m_clist.h)
+
+ownerdata is passed to callback services(ExecService and CheckService)
+when building menu or processed command.
+*/
+
+/*GENMENU_MODULE*/
+/*
+Changes:
+
+28-04-2003
+Moved all general stuff to genmenu.c(m_genmenu.h,genmenu.h),
+so removed all frames stuff.
+
+
+Changes:
+
+28-12-2002
+
+Contact menu item service called with wparam=hcontact,lparam=popupPosition -
+plugin may add different menu items with some service.
+(old behavior wparam=hcontact lparam=0)
+
+
+
+25-11-2002 Full support of runtime build of all menus.
+ Contact MS_CLIST_ADDCONTACTMENUITEM
+ MS_CLIST_REMOVECONTACTMENUITEM
+ MS_CLIST_MENUBUILDCONTACT
+ ME_CLIST_PREBUILDCONTACTMENU
+
+ MainMenu MS_CLIST_ADDMAINMENUITEM
+ MS_CLIST_REMOVEMAINMENUITEM
+ MS_CLIST_MENUBUILDMAIN
+ ME_CLIST_PREBUILDMAINMENU
+
+ FrameMenu MS_CLIST_ADDCONTEXTFRAMEMENUITEM
+ MS_CLIST_REMOVECONTEXTFRAMEMENUITEM
+ MS_CLIST_MENUBUILDFRAMECONTEXT
+ ME_CLIST_PREBUILDFRAMEMENU
+
+ For All menus may be used
+ MS_CLIST_MODIFYMENUITEM
+
+ All menus supported any level of popups
+ (pszPopupName=(char *)hMenuItem - for make child of popup)
+*/
+
+// SubGroup MENU
+//remove a item from SubGroup menu
+//wParam=hMenuItem returned by MS_CLIST_ADDSubGroupMENUITEM
+//lParam=0
+//returns 0 on success, nonzero on failure
+#define MS_CLIST_REMOVESUBGROUPMENUITEM "CList/RemoveSubGroupMenuItem"
+
+//builds the SubGroup menu
+//wParam=lParam=0
+//returns a HMENU identifying the menu.
+#define MS_CLIST_MENUBUILDSUBGROUP "CList/MenuBuildSubGroup"
+
+//add a new item to the SubGroup menus
+//wParam=lpGroupMenuParam, params to call when exec menuitem
+//lParam=(LPARAM)(CLISTMENUITEM*)&mi
+#define MS_CLIST_ADDSUBGROUPMENUITEM "CList/AddSubGroupMenuItem"
+
+//the SubGroup menu is about to be built
+//wParam=lParam=0
+#define ME_CLIST_PREBUILDSUBGROUPMENU "CList/PreBuildSubGroupMenu"
+
+// SubGroup MENU
+
+// Group MENU
+typedef struct{
+int wParam;
+int lParam;
+}GroupMenuParam,*lpGroupMenuParam;
+
+//remove a item from Group menu
+//wParam=hMenuItem returned by MS_CLIST_ADDGroupMENUITEM
+//lParam=0
+//returns 0 on success, nonzero on failure
+#define MS_CLIST_REMOVEGROUPMENUITEM "CList/RemoveGroupMenuItem"
+
+//builds the Group menu
+//wParam=lParam=0
+//returns a HMENU identifying the menu.
+#define MS_CLIST_MENUBUILDGROUP "CList/MenuBuildGroup"
+
+//add a new item to the Group menus
+//wParam=lpGroupMenuParam, params to call when exec menuitem
+//lParam=(LPARAM)(CLISTMENUITEM*)&mi
+#define MS_CLIST_ADDGROUPMENUITEM "CList/AddGroupMenuItem"
+
+//the Group menu is about to be built
+//wParam=lParam=0
+#define ME_CLIST_PREBUILDGROUPMENU "CList/PreBuildGroupMenu"
+
+// Group MENU
+
+
+// TRAY MENU
+//remove a item from tray menu
+//wParam=hMenuItem returned by MS_CLIST_ADDTRAYMENUITEM
+//lParam=0
+//returns 0 on success, nonzero on failure
+#define MS_CLIST_REMOVETRAYMENUITEM "CList/RemoveTrayMenuItem"
+
+//builds the tray menu
+//wParam=lParam=0
+//returns a HMENU identifying the menu.
+#define MS_CLIST_MENUBUILDTRAY "CList/MenuBuildTray"
+
+//add a new item to the tray menus
+//wParam=0
+//lParam=(LPARAM)(CLISTMENUITEM*)&mi
+#define MS_CLIST_ADDTRAYMENUITEM "CList/AddTrayMenuItem"
+
+//the tray menu is about to be built
+//wParam=lParam=0
+#define ME_CLIST_PREBUILDTRAYMENU "CList/PreBuildTrayMenu"
+
+// STATUS MENU
+
+//the status menu is about to be built
+//wParam=lParam=0
+#define ME_CLIST_PREBUILDSTATUSMENU "CList/PreBuildStatusMenu"
+
+//add a new item to the status menu
+//wParam=0
+//lParam=(LPARAM)(CLISTMENUITEM*)&mi
+#define MS_CLIST_ADDSTATUSMENUITEM "CList/AddStatusMenuItem"
+
+//remove a item from main menu
+//wParam=hMenuItem returned by MS_CLIST_ADDMAINMENUITEM
+//lParam=0
+//returns 0 on success, nonzero on failure
+#define MS_CLIST_REMOVEMAINMENUITEM "CList/RemoveMainMenuItem"
+
+//builds the main menu
+//wParam=lParam=0
+//returns a HMENU identifying the menu.
+#define MS_CLIST_MENUBUILDMAIN "CList/MenuBuildMain"
+
+
+
+//the main menu is about to be built
+//wParam=lParam=0
+#define ME_CLIST_PREBUILDMAINMENU "CList/PreBuildMainMenu"
+
+
+
+
+//remove a item from contact menu
+//wParam=hMenuItem returned by MS_CLIST_ADDCONTACTMENUITEM
+//lParam=0
+//returns 0 on success, nonzero on failure
+#define MS_CLIST_REMOVECONTACTMENUITEM "CList/RemoveContactMenuItem"
+/*GENMENU_MODULE*/
+
+#define SETTING_NOOFFLINEBOTTOM_DEFAULT 0
+
+typedef struct
+{
+ int cbSize;
+ union
+ {
+ char *pszName;
+ TCHAR *ptszName;
+ };
+ int position;
+ HGENMENU root;
+ int flags;
+ union {
+ HICON hIcon;
+ HANDLE hIcolibItem;
+ };
+ DWORD hotKey;
+ void *ownerdata;
+}
+ TMO_MenuItem,*PMO_MenuItem;
+
+/*
+This structure passed to CheckService.
+*/
+typedef struct
+{
+ void *MenuItemOwnerData;
+ HGENMENU MenuItemHandle;
+ WPARAM wParam;//from ListParam.wParam when building menu
+ LPARAM lParam;//from ListParam.lParam when building menu
+}
+ TCheckProcParam,*PCheckProcParam;
+
+typedef struct
+{
+ int cbSize;
+ char *name;
+
+ /*
+ This service called when module build menu(MO_BUILDMENU).
+ Service called with params
+
+ wparam=PCheckProcParam
+ lparam=0
+ if return==FALSE item is skiped.
+ */
+ char *CheckService;
+
+ /*
+ This service called when user select menu item.
+ Service called with params
+ wparam=ownerdata
+ lparam=lParam from MO_PROCESSCOMMAND
+ */
+ char *ExecService;//called when processmenuitem called
+}
+ TMenuParam,*PMenuParam;
+
+//used in MO_BUILDMENU
+typedef struct tagListParam
+{
+ int rootlevel;
+ HANDLE MenuObjectHandle;
+ WPARAM wParam;
+ LPARAM lParam;
+}
+ ListParam,*lpListParam;
+
+typedef struct
+{
+ HMENU menu;
+ int ident;
+ LPARAM lParam;
+}
+ ProcessCommandParam,*lpProcessCommandParam;
+
+//wparam started hMenu
+//lparam ListParam*
+//result hMenu
+#define MO_BUILDMENU "MO/BuildMenu"
+
+//wparam=MenuItemHandle
+//lparam userdefined
+//returns TRUE if it processed the command, FALSE otherwise
+#define MO_PROCESSCOMMAND "MO/ProcessCommand"
+
+//if menu not known call this
+//LOWORD(wparam) menuident (from WM_COMMAND message)
+//returns TRUE if it processed the command, FALSE otherwise
+//Service automatically find right menuobject and menuitem
+//and call MO_PROCESSCOMMAND
+#define MO_PROCESSCOMMANDBYMENUIDENT "MO/ProcessCommandByMenuIdent"
+
+
+//wparam=0;
+//lparam=PMenuParam;
+//returns=MenuObjectHandle on success,-1 on failure
+#define MO_CREATENEWMENUOBJECT "MO/CreateNewMenuObject"
+
+//wparam=MenuObjectHandle
+//lparam=0
+//returns 0 on success,-1 on failure
+//Note: you must free all ownerdata structures, before you
+//call this service.MO_REMOVEMENUOBJECT NOT free it.
+#define MO_REMOVEMENUOBJECT "MO/RemoveMenuObject"
+
+
+//wparam=MenuItemHandle
+//lparam=0
+//returns 0 on success,-1 on failure.
+//You must free ownerdata before this call.
+//If MenuItemHandle is root all child will be removed too.
+#define MO_REMOVEMENUITEM "MO/RemoveMenuItem"
+
+//wparam=MenuObjectHandle
+//lparam=PMO_MenuItem
+//return MenuItemHandle on success,-1 on failure
+//Service supports old menu items (without CMIF_ROOTPOPUP or
+//CMIF_CHILDPOPUP flag).For old menu items needed root will be created
+//automatically.
+#define MO_ADDNEWMENUITEM "MO/AddNewMenuItem"
+
+//wparam MenuItemHandle
+//returns ownerdata on success,NULL on failure
+//Useful to get and free ownerdata before delete menu item.
+#define MO_MENUITEMGETOWNERDATA "MO/MenuItemGetOwnerData"
+
+//wparam MenuItemHandle
+//lparam PMO_MenuItem
+//returns 0 on success,-1 on failure
+#define MO_MODIFYMENUITEM "MO/ModifyMenuItem"
+
+//wparam=MenuItemHandle
+//lparam=PMO_MenuItem
+//returns 0 and filled PMO_MenuItem structure on success and
+//-1 on failure
+#define MO_GETMENUITEM "MO/GetMenuItem"
+
+//wparam=MenuItemHandle
+//lparam=0
+//returns a menu handle on success or NULL on failure
+#define MO_GETDEFAULTMENUITEM "MO/GetDefaultMenuItem"
+
+//wparam=MenuObjectHandle
+//lparam=vKey
+//returns TRUE if it processed the command, FALSE otherwise
+//this should be called in WM_KEYDOWN
+#define MO_PROCESSHOTKEYS "MO/ProcessHotKeys"
+
+//set uniq name to menuitem(used to store it in database when enabled OPT_USERDEFINEDITEMS)
+#define OPT_MENUITEMSETUNIQNAME 1
+
+//Set FreeService for menuobject. When freeing menuitem it will be called with
+//wParam=MenuItemHandle
+//lParam=mi.ownerdata
+#define OPT_MENUOBJECT_SET_FREE_SERVICE 2
+
+//Set onAddService for menuobject.
+#define OPT_MENUOBJECT_SET_ONADD_SERVICE 3
+
+//Set menu check service
+#define OPT_MENUOBJECT_SET_CHECK_SERVICE 4
+
+//enable ability user to edit menuitems via options page.
+#define OPT_USERDEFINEDITEMS 1
+
+
+typedef struct tagOptParam
+{
+ HANDLE Handle;
+ int Setting;
+ INT_PTR Value;
+}
+ OptParam,*lpOptParam;
+
+//wparam=0
+//lparam=*lpOptParam
+//returns TRUE if it processed the command, FALSE otherwise
+#define MO_SETOPTIONSMENUOBJECT "MO/SetOptionsMenuObject"
+
+
+//wparam=0
+//lparam=*lpOptParam
+//returns TRUE if it processed the command, FALSE otherwise
+#define MO_SETOPTIONSMENUITEM "MO/SetOptionsMenuItem"
+
+//wparam=char* szProtoName
+//lparam=0
+//returns HGENMENU of the root item or NULL
+#define MO_GETPROTOROOTMENU "MO/GetProtoRootMenu"
+
+__forceinline HGENMENU MO_GetProtoRootMenu( const char* szProtoName )
+{
+ return ( HGENMENU )CallService( MO_GETPROTOROOTMENU, ( WPARAM )szProtoName, 0 );
+}
+
+#endif
diff --git a/include/m_help.h b/include/m_help.h new file mode 100644 index 0000000000..15b404c2e4 --- /dev/null +++ b/include/m_help.h @@ -0,0 +1,34 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_HELP_H__
+#define M_HELP_H__ 1
+
+
+// wParam = 0
+// lParam = (char *)url;
+// Sends the bug report url in lParam. Is usually called from
+// the Help/Report Bug menu.
+#define ME_HELP_BUGREPORT "Help/ReportBug"
+
+#endif // M_HELP_H__
diff --git a/include/m_history.h b/include/m_history.h new file mode 100644 index 0000000000..d4f1b9ec15 --- /dev/null +++ b/include/m_history.h @@ -0,0 +1,34 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_HISTORY_H__
+#define M_HISTORY_H__ 1
+
+//show the History dialog box for a contact
+// wParam=(WPARAM)(HANDLE)hContact
+// lParam=0
+//hContact can be NULL to show system messages
+#define MS_HISTORY_SHOWCONTACTHISTORY "History/ShowContactHistory"
+
+#endif // M_HISTORY_H__
+
diff --git a/include/m_hotkeys.h b/include/m_hotkeys.h new file mode 100644 index 0000000000..a7b628e0bf --- /dev/null +++ b/include/m_hotkeys.h @@ -0,0 +1,113 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_HOTKEYS_H__
+#define M_HOTKEYS_H__ 1
+
+#define HKD_UNICODE 0x0001
+
+#if defined( _UNICODE )
+ #define HKD_TCHAR HKD_UNICODE
+#else
+ #define HKD_TCHAR 0
+#endif
+
+typedef struct
+{
+ int cbSize;
+ const char *pszName; /* name to refer to hotkey when playing and in db */
+ union {
+ const char *pszDescription; /* description for options dialog */
+ const TCHAR *ptszDescription;
+ };
+ union {
+ const char *pszSection; /* section name used to group sounds (NULL is acceptable) */
+ const TCHAR *ptszSection;
+ };
+ const char *pszService; /* Service to call when HotKey Pressed */
+ WORD DefHotKey; /* default hot key for action */
+ LPARAM lParam; /* lParam to pass to service */
+ #if MIRANDA_VER >= 0x900
+ DWORD dwFlags;
+ #endif
+} HOTKEYDESC;
+
+#if MIRANDA_VER >= 0x900
+#define HOTKEYDESC_SIZE_V1 (offsetof(HOTKEYDESC, dwFlags))
+#endif
+
+#define HKF_MIRANDA_LOCAL 0x8000
+
+/* use this macro to defile hotkey codes like this:
+ hkd.DefHotkey = HOTKEYCODE(HOTKEYF_SHIFT|HOTKEYF_EXT, 'A');
+*/
+#define HOTKEYCODE(mod,vk) (MAKEWORD((vk),(mod)))
+
+/* CoreHotkeys/Register service
+Registers new hotkey
+ wParam=(WPARAM)0
+ lParam=(LPARAM)(HOTKEYDESC *)hotkey
+Returns 0 on failure or hotkey atom id on success
+*/
+#define MS_HOTKEY_REGISTER "CoreHotkeys/Register"
+
+/* CoreHotkeys/Unregister service
+Unregister existing hotkey
+ wParam=(WPARAM)0
+ lParam=(LPARAM)(char *)pszName
+Returns 0 on success or nonzero otherwise
+*/
+#define MS_HOTKEY_UNREGISTER "CoreHotkeys/Unregister"
+
+/* CoreHotkeys/Check service
+Checks if "manual" hotkey was activated and returns its id.
+ wParam=(WPARAM)(MSG *)message
+ lParam=(LPARAM)(char *)pszSection
+Returns lParam associated with activated hotkey
+*/
+#define MS_HOTKEY_CHECK "CoreHotkeys/Check"
+
+/* Subclass/unsubclass edit box to act as hotkey control
+ wParam=(WPARAM)(HWND)hwndEdit
+ lParam=(LPARAM)0
+Returns zero on success
+
+You will get notification with LOWORD(wParam) == 0 when users sets hotkey.
+
+Subclassed control processes HKM_SETHOTKEY and HKM_GETHOTKEY similarly to
+windows' hotkey, in all other it acts just like normal editbox (beware of
+standart notifications that occur on text updates!)
+
+Subclass procedure uses GWLP_USERDATA to store internal information. Do not
+use it for own purposes.
+*/
+#define MS_HOTKEY_SUBCLASS "CoreHotkeys/Subclass"
+#define MS_HOTKEY_UNSUBCLASS "CoreHotkeys/Unsubclass"
+
+/* This event is fired when hotkeys were changed
+ wParam = lParam = 0
+*/
+
+#define ME_HOTKEYS_CHANGED "CoreHotkeys/Changed"
+
+#endif // M_HOTKEYS_H__
diff --git a/include/m_icolib.h b/include/m_icolib.h new file mode 100644 index 0000000000..1f868d13a8 --- /dev/null +++ b/include/m_icolib.h @@ -0,0 +1,145 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_ICOLIB_H__
+#define M_ICOLIB_H__ 1
+
+#define SKINICONDESC_SIZE sizeof(SKINICONDESC) // v0.0.1.0+
+#define SKINICONDESC_SIZE_V1 (offsetof(SKINICONDESC, hDefaultIcon))
+#define SKINICONDESC_SIZE_V2 (offsetof(SKINICONDESC, cx)) // v0.0.0.2+
+#define SKINICONDESC_SIZE_V3 (offsetof(SKINICONDESC, flags)) // v0.0.0.3+
+
+// WARNING: do not use Translate(TS) for p(t)szSection or p(t)szDescription as they
+// are translated by the core, which may lead to double translation.
+// Use LPGEN instead which are just dummy wrappers/markers for "lpgen.pl".
+typedef struct {
+ size_t cbSize;
+ union {
+ char *pszSection; // section name used to group icons
+ TCHAR *ptszSection; // [TRANSLATED-BY-CORE]
+ WCHAR *pwszSection;
+ };
+ union {
+ char *pszDescription; // description for options dialog
+ TCHAR *ptszDescription; // [TRANSLATED-BY-CORE]
+ WCHAR *pwszDescription;
+ };
+ char *pszName; // name to refer to icon when playing and in db
+ union {
+ char *pszDefaultFile; // default icon file to use
+ TCHAR *ptszDefaultFile;
+ WCHAR *pwszDefaultFile;
+ };
+ int iDefaultIndex; // index of icon in default file
+ HICON hDefaultIcon; // handle to default icon
+ int cx,cy; // dimensions of icon (if 0 then standard size icon (big and small options available)
+ int flags; // combination of SIDF_*
+} SKINICONDESC;
+
+#define SIDF_SORTED 0x01 // Icons in section are sorted by name
+#define SIDF_UNICODE 0x100 // Section and Description are in UCS-2
+#define SIDF_PATH_UNICODE 0x200 // Default File is in UCS-2
+#define SIDF_ALL_UNICODE SIDF_PATH_UNICODE | SIDF_UNICODE
+
+#if defined(_UNICODE)
+ #define SIDF_TCHAR SIDF_UNICODE
+ #define SIDF_PATH_TCHAR SIDF_PATH_UNICODE
+ #define SIDF_ALL_TCHAR SIDF_ALL_UNICODE
+#else
+ #define SIDF_TCHAR 0
+ #define SIDF_PATH_TCHAR 0
+ #define SIDF_ALL_TCHAR 0
+#endif
+
+//
+// Add a icon into options UI
+//
+// wParam = (WPARAM)0
+// lParam = (LPARAM)(SKINICONDESC*)sid;
+// returns a handle to the newly added item
+//
+#define MS_SKIN2_ADDICON "Skin2/Icons/AddIcon"
+
+//
+// Remove a icon from options UI
+//
+// wParam = (WPARAM)0
+// lParam = (LPARAM)(char*)pszName
+// WARNING: This will invalidate all HICONs retrieved for specified pszName
+//
+#define MS_SKIN2_REMOVEICON "Skin2/Icons/RemoveIcon"
+
+//
+// Retrieve HICON with name specified in lParam
+// wParam = (WPARAM)0 - small 1 - big
+// lParam = (LPARAM)(char*)pszName
+// Returned HICON SHOULDN'T be destroyed, it is managed by IcoLib
+//
+#define MS_SKIN2_GETICON "Skin2/Icons/GetIcon"
+
+//
+// Retrieve an icolib handle for icon by name specified in lParam
+// wParam = (WPARAM)0
+// lParam = (LPARAM)(char*)pszName
+//
+#define MS_SKIN2_GETICONHANDLE "Skin2/Icons/GetIconHandle"
+
+//
+// Retrieve HICON with HANDLE specified in lParam
+// wParam = (WPARAM)0 - small 1 - big
+// lParam = (LPARAM)(HANDLE)hIcoLibIcon
+// Returned HICON SHOULDN'T be destroyed, it is managed by IcoLib
+//
+#define MS_SKIN2_GETICONBYHANDLE "Skin2/Icons/GetIconByHandle"
+
+//
+// Add reference to HICON
+//
+// wParam = (WPARAM)HICON
+// lParam = 0 - small 1 - big
+//
+#define MS_SKIN2_ADDREFICON "Skin2/Icons/AddRef"
+
+//
+// Retrieved HICON is not needed anymore (release reference; this helps optimize GDI usage)
+//
+// wParam = (WPARAM)HICON (optional)
+// lParam = (LPARAM)(char*)pszName (optional) // at least one needs to be specified
+//
+#define MS_SKIN2_RELEASEICON "Skin2/Icons/ReleaseIcon"
+#define MS_SKIN2_RELEASEICONBIG "Skin2/Icons/ReleaseIconBig"
+
+//
+// Check whether HICON is managed by IcoLib
+//
+// wParam = (WPARAM)HICON
+// lParam = 0
+//
+#define MS_SKIN2_ISMANAGEDICON "Skin2/Icons/IsManaged"
+
+//
+// Icons change notification
+//
+#define ME_SKIN2_ICONSCHANGED "Skin2/IconsChanged"
+
+#endif /* M_ICOLIB_H__ */
diff --git a/include/m_iconheader.h b/include/m_iconheader.h new file mode 100644 index 0000000000..1cd1199093 --- /dev/null +++ b/include/m_iconheader.h @@ -0,0 +1,83 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2007 Artem Shpynov
+Copyright 2000-2007 Miranda ICQ/IM 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_ICONHEADER_H__
+#define M_ICONHEADER_H__ 1
+
+#define MIRANDAICOTABCLASS _T("MirandaIcoTabClass")
+
+#define MITCF_SHAREDICON 0x01
+#define MITCF_UNICODE 0x02
+#ifdef _UNICODE
+ #define MITCF_TCHAR MITCF_UNICODE
+#else
+ #define MITCF_TCHAR 0
+#endif
+
+#define ITCM_FIRST (WM_USER+1024)
+#define ITCM_LAST (ITCM_FIRST+64)
+
+#define ITCM_SETBACKGROUND (ITCM_FIRST+1) //LPARAM is HBITMAP
+#define ITCM_ADDITEM (ITCM_FIRST+2) //LPARAM is pointer to MIcoTab
+#define ITCM_SETSEL (ITCM_FIRST+3) //WPARAM is new selected index
+#define ITCM_GETSEL (ITCM_FIRST+4) //result is selected item index
+#define ITCM_GETITEMDATA (ITCM_FIRST+5) //WPARAM is item index, result is custom data
+
+#define ITCN_SELCHANGED 1
+#define ITCN_SELCHANGEDKBD 2
+
+// structure is used for storing info about single tab
+typedef struct {
+ HICON hIcon;
+ union {
+ TCHAR *tcsName;
+ TCHAR *lptzName;
+ char *lpzName;
+ WCHAR *lpwzName;
+ };
+ DWORD flag;
+ LPARAM data;
+} MIcoTab;
+
+#define MIcoTab_SetBackground(hwnd, hBmp) \
+ (SendMessage((hwnd), ITCM_SETBACKGROUND, 0, (LPARAM)(hBmp)))
+#define MIcoTab_SetSel(hwnd, idx) \
+ (SendMessage((hwnd), ITCM_SETSEL, (idx), 0))
+#define MIcoTab_GetSel(hwnd) \
+ (SendMessage((hwnd), ITCM_GETSEL, 0, 0))
+#define MIcoTab_GetItemData(hwnd, idx) \
+ (SendMessage((hwnd), ITCM_GETITEMDATA, (idx), 0))
+
+static __forceinline void MIcoTab_AddItem(HWND hwnd, TCHAR *lptzName, HICON hIcon, LPARAM data, BOOL bSharedIcon)
+{
+ MIcoTab mit = {0};
+ mit.flag = (bSharedIcon?MITCF_SHAREDICON:0)|MITCF_TCHAR;
+ mit.hIcon = hIcon;
+ mit.tcsName = lptzName;
+ mit.data = data;
+ SendMessage(hwnd, ITCM_ADDITEM, (WPARAM)&mit, 0);
+}
+
+#endif // M_ICONHEADER_H__
diff --git a/include/m_icq.h b/include/m_icq.h new file mode 100644 index 0000000000..63e226d99b --- /dev/null +++ b/include/m_icq.h @@ -0,0 +1,282 @@ +// ---------------------------------------------------------------------------80
+// ICQ plugin for Miranda Instant Messenger
+// ________________________________________
+//
+// Copyright © 2000-2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede
+// Copyright © 2001-2002 Jon Keating, Richard Hughes
+// Copyright © 2002-2004 Martin Öberg, Sam Kothari, Robert Rainwater
+// Copyright © 2004-2010 Joe Kucera
+//
+// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// -----------------------------------------------------------------------------
+//
+// File name : $URL: http://miranda.googlecode.com/svn/trunk/miranda/include/m_icq.h $
+// Revision : $Revision: 11723 $
+// Last change on : $Date: 2010-05-09 14:55:59 +0300 (Ð’Ñ, 09 май 2010) $
+// Last change by : $Author: borkra $
+//
+// DESCRIPTION:
+//
+// Public headers for ICQ protocol plug-in
+//
+// -----------------------------------------------------------------------------
+
+#ifndef M_ICQ_H__
+#define M_ICQ_H__ 1
+
+
+
+//extended search result structure, used for all searches
+typedef struct {
+ PROTOSEARCHRESULT hdr;
+ DWORD uin;
+ BYTE auth;
+ BYTE gender;
+ BYTE age;
+ DWORD country;
+ BYTE maritalStatus;
+} ICQSEARCHRESULT;
+
+
+// Request authorization
+// wParam=(WPARAM)hContact
+#define MS_REQ_AUTH "/ReqAuth"
+
+// Grant authorization
+// wParam=(WPARAM)hContact;
+#define MS_GRANT_AUTH "/GrantAuth"
+
+// Revoke authorization
+// wParam=(WPARAM)hContact
+#define MS_REVOKE_AUTH "/RevokeAuth"
+
+// Add contact to server-list
+// wParam=(WPARAM)hContact
+#define MS_ICQ_ADDSERVCONTACT "/AddServerContact"
+
+// Display XStatus detail (internal use only)
+// wParam=(WPARAM)hContact;
+#define MS_XSTATUS_SHOWDETAILS "/ShowXStatusDetails"
+
+//Send an SMS via the ICQ network
+//wParam=(WPARAM)(const char*)szPhoneNumber
+//lParam=(LPARAM)(const char*)szMessage
+//Returns a HANDLE to the send on success, or NULL on failure
+//szPhoneNumber should be the full number with international code and preceeded
+//by a +
+
+//When the server acks the send, an ack will be broadcast:
+// type=ICQACKTYPE_SMS, result=ACKRESULT_SENTREQUEST, lParam=(LPARAM)(char*)szInfo
+//At this point the message is queued to be delivered. szInfo contains the raw
+//XML data of the ack. Here's what I got when I tried:
+//"<sms_response><source>airbornww.com</source><deliverable>Yes</deliverable><network>BT Cellnet, United Kingdom</network><message_id>[my uin]-1-1955988055-[destination phone#, without +]</message_id><messages_left>0</messages_left></sms_response>\r\n"
+
+//Now the hProcess has been deleted. The only way to track which receipt
+//corresponds with which response is to parse the <message_id> field.
+
+//At a (possibly much) later time the SMS will have been delivered. An ack will
+//be broadcast:
+// type=ICQACKTYPE_SMS, result=ACKRESULT_SUCCESS, hProcess=NULL, lParam=(LPARAM)(char*)szInfo
+//Note that the result will always be success even if the send failed, just to
+//save needing to have an attempt at an XML parser in the ICQ module.
+//Here's the szInfo for a success:
+//"<sms_delivery_receipt><message_id>[my uin]-1--1461632229-[dest phone#, without +]</message_id><destination>[dest phone#, without +]</destination><delivered>Yes</delivered><text>[first 20 bytes of message]</text><submition_time>Tue, 30 Oct 2001 22:35:16 GMT</submition_time><delivery_time>Tue, 30 Oct 2001 22:34:00 GMT</delivery_time></sms_delivery_receipt>"
+//And here's a failure:
+//"<sms_delivery_receipt><message_id>[my uin]-1-1955988055-[destination phone#, without leading +]</message_id><destination>[destination phone#, without leading +]</destination><delivered>No</delivered><submition_time>Tue, 23 Oct 2001 23:17:02 GMT</submition_time><error_code>999999</error_code><error><id>15</id><params><param>0</param><param>Multiple message submittion failed</param></params></error></sms_delivery_receipt>"
+
+//SMSes received from phones come through this same ack, again to avoid having
+//an XML parser in the protocol module. Here's one I got:
+//"<sms_message><source>MTN</source><destination_UIN>[UIN of recipient, ie this account]</destination_UIN><sender>[sending phone number, without +]</sender><senders_network>[contains one space, because I sent from ICQ]</senders_network><text>[body of the message]</text><time>Fri, 16 Nov 2001 03:12:33 GMT</time></sms_message>"
+#define ICQACKTYPE_SMS 1001
+#define ICQEVENTTYPE_SMS 2001 //database event type
+#define MS_ICQ_SENDSMS "/SendSMS"
+
+//e-mail express
+//db event added to NULL contact
+//blob format is:
+//ASCIIZ text, usually of the form "Subject: %s\r\n%s"
+//ASCIIZ from name
+//ASCIIZ from e-mail
+#define ICQEVENTTYPE_EMAILEXPRESS 2002 //database event type
+
+//www pager
+//db event added to NULL contact
+//blob format is:
+//ASCIIZ text, usually "Sender IP: xxx.xxx.xxx.xxx\r\n%s"
+//ASCIIZ from name
+//ASCIIZ from e-mail
+#define ICQEVENTTYPE_WEBPAGER 2003 //database event type
+
+//missed message notification
+//db event added to contact's history
+//blob format is:
+//WORD error code
+#define ICQEVENTTYPE_MISSEDMESSAGE 2004 //database event type
+
+
+//for server-side lists, used internally only
+//hProcess=dwSequence
+//lParam=server's error code, 0 for success
+#define ICQACKTYPE_SERVERCLIST 1003
+
+//for rate warning distribution (mainly upload dlg)
+//hProcess=Rate class ID
+//lParam=server's status code
+#define ICQACKTYPE_RATEWARNING 1004
+
+//received Xtraz Notify response
+//hProcess=dwSequence
+//lParam=contents of RES node
+#define ICQACKTYPE_XTRAZNOTIFY_RESPONSE 1005
+
+//received Custom Status details response
+//hProcess=dwSequence
+//lParam=0
+#define ICQACKTYPE_XSTATUS_RESPONSE 1006
+
+
+//Update user details on server
+//Permited operation types:
+#define CIXT_BASIC 0x0001
+#define CIXT_MORE 0x0002
+#define CIXT_WORK 0x0004
+#define CIXT_CONTACT 0x0008
+#define CIXT_LOCATION 0x0010
+#define CIXT_BACKGROUND 0x0020
+#define CIXT_EDUCATION 0x0040
+#define CIXT_EXTRA 0x0080
+#define CIXT_FULL 0x00FF
+
+//wParam=operationType
+#define PS_CHANGEINFOEX "/ChangeInfoEx"
+
+//Change nickname in White pages
+//lParam=(LPARAM)(const char*)szNewNickName
+#define PS_SET_NICKNAME "/SetNickname"
+
+//Set password for current session
+//lParam=(LPARAM)(const char*)szPassword
+#define PS_ICQ_SETPASSWORD "/SetPassword"
+
+//miranda/icqoscar/statusmsgreq event
+//called when our status message is requested
+//wParam=(BYTE)msgType
+//lParam=(DWORD)uin
+//msgType is one of the ICQ_MSGTYPE_GET###MSG constants in icq_constants.h
+//uin is the UIN of the contact requesting our status message
+#define ME_ICQ_STATUSMSGREQ "/StatusMsgReq"
+
+
+
+/* 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). (obsolete)
+ - 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
+ */
+#define CSSF_MASK_STATUS 0x0001 // status member valid for set/get
+#define CSSF_MASK_NAME 0x0002 // pszName member valid for set/get
+#define CSSF_MASK_MESSAGE 0x0004 // pszMessage member valid for set/get
+#define CSSF_DISABLE_MENU 0x0020 // disable default custom status menu, wParam = bEnable
+#define CSSF_DISABLE_UI 0x0040 // disable default custom status UI, wParam = bEnable
+#define CSSF_DEFAULT_NAME 0x0080 // only with CSSF_MASK_NAME and get API to get default custom status name (wParam = status)
+#define CSSF_STATUSES_COUNT 0x0100 // returns number of custom statuses in wParam, only get API
+#define CSSF_STR_SIZES 0x0200 // returns sizes of custom status name & message (wParam & lParam members) in chars
+#define CSSF_UNICODE 0x1000 // strings are in UCS-2
+
+#if defined(_UNICODE)
+ #define CSSF_TCHAR CSSF_UNICODE
+#else
+ #define CSSF_TCHAR 0
+#endif
+
+
+typedef struct {
+ int cbSize; // size of the structure
+ int flags; // combination of CSSF_*
+ int *status; // custom status id
+ union {
+ char *pszName; // buffer for custom status name
+ TCHAR *ptszName;
+ WCHAR *pwszName;
+ };
+ union {
+ char *pszMessage; // buffer for custom status message
+ TCHAR *ptszMessage;
+ WCHAR *pwszMessage;
+ };
+ WPARAM *wParam; // extra params, see flags
+ LPARAM *lParam;
+} ICQ_CUSTOM_STATUS;
+
+
+// Sets owner current custom status (obsolete)
+//wParam = (int)N // custom status id (1-32)
+//lParam = 0
+//return = N (id of status set) or 0 (failed - probably bad params)
+#define 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)
+#define 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)
+#define PS_ICQ_GETCUSTOMSTATUSEX "/GetXStatusEx"
+
+#define LR_BIGICON 0x40
+
+// 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)
+#define PS_ICQ_GETCUSTOMSTATUSICON "/GetXStatusIcon"
+
+// Get Custom status DB field names & current owner custom status (obsolete)
+//wParam = (char**)szDBTitle // will receive title DB setting name (do not free)
+//lParam = (char**)szDBMsg // will receive message DB setting name
+//return = N // current custom status id if successful, 0 otherwise
+#define PS_ICQ_GETCUSTOMSTATUS "/GetXStatus"
+
+// Request Custom status details (messages) for specified contact
+//wParam = hContact // request custom status details for this contact
+//lParam = 0
+//return = (int)dwSequence // if successful it is sequence for ICQACKTYPE_XSTATUS_RESPONSE
+ // 0 failed to request (e.g. auto-request enabled)
+ // -1 delayed (rate control) - sequence unknown
+#define PS_ICQ_REQUESTCUSTOMSTATUS "/RequestXStatusDetails"
+
+// Called when contact changes custom status and extra icon is set to clist_mw
+//wParam = hContact // contact changing status
+//lParam = hIcon // HANDLE to clist extra icon set as custom status
+#define ME_ICQ_CUSTOMSTATUS_EXTRAICON_CHANGED "/XStatusExtraIconChanged"
+
+// Called when a contact changes its custom status
+// wParam = hContact
+// lParam = 0
+#define ME_ICQ_CUSTOMSTATUS_CHANGED "/XStatusChanged"
+
+// Called from contact list in order to get index of custom status icon in list
+// wParam = hContact
+// lParam = 0
+// rerurn = (int) index of extra contact icon shifted <<16 (the low word will be normal status icon, the high will be xStatus Icon
+#define PS_ICQ_GETADVANCEDSTATUSICON "/GetAdvancedStatusIcon"
+
+#endif // M_ICQ_H__
diff --git a/include/m_idle.h b/include/m_idle.h new file mode 100644 index 0000000000..97a6a203bb --- /dev/null +++ b/include/m_idle.h @@ -0,0 +1,75 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2005 Miranda ICQ/IM 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_IDLE_H__
+#define M_IDLE_H__ 1
+
+/* The idle module checks how long the user has been idle, it can be at the Miranda level
+or the OS level - the user has optional two settings, one for "short" idle and another
+for "long" idle. Thie module will generate long/short events based on these user preferences
+and other information too. If you are unsure which idle mode to report for, report it
+for short idle.*/
+
+#define IDF_ISIDLE 0x1 // idle has become active (if not set, inactive)
+#define IDF_PRIVACY 0x8 // if set, the information provided shouldn't be given to third parties.
+
+/*
+ wParam: 0
+ lParam: IDF_* (or'd field)
+ Affect: This event is fired when information about idle changes.
+ Note: You will get multiple calls with IDF_ISIDLE set, the first is for short idle
+ then long idle, then anytime during you might get IDF_ONFORCE if the screensaver or station
+ become locked.
+
+ It is up to you to keep state, i.e. once the idle that you care about is reported
+ ignore other status notifications with IDF_ISIDLE set until you get one with IDF_ISIDLE isn't
+ set.
+ Version: 0.3.4a+ (2004/09/16)
+*/
+#define ME_IDLE_CHANGED "Miranda/Idle/Changed"
+
+#define MIRANDA_IDLE_INFO_SIZE_1 20
+
+typedef struct {
+ int cbSize; // sizeof()
+ int idleTime; // idle in mins, if zero then disabled
+ int privacy; // user doesnt want other people seeing anything more than they are idle
+ int aaStatus; // status to go to when user is auto away
+ int aaLock; // the status shouldn't be unset if its set
+ int idleType;
+}
+ MIRANDA_IDLE_INFO;
+
+/*
+ wParam; 0
+ lParam: &MIRANDA_IDLE_INFO
+ Affect: Return information about current idle settings, like short/long idle time in mins
+ and if the user wants that info kept private, etc
+ Returns: zero on success, non zero on failure
+ Version: 0.3.4 (2004/09/16)
+*/
+
+#define MS_IDLE_GETIDLEINFO "Miranda/Idle/GetInfo"
+
+#endif // M_IDLE_H__
+
diff --git a/include/m_ignore.h b/include/m_ignore.h new file mode 100644 index 0000000000..312d0f70e8 --- /dev/null +++ b/include/m_ignore.h @@ -0,0 +1,64 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_IGNORE_H__
+#define M_IGNORE_H__ 1
+
+//this module provides UI and storage for blocking only, protocol modules are
+//responsible for implementing the block
+
+#define IGNOREEVENT_ALL (LPARAM)(-1)
+#define IGNOREEVENT_MESSAGE 1
+#define IGNOREEVENT_URL 2
+#define IGNOREEVENT_FILE 3
+#define IGNOREEVENT_USERONLINE 4
+#define IGNOREEVENT_AUTHORIZATION 5
+#define IGNOREEVENT_YOUWEREADDED 6 // 0.3.3a+
+#define IGNOREEVENT_TYPINGNOTIFY 7 // 0.7+
+
+//determines if a message type to a contact should be ignored v0.1.0.1+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=message type, an ignoreevent_ constant
+//returns 0 if the message should be shown, or nonzero if it should be ignored
+//Use hContact=NULL to retrieve the setting for unknown contacts (not on the
+//contact list, as either permanent or temporary).
+//don't use ignoreevent_all when calling this service
+#define MS_IGNORE_ISIGNORED "Ignore/IsIgnored"
+
+//ignore future messages from a contact v0.1.0.1+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=message type, an ignoreevent_ constant
+//returns 0 on success or nonzero on failure
+//Use hContact=NULL to retrieve the setting for unknown contacts
+#define MS_IGNORE_IGNORE "Ignore/Ignore"
+
+//receive future messages from a contact v0.1.0.1+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=message type, an ignoreevent_ constant
+//returns 0 on success or nonzero on failure
+//Use hContact=NULL to retrieve the setting for unknown contacts
+#define MS_IGNORE_UNIGNORE "Ignore/Unignore"
+
+
+#endif // M_IGNORE_H__
+
diff --git a/include/m_imgsrvc.h b/include/m_imgsrvc.h new file mode 100644 index 0000000000..37f65f4292 --- /dev/null +++ b/include/m_imgsrvc.h @@ -0,0 +1,519 @@ +/*
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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.
+
+-----------------------------------------------------------------------
+Miranda Image services plugin / API definitions
+Provides various services for image loading, saving and manipulations.
+
+This module is based on the freeimage library, copyrighted by the FreeImage
+Project members.
+
+Miranda plugin code (c) 2007 by Nightwish, silvercircle@gmail.com, all else (C)
+by the FreeImage project (http://freeimage.sourceforge.net)
+
+*/
+
+#ifndef __M_IMGSRVC_H
+#define __M_IMGSRVC_H
+
+#define _FI_MIMPLUGIN 1
+
+#include "m_freeimage.h"
+
+#define FI_IF_VERSION (PLUGIN_MAKE_VERSION(0, 0, 1, 0)) // interface version - must match
+
+// memory i/o defs
+
+/*
+ * this struct defines a memio job.
+ * datalen and filename must match and must be populated to the size of the memory buffer (caution)
+ * data must point to the buffer.
+ * curpos is internal and should be initialized to 0
+ */
+
+typedef struct fiio_mem_handle_s {
+ long filelen,datalen,curpos;
+ void *data;
+} fiio_mem_handle;
+
+/* it is up to the user to create a fiio_mem_handle and init datalen and data
+ * filelen will be pre-set to 0 by SaveToMem
+ * curpos will be pre-set to 0 by SaveToMem and LoadFromMem
+ * IMPORTANT: data should be set to NULL and datalen to 0,
+ * unless the user wants to manually malloc a larger buffer
+ */
+FIBITMAP *FreeImage_LoadFromMem(FREE_IMAGE_FORMAT fif, fiio_mem_handle *handle, int flags);
+FIMEMORY *FreeImage_SaveToMem(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, fiio_mem_handle *handle, int flags);
+
+void SetMemIO(FreeImageIO *io);
+unsigned __stdcall fiio_mem_ReadProc(void *buffer, unsigned size, unsigned count, fi_handle handle);
+unsigned __stdcall fiio_mem_WriteProc(void *buffer, unsigned size, unsigned count, fi_handle handle);
+int __stdcall fiio_mem_SeekProc(fi_handle handle, long offset, int origin);
+long __stdcall fiio_mem_TellProc(fi_handle handle);
+
+/*
+ * this interface directly exports most of FreeImage routines
+ * you can use them in your plugin after obtaining the interfasce using MS_IMG_GETINTERFACE
+ */
+
+typedef struct _tagFI_interface {
+
+ DWORD version;
+
+ FIBITMAP *(DLL_CALLCONV *FI_Allocate)(int width, int height, int bpp, unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0));
+ FIBITMAP *(DLL_CALLCONV *FI__AllocateT)(FREE_IMAGE_TYPE type, int width, int height, int bpp FI_DEFAULT(8), unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0));
+ FIBITMAP *(DLL_CALLCONV *FI_Clone)(FIBITMAP *dib);
+ void (DLL_CALLCONV *FI_Unload)(FIBITMAP *dib);
+
+ // Load / Save routines -----------------------------------------------------
+
+ FIBITMAP *(DLL_CALLCONV *FI_Load)(FREE_IMAGE_FORMAT fif, const char *filename, int flags FI_DEFAULT(0));
+ FIBITMAP *(DLL_CALLCONV *FI_LoadU)(FREE_IMAGE_FORMAT fif, const wchar_t *filename, int flags FI_DEFAULT(0));
+ FIBITMAP *(DLL_CALLCONV *FI_LoadFromHandle)(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
+ BOOL (DLL_CALLCONV *FI_Save)(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, const char *filename, int flags FI_DEFAULT(0));
+ BOOL (DLL_CALLCONV *FI_SaveU)(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, const wchar_t *filename, int flags FI_DEFAULT(0));
+ BOOL (DLL_CALLCONV *FI_SaveToHandle)(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0));
+
+// Memory I/O stream routines -----------------------------------------------
+
+ FIMEMORY *(DLL_CALLCONV *FI_OpenMemory)(BYTE *data FI_DEFAULT(0), DWORD size_in_bytes FI_DEFAULT(0));
+ void (DLL_CALLCONV *FI_CloseMemory)(FIMEMORY *stream);
+ FIBITMAP *(DLL_CALLCONV *FI_LoadFromMemory)(FREE_IMAGE_FORMAT fif, FIMEMORY *stream, int flags FI_DEFAULT(0));
+ BOOL (DLL_CALLCONV *FI_SaveToMemory)(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, FIMEMORY *stream, int flags FI_DEFAULT(0));
+ long (DLL_CALLCONV *FI_TellMemory)(FIMEMORY *stream);
+ BOOL (DLL_CALLCONV *FI_SeekMemory)(FIMEMORY *stream, long offset, int origin);
+ BOOL (DLL_CALLCONV *FI_AcquireMemory)(FIMEMORY *stream, BYTE **data, DWORD *size_in_bytes);
+ unsigned (DLL_CALLCONV *FI_ReadMemory)(void *buffer, unsigned size, unsigned count, FIMEMORY *stream);
+ unsigned (DLL_CALLCONV *FI_WriteMemory)(const void *buffer, unsigned size, unsigned count, FIMEMORY *stream);
+ FIMULTIBITMAP *(DLL_CALLCONV *FI_LoadMultiBitmapFromMemory)(FREE_IMAGE_FORMAT fif, FIMEMORY *stream, int flags FI_DEFAULT(0));
+
+// Plugin Interface ---------------------------------------------------------
+
+ FREE_IMAGE_FORMAT (DLL_CALLCONV *FI_RegisterLocalPlugin)(FI_InitProc proc_address, const char *format FI_DEFAULT(0), const char *description FI_DEFAULT(0), const char *extension FI_DEFAULT(0), const char *regexpr FI_DEFAULT(0));
+ FREE_IMAGE_FORMAT (DLL_CALLCONV *FI_RegisterExternalPlugin)(const char *path, const char *format FI_DEFAULT(0), const char *description FI_DEFAULT(0), const char *extension FI_DEFAULT(0), const char *regexpr FI_DEFAULT(0));
+ int (DLL_CALLCONV *FI_GetFIFCount)(void);
+ int (DLL_CALLCONV *FI_SetPluginEnabled)(FREE_IMAGE_FORMAT fif, BOOL enable);
+ int (DLL_CALLCONV *FI_IsPluginEnabled)(FREE_IMAGE_FORMAT fif);
+ FREE_IMAGE_FORMAT (DLL_CALLCONV *FI_GetFIFFromFormat)(const char *format);
+ FREE_IMAGE_FORMAT (DLL_CALLCONV *FI_GetFIFFromMime)(const char *mime);
+ const char *(DLL_CALLCONV *FI_GetFormatFromFIF)(FREE_IMAGE_FORMAT fif);
+ const char *(DLL_CALLCONV *FI_GetFIFExtensionList)(FREE_IMAGE_FORMAT fif);
+ const char *(DLL_CALLCONV *FI_GetFIFDescription)(FREE_IMAGE_FORMAT fif);
+ const char *(DLL_CALLCONV *FI_GetFIFRegExpr)(FREE_IMAGE_FORMAT fif);
+ const char *(DLL_CALLCONV *FI_GetFIFMimeType)(FREE_IMAGE_FORMAT fif);
+ FREE_IMAGE_FORMAT (DLL_CALLCONV *FI_GetFIFFromFilename)(const char *filename);
+ FREE_IMAGE_FORMAT (DLL_CALLCONV *FI_GetFIFFromFilenameU)(const wchar_t *filename);
+ BOOL (DLL_CALLCONV *FI_FIFSupportsReading)(FREE_IMAGE_FORMAT fif);
+ BOOL (DLL_CALLCONV *FI_FIFSupportsWriting)(FREE_IMAGE_FORMAT fif);
+ BOOL (DLL_CALLCONV *FI_FIFSupportsExportBPP)(FREE_IMAGE_FORMAT fif, int bpp);
+ BOOL (DLL_CALLCONV *FI_FIFSupportsExportType)(FREE_IMAGE_FORMAT fif, FREE_IMAGE_TYPE type);
+ BOOL (DLL_CALLCONV *FI_FIFSupportsICCProfiles)(FREE_IMAGE_FORMAT fif);
+
+// Multipaging interface ----------------------------------------------------
+
+ FIMULTIBITMAP *(DLL_CALLCONV *FI_OpenMultiBitmap)(FREE_IMAGE_FORMAT fif, const char *filename, BOOL create_new, BOOL read_only, BOOL keep_cache_in_memory FI_DEFAULT(FALSE), int flags FI_DEFAULT(0));
+ BOOL (DLL_CALLCONV *FI_CloseMultiBitmap)(FIMULTIBITMAP *bitmap, int flags FI_DEFAULT(0));
+ int (DLL_CALLCONV *FI_GetPageCount)(FIMULTIBITMAP *bitmap);
+ void (DLL_CALLCONV *FI_AppendPage)(FIMULTIBITMAP *bitmap, FIBITMAP *data);
+ void (DLL_CALLCONV *FI_InsertPage)(FIMULTIBITMAP *bitmap, int page, FIBITMAP *data);
+ void (DLL_CALLCONV *FI_DeletePage)(FIMULTIBITMAP *bitmap, int page);
+ FIBITMAP *(DLL_CALLCONV *FI_LockPage)(FIMULTIBITMAP *bitmap, int page);
+ void (DLL_CALLCONV *FI_UnlockPage)(FIMULTIBITMAP *bitmap, FIBITMAP *data, BOOL changed);
+ BOOL (DLL_CALLCONV *FI_MovePage)(FIMULTIBITMAP *bitmap, int target, int source);
+ BOOL (DLL_CALLCONV *FI_GetLockedPageNumbers)(FIMULTIBITMAP *bitmap, int *pages, int *count);
+
+// Filetype request routines ------------------------------------------------
+
+ FREE_IMAGE_FORMAT (DLL_CALLCONV *FI_GetFileType)(const char *filename, int size FI_DEFAULT(0));
+ FREE_IMAGE_FORMAT (DLL_CALLCONV *FI_GetFileTypeU)(const wchar_t *filename, int size FI_DEFAULT(0));
+ FREE_IMAGE_FORMAT (DLL_CALLCONV *FI_GetFileTypeFromHandle)(FreeImageIO *io, fi_handle handle, int size FI_DEFAULT(0));
+ FREE_IMAGE_FORMAT (DLL_CALLCONV *FI_GetFileTypeFromMemory)(FIMEMORY *stream, int size FI_DEFAULT(0));
+
+// FreeImage helper routines ------------------------- MISSING !!!! TODO
+
+ BOOL (DLL_CALLCONV *FI_IsLittleEndian)(void);
+ BOOL (DLL_CALLCONV *FI_LookupX11Color)(const char *szColor, BYTE *nRed, BYTE *nGreen, BYTE *nBlue);
+ BOOL (DLL_CALLCONV *FI_LookupSVGColor)(const char *szColor, BYTE *nRed, BYTE *nGreen, BYTE *nBlue);
+
+// Image type request routine -----------------------------------------------
+
+ FREE_IMAGE_TYPE (DLL_CALLCONV *FI_GetImageType)(FIBITMAP *dib);
+
+// Pixel access routines ----------------------------------------------------
+
+ BYTE *(DLL_CALLCONV *FI_GetBits)(FIBITMAP *dib);
+ BYTE *(DLL_CALLCONV *FI_GetScanLine)(FIBITMAP *dib, int scanline);
+
+ BOOL (DLL_CALLCONV *FI_GetPixelIndex)(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value);
+ BOOL (DLL_CALLCONV *FI_GetPixelColor)(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value);
+ BOOL (DLL_CALLCONV *FI_SetPixelIndex)(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value);
+ BOOL (DLL_CALLCONV *FI_SetPixelColor)(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value);
+
+// DIB info routines --------------------------------------------------------
+
+ unsigned (DLL_CALLCONV *FI_GetColorsUsed)(FIBITMAP *dib);
+ unsigned (DLL_CALLCONV *FI_GetBPP)(FIBITMAP *dib);
+ unsigned (DLL_CALLCONV *FI_GetWidth)(FIBITMAP *dib);
+ unsigned (DLL_CALLCONV *FI_GetHeight)(FIBITMAP *dib);
+ unsigned (DLL_CALLCONV *FI_GetLine)(FIBITMAP *dib);
+ unsigned (DLL_CALLCONV *FI_GetPitch)(FIBITMAP *dib);
+ unsigned (DLL_CALLCONV *FI_GetDIBSize)(FIBITMAP *dib);
+ RGBQUAD *(DLL_CALLCONV *FI_GetPalette)(FIBITMAP *dib);
+
+ unsigned (DLL_CALLCONV *FI_GetDotsPerMeterX)(FIBITMAP *dib);
+ unsigned (DLL_CALLCONV *FI_GetDotsPerMeterY)(FIBITMAP *dib);
+ void (DLL_CALLCONV *FI_SetDotsPerMeterX)(FIBITMAP *dib, unsigned res);
+ void (DLL_CALLCONV *FI_SetDotsPerMeterY)(FIBITMAP *dib, unsigned res);
+
+ BITMAPINFOHEADER *(DLL_CALLCONV *FI_GetInfoHeader)(FIBITMAP *dib);
+ BITMAPINFO *(DLL_CALLCONV *FI_GetInfo)(FIBITMAP *dib);
+ FREE_IMAGE_COLOR_TYPE (DLL_CALLCONV *FI_GetColorType)(FIBITMAP *dib);
+
+ unsigned (DLL_CALLCONV *FI_GetRedMask)(FIBITMAP *dib);
+ unsigned (DLL_CALLCONV *FI_GetGreenMask)(FIBITMAP *dib);
+ unsigned (DLL_CALLCONV *FI_GetBlueMask)(FIBITMAP *dib);
+
+ unsigned (DLL_CALLCONV *FI_GetTransparencyCount)(FIBITMAP *dib);
+ BYTE *(DLL_CALLCONV *FI_GetTransparencyTable)(FIBITMAP *dib);
+ void (DLL_CALLCONV *FI_SetTransparent)(FIBITMAP *dib, BOOL enabled);
+ void (DLL_CALLCONV *FI_SetTransparencyTable)(FIBITMAP *dib, BYTE *table, int count);
+ BOOL (DLL_CALLCONV *FI_IsTransparent)(FIBITMAP *dib);
+
+ BOOL (DLL_CALLCONV *FI_HasBackgroundColor)(FIBITMAP *dib);
+ BOOL (DLL_CALLCONV *FI_GetBackgroundColor)(FIBITMAP *dib, RGBQUAD *bkcolor);
+ BOOL (DLL_CALLCONV *FI_SetBackgroundColor)(FIBITMAP *dib, RGBQUAD *bkcolor);
+
+ // ICC profile routines ------------------------------- MISSING !!! TODO
+
+ FIICCPROFILE *(DLL_CALLCONV *FI_GetICCProfile)(FIBITMAP *dib);
+ FIICCPROFILE *(DLL_CALLCONV *FI_CreateICCProfile)(FIBITMAP *dib, void *data, long size);
+ void (DLL_CALLCONV *FI_DestroyICCProfile)(FIBITMAP *dib);
+
+ // Line conversion routines ----------------------------MISSING !!! TODO
+
+// Smart conversion routines ------------------------------------------------
+
+ FIBITMAP *(DLL_CALLCONV *FI_ConvertTo4Bits)(FIBITMAP *dib);
+ FIBITMAP *(DLL_CALLCONV *FI_ConvertTo8Bits)(FIBITMAP *dib);
+ FIBITMAP *(DLL_CALLCONV *FI_ConvertToGreyscale)(FIBITMAP *dib);
+ FIBITMAP *(DLL_CALLCONV *FI_ConvertTo16Bits555)(FIBITMAP *dib);
+ FIBITMAP *(DLL_CALLCONV *FI_ConvertTo16Bits565)(FIBITMAP *dib);
+ FIBITMAP *(DLL_CALLCONV *FI_ConvertTo24Bits)(FIBITMAP *dib);
+ FIBITMAP *(DLL_CALLCONV *FI_ConvertTo32Bits)(FIBITMAP *dib);
+ FIBITMAP *(DLL_CALLCONV *FI_ColorQuantize)(FIBITMAP *dib, FREE_IMAGE_QUANTIZE quantize);
+
+ FIBITMAP *(DLL_CALLCONV *FI_ColorQuantizeEx)(FIBITMAP *dib, FREE_IMAGE_QUANTIZE quantize /*FI_DEFAULT(FIQ_WUQUANT) */, int PaletteSize FI_DEFAULT(256), int ReserveSize FI_DEFAULT(0), RGBQUAD *ReservePalette FI_DEFAULT(NULL));
+
+ FIBITMAP *(DLL_CALLCONV *FI_Threshold)(FIBITMAP *dib, BYTE T);
+ FIBITMAP *(DLL_CALLCONV *FI_Dither)(FIBITMAP *dib, FREE_IMAGE_DITHER algorithm);
+ FIBITMAP *(DLL_CALLCONV *FI_ConvertFromRawBits)(BYTE *bits, int width, int height, int pitch, unsigned bpp, unsigned red_mask, unsigned green_mask, unsigned blue_mask, BOOL topdown FI_DEFAULT(FALSE));
+ void (DLL_CALLCONV *FI_ConvertToRawBits)(BYTE *bits, FIBITMAP *dib, int pitch, unsigned bpp, unsigned red_mask, unsigned green_mask, unsigned blue_mask, BOOL topdown FI_DEFAULT(FALSE));
+
+ FIBITMAP *(DLL_CALLCONV *FI_ConvertToRGBF)(FIBITMAP *dib);
+ FIBITMAP *(DLL_CALLCONV *FI_ConvertToStandardType)(FIBITMAP *src, BOOL scale_linear FI_DEFAULT(TRUE));
+ FIBITMAP *(DLL_CALLCONV *FI_ConvertToType)(FIBITMAP *src, FREE_IMAGE_TYPE dst_type, BOOL scale_linear FI_DEFAULT(TRUE));
+
+// tone mapping operators
+ FIBITMAP *(DLL_CALLCONV *FI_ToneMapping)(FIBITMAP *dib, FREE_IMAGE_TMO tmo, double first_param FI_DEFAULT(0), double second_param FI_DEFAULT(0));
+ FIBITMAP *(DLL_CALLCONV *FI_TmoDrago03)(FIBITMAP *src, double gamma FI_DEFAULT(2.2), double exposure FI_DEFAULT(0));
+ FIBITMAP *(DLL_CALLCONV *FI_TmoReinhard05)(FIBITMAP *src, double intensity FI_DEFAULT(0), double contrast FI_DEFAULT(0));
+
+// ZLib interface -----------------------------------------------------------
+
+ DWORD (DLL_CALLCONV *FI_ZLibCompress)(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
+ DWORD (DLL_CALLCONV *FI_ZLibUncompress)(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
+ DWORD (DLL_CALLCONV *FI_ZLibGZip)(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
+ DWORD (DLL_CALLCONV *FI_ZLibGUnzip)(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size);
+ DWORD (DLL_CALLCONV *FI_ZLibCRC32)(DWORD crc, BYTE *source, DWORD source_size);
+
+
+// --------------------------------------------------------------------------
+// Metadata routines --------------------------------------------------------
+// --------------------------------------------------------------------------
+
+// tag creation / destruction
+ FITAG *(DLL_CALLCONV *FI_CreateTag)();
+ void (DLL_CALLCONV *FI_DeleteTag)(FITAG *tag);
+ FITAG *(DLL_CALLCONV *FI_CloneTag)(FITAG *tag);
+
+// tag getters and setters
+ const char *(DLL_CALLCONV *FI_GetTagKey)(FITAG *tag);
+ const char *(DLL_CALLCONV *FI_GetTagDescription)(FITAG *tag);
+ WORD (DLL_CALLCONV *FI_GetTagID)(FITAG *tag);
+ FREE_IMAGE_MDTYPE (DLL_CALLCONV *FI_GetTagType)(FITAG *tag);
+ DWORD (DLL_CALLCONV *FI_GetTagCount)(FITAG *tag);
+ DWORD (DLL_CALLCONV *FI_GetTagLength)(FITAG *tag);
+ const void *(DLL_CALLCONV *FI_GetTagValue)(FITAG *tag);
+
+ BOOL (DLL_CALLCONV *FI_SetTagKey)(FITAG *tag, const char *key);
+ BOOL (DLL_CALLCONV *FI_SetTagDescription)(FITAG *tag, const char *description);
+ BOOL (DLL_CALLCONV *FI_SetTagID)(FITAG *tag, WORD id);
+ BOOL (DLL_CALLCONV *FI_SetTagType)(FITAG *tag, FREE_IMAGE_MDTYPE type);
+ BOOL (DLL_CALLCONV *FI_SetTagCount)(FITAG *tag, DWORD count);
+ BOOL (DLL_CALLCONV *FI_SetTagLength)(FITAG *tag, DWORD length);
+ BOOL (DLL_CALLCONV *FI_SetTagValue)(FITAG *tag, const void *value);
+
+// iterator
+ FIMETADATA *(DLL_CALLCONV *FI_FindFirstMetadata)(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, FITAG **tag);
+ BOOL (DLL_CALLCONV *FI_FindNextMetadata)(FIMETADATA *mdhandle, FITAG **tag);
+ void (DLL_CALLCONV *FI_FindCloseMetadata)(FIMETADATA *mdhandle);
+
+// metadata setter and getter
+ BOOL (DLL_CALLCONV *FI_SetMetadata)(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG *tag);
+ BOOL (DLL_CALLCONV *FI_GetMetadata)(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG **tag);
+
+// helpers
+ unsigned (DLL_CALLCONV *FI_GetMetadataCount)(FREE_IMAGE_MDMODEL model, FIBITMAP *dib);
+
+// tag to C string conversion
+ const char *(DLL_CALLCONV *FI_TagToString)(FREE_IMAGE_MDMODEL model, FITAG *tag, char *Make FI_DEFAULT(NULL));
+
+
+// --------------------------------------------------------------------------
+// Image manipulation toolkit -----------------------------------------------
+// --------------------------------------------------------------------------
+
+// rotation and flipping
+ FIBITMAP *(DLL_CALLCONV *FI_RotateClassic)(FIBITMAP *dib, double angle);
+ FIBITMAP *(DLL_CALLCONV *FI_RotateEx)(FIBITMAP *dib, double angle, double x_shift, double y_shift, double x_origin, double y_origin, BOOL use_mask);
+ BOOL (DLL_CALLCONV *FI_FlipHorizontal)(FIBITMAP *dib);
+ BOOL (DLL_CALLCONV *FI_FlipVertical)(FIBITMAP *dib);
+ BOOL (DLL_CALLCONV *FI_JPEGTransform)(const char *src_file, const char *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(FALSE));
+
+// upsampling / downsampling
+ FIBITMAP *(DLL_CALLCONV *FI_Rescale)(FIBITMAP *dib, int dst_width, int dst_height, FREE_IMAGE_FILTER filter);
+ FIBITMAP *(DLL_CALLCONV *FI_MakeThumbnail)(FIBITMAP *dib, int max_pixel_size, BOOL convert FI_DEFAULT(TRUE));
+
+// color manipulation routines (point operations)
+ BOOL (DLL_CALLCONV *FI_AdjustCurve)(FIBITMAP *dib, BYTE *LUT, FREE_IMAGE_COLOR_CHANNEL channel);
+ BOOL (DLL_CALLCONV *FI_AdjustGamma)(FIBITMAP *dib, double gamma);
+ BOOL (DLL_CALLCONV *FI_AdjustBrightness)(FIBITMAP *dib, double percentage);
+ BOOL (DLL_CALLCONV *FI_AdjustContrast)(FIBITMAP *dib, double percentage);
+ BOOL (DLL_CALLCONV *FI_Invert)(FIBITMAP *dib);
+ BOOL (DLL_CALLCONV *FI_GetHistogram)(FIBITMAP *dib, DWORD *histo, FREE_IMAGE_COLOR_CHANNEL channel);
+
+// channel processing routines
+ FIBITMAP *(DLL_CALLCONV *FI_GetChannel)(FIBITMAP *dib, FREE_IMAGE_COLOR_CHANNEL channel);
+ BOOL (DLL_CALLCONV *FI_SetChannel)(FIBITMAP *dib, FIBITMAP *dib8, FREE_IMAGE_COLOR_CHANNEL channel);
+ FIBITMAP *(DLL_CALLCONV *FI_GetComplexChannel)(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);
+ BOOL (DLL_CALLCONV *FI_SetComplexChannel)(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);
+
+// copy / paste / composite routines
+ FIBITMAP *(DLL_CALLCONV *FI_Copy)(FIBITMAP *dib, int left, int top, int right, int bottom);
+ BOOL (DLL_CALLCONV *FI_Paste)(FIBITMAP *dst, FIBITMAP *src, int left, int top, int alpha);
+ FIBITMAP *(DLL_CALLCONV *FI_Composite)(FIBITMAP *fg, BOOL useFileBkg FI_DEFAULT(FALSE), RGBQUAD *appBkColor FI_DEFAULT(NULL), FIBITMAP *bg FI_DEFAULT(NULL));
+ BOOL (DLL_CALLCONV *FI_JPEGCrop)(const char *src_file, const char *dst_file, int left, int top, int right, int bottom);
+
+// own functions
+
+ // memory I/O
+ FIBITMAP *(*FI_LoadFromMem)(FREE_IMAGE_FORMAT fif, fiio_mem_handle *handle, int flags);
+ FIMEMORY *(*FI_SaveToMem)(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, fiio_mem_handle *handle, int flags);
+
+ // helpers
+ FIBITMAP *(*FI_CreateDIBFromHBITMAP)(HBITMAP hBmp);
+ HBITMAP (*FI_CreateHBITMAPFromDIB)(FIBITMAP *dib);
+ BOOL (*FI_Premultiply)(HBITMAP hBmp); // premultiplies alpha channel for usage with AlphaBlend()
+ // original HBITMAP stays valid and must be 32bit RGBA
+ INT_PTR (*FI_BmpFilterResizeBitmap)(WPARAM wParam,LPARAM lParam); // more generic resizer for avatar images
+ void (*FI_CorrectBitmap32Alpha)(HBITMAP hBitmap, BOOL force); // corrects broken images (when all alpha values are 0)
+
+ FIMULTIBITMAP *(DLL_CALLCONV *FI_OpenMultiBitmapU)(FREE_IMAGE_FORMAT fif, const wchar_t *filename, BOOL create_new, BOOL read_only, BOOL keep_cache_in_memory FI_DEFAULT(FALSE), int flags FI_DEFAULT(0));
+
+ void* reserved[49]; // future usage
+} FI_INTERFACE;
+
+
+#if defined(UNICODE) || defined(_UNICODE)
+#define FI_GetFIFFromFilenameT FI_GetFIFFromFilenameU
+#define FI_GetFileTypeT FI_GetFileTypeU
+#define FI_LoadT FI_LoadU
+#define FI_OpenMultiBitmapT FI_OpenMultiBitmapU
+#else
+#define FI_GetFIFFromFilenameT FI_GetFIFFromFilename
+#define FI_GetFileTypeT FI_GetFileType
+#define FI_LoadT FI_Load
+#define FI_OpenMultiBitmapT FI_OpenMultiBitmap
+#endif
+
+/*
+ * image services
+ *
+ * only basic functionality is wrapped around Miranda services, because otherwise we would get a huge
+ * load of services with complex parameter marshalling requirements.
+ */
+
+// get the interface version number
+// wParam = lParam = 0
+// returns FI_IF_VERSION
+
+#define MS_IMG_GETIFVERSION "IMG/GetVersion"
+
+// obtain the full FreeImage interface from the library. This interface provides full access to freeimage
+// internal functions, thus enabling devs to fully utilize the FreeImage API. Only popular functions will
+// be exported as miranda services.
+// wParam = (DWORD)version Number // the caller MUST provide the desired version number
+// lParam = **FI_INTERFACE
+// returns S_OK on success, any other value indicates a problem.
+// the interface is populated during the _DllMain() handler, so you can assume it is ready when Miranda
+// calls the Load() handler of your plugin and you can return 1 in your Load() to disable your plugin when
+// it depends on the freeimage interface and the freeimage plugin is missing
+//
+// example:
+//
+// FI_INTERFACE *fii = NULL;
+//
+// result = CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&fii);
+//
+// if(result != S_OK)
+// failed, in this case, fei will be NULL and your plugin will crash when using the interface,
+// so ALWAYS check it
+
+#define MS_IMG_GETINTERFACE "IMG/GetInterface"
+
+
+#define IMGL_RETURNDIB 1 // will NOT return a HBITMAP but a FIBITMAP * instead (useful, if you
+ // want to do further image manipulations before converting to a Win32 bitmap
+ // caller MUST then free the FIBITMAP * using fii->FI_Unload() or MS_IMG_UNLOAD (see below)
+
+#define IMGL_WCHAR 2 // filename is wchar_t
+
+#if defined(UNICODE) || defined(_UNICODE)
+ #define IMGL_TCHAR IMGL_WCHAR
+#else
+ #define IMGL_TCHAR 0
+#endif
+
+// load an image from disk
+// wParam = full path and filename to the image
+// lParam = IMGL_* flags
+// returns a valid HBITMAP or 0 if image cannot be loaded
+// if IMGL_RETURNDIB is set, it returns a pointer to a freeimage bitmap (FIBITMAP *)
+
+#define MS_IMG_LOAD "IMG/Load"
+
+/*
+ * control structure for loading images from memory buffers (e.g. network buffers, memory mapped files).
+ */
+
+typedef struct _tagIMGSRVC_MEMIO {
+ long iLen; // length of the buffer
+ void *pBuf; // the buffer itself (you are responsible for allocating and free'ing it)
+ FREE_IMAGE_FORMAT fif; // -1 to detect the format or one of the FIF_* image format constants
+ UINT flags; // flags to pass to FreeImage_LoadFromMemory() (see freeimage docs)
+} IMGSRVC_MEMIO;
+
+// load an image from a memory buffer
+// wParam = IMGSRVC_MEMIO *
+// lParam = flags (see IMG/Load), valid are IMGL_RETURNDIB
+// you must popupate iLen (buffer length) and pBuf (pointer to memory buffer)
+// you must also specify the format in IMGSRVC_MEMIO.fif using one of the FIF_* constants defined in m_freeimage.h
+
+#define MS_IMG_LOADFROMMEM "IMG/LoadFromMem"
+
+// flags for IMGSRVC_INFO.dwMask
+
+#define IMGI_FBITMAP 1 // the dib member is valid
+#define IMGI_HBITMAP 2 // the hbm member is valid
+
+/*
+ * generic structure for various img functions
+ * you must populate the fields as required, set the mask bits to indicate which member is valid
+ */
+
+typedef struct _tagIMGSRVC_INFO {
+ DWORD cbSize;
+ union {
+ char *szName;
+ wchar_t *wszName;
+ TCHAR *tszName;
+ };
+ HBITMAP hbm;
+ FIBITMAP *dib;
+ DWORD dwMask;
+ FREE_IMAGE_FORMAT fif;
+} IMGSRVC_INFO;
+
+// save image to disk
+// wParam = IMGSRVC_INFO * (szName/wszName, hbm OR dib, cbSize, dwMask mandatory. fif optional, if FIF_UNKNOWN is given
+// it will be determined from the filename).
+// lParam = low word: IMG_* flags (IMGL_WCHAR is the only valid - filename will be assumed to be wchar_t and wszName must be used)
+// high word: FreeImage_Save flags
+// set IMGSRVC_INFO.dwMask to indicate whether the HBITMAP of FIBITMAP member is valid
+
+#define MS_IMG_SAVE "IMG/Save"
+
+// unload a FIFBITMAP
+// wParam = FIFBITMAP *
+// lParam = 0;
+// this service is useful when you have loaded a bitmap with IMGL_RETURNDIB in which case you do not get
+// a HBITMAP but instead a FBITMAP * which describes the freeimage-internal representation of a bitmap.
+
+#define MS_IMG_UNLOAD "IMG/Unload"
+
+/*
+ * resizer from loadavatars moved to image service plugin
+*/
+
+#define RESIZEBITMAP_STRETCH 0 // Distort bitmap to size in (max_width, max_height)
+#define RESIZEBITMAP_KEEP_PROPORTIONS 1 // Keep bitmap proportions (probabily only one of the
+ // max_width/max_height will be respected, and the other will be
+ // smaller)
+#define RESIZEBITMAP_CROP 2 // Keep bitmap proportions but crop it to fix exactly in (max_width, max_height)
+ // Some image info outside will be lost
+#define RESIZEBITMAP_MAKE_SQUARE 3 // Image will be allways square. Image will be croped and the size
+ // returned will be min(max_width, max_height)
+
+#define RESIZEBITMAP_FLAG_DONT_GROW 0x1000 // If set, the image will not grow. Else, it will grow to fit the max width/height
+
+typedef struct {
+ size_t size; // sizeof(ResizeBitmap);
+
+ HBITMAP hBmp;
+
+ int max_width;
+ int max_height;
+
+ int fit; // One of RESIZEBITMAP_* with an OR with RESIZEBITMAP_FLAG_DONT_GROW if needed
+} ResizeBitmap;
+
+// Returns a copy of the bitmap with the size especified or the original bitmap if nothing has to be changed
+// wParam = ResizeBitmap *
+// lParam = NULL
+// return NULL on error, ResizeBitmap->hBmp if don't need to resize or a new HBITMAP if resized
+// You are responsible for calling DestroyObject() on the original HBITMAP
+
+#define MS_IMG_RESIZE "IMG/ResizeBitmap"
+
+
+/*
+ * format conversion helpers
+ *
+ * these helper macros allow converting HBITMAP to FIBITMAP * format and vice vera. In any case,
+ * the caller is responsible for freeing or deleting the original object.
+ * These macros wrap around the FI_CreateHBITMAPFromDib() and FI_CreateDIBFromHBITMAP() interface
+ * functions.
+ */
+
+//#define FI_HBM2DIB(x) (FI_CreateDIBFromHBITMAP((x)))
+//#define FI_DIB2HBM(x) (FI_CreateHBITMAPFromDIB((x)))
+
+#endif // __M_IMGSRVC_H
diff --git a/include/m_jabber.h b/include/m_jabber.h new file mode 100644 index 0000000000..b19a656521 --- /dev/null +++ b/include/m_jabber.h @@ -0,0 +1,252 @@ +/*
+
+Jabber Protocol Plugin for Miranda IM
+Copyright ( C ) 2002-04 Santithorn Bunchua
+Copyright ( C ) 2005-08 George Hazan
+Copyright ( C ) 2007 Maxim Mluhov
+Copyright ( C ) 2008-09 Dmitriy Chervov
+
+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.
+
+File name : $URL: https://miranda.svn.sourceforge.net/svnroot/miranda/trunk/miranda/include/m_jabber.h $
+Revision : $Revision: 9996 $
+Last change on : $Date: 2009-11-15 13:27:32 +0200 $
+Last change by : $Author: dchervov $
+
+*/
+
+#ifndef M_JABBER_H__
+#define M_JABBER_H__
+
+#ifdef __cplusplus
+
+#include <m_xml.h>
+
+struct IJabberInterface;
+
+struct IJabberSysInterface
+{
+ // Returns version of IJabberSysInterface.
+ virtual int STDMETHODCALLTYPE GetVersion() const = 0;
+
+ // Compares JIDs by their node@domain part (without resource name).
+ virtual int STDMETHODCALLTYPE CompareJIDs(LPCTSTR jid1, LPCTSTR jid2) = 0;
+
+ // Returns contact handle for given JID, or NULL on error.
+ virtual HANDLE STDMETHODCALLTYPE ContactFromJID(LPCTSTR jid) = 0;
+
+ // Returns JID of hContact, or NULL on error. You must free the result using mir_free().
+ virtual LPTSTR STDMETHODCALLTYPE ContactToJID(HANDLE hContact) = 0;
+
+ // Returns best resource name for given JID, or NULL on error. You must free the result using mir_free().
+ virtual LPTSTR STDMETHODCALLTYPE GetBestResourceName(LPCTSTR jid) = 0;
+
+ // Returns all resource names for a given JID in format "resource1\0resource2\0resource3\0\0" (all resources are separated by \0 character and the whole string is terminated with two \0 characters), or NULL on error. You must free returned string using mir_free().
+ virtual LPTSTR STDMETHODCALLTYPE GetResourceList(LPCTSTR jid) = 0;
+
+ // Returns Jabber module name. DO NOT free the returned string.
+ virtual char* STDMETHODCALLTYPE GetModuleName() const = 0;
+};
+
+// Iq type flags
+enum
+{
+ JABBER_IQ_TYPE_FAIL = 0,
+ JABBER_IQ_TYPE_RESULT = 1,
+ JABBER_IQ_TYPE_ERROR = 2,
+ JABBER_IQ_TYPE_GET = 4,
+ JABBER_IQ_TYPE_SET = 8,
+
+ JABBER_IQ_TYPE_RESULT_ERROR = JABBER_IQ_TYPE_RESULT | JABBER_IQ_TYPE_ERROR,
+ JABBER_IQ_TYPE_GOOD = JABBER_IQ_TYPE_RESULT | JABBER_IQ_TYPE_GET | JABBER_IQ_TYPE_SET,
+ JABBER_IQ_TYPE_ANY = JABBER_IQ_TYPE_RESULT | JABBER_IQ_TYPE_ERROR | JABBER_IQ_TYPE_GET | JABBER_IQ_TYPE_SET
+};
+
+// Message type flags
+enum
+{
+ JABBER_MESSAGE_TYPE_FAIL = 0,
+ JABBER_MESSAGE_TYPE_NORMAL = 1,
+ JABBER_MESSAGE_TYPE_ERROR = 2,
+ JABBER_MESSAGE_TYPE_CHAT = 4,
+ JABBER_MESSAGE_TYPE_GROUPCHAT = 8,
+ JABBER_MESSAGE_TYPE_HEADLINE = 0x10,
+
+ JABBER_MESSAGE_TYPE_ANY = JABBER_MESSAGE_TYPE_NORMAL | JABBER_MESSAGE_TYPE_ERROR | JABBER_MESSAGE_TYPE_CHAT | JABBER_MESSAGE_TYPE_GROUPCHAT | JABBER_MESSAGE_TYPE_HEADLINE
+};
+
+// Handler priority values.
+// All handler calls are ordered by priority specified when adding a handler.
+// For recv, it will go from lower to higher, so in this case: check ignore, default.
+// For send handlers, it will go in the opposite order: default, check ignore, send.
+// You may also use other values than specified here for your handler priority, if it's necessary.
+
+// IMPORTANT: In all incoming stanza handlers, return FALSE to continue processing the stanza (Jabber plugin will then call other handlers), or TRUE to stop processing the stanza (if you're sure noone else needs to process this stanza).
+// In an outgoing stanza handler it works in the same way: return TRUE to stop processing the stanza and abort sending.
+// All handlers may modify the stanza if it's necessary; these modifications will be passed to remaining handlers.
+enum
+{
+ JH_PRIORITY_IGNORE = 50,
+ JH_PRIORITY_DEFAULT = 1000,
+ JH_PRIORITY_UNHANDLED = 5000 // useful for example to catch unhandled Iq stanzas to send a correct reply.
+};
+
+typedef void* HJHANDLER;
+
+typedef BOOL (*JABBER_HANDLER_FUNC)(IJabberInterface *ji, HXML node, void *pUserData);
+
+struct IJabberNetInterface
+{
+ // Returns version of IJabberNetInterface.
+ virtual int STDMETHODCALLTYPE GetVersion() const = 0;
+
+ // Returns id that can be used for next message sent through SendXmlNode().
+ virtual unsigned int STDMETHODCALLTYPE SerialNext() = 0;
+
+ // Sends XML node.
+ virtual int STDMETHODCALLTYPE SendXmlNode(HXML node) = 0;
+
+
+ // Registers incoming <presence/> handler. Returns handler handle on success or NULL on error.
+ virtual HJHANDLER STDMETHODCALLTYPE AddPresenceHandler(JABBER_HANDLER_FUNC Func, void *pUserData = NULL, int iPriority = JH_PRIORITY_DEFAULT) = 0;
+
+ // Registers incoming <message/> handler for messages of types specified by iMsgTypes. iMsgTypes is a combination of JABBER_MESSAGE_TYPE_* flags. Returns handler handle on success or NULL on error.
+ virtual HJHANDLER STDMETHODCALLTYPE AddMessageHandler(JABBER_HANDLER_FUNC Func, int iMsgTypes, LPCTSTR szXmlns, LPCTSTR szTag, void *pUserData = NULL, int iPriority = JH_PRIORITY_DEFAULT) = 0;
+
+ // Registers incoming <iq/> handler. iIqTypes is a combination of JABBER_IQ_TYPE_* flags. Returns handler handle on success or NULL on error.
+ virtual HJHANDLER STDMETHODCALLTYPE AddIqHandler(JABBER_HANDLER_FUNC Func, int iIqTypes, LPCTSTR szXmlns, LPCTSTR szTag, void *pUserData = NULL, int iPriority = JH_PRIORITY_DEFAULT) = 0;
+
+ // Registers temporary handler for incoming <iq/> stanza of type iIqType with id iIqId. iIqTypes is a combination of JABBER_IQ_TYPE_* flags. Returns handler handle on success or NULL on error.
+ // If dwTimeout milliseconds pass and no Iq stanza with the specified iIqId is received, Jabber plugin will call Func() with NULL node.
+ virtual HJHANDLER STDMETHODCALLTYPE AddTemporaryIqHandler(JABBER_HANDLER_FUNC Func, int iIqTypes, int iIqId, void *pUserData = NULL, DWORD dwTimeout = 30000, int iPriority = JH_PRIORITY_DEFAULT) = 0;
+
+ // Registers handler for outgoing nodes. Returns handler handle on success or NULL on error.
+ // Return FALSE in the handler to continue, or TRUE to abort sending.
+ virtual HJHANDLER STDMETHODCALLTYPE AddSendHandler(JABBER_HANDLER_FUNC Func, void *pUserData = NULL, int iPriority = JH_PRIORITY_DEFAULT) = 0;
+
+ // Unregisters handler by its handle.
+ virtual int STDMETHODCALLTYPE RemoveHandler(HJHANDLER hHandler) = 0;
+
+
+// Entity capabilities support (see xep-0115)
+ // Registers feature so that it's displayed with proper description in other users' details. Call this function in your ME_SYSTEM_MODULESLOADED handler. Returns TRUE on success or FALSE on error.
+ virtual int STDMETHODCALLTYPE RegisterFeature(LPCTSTR szFeature, LPCTSTR szDescription) = 0;
+
+ // Adds features to the list of features supported by the client. szFeatures is a list of features separated by \0 character and terminated with two \0 characters. You can call this function at any time. Returns TRUE on success or FALSE on error.
+ virtual int STDMETHODCALLTYPE AddFeatures(LPCTSTR szFeatures) = 0;
+
+ // Removes features from the list of features supported by the client. szFeatures is a list of features separated by \0 character and terminated with two \0 characters. You can call this function at any time.
+ virtual int STDMETHODCALLTYPE RemoveFeatures(LPCTSTR szFeatures) = 0;
+
+ // Returns features supported by JID in format "feature1\0feature2\0...\0featureN\0\0" (a list of features separated by \0 character and terminated with two \0 characters), or NULL on error. JID may contain resource name to get features of a specific resource. If there's no resource name, GetResourceFeatures() returns features for the same resource as IJabberSysInterface::GetBestResourceName() returns. If a feature you're checking for is not supported by Jabber plugin natively, you must register it with RegisterFeature(), otherwise GetContactFeatures() won't be able to return it. You must free returned string using mir_free().
+ virtual LPTSTR STDMETHODCALLTYPE GetResourceFeatures(LPCTSTR jid) = 0;
+};
+
+// IJabberInterface::dwFlags values
+enum
+{
+ JIF_UNICODE = 1
+};
+
+// Overall Jabber interface
+struct IJabberInterface
+{
+ // Set of JIF_* flags.
+ virtual DWORD STDMETHODCALLTYPE GetFlags() const = 0;
+
+ // Returns version of IJabberInterface.
+ virtual int STDMETHODCALLTYPE GetVersion() const = 0;
+
+ // Returns Jabber plugin version.
+ virtual DWORD STDMETHODCALLTYPE GetJabberVersion() const = 0;
+
+ // Jabber system utilities.
+ virtual IJabberSysInterface* STDMETHODCALLTYPE Sys() const = 0;
+
+ // Jabber network interface.
+ virtual IJabberNetInterface* STDMETHODCALLTYPE Net() const = 0;
+};
+
+/*
+A service to obtain Jabber API for a given account.
+If you store the pointer to the interface for later use, you must also hook ME_PROTO_ACCLISTCHANGED and update the pointer to prevent calling API for a removed account.
+
+wParam = 0;
+lParam = (LPARAM)(IJabberInterface**).
+
+Returns FALSE if all is Ok, and TRUE otherwise.
+*/
+#define JS_GETJABBERAPI "/GetJabberApi"
+
+__forceinline IJabberInterface *getJabberApi(const char *szAccount)
+{
+ IJabberInterface *ji;
+ if (!CallProtoService(szAccount, JS_GETJABBERAPI, 0, (LPARAM)&ji))
+ {
+ return ji;
+ }
+ return NULL;
+}
+
+/* Custom Status helper API *
+ DB settings and write values to them (UTF-8 strings best). (obsolete)
+ - use JS_GETXSTATUSEX and JS_SETXSTATUSEX for controling Custom Status
+ */
+#define CSSF_MASK_STATUS 0x0001 // status member valid for set/get
+#define CSSF_MASK_NAME 0x0002 // pszName member valid for set/get
+#define CSSF_MASK_MESSAGE 0x0004 // pszMessage member valid for set/get
+#define CSSF_DISABLE_MENU 0x0020 // disable default custom status menu, wParam = bEnable
+#define CSSF_DISABLE_UI 0x0040 // disable default custom status UI, wParam = bEnable
+#define CSSF_DEFAULT_NAME 0x0080 // only with CSSF_MASK_NAME and get API to get default custom status name (wParam = status)
+#define CSSF_STATUSES_COUNT 0x0100 // returns number of custom statuses in wParam, only get API
+#define CSSF_STR_SIZES 0x0200 // returns sizes of custom status name & message (wParam & lParam members) in chars
+#define CSSF_UNICODE 0x1000 // strings are in UCS-2
+
+#if defined(_UNICODE)
+ #define CSSF_TCHAR CSSF_UNICODE
+#else
+ #define CSSF_TCHAR 0
+#endif
+
+typedef struct {
+ int cbSize; // size of the structure
+ int flags; // combination of CSSF_*
+ int *status; // custom status id
+ union {
+ char *pszMessage; // buffer for custom status message
+ TCHAR *ptszMessage;
+ WCHAR *pwszMessage;
+ };
+ WPARAM *wParam; // extra params, see flags
+ LPARAM *lParam;
+} JABBER_CUSTOM_STATUS;
+
+// Sets owner current custom status
+//wParam = 0 // reserved
+//lParam = (JABBER_CUSTOM_STATUS*)pData // contains what to set and new values
+//return = 0 (for success)
+#define JS_SETXSTATUSEX "/SetXStatusEx"
+
+// Retrieves custom status details for specified hContact
+//wParam = (HANDLE)hContact
+//lParam = (JABBER_CUSTOM_STATUS*)pData // receives details (members must be prepared)
+//return = 0 (for success)
+
+// not needed anymore and therefore commented out
+//#define JS_GETXSTATUSEX "/GetXStatusEx"
+
+#endif // __cplusplus
+
+#endif // M_JABBER_H__
diff --git a/include/m_keybindings.h b/include/m_keybindings.h new file mode 100644 index 0000000000..80f6ed1e2b --- /dev/null +++ b/include/m_keybindings.h @@ -0,0 +1,57 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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.
+*/
+
+#define KB_CTRL_FLAG 0x10000
+#define KB_SHIFT_FLAG 0x20000
+#define KB_ALT_FLAG 0x40000
+#define KBDF_UNICODE 1
+
+typedef struct {
+ int cbSize; //size of the structure
+ union {
+ char *pszSection; // section name used to display key bindings in the tree view
+ TCHAR *ptszSection; // [TRANSLATED-BY-CORE]
+ WCHAR *pwszSection;
+ };
+ union {
+ char *pszActionName; // action name used to display key bindings in the tree view
+ TCHAR *ptszActionName; // [TRANSLATED-BY-CORE]
+ WCHAR *pwszActionName;
+ };
+ char *pszActionGroup; // action group name used to group unique shortcuts, shortcuts cannot be duplicated within a group
+ DWORD key[5]; // virtual key + KB_* flags, up to 5 different shortcuts may be defined for each action
+ DWORD flags; // flags (KBDF_*)
+ int action; // id of the action
+} KEYBINDINGDESC;
+
+//Registers action with default key bindings assigned to it.
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (KEYBINDINGDESC*)
+//return: 0 on success, error code otherwise
+#define MS_KEYBINDINGS_REGISTER "KeyBindings/Register"
+//Gets action assigned to the given key
+//key[0] and pszActionGroup in KEYBINDINGDESC should be set before calling this service
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (KEYBINDINGDESC*)
+//return: 0 if action assigned to the given key was found, 1 otherwise
+#define MS_KEYBINDINGS_GET "KeyBindings/Get"
diff --git a/include/m_langpack.h b/include/m_langpack.h new file mode 100644 index 0000000000..946d2a28cd --- /dev/null +++ b/include/m_langpack.h @@ -0,0 +1,201 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_LANGPACK_H__
+#define M_LANGPACK_H__
+
+#if MIRANDA_VER >= 0x0A00 && !defined( _STATIC )
+ #define MIRANDA_CUSTOM_LP
+#endif
+
+#define LANG_UNICODE 0x1000
+
+//translates a single string into the user's local language v0.1.1.0+
+//wParam=0
+//lParam=(LPARAM)(const char*)szEnglish
+//returns a pointer to the localised string. If there is no known translation
+//it will return szEnglish. The return value does not need to be freed in any
+//way
+//Note that the Translate() macro as defined below will crash plugins that are
+//loaded into Miranda 0.1.0.1 and earlier. If anyone's actually using one of
+//these versions, I pity them.
+#define MS_LANGPACK_TRANSLATESTRING "LangPack/TranslateString"
+
+#if defined( MIRANDA_CUSTOM_LP )
+
+extern int hLangpack;
+
+__inline static char* Translate(const char* str)
+{ return (char*)CallService(MS_LANGPACK_TRANSLATESTRING,hLangpack,(LPARAM)(str));
+}
+
+__inline static WCHAR* TranslateW(const WCHAR* str)
+{ return (WCHAR*)CallService(MS_LANGPACK_TRANSLATESTRING,hLangpack+LANG_UNICODE,(LPARAM)(str));
+}
+
+#else
+
+__inline static char* Translate(const char* str)
+{ return (char*)CallService(MS_LANGPACK_TRANSLATESTRING,0,(LPARAM)(str));
+}
+
+__inline static WCHAR* TranslateW(const WCHAR* str)
+{ return (WCHAR*)CallService(MS_LANGPACK_TRANSLATESTRING,LANG_UNICODE,(LPARAM)(str));
+}
+
+#endif
+
+#ifdef _UNICODE
+ #define TranslateT(s) TranslateW(_T(s))
+ #define TranslateTS(s) TranslateW(s)
+#else
+ #define TranslateT(s) Translate(s)
+ #define TranslateTS(s) Translate(s)
+#endif
+
+// If you're storing some string for calling later-on Translate or using it
+// with an API call that does translation automatically marked with
+// [TRANSLATED-BY-CORE] please wrap it with one of LPGEN macros in order to
+// generate proper language pack.
+#define LPGEN(s) s
+#define LPGENW(s) L ## s
+#ifdef _UNICODE
+ #define LPGENT(s) _T(s)
+#else
+ #define LPGENT(s) s
+#endif
+//Those macros do NOTHING. They are just markers for lpgen.pl.
+
+//translates a dialog into the user's local language v0.1.1.0+
+//wParam=0
+//lParam=(LPARAM)(LANGPACKTRANSLATEDIALOG*)&lptd
+//returns 0 on success, nonzero on failure
+//This service only knows about the following controls:
+//Window titles, STATIC, EDIT, Hyperlink, BUTTON
+typedef struct {
+ int cbSize;
+ DWORD flags;
+ HWND hwndDlg;
+ const int *ignoreControls; //zero-terminated list of control IDs *not* to
+ //translate
+} LANGPACKTRANSLATEDIALOG;
+#define LPTDF_NOIGNOREEDIT 1 //translate all edit controls. By default
+ //non-read-only edit controls are not translated
+#define LPTDF_NOTITLE 2 //do not translate the title of the dialog
+
+#define MS_LANGPACK_TRANSLATEDIALOG "LangPack/TranslateDialog"
+
+#if defined( MIRANDA_CUSTOM_LP )
+
+__inline static INT_PTR TranslateDialogDefault(HWND hwndDlg)
+{
+ LANGPACKTRANSLATEDIALOG lptd;
+ lptd.cbSize=sizeof(lptd);
+ lptd.flags=hLangpack;
+ lptd.hwndDlg=hwndDlg;
+ lptd.ignoreControls=NULL;
+ return CallService(MS_LANGPACK_TRANSLATEDIALOG,0,(LPARAM)&lptd);
+}
+
+#else
+
+__inline static INT_PTR TranslateDialogDefault(HWND hwndDlg)
+{
+ LANGPACKTRANSLATEDIALOG lptd;
+ lptd.cbSize=sizeof(lptd);
+ lptd.flags=0;
+ lptd.hwndDlg=hwndDlg;
+ lptd.ignoreControls=NULL;
+ return CallService(MS_LANGPACK_TRANSLATEDIALOG,0,(LPARAM)&lptd);
+}
+
+#endif
+
+//translates a menu into the user's local language v0.1.1.0+
+//wParam=(WPARAM)(HMENU)hMenu
+//lParam=langpack handle (v.0.10.0+)
+//returns 0 on success, nonzero on failure
+#define MS_LANGPACK_TRANSLATEMENU "LangPack/TranslateMenu"
+
+#if defined( MIRANDA_CUSTOM_LP )
+
+__inline static INT_PTR TranslateMenu(HMENU hMenu)
+{ return CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM)hMenu, hLangpack);
+}
+
+#else
+
+__inline static INT_PTR TranslateMenu(HMENU hMenu)
+{ return CallService(MS_LANGPACK_TRANSLATEMENU, (LPARAM)hMenu, 0);
+}
+
+#endif
+
+//returns the codepage used in the language pack v0.4.3.0+
+//wParam=0
+//lParam=0
+//returns the codepage stated in the langpack, or CP_ACP if no langpack is present
+#define MS_LANGPACK_GETCODEPAGE "LangPack/GetCodePage"
+
+//returns the locale id associated with the language pack v0.4.3.0+
+//wParam=0
+//lParam=0
+//returns the Windows locale id stated in the langpack, or LOCALE_USER_DEFAULT if no langpack is present
+#define MS_LANGPACK_GETLOCALE "LangPack/GetLocale"
+
+//returns the strdup/wcsdup of lparam according to the langpack v0.4.3.0+
+//wParam=langpack handle (v.0.10.0+)
+//lParam=(LPARAM)(char*)source string
+//returns a string converted from char* to TCHAR* using the langpack codepage.
+//This string should be freed using mir_free() then
+#define MS_LANGPACK_PCHARTOTCHAR "LangPack/PcharToTchar"
+
+#if defined( MIRANDA_CUSTOM_LP )
+
+__inline static INT_PTR Langpack_PCharToTChar(const char* str)
+{ return CallService(MS_LANGPACK_PCHARTOTCHAR, hLangpack, (LPARAM)str);
+}
+
+#else
+
+__inline static INT_PTR Langpack_PCharToTChar(const char* str)
+{ return CallService(MS_LANGPACK_PCHARTOTCHAR, 0, (LPARAM)str);
+}
+
+#endif
+
+//initializes the plugin-specific translation context v0.10.0+
+//wParam=pointer to the langpack handle
+//lParam=PLUGININFOEX* of the caller plugin
+//always returns 0
+#define MS_LANGPACK_REGISTER "LangPack/Register"
+
+#if defined( MIRANDA_CUSTOM_LP )
+
+__forceinline void mir_getLP( const PLUGININFOEX* pInfo )
+{ CallService(MS_LANGPACK_REGISTER, (WPARAM)&hLangpack, (LPARAM)pInfo);
+}
+
+#endif
+
+#endif // M_LANGPACK_H__
diff --git a/include/m_message.h b/include/m_message.h new file mode 100644 index 0000000000..4b6a7933c0 --- /dev/null +++ b/include/m_message.h @@ -0,0 +1,173 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_MESSAGE_H__
+#define M_MESSAGE_H__ 1
+
+//brings up the send message dialog for a contact
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=(LPARAM)(char*)szText
+//returns 0 on success or nonzero on failure
+//returns immediately, just after the dialog is shown
+//szText is the text to put in the edit box of the window (but not send)
+//szText=NULL will not use any text
+//szText!=NULL is only supported on v0.1.2.0+
+#define MS_MSG_SENDMESSAGE "SRMsg/SendCommand"
+#define MS_MSG_SENDMESSAGEW "SRMsg/SendCommandW"
+
+#ifdef _UNICODE
+#define MS_MSG_SENDMESSAGET MS_MSG_SENDMESSAGEW
+#else
+#define MS_MSG_SENDMESSAGET MS_MSG_SENDMESSAGE
+#endif
+
+#define ME_MSG_WINDOWEVENT "MessageAPI/WindowEvent"
+//wparam=0
+//lparam=(WPARAM)(MessageWindowEventData*)hWindowEvent;
+//Event types
+#define MSG_WINDOW_EVT_OPENING 1 //window is about to be opened
+#define MSG_WINDOW_EVT_OPEN 2 //window has been opened
+#define MSG_WINDOW_EVT_CLOSING 3 //window is about to be closed
+#define MSG_WINDOW_EVT_CLOSE 4 //window has been closed
+#define MSG_WINDOW_EVT_CUSTOM 5 //custom event for message plugins to use (custom uFlags may be used)
+
+#define MSG_WINDOW_UFLAG_MSG_FROM 0x00000001
+#define MSG_WINDOW_UFLAG_MSG_TO 0x00000002
+#define MSG_WINDOW_UFLAG_MSG_BOTH 0x00000004
+
+typedef struct {
+ int cbSize;
+ HANDLE hContact;
+ HWND hwndWindow; // top level window for the contact
+ const char* szModule; // used to get plugin type (which means you could use local if needed)
+ unsigned int uType; // see event types above
+ unsigned int uFlags; // used to indicate message direction for all event types except custom
+ void *local; // used to store pointer to custom data
+ HWND hwndInput; // input area window for the contact (or NULL if there is none)
+ HWND hwndLog; // log area window for the contact (or NULL if there is none)
+} MessageWindowEventData;
+
+#define MS_MSG_GETWINDOWAPI "MessageAPI/WindowAPI"
+//wparam=0
+//lparam=0
+//Returns a dword with the current message api version
+//Current version is 0,0,0,4
+
+#define MS_MSG_GETWINDOWCLASS "MessageAPI/WindowClass"
+//wparam=(char*)szBuf
+//lparam=(int)cbSize size of buffer
+//Sets the window class name in wParam (ex. "SRMM" for srmm.dll)
+
+typedef struct {
+ int cbSize;
+ HANDLE hContact;
+ int uFlags; // see uflags above
+} MessageWindowInputData;
+
+#define MSG_WINDOW_STATE_EXISTS 0x00000001 // Window exists should always be true if hwndWindow exists
+#define MSG_WINDOW_STATE_VISIBLE 0x00000002
+#define MSG_WINDOW_STATE_FOCUS 0x00000004
+#define MSG_WINDOW_STATE_ICONIC 0x00000008
+
+typedef struct {
+ int cbSize;
+ HANDLE hContact;
+ int uFlags; // should be same as input data unless 0, then it will be the actual type
+ HWND hwndWindow; //top level window for the contact or NULL if no window exists
+ int uState; // see window states
+ void *local; // used to store pointer to custom data
+} MessageWindowData;
+
+#define MS_MSG_GETWINDOWDATA "MessageAPI/GetWindowData"
+//wparam=(MessageWindowInputData*)
+//lparam=(MessageWindowData*)
+//returns 0 on success and returns non-zero (1) on error or if no window data exists for that hcontact
+
+
+#define ME_MSG_WINDOWPOPUP "MessageAPI/WindowPopupRequested"
+// wParam = 0
+// lParam = (MessageWindowPopupData *)&MessageWindowPopupData;
+// Fired to allow plugins to add items to the msg window popup menu
+// Always fired twice: once with MSG_WINDOWPOPUP_SHOWING and once with MSG_WINDOWPOPUP_SELECTED.
+// This is done to allow cleaning of resources.
+#define MSG_WINDOWPOPUP_SHOWING 1
+#define MSG_WINDOWPOPUP_SELECTED 2
+
+#define MSG_WINDOWPOPUP_INPUT 1
+#define MSG_WINDOWPOPUP_LOG 2
+
+typedef struct {
+ int cbSize;
+ unsigned int uType; // see popup types above
+ unsigned int uFlags; // used to indicate in which window the popup was requested
+ HANDLE hContact;
+ HWND hwnd; // window where the popup was requested
+ HMENU hMenu; // The handle to the menu
+ POINT pt; // The point, in screen coords
+ int selection; // The menu control id or 0 if no one was selected
+} MessageWindowPopupData;
+
+// status icons - HICONs will be automatically destroyed when removed or when miranda exits
+
+#define MBF_DISABLED 0x01
+#define MBF_HIDDEN 0x02
+
+typedef struct {
+ int cbSize;
+ char *szModule; // used in combo with the dwId below to create a unique identifier
+ DWORD dwId;
+ HICON hIcon, hIconDisabled; // hIconDisabled is optional - if null, will use hIcon in the disabled state
+ int flags; // bitwize OR of MBF_* flags above
+ char *szTooltip;
+} StatusIconData;
+
+#define MBCF_RIGHTBUTTON 0x01 // if this flag is specified, the click was a right button - otherwize it was a left click
+
+typedef struct {
+ int cbSize;
+ POINT clickLocation; // click location, in screen coordinates
+ char *szModule;
+ DWORD dwId;
+ int flags; // bitwize OR of MBCF_* flags above
+} StatusIconClickData;
+
+#define MS_MSG_ADDICON "MessageAPI/AddIcon"
+// lParam = (StatusIconData *)&StatusIconData
+
+#define MS_MSG_REMOVEICON "MessageAPI/RemoveIcon"
+// lParam = (StatusIconData *)&StatusIconData
+// only szModule and szId are used
+
+#define MS_MSG_MODIFYICON "MessageAPI/ModifyIcon"
+// wParam = (HANDLE)hContact
+// lParam = (StatusIconData *)&StatusIconData
+// if hContact is null, icon is modified for all contacts
+// otherwise, only the flags field is valid
+// if either hIcon, hIconDisabled or szTooltip is null, they will not be modified
+
+#define ME_MSG_ICONPRESSED "MessageAPI/IconPressed"
+// wParam = (HANDLE)hContact;
+// lParam = (StatusIconClickData *)&StatusIconClickData;
+// catch to show a popup menu, etc.
+
+#endif // M_MESSAGE_H__
diff --git a/include/m_modernopt.h b/include/m_modernopt.h new file mode 100644 index 0000000000..02f2d1cdba --- /dev/null +++ b/include/m_modernopt.h @@ -0,0 +1,120 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2007 Artem Shpynov
+Copyright 2000-2007 Miranda ICQ/IM 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_MODERNOPT_H__
+#define M_MODERNOPT_H__ 1
+
+/*
+ 260x210 - subsection
+ 368x210 - section
+*/
+
+#define MS_MODERNOPT_SHOW "ModernOpt/Show"
+
+#define ME_MODERNOPT_INITIALIZE "ModernOpt/Initialize"
+
+#define MODEROPT_FLG_UNICODE 0x01
+#define MODEROPT_FLG_NORESIZE 0x02
+
+#ifdef UNICODE
+ #define MODEROPT_FLG_TCHAR MODEROPT_FLG_UNICODE
+#else
+ #define MODEROPT_FLG_TCHAR 0
+#endif
+
+typedef enum {
+ MODERNOPT_TYPE_SECTIONPAGE,
+ MODERNOPT_TYPE_SUBSECTIONPAGE,
+ MODERNOPT_TYPE_IGNOREOBJECT,
+ MODERNOPT_TYPE_SELECTORPAGE,
+ MODERNOPT_TYPE_COUNT
+};
+
+typedef enum {
+ MODERNOPT_PAGE_HOME,
+ MODERNOPT_PAGE_ACCOUNTS,
+ MODERNOPT_PAGE_SKINS,
+ MODERNOPT_PAGE_CLIST,
+ MODERNOPT_PAGE_MSGS,
+ MODERNOPT_PAGE_IGNORE,
+ MODERNOPT_PAGE_STATUS,
+ MODERNOPT_PAGE_ADVANCED,
+ MODERNOPT_PAGE_MODULES,
+ MODERNOPT_PAGE_COUNT
+};
+
+#define MODERNOPT_CTRL_LAST 0
+
+typedef struct {
+ int cbSize;
+ DWORD dwFlags;
+ int iType;
+ int iSection;
+
+ HICON hIcon;
+ union {
+ TCHAR *lptzSubsection;
+ char *lpzSubsection;
+ WCHAR *lpwzSubsection;
+ };
+
+ // Generic dialog page
+ HINSTANCE hInstance;
+ char *lpzTemplate;
+ DLGPROC pfnDlgProc;
+ int *iBoldControls;
+
+ // General page support
+ char *lpzClassicGroup;
+ char *lpzClassicPage;
+ char *lpzClassicTab;
+ char *lpzHelpUrl;
+
+ // Ingore page
+ char *lpzIgnoreModule;
+ char *lpzIgnoreSetting;
+ DWORD dwIgnoreBit;
+
+ // Selector type page
+ char *lpzThemeExtension;
+ char *lpzThemeModuleName;
+} MODERNOPTOBJECT;
+
+#define MS_MODERNOPT_ADDOBJECT "ModernOpt/AddObject"
+
+#define MS_MODERNOPT_SELECTPAGE "ModernOpt/SelectPage"
+
+#define ME_MODERNINGORE_RELOAD "ModernOpt/Ignore/Reload"
+
+#define TS_SKIN_ACTIVE "/Active"
+
+#define TS_SKIN_PREVIEW "/Preview"
+
+#define TS_SKIN_APPLY "/Apply"
+
+// used by core options module to switch back to modernopt module
+#define MS_MODERNOPT_RESTORE "ModernOpt/Restore"
+
+#endif // M_MODERNOPT_H__
diff --git a/include/m_netlib.h b/include/m_netlib.h new file mode 100644 index 0000000000..06b41c2a2a --- /dev/null +++ b/include/m_netlib.h @@ -0,0 +1,859 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_NETLIB_H__
+#define M_NETLIB_H__ 1
+
+#include "m_utils.h"
+
+//this module was created in 0.1.2.2
+//All error codes are returned via GetLastError() (or WSAGetLastError():
+//they're the same).
+//This module is thread-safe where it is sensible for it to be so. This
+//basically means that you can call anything from any thread, but don't try
+//to predict what will happen if you try to recv() on the same connection from
+//two different threads at the same time.
+//Note that because the vast majority of the routines in this module return
+//a pointer, I have decided to diverge from the rest of Miranda and go with
+//the convention that functions return false on failure and nonzero on success.
+
+struct NETLIBHTTPREQUEST_tag;
+typedef struct NETLIBHTTPREQUEST_tag NETLIBHTTPREQUEST;
+struct NETLIBOPENCONNECTION_tag;
+typedef struct NETLIBOPENCONNECTION_tag NETLIBOPENCONNECTION;
+
+//Initialises the netlib for a set of connections
+//wParam=0
+//lParam=(LPARAM)(NETLIBUSER*)&nu
+//Returns a HANDLE to be used for future netlib calls, NULL on failure
+//NOTE: Netlib is loaded after any plugins, so you need to wait until
+// ME_SYSTEM_MODULESLOADED before calling this function
+//Netlib settings are stored under the module szSettingsModule
+//All netlib settings being with "NL".
+//The default settings for registered users that don't have any settings stored
+//in the database are the same as those displayed by the <All connections> page
+//of the netlib options page.
+//See notes below this function for the behaviour of HTTP gateways
+//Errors: ERROR_INVALID_PARAMETER, ERROR_OUTOFMEMORY, ERROR_DUP_NAME
+typedef int (*NETLIBHTTPGATEWAYINITPROC)(HANDLE hConn,NETLIBOPENCONNECTION *nloc,NETLIBHTTPREQUEST *nlhr);
+typedef int (*NETLIBHTTPGATEWAYBEGINPROC)(HANDLE hConn,NETLIBOPENCONNECTION *nloc);
+typedef int (*NETLIBHTTPGATEWAYWRAPSENDPROC)(HANDLE hConn,PBYTE buf,int len,int flags,MIRANDASERVICE pfnNetlibSend);
+typedef PBYTE (*NETLIBHTTPGATEWAYUNWRAPRECVPROC)(NETLIBHTTPREQUEST *nlhr,PBYTE buf,int len,int *outBufLen,void *(*NetlibRealloc)(void*,size_t));
+typedef struct {
+ int cbSize;
+ char *szSettingsModule; //used for db settings and log
+ union {
+ char *szDescriptiveName; //used in options dialog, already translated
+ TCHAR *ptszDescriptiveName;
+ };
+ DWORD flags;
+ char *szHttpGatewayHello;
+ char *szHttpGatewayUserAgent; //can be NULL to send no user-agent, also used by HTTPS proxies
+ NETLIBHTTPGATEWAYINITPROC pfnHttpGatewayInit;
+ NETLIBHTTPGATEWAYBEGINPROC pfnHttpGatewayBegin; //can be NULL if no beginning required
+ NETLIBHTTPGATEWAYWRAPSENDPROC pfnHttpGatewayWrapSend; //can be NULL if no wrapping required
+ NETLIBHTTPGATEWAYUNWRAPRECVPROC pfnHttpGatewayUnwrapRecv; //can be NULL if no wrapping required
+ int minIncomingPorts; //only if NUF_INCOMING. Will be used for validation of user input.
+} NETLIBUSER;
+#define NUF_INCOMING 0x01 //binds incoming ports
+#define NUF_OUTGOING 0x02 //makes outgoing plain connections
+#define NUF_HTTPGATEWAY 0x04 //can use HTTP gateway for plain sockets. ???HttpGateway* are valid. Enables the HTTP proxy option in options.
+#define NUF_NOOPTIONS 0x08 //don't create an options page for this. szDescriptiveName is never used.
+#define NUF_HTTPCONNS 0x10 //at least some connections are made for HTTP communication. Enables the HTTP proxy option in options.
+#define NUF_NOHTTPSOPTION 0x20 //disable the HTTPS proxy option in options. Use this if all communication is HTTP.
+#define NUF_UNICODE 0x40 //if set ptszDescriptiveName points to Unicode, otherwise it points to ANSI string
+#define MS_NETLIB_REGISTERUSER "Netlib/RegisterUser"
+
+#if defined(_UNICODE)
+ #define NUF_TCHAR NUF_UNICODE
+#else
+ #define NUF_TCHAR 0
+#endif
+
+
+
+//Assign a Netlib user handle a set of dynamic HTTP headers to be used with all
+//
+//HTTP connections that enable the HTTP-use-sticky headers flag.
+//The headers persist until cleared with lParam=NULL.
+//
+//All memory should be allocated by the caller using malloc() from MS_SYSTEM_GET_MMI
+//Once it has passed to Netlib, Netlib is the owner of it, the caller should not refer to the memory
+//In any way after this point.
+//
+//wParam=(WPARAM)hNetLibUser
+//lParam=(LPARAM)(char*)szHeaders
+//
+//NOTE: The szHeaders parameter should be a NULL terminated string following the HTTP header syntax.
+//This string will be injected verbatim, thus the user should be aware of setting strings that are not
+//headers. This service is NOT THREAD SAFE, only a single thread is expected to set the headers and a single
+//thread reading the pointer internally, stopping race conditions and mutual exclusion don't happen.
+//
+//Version 0.3.2a+ (2003/10/27)
+//
+#define MS_NETLIB_SETSTICKYHEADERS "Netlib/SetStickyHeaders"
+
+/* Notes on HTTP gateway usage
+When a connection is initiated through an HTTP proxy using
+MS_NETLIB_OPENCONNECTION, netlib will GET nlu.szHttpGatewayHello and read
+the replied headers. Once this succeeds nlu.pfnHttpGatewayInit will be called
+with a valid handle to the connection, the NETLIBOPENCONNECTION structure that
+MS_NETLIB_OPENCONNECTION was called with, and the replied HTTP headers as its
+parameters. This function is responsible for recving and parsing the data then
+calling MS_NETLIB_SETHTTPPROXYINFO with the appropriate information.
+nlu.pfnHttpGatewayInit should return nonzero on success. If it returns zero
+then the entire connection attempt will return signalling failure. If your
+function needs to return an error code it can do so via SetLastError().
+If nlu.pfnHttpGatewayInit returns success without having called
+MS_NETLIB_SETHTTPPROXYINFO then the connection attempt will fail anyway.
+If you need more fine-tuned control over the GET/POST URLs than just appending
+sequence numbers you can call MS_NETLIB_SETHTTPPROXYINFO from within your
+wrap/unwrap functions (see below).
+
+Just prior to MS_NETLIB_OPENCONNECTION returning nlu.pfnHttpGatewayBegin is
+called with the handle to the connection and the NETLIBOPENCONNECTION structure
+as its parameters. This is for gateways that need special non-protocol
+initialisation. If you do send any packets in this function, you probably want
+to remember to use the MSG_NOHTTPGATEWAYWRAP flag. This function pointer can be
+NULL if this functionality isn't needed. This function must return nonzero on
+success. If it fails the connect attempt will return failure without changing
+LastError.
+
+Whenever MS_NETLIB_SEND is called on a connection through an HTTP proxy and
+the MSG_NOHTTPGATEWAYWRAP flags is not set and nlu.pfnHttpGatewayWrapSend is
+not NULL, nlu.pfnHttpGatewayWrapSend will be called *instead* of sending the
+data. It is this function's responsibility to wrap the sending data
+appropriately for transmission and call pfnNetlibSend to send it again.
+The flags parameter to nlu.pfnHttpGatewayWrapSend should be passed straight
+through to the pfnNetlibSend call. It has already been ORed with
+MSG_NOHTTPGATEWAYWRAP. nlu.pfnHttpGatewayWrapSend should return the a
+number of the same type as MS_NETLIB_SEND, ie the number of bytes sent or
+SOCKET_ERROR. The number of wrapping bytes should be subtracted so that the
+return value appears as if the proxy wasn't there.
+pfnNetlibSend() is identical to CallService(MS_NETLIB_SEND,...) but it's
+quicker to call using this pointer than to do the CallService() lookup again.
+
+Whenever an HTTP reply is received inside MS_NETLIB_RECV the headers and data
+are read into memory. If the headers indicate success then the data is passed
+to nlu.pfnHttpGatewayUnwrapRecv (if it's non-NULL) for processing. This
+function should remove (and do other processing if necessary) all HTTP proxy
+specific headers and return a pointer to the buffer whose size is returned in
+*outBufLen. If the buffer needs to be resized then NetlibRealloc() should be
+used for that purpose, *not* your own CRT's realloc(). NetlibRealloc() behaves
+identically to realloc() so it's possible to free the original buffer and
+create a new one if that's the most sensible way to write your parser.
+If errors are encountered you should SetLastError() and return NULL;
+MS_NETLIB_RECV will return SOCKET_ERROR. If the passed buffer unwraps to
+contain no actual data you should set *outBufLen to 0 but make sure you return
+some non-NULL buffer that can be freed.
+
+When you call MS_NETLIB_SEND or MS_NETLIB_RECV from any of these functions, you
+should use the MSG_DUMPPROXY flag so that the logging is neat.
+*/
+
+//Gets the user-configured settings for a netlib user
+//wParam=(WPARAM)(HANDLE)hUser
+//lParam=(LPARAM)(NETLIBUSERSETTINGS*)&nlus
+//Returns nonzero on success, 0 on failure (!! this is different to most of the rest of Miranda, but consistent with netlib)
+//The pointers referred to in the returned struct will remain valid until
+//the hUser handle is closed, or until the user changes the settings in the
+//options page, so it's best not to rely on them for too long.
+//Errors: ERROR_INVALID_PARAMETER
+#define PROXYTYPE_SOCKS4 1
+#define PROXYTYPE_SOCKS5 2
+#define PROXYTYPE_HTTP 3
+#define PROXYTYPE_HTTPS 4
+#define PROXYTYPE_IE 5
+typedef struct {
+ int cbSize; // to be filled in before calling
+ int useProxy; // 1 or 0
+ int proxyType; // a PROXYTYPE_
+ char *szProxyServer; // can be NULL
+ int wProxyPort; // host byte order
+ int useProxyAuth; // 1 or 0. Always 0 for SOCKS4
+ char *szProxyAuthUser; // can be NULL, always used by SOCKS4
+ char *szProxyAuthPassword; // can be NULL
+ int useProxyAuthNtlm; // 1 or 0, only used by HTTP, HTTPS
+ int dnsThroughProxy; // 1 or 0
+ int specifyIncomingPorts; // 1 or 0
+ char *szIncomingPorts; // can be NULL. Of form "1024-1050,1060-1070,2000"
+ int specifyOutgoingPorts; // 0.3.3a+
+ char *szOutgoingPorts; // 0.3.3a+
+ int enableUPnP; // 0.6.1+ only for NUF_INCOMING
+ int validateSSL;
+} NETLIBUSERSETTINGS;
+#define MS_NETLIB_GETUSERSETTINGS "Netlib/GetUserSettings"
+
+//Changes the user-configurable settings for a netlib user
+//wParam=(WPARAM)(HANDLE)hUser
+//lParam=(LPARAM)(NETLIBUSERSETTINGS*)&nlus
+//Returns nonzero on success, 0 on failure (!! this is different to most of the rest of Miranda, but consistent with netlib)
+//This function is only really useful for people that specify NUF_NOOPTIONS
+//and want to create their own options.
+//Even if a setting is not active (eg szProxyAuthPassword when useProxyAuth is
+//zero) that settings is still set for use in the options dialog.
+//Errors: ERROR_INVALID_PARAMETER
+#define MS_NETLIB_SETUSERSETTINGS "Netlib/SetUserSettings"
+
+//Closes a netlib handle
+//wParam=(WPARAM)(HANDLE)hNetlibHandle
+//lParam=0
+//Returns nonzero on success, 0 on failure (!! this is different to most of the rest of Miranda, but consistent with netlib)
+//This function should be called on all handles returned by netlib functions
+//once you are done with them. If it's called on a socket-type handle, the
+//socket will be closed.
+//Errors: ERROR_INVALID_PARAMETER
+#define MS_NETLIB_CLOSEHANDLE "Netlib/CloseHandle"
+__inline static INT_PTR Netlib_CloseHandle(HANDLE h) {return CallService(MS_NETLIB_CLOSEHANDLE,(WPARAM)h,0);}
+
+//Open a port and wait for connections on it
+//wParam=(WPARAM)(HANDLE)hUser
+//lParam=(LPARAM)(NETLIBBIND*)&nlb
+//Returns a HANDLE on success, NULL on failure
+//hUser should have been returned by MS_NETLIB_REGISTERUSER
+//This function does the equivalent of socket(), bind(), getsockname(),
+//listen(), accept()
+//Internally this function creates a new thread which waits around in accept()
+//for new connections. When one is received it calls nlb.pfnNewConnection *from
+//this new thread* and then loops back to wait again.
+//Close the returned handle to end the thread and close the open port.
+//Errors: ERROR_INVALID_PARAMETER, any returned by socket() or bind() or
+// listen() or getsockname()
+//
+// Notes:
+//
+// During development of 0.3.1a+ (2003/07/04) passing wPort != 0
+// will result in an attempt to bind on the port given in wPort
+// if this port is taken then you will get an error, so be sure to check
+// for such conditions.
+//
+// passing wPort != 0 is for people who need to open a set port for
+// daemon activities, usually passing wPort==0 is what you want and
+// will result in a free port given by the TCP/IP socket layer and/or
+// seeded from the user selected port ranges.
+//
+// also note that wPort if != 0, will have be converted to network byte order
+//
+/* pExtra was added during 0.3.4+, prior its just two args, since we use the cdecl convention
+it shouldnt matter */
+
+#define NETLIBBIND_SIZEOF_V1 16 // sizeof(NETLIBBIND) prior to 0.3.4+ (2004/08/05)
+#define NETLIBBIND_SIZEOF_V2 20 // sizeof(NETLIBBIND) prior to 0.6+ (2006/07/03)
+
+typedef void (*NETLIBNEWCONNECTIONPROC_V2)(HANDLE hNewConnection,DWORD dwRemoteIP, void * pExtra);
+typedef void (*NETLIBNEWCONNECTIONPROC)(HANDLE hNewConnection,DWORD dwRemoteIP);
+/* This is NETLIBBIND prior to 2004/08/05+, DONT use this anymore unless you want to work
+with older cores, pExtra isnt available on older cores and never will be - for a period of time, the ABI
+for this service was broken and older NETLIBBINDs were not supported, if NULL is returned and the
+argument is good, then tell the user to upgrade to the latest CVS.
+
+The older structure was used til around 2004/08/05 */
+typedef struct {
+ int cbSize;
+ NETLIBNEWCONNECTIONPROC pfnNewConnection;
+ //function to call when there's a new connection. Params are: the
+ //new connection, IP of remote machine (host byte order)
+ DWORD dwInternalIP; //set on return, host byte order
+ WORD wPort; //set on return, host byte order
+} NETLIBBINDOLD;
+
+typedef struct {
+ int cbSize;
+ union { // new code should use V2
+ NETLIBNEWCONNECTIONPROC pfnNewConnection;
+ NETLIBNEWCONNECTIONPROC_V2 pfnNewConnectionV2;
+ };
+ //function to call when there's a new connection. Params are: the
+ //new connection, IP of remote machine (host byte order)
+ DWORD dwInternalIP; //set on return, host byte order
+ WORD wPort; //set on return, host byte order
+ void * pExtra; //argument is sent to callback, added during 0.3.4+
+ DWORD dwExternalIP; //set on return, host byte order
+ WORD wExPort; //set on return, host byte order
+} NETLIBBIND;
+#define MS_NETLIB_BINDPORT "Netlib/BindPort"
+
+//Open a connection
+//wParam=(WPARAM)(HANDLE)hUser
+//lParam=(LPARAM)(NETLIBOPENCONNECTION*)&nloc
+//Returns a HANDLE to the new connection on success, NULL on failure
+//hUser must have been returned by MS_NETLIB_REGISTERUSER
+//Internally this function is the equivalent of socket(), gethostbyname(),
+//connect()
+//If NLOCF_HTTP is set and hUser is configured for an HTTP or HTTPS proxy then
+//this function will connect() to the proxy server only, without performing any
+//initialisation conversation.
+//If hUser is configured for an HTTP proxy and does not support HTTP gateways
+//and you try to open a connection without specifying NLOCF_HTTP then this
+//function will first attempt to open an HTTPS connection, if that fails it
+//will try a direct connection, if that fails it will return failure with the
+//error from the connect() during the direct connection attempt.
+//Errors: ERROR_INVALID_PARAMETER, any returned by socket(), gethostbyname(),
+// connect(), MS_NETLIB_SEND, MS_NETLIB_RECV, select()
+// ERROR_TIMEOUT (during proxy communication)
+// ERROR_BAD_FORMAT (very invalid proxy reply)
+// ERROR_ACCESS_DENIED (by proxy)
+// ERROR_CONNECTION_UNAVAIL (socks proxy can't connect to identd)
+// ERROR_INVALID_ACCESS (proxy refused identd auth)
+// ERROR_INVALID_DATA (proxy returned invalid code)
+// ERROR_INVALID_ID_AUTHORITY (proxy requires use of auth method that's not supported)
+// ERROR_GEN_FAILURE (socks5/https general failure)
+// ERROR_CALL_NOT_IMPLEMENTED (socks5 command not supported)
+// ERROR_INVALID_ADDRESS (socks5 address type not supported)
+// HTTP: anything from nlu.pfnHttpGatewayInit, nlu.pfnHttpGatewayBegin,
+// MS_NETLIB_SENDHTTPREQUEST or MS_NETLIB_RECVHTTPHEADERS
+#define NLOCF_HTTP 0x0001 //this connection will be used for HTTP communications. If configured for an HTTP/HTTPS proxy the connection is opened as if there was no proxy.
+#define NLOCF_STICKYHEADERS 0x0002 //this connection should send the sticky headers associated with NetLib user apart of any HTTP request
+#define NLOCF_V2 0x0004 //this connection understands the newer structure, newer cbSize isnt enough
+#define NLOCF_UDP 0x0008 // this connection is UDP
+#define NLOCF_SSL 0x0010 // this connection is SSL
+#define NLOCF_HTTPGATEWAY 0x0020 // this connection is HTTP Gateway
+
+/* Added during 0.4.0+ development!! (2004/11/29) prior to this, connect() blocks til a connection is made or
+a hard timeout is reached, this can be anywhere between 30-60 seconds, and it stops Miranda from unloading whilst
+this is attempted, clearing sucking - so now you can set a timeout of any value, there is still a hard limit which is
+always reached by Windows, If a timeout occurs, or Miranda is exiting then you will get ERROR_TIMEOUT as soon as possible.
+*/
+#define NETLIBOPENCONNECTION_V1_SIZE 16 /* old sizeof() is 14 bytes, but there is padding of 2 bytes */
+struct NETLIBOPENCONNECTION_tag {
+ int cbSize;
+ const char *szHost; //can contain the string representation of an IP
+ WORD wPort; //host byte order
+ DWORD flags;
+ unsigned int timeout;
+ /* optional, called in the context of the thread that issued the attempt, if it returns 0 the connection attempt is
+ stopped, the remaining timeout value can also be adjusted */
+ int (*waitcallback) (unsigned int * timeout);
+};
+//typedef struct NETLIBOPENCONNECTION_tag NETLIBOPENCONNECTION; //(above for reasons of forward referencing)
+#define MS_NETLIB_OPENCONNECTION "Netlib/OpenConnection"
+
+//Sets the required information for an HTTP proxy connection
+//wParam=(WPARAM)(HANDLE)hConnection
+//lParam=(LPARAM)(NETLIBHTTPPROXYINFO*)&nlhpi
+//Returns nonzero on success, 0 on failure (!! this is different to most of the rest of Miranda, but consistent with netlib)
+//This function is designed to be called from within pfnHttpGatewayInit
+//See notes below MS_NETLIB_REGISTERUSER.
+//Errors: ERROR_INVALID_PARAMETER
+#define NLHPIF_USEGETSEQUENCE 0x0001 //append sequence numbers to GET requests
+#define NLHPIF_USEPOSTSEQUENCE 0x0002 //append sequence numbers to POST requests
+#define NLHPIF_GETPOSTSAMESEQUENCE 0x0004 //GET and POST use the same sequence
+#define NLHPIF_HTTP11 0x0008 //HTTP 1.1 proxy
+typedef struct {
+ int cbSize;
+ DWORD flags;
+ char *szHttpPostUrl;
+ char *szHttpGetUrl;
+ int firstGetSequence,firstPostSequence;
+#if MIRANDA_VER >= 0x0900
+ int combinePackets;
+#endif
+} NETLIBHTTPPROXYINFO;
+#define MS_NETLIB_SETHTTPPROXYINFO "Netlib/SetHttpProxyInfo"
+
+//Gets the SOCKET associated with a netlib handle
+//wParam=(WPARAM)(HANDLE)hNetlibHandle
+//lParam=0
+//Returns the SOCKET on success, INVALID_SOCKET on failure
+//hNetlibHandle should have been returned by MS_NETLIB_BINDPORT or
+//MS_NETLIB_OPENCONNECTION only.
+//Be careful how you use this socket because you might be connected via an
+//HTTP proxy in which case calling send() or recv() will totally break things.
+//Errors: ERROR_INVALID_PARAMETER
+#define MS_NETLIB_GETSOCKET "Netlib/GetSocket"
+
+//URL-encode a string for x-www-form-urlencoded (and other) transmission
+//wParam=0
+//lParam=(LPARAM)(const char *)pszString
+//Returns a char* containing the new string. This must be freed with
+//HeapFree(GetProcessHeap(),0,pszReturnString) when you're done with it.
+//Returns NULL on error.
+//Errors: ERROR_INVALID_PARAMETER, ERROR_OUTOFMEMORY
+#define MS_NETLIB_URLENCODE "Netlib/UrlEncode"
+
+//Base64 decode a string. See rfc1421.
+//wParam=0
+//lParam=(LPARAM)(NETLIBBASE64*)&nlb64
+//Returns nonzero on success, 0 on failure (!! this is different to most of the rest of Miranda, but consistent with netlib)
+//nlb64.pszEncoded and nlb64.cchEncoded contain the input string and its length
+//(excluding terminating zero).
+//nlb64.pbDecoded and nlb64.cbDecoded contain the buffer in which to put the
+//output and the length of this buffer. The maximum output size for a given
+//input is available from the macro Netlib_GetBase64DecodedBufferSize() below.
+//On return nlb64.cbDecoded is set to the actual length of the decoded data.
+//Errors: ERROR_INVALID_PARAMETER, ERROR_INVALID_DATA, ERROR_BUFFER_OVERFLOW
+typedef struct {
+ char *pszEncoded;
+ int cchEncoded;
+ PBYTE pbDecoded;
+ int cbDecoded;
+} NETLIBBASE64;
+#define Netlib_GetBase64DecodedBufferSize(cchEncoded) (((cchEncoded)>>2)*3)
+#define MS_NETLIB_BASE64DECODE "Netlib/Base64Decode"
+
+//Base64 encode a string. See rfc1421.
+//wParam=0
+//lParam=(LPARAM)(NETLIBBASE64*)&nlb64
+//Returns nonzero on success, 0 on failure (!! this is different to most of the rest of Miranda, but consistent with netlib)
+//nlb64.pbDecoded and nlb64.cbDecoded contain the input buffer and its length
+//nlb64.pszEncoded and nlb64.cchEncoded contain the buffer in which to put the
+//output and the length of this buffer. The maximum output size for a given
+//input is available from the macro Netlib_GetBase64EncodedBufferSize() below.
+//nlb64.pszEncoded is terminated with a 0.
+//On return nlb64.cchEncoded is set to the actual length of the decoded data,
+//excluding the terminating 0.
+//Errors: ERROR_INVALID_PARAMETER, ERROR_BUFFER_OVERFLOW
+#define Netlib_GetBase64EncodedBufferSize(cbDecoded) (((cbDecoded)*4+11)/12*4+1)
+#define MS_NETLIB_BASE64ENCODE "Netlib/Base64Encode"
+
+//Send an HTTP request over a connection
+//wParam=(WPARAM)(HANDLE)hConnection
+//lParam=(LPARAM)(NETLIBHTTPREQUEST*)&nlhr
+//Returns number of bytes sent on success, SOCKET_ERROR on failure
+//hConnection must have been returned by MS_NETLIB_OPENCONNECTION
+//Note that if you use NLHRF_SMARTAUTHHEADER and NTLM authentication is in use
+//then the full NTLM authentication transaction occurs, comprising sending the
+//domain, receiving the challenge, then sending the response.
+//nlhr.resultCode and nlhr.szResultDescr are ignored by this function.
+//Errors: ERROR_INVALID_PARAMETER, anything returned by MS_NETLIB_SEND
+typedef struct {
+ char *szName;
+ char *szValue;
+} NETLIBHTTPHEADER;
+
+#define REQUEST_RESPONSE 0 //used by structure returned by MS_NETLIB_RECVHTTPHEADERS
+#define REQUEST_GET 1
+#define REQUEST_POST 2
+#define REQUEST_CONNECT 3
+#define REQUEST_HEAD 4 // new in 0.5.1
+#define REQUEST_PUT 5
+#define REQUEST_DELETE 6
+
+#define NLHRF_GENERATEHOST 0x00000001 //auto-generate a "Host" header from szUrl
+#define NLHRF_REMOVEHOST 0x00000002 //remove any host and/or protocol portion of szUrl before sending it
+#define NLHRF_SMARTREMOVEHOST 0x00000004 //removes host and/or protocol from szUrl unless the connection was opened through an HTTP or HTTPS proxy.
+#define NLHRF_SMARTAUTHHEADER 0x00000008 //if the connection was opened through an HTTP or HTTPS proxy then send a Proxy-Authorization header if required.
+#define NLHRF_HTTP11 0x00000010 //use HTTP 1.1
+#define NLHRF_PERSISTENT 0x00000020 //preserve connection on exit, open connection provided in the nlc field of the reply
+ //it should be supplied in nlc field of request for reuse or closed if not needed
+#define NLHRF_SSL 0x00000040 //use SSL connection
+#define NLHRF_NOPROXY 0x00000080 //do not use proxy server
+#define NLHRF_REDIRECT 0x00000100 //handle HTTP redirect requests (response 30x), the resulting url provided in szUrl of the response
+#define NLHRF_NODUMP 0x00010000 //never dump this to the log
+#define NLHRF_NODUMPHEADERS 0x00020000 //don't dump http headers (only useful for POSTs and MS_NETLIB_HTTPTRANSACTION)
+#define NLHRF_DUMPPROXY 0x00040000 //this transaction is a proxy communication. For dump filtering only.
+#define NLHRF_DUMPASTEXT 0x00080000 //dump posted and reply data as text. Headers are always dumped as text.
+#define NLHRF_NODUMPSEND 0x00100000 //do not dump sent message.
+struct NETLIBHTTPREQUEST_tag {
+ int cbSize;
+ int requestType; //a REQUEST_
+ DWORD flags;
+ char *szUrl;
+ NETLIBHTTPHEADER *headers; //If this is a POST request and headers
+ //doesn't contain a Content-Length it'll be added automatically
+ int headersCount;
+ char *pData; //data to be sent in POST request.
+ int dataLength; //must be 0 for REQUEST_GET/REQUEST_CONNECT
+ int resultCode;
+ char *szResultDescr;
+ HANDLE nlc;
+ int timeout;
+};
+
+#define NETLIBHTTPREQUEST_V1_SIZE (offsetof(NETLIBHTTPREQUEST_tag, timeout))
+//typedef struct NETLIBHTTPREQUEST_tag NETLIBHTTPREQUEST; //(above for reasons of forward referencing)
+#define MS_NETLIB_SENDHTTPREQUEST "Netlib/SendHttpRequest"
+
+//Receive HTTP headers
+//wParam=(WPARAM)(HANDLE)hConnection
+//lParam=0
+//Returns a pointer to a NETLIBHTTPREQUEST structure on success, NULL on
+//failure.
+//Call MS_NETLIB_FREEHTTPREQUESTSTRUCT to free this.
+//hConnection must have been returned by MS_NETLIB_OPENCONNECTION
+//nlhr->pData=NULL and nlhr->dataLength=0 always. The requested data should
+//be retrieved using MS_NETLIB_RECV once the header has been parsed.
+//If the headers haven't finished within 60 seconds the function returns NULL
+//and ERROR_TIMEOUT.
+//Errors: ERROR_INVALID_PARAMETER, any from MS_NETLIB_RECV or select()
+// ERROR_HANDLE_EOF (connection closed before headers complete)
+// ERROR_TIMEOUT (headers still not complete after 60 seconds)
+// ERROR_BAD_FORMAT (invalid character or line ending in headers, or first line is blank)
+// ERROR_BUFFER_OVERFLOW (each header line must be less than 4096 chars long)
+// ERROR_INVALID_DATA (first header line is malformed ("http/[01].[0-9] [0-9]+ .*", or no colon in subsequent line)
+#define MS_NETLIB_RECVHTTPHEADERS "Netlib/RecvHttpHeaders"
+
+//Free the memory used by a NETLIBHTTPREQUEST structure
+//wParam=0
+//lParam=(LPARAM)(NETLIBHTTPREQUEST*)pnlhr
+//Returns nonzero on success, 0 on failure (!! this is different to most of the rest of Miranda, but consistent with netlib)
+//This should only be called on structures returned by
+//MS_NETLIB_RECVHTTPHEADERS or MS_NETLIB_HTTPTRANSACTION. Calling it on an
+//arbitrary structure will have disastrous results.
+//Errors: ERROR_INVALID_PARAMETER
+#define MS_NETLIB_FREEHTTPREQUESTSTRUCT "Netlib/FreeHttpRequestStruct"
+
+//Do an entire HTTP transaction
+//wParam=(WPARAM)(HANDLE)hUser
+//lParam=(LPARAM)(NETLIBHTTPREQUEST*)&nlhr
+//Returns a pointer to another NETLIBHTTPREQUEST structure on success, NULL on
+//failure.
+//Call MS_NETLIB_FREEHTTPREQUESTSTRUCT to free this.
+//hUser must have been returned by MS_NETLIB_REGISTERUSER
+//nlhr.szUrl should be a full HTTP URL. If it does not start with http://, that
+//will be assumed (but it's best not to use this fact, for reasons of
+//extensibility).
+//This function is the equivalent of MS_NETLIB_OPENCONNECTION,
+//MS_NETLIB_SENDHTTPREQ, MS_NETLIB_RECVHTTPHEADERS, MS_NETLIB_RECV,
+//MS_NETLIB_CLOSEHANDLE
+//nlhr.headers will be augmented with the following headers unless they have
+//already been set by the caller:
+// "Host" (regardless of whether it is requested in nlhr.flags)
+// "User-Agent" (of the form "Miranda/0.1.2.2 (alpha)" or "Miranda/0.1.2.2")
+// "Content-Length" (for POSTs only. Set to nlhr.dataLength)
+//If you do not want to send one of these headers, create a nlhr.headers with
+//szValue=NULL.
+//In the return value headers, headerCount, pData, dataLength, resultCode and
+//szResultDescr are all valid.
+//In the return value pData[dataLength]==0 always, as an extra safeguard
+//against programming slips.
+//Note that the function can succeed (ie not return NULL) yet result in an HTTP
+//error code. You should check that resultCode==2xx before proceeding.
+//Errors: ERROR_INVALID_PARAMETER, ERROR_OUTOFMEMORY, anything from the above
+// list of functions
+#define MS_NETLIB_HTTPTRANSACTION "Netlib/HttpTransaction"
+
+//Send data over a connection
+//wParam=(WPARAM)(HANDLE)hConnection
+//lParam=(LPARAM)(NETLIBBUFFER*)&nlb
+//Returns the number of bytes sent on success, SOCKET_ERROR on failure
+//Errors: ERROR_INVALID_PARAMETER
+// anything from send(), nlu.pfnHttpGatewayWrapSend()
+// HTTP proxy: ERROR_GEN_FAILURE (http result code wasn't 2xx)
+// anything from socket(), connect(),
+// MS_NETLIB_SENDHTTPREQUEST, MS_NETLIB_RECVHTTPHEADERS
+//flags:
+#define MSG_NOHTTPGATEWAYWRAP 0x010000 //don't wrap the outgoing packet using nlu.pfnHttpGatewayWrapSend
+#define MSG_NODUMP 0x020000 //don't dump this packet to the log
+#define MSG_DUMPPROXY 0x040000 //this is proxy communiciation. For dump filtering only.
+#define MSG_DUMPASTEXT 0x080000 //this is textual data, don't dump as hex
+#define MSG_RAW 0x100000 //send as raw data, bypass any HTTP proxy stuff
+#define MSG_DUMPSSL 0x200000 //this is SSL traffic. For dump filtering only.
+typedef struct {
+ char *buf;
+ int len;
+ int flags;
+} NETLIBBUFFER;
+#define MS_NETLIB_SEND "Netlib/Send"
+static __inline INT_PTR Netlib_Send(HANDLE hConn,const char *buf,int len,int flags) {
+ NETLIBBUFFER nlb={(char*)buf,len,flags};
+ return CallService(MS_NETLIB_SEND,(WPARAM)hConn,(LPARAM)&nlb);
+}
+
+//Receive data over a connection
+//wParam=(WPARAM)(HANDLE)hConnection
+//lParam=(LPARAM)(NETLIBBUFFER*)&nlb
+//Returns the number of bytes read on success, SOCKET_ERROR on failure,
+//0 if the connection has been closed
+//Flags supported: MSG_PEEK, MSG_NODUMP, MSG_DUMPPROXY, MSG_NOHTTPGATEWAYWRAP,
+// MSG_DUMPASTEXT, MSG_RAW
+//On using MSG_NOHTTPGATEWAYWRAP: Because packets through an HTTP proxy are
+// batched and cached and stuff, using this flag is not a guarantee that it
+// will be obeyed, and if it is it may even be propogated to future calls
+// even if you don't specify it then. Because of this, the flag should be
+// considered an all-or-nothing thing: either use it for the entire duration
+// of a connection, or not at all.
+//Errors: ERROR_INVALID_PARAMETER, anything from recv()
+// HTTP proxy: ERROR_GEN_FAILURE (http result code wasn't 2xx)
+// ERROR_INVALID_DATA (no Content-Length header in reply)
+// ERROR_NOT_ENOUGH_MEMORY (Content-Length very large)
+// ERROR_HANDLE_EOF (connection closed before Content-Length bytes recved)
+// anything from select(), MS_NETLIB_RECVHTTPHEADERS,
+// nlu.pfnHttpGatewayUnwrapRecv, socket(), connect(),
+// MS_NETLIB_SENDHTTPREQUEST
+#define MS_NETLIB_RECV "Netlib/Recv"
+static __inline INT_PTR Netlib_Recv(HANDLE hConn,char *buf,int len,int flags) {
+ NETLIBBUFFER nlb={buf,len,flags};
+ return CallService(MS_NETLIB_RECV,(WPARAM)hConn,(LPARAM)&nlb);
+}
+
+//Determine the status of one or more connections
+//wParam=0
+//lParam=(LPARAM)(NETLIBSELECT*)&nls
+//Returns the number of ready connections, SOCKET_ERROR on failure,
+//0 if the timeout expired.
+//All handles passed to this function must have been returned by either
+//MS_NETLIB_OPENCONNECTION or MS_NETLIB_BINDPORT.
+//The last handle in each list must be followed by either NULL or
+//INVALID_HANDLE_VALUE.
+//Errors: ERROR_INVALID_HANDLE, ERROR_INVALID_DATA, anything from select()
+typedef struct {
+ int cbSize;
+ DWORD dwTimeout; //in milliseconds, INFINITE is acceptable
+ HANDLE hReadConns[FD_SETSIZE+1];
+ HANDLE hWriteConns[FD_SETSIZE+1];
+ HANDLE hExceptConns[FD_SETSIZE+1];
+} NETLIBSELECT;
+
+typedef struct {
+ int cbSize;
+ DWORD dwTimeout; //in milliseconds, INFINITE is acceptable
+ HANDLE hReadConns[FD_SETSIZE+1];
+ HANDLE hWriteConns[FD_SETSIZE+1];
+ HANDLE hExceptConns[FD_SETSIZE+1];
+ /* Added in v0.3.3+ */
+ BOOL hReadStatus[FD_SETSIZE+1]; /* out, [in, expected to be FALSE] */
+ BOOL hWriteStatus[FD_SETSIZE+1]; /* out, [in, expected to be FALSE] */
+ BOOL hExceptStatus[FD_SETSIZE+1]; /* out, [in, expected to be FALSE] */
+} NETLIBSELECTEX;
+
+#define MS_NETLIB_SELECT "Netlib/Select"
+// added in v0.3.3
+#define MS_NETLIB_SELECTEX "Netlib/SelectEx"
+
+//Shutdown connection
+//wParam=(WPARAM)(HANDLE)hConnection
+//lParam=(LPARAM)0
+//Returns 0
+#define MS_NETLIB_SHUTDOWN "Netlib/Shutdown"
+__inline static void Netlib_Shutdown(HANDLE h) {CallService(MS_NETLIB_SHUTDOWN,(WPARAM)h,0);}
+
+//Create a packet receiver
+//wParam=(WPARAM)(HANDLE)hConnection
+//lParam=(LPARAM)(int)maxPacketSize
+//Returns a HANDLE on success, NULL on failure
+//The packet receiver implements the common situation where you have variable
+//length packets coming in over a connection and you want to split them up
+//in order to handle them.
+//The major limitation is that the buffer is created in memory, so you can't
+//have arbitrarily large packets.
+//Errors: ERROR_INVALID_PARAMETER, ERROR_OUTOFMEMORY
+#define MS_NETLIB_CREATEPACKETRECVER "Netlib/CreatePacketRecver"
+
+//Get the next set of packets from a packet receiver
+//wParam=(WPARAM)(HANDLE)hPacketRecver
+//lParam=(LPARAM)(NETLIBPACKETRECVER*)&nlpr
+//Returns the total number of bytes available in the buffer, 0 if the
+//connection was closed, SOCKET_ERROR on error.
+//hPacketRecver must have been returned by MS_NETLIB_CREATEPACKETRECVER
+//If nlpr.bytesUsed is set to zero and the buffer is already full up to
+//maxPacketSize, it is assumed that too large a packet has been received. All
+//data in the buffer is discarded and receiving is begun anew. This will
+//probably cause alignment problems so if you think this is likely to happen
+//then you should deal with it yourself.
+//Closing the packet receiver will not close the associated connection, but
+//will discard any bytes still in the buffer, so if you intend to carry on
+//reading from that connection, make sure you have processed the buffer first.
+//This function is the equivalent of a memmove() to remove the first bytesUsed
+//from the buffer, select() if dwTimeout is not INFINITE, then MS_NETLIB_RECV.
+//Errors: ERROR_INVALID_PARAMETER, ERROR_TIMEOUT,
+// anything from select(), MS_NETLIB_RECV
+typedef struct {
+ int cbSize;
+ DWORD dwTimeout; //fill before calling. In milliseconds. INFINITE is valid
+ int bytesUsed; //fill before calling. This many bytes are removed from the start of the buffer. Set to 0 on return
+ int bytesAvailable; //equal to the return value, unless the return value is 0
+ int bufferSize; //same as parameter to MS_NETLIB_CREATEPACKETRECVER
+ BYTE *buffer; //contains the recved data
+} NETLIBPACKETRECVER;
+#define MS_NETLIB_GETMOREPACKETS "Netlib/GetMorePackets"
+
+//Add a message to the log (if it's running)
+//wParam=(WPARAM)(HANDLE)hUser
+//lParam=(LPARAM)(const char *)szMessage
+//Returns nonzero on success, 0 on failure (!! this is different to most of the rest of Miranda, but consistent with netlib)
+//Do not include a final line ending in szMessage.
+//Errors: ERROR_INVALID_PARAMETER
+#define MS_NETLIB_LOG "Netlib/Log"
+#define MS_NETLIB_LOGW "Netlib/LogW"
+
+//Sets a gateway polling timeout interval
+//wParam=(WPARAM)(HANDLE)hConn
+//lParam=(LPARAM)timeout
+//Returns previous timeout value
+//Errors: -1
+#define MS_NETLIB_SETPOLLINGTIMEOUT "Netlib/SetPollingTimeout"
+
+//Makes connection SSL
+//wParam=(WPARAM)(HANDLE)hConn
+//lParam=(LPARAM)(NETLIBSSL*)&nlssl or null if no certficate validation required
+//Returns 0 on failure 1 on success
+#define MS_NETLIB_STARTSSL "Netlib/StartSsl"
+
+typedef struct
+{
+ int cbSize;
+ const char *host; //Expected host name
+ int flags; //Reserved
+} NETLIBSSL;
+
+
+//here's a handy piece of code to let you log using printf-style specifiers:
+//#include <stdarg.h> and <stdio.h> before including this header in order to
+//use it.
+#if defined va_start && (defined _STDIO_DEFINED || defined _STDIO_H_) && (!defined NETLIB_NOLOGGING)
+static INT_PTR Netlib_Logf(HANDLE hUser, const char *fmt, ...)
+{
+ va_list va;
+ char szText[1024];
+
+ __try
+ {
+ va_start(va, fmt);
+ mir_vsnprintf(szText, sizeof(szText), fmt, va);
+ va_end(va);
+ return CallService(MS_NETLIB_LOG, (WPARAM)hUser, (LPARAM)szText);
+ }
+ __except(EXCEPTION_EXECUTE_HANDLER) {}
+ return 0;
+}
+
+#ifdef _UNICODE
+ static INT_PTR Netlib_LogfW(HANDLE hUser, const wchar_t *fmt, ...)
+ {
+ va_list va;
+ wchar_t szText[1024];
+
+ __try
+ {
+ va_start(va,fmt);
+ mir_vsntprintf(szText, sizeof(szText), fmt, va);
+ va_end(va);
+ return CallService(MS_NETLIB_LOGW, (WPARAM)hUser, (LPARAM)szText);
+ }
+ __except(EXCEPTION_EXECUTE_HANDLER) {}
+ return 0;
+ }
+ #define Netlib_LogfW Netlib_LogfT
+#else
+ #define Netlib_LogfW Netlib_Logf
+#endif
+
+#endif //defined va_start
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Security providers (0.6+)
+
+#define NNR_UNICODE 1
+
+#ifdef UNICODE
+#define NNR_TCHAR 1
+#else
+#define NNR_TCHAR 0
+#endif
+
+// Inits a required security provider. Right now only NTLM is supported
+// Returns HANDLE = NULL on error or non-null value on success
+// Known providers: Basic, NTLM, Negotiate, Kerberos, GSSAPI - (Kerberos SASL)
+#define MS_NETLIB_INITSECURITYPROVIDER "Netlib/InitSecurityProvider"
+
+static __inline HANDLE Netlib_InitSecurityProvider( char* szProviderName )
+{
+ return (HANDLE)CallService( MS_NETLIB_INITSECURITYPROVIDER, 0, (LPARAM)szProviderName );
+}
+
+typedef struct {
+ size_t cbSize;
+ const TCHAR* szProviderName;
+ const TCHAR* szPrincipal;
+ unsigned flags;
+}
+ NETLIBNTLMINIT2;
+
+#define MS_NETLIB_INITSECURITYPROVIDER2 "Netlib/InitSecurityProvider2"
+
+static __inline HANDLE Netlib_InitSecurityProvider2( const TCHAR* szProviderName, const TCHAR* szPrincipal )
+{
+ NETLIBNTLMINIT2 temp = { sizeof(temp), szProviderName, szPrincipal, NNR_TCHAR };
+ return (HANDLE)CallService( MS_NETLIB_INITSECURITYPROVIDER2, 0, (LPARAM)&temp );
+}
+
+
+// Destroys a security provider's handle, provided by Netlib_InitSecurityProvider.
+// Right now only NTLM is supported
+#define MS_NETLIB_DESTROYSECURITYPROVIDER "Netlib/DestroySecurityProvider"
+
+static __inline void Netlib_DestroySecurityProvider( char* szProviderName, HANDLE hProvider )
+{
+ CallService( MS_NETLIB_DESTROYSECURITYPROVIDER, (WPARAM)szProviderName, (LPARAM)hProvider );
+}
+
+// Returns the NTLM response string. The result value should be freed using mir_free
+
+typedef struct {
+ char* szChallenge;
+ char* userName;
+ char* password;
+}
+ NETLIBNTLMREQUEST;
+
+#define MS_NETLIB_NTLMCREATERESPONSE "Netlib/NtlmCreateResponse"
+
+static __inline char* Netlib_NtlmCreateResponse( HANDLE hProvider, char* szChallenge, char* login, char* psw )
+{
+ NETLIBNTLMREQUEST temp = { szChallenge, login, psw };
+ return (char*)CallService( MS_NETLIB_NTLMCREATERESPONSE, (WPARAM)hProvider, (LPARAM)&temp );
+}
+
+typedef struct {
+ size_t cbSize;
+ const char* szChallenge;
+ const TCHAR* szUserName;
+ const TCHAR* szPassword;
+ unsigned complete;
+ unsigned flags;
+}
+ NETLIBNTLMREQUEST2;
+
+#define MS_NETLIB_NTLMCREATERESPONSE2 "Netlib/NtlmCreateResponse2"
+
+static __inline char* Netlib_NtlmCreateResponse2( HANDLE hProvider, char* szChallenge, TCHAR* szLogin, TCHAR* szPass, unsigned *complete )
+{
+ NETLIBNTLMREQUEST2 temp = { sizeof(temp), szChallenge, szLogin, szPass, *complete, NNR_TCHAR };
+ char* res = (char*)CallService( MS_NETLIB_NTLMCREATERESPONSE2, (WPARAM)hProvider, (LPARAM)&temp );
+ *complete = temp.complete;
+ return res;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Netlib hooks (0.8+)
+
+// WARNING: these hooks are being called in the context of the calling thread, without switching
+// to the first thread, like all another events do. The hook procedure should be ready for the
+// multithreaded mode
+//
+// Parameters:
+// wParam: NETLIBNOTIFY* - points to the data being sent/received
+// lParam: NETLIBUSER* - points to the protocol definition
+
+typedef struct {
+ NETLIBBUFFER* nlb; // pointer to the request buffer
+ int result; // amount of bytes really sent/received
+}
+ NETLIBNOTIFY;
+
+#define ME_NETLIB_FASTRECV "Netlib/OnRecv" // being called on every receive
+#define ME_NETLIB_FASTSEND "Netlib/OnSend" // being called on every send
+#define ME_NETLIB_FASTDUMP "Netlib/OnDump" // being called on every dump
+
+#endif // M_NETLIB_H__
diff --git a/include/m_options.h b/include/m_options.h new file mode 100644 index 0000000000..e09719c28c --- /dev/null +++ b/include/m_options.h @@ -0,0 +1,139 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_OPTIONS_H__
+#define M_OPTIONS_H__
+
+/* Opt/Initialise
+The user opened the options dialog. Modules should do whatever initialisation
+they need and call opt/addpage one or more times if they want pages displayed
+in the options dialog
+wParam=addInfo
+lParam=0
+addInfo should be passed straight to the wParam of opt/addpage
+*/
+#define ME_OPT_INITIALISE "Opt/Initialise"
+
+/* Opt/AddPage
+Must only be called during an opt/initialise hook
+Adds a page to the options dialog
+wParam=addInfo
+lParam=(LPARAM)(OPTIONSDIALOGPAGE*)odp
+addInfo must have come straight from the wParam of opt/initialise
+Pages in the options dialog operate just like pages in property sheets. See the
+Microsoft documentation for details on how they operate.
+Strings in the structure can be released as soon as the service returns, but
+icons must be kept around. This is not a problem if you're loading them from a
+resource.
+Prior to v0.1.2.1 the options dialog would resize to fit the largest page, but
+since then it is fixed in size. The largest page that fits neatly is 314x240
+DLUs.
+*/
+
+// WARNING: do not use Translate(TS) for pszTitle, pszGroup or pszTab as they
+// are translated by the core, which may lead to double translation.
+// Use LPGEN instead which are just dummy wrappers/markers for "lpgen.pl".
+typedef struct {
+ int cbSize;
+ int position; //a position number, lower numbers are topmost
+ union {
+ char* pszTitle; // [TRANSLATED-BY-CORE]
+ TCHAR* ptszTitle;
+ };
+ DLGPROC pfnDlgProc;
+ char *pszTemplate;
+ HINSTANCE hInstance;
+ HICON hIcon; //v0.1.0.1+
+ union {
+ char* pszGroup; //v0.1.0.1+ [TRANSLATED-BY-CORE]
+ TCHAR* ptszGroup; //v0.1.0.1+
+ };
+ int groupPosition; //v0.1.0.1+
+ HICON hGroupIcon; //v0.1.0.1+
+ DWORD flags; //v0.1.2.1+
+ int nIDBottomSimpleControl; //v0.1.2.1+ if in simple mode the dlg will be cut off after this control, 0 to disable
+ int nIDRightSimpleControl; //v0.1.2.1+ if in simple mode the dlg will be cut off after this control, 0 to disable
+ UINT *expertOnlyControls;
+ int nExpertOnlyControls; //v0.1.2.1+ these controls will be hidden in simple mode. Array must remain valid for duration of dlg.
+
+ #if MIRANDA_VER >= 0x0600
+ union {
+ char* pszTab; //v0.6.0.0+ [TRANSLATED-BY-CORE]
+ TCHAR* ptszTab; //v0.6.0.0+
+ };
+ #endif
+
+ #if MIRANDA_VER >= 0x0800
+ LPARAM dwInitParam; //v0.8.0.0+ a value to pass to lParam of WM_INITDIALOG message
+ #endif
+}
+ OPTIONSDIALOGPAGE;
+
+#define OPTIONPAGE_OLD_SIZE (offsetof(OPTIONSDIALOGPAGE, flags))
+#if MIRANDA_VER >= 0x0600
+ #define OPTIONPAGE_OLD_SIZE2 (offsetof(OPTIONSDIALOGPAGE, pszTab))
+#endif
+#if MIRANDA_VER >= 0x0800
+ #define OPTIONPAGE_OLD_SIZE3 (offsetof(OPTIONSDIALOGPAGE, dwInitParam))
+#endif
+
+#define ODPF_SIMPLEONLY 1 // page is only shown when in simple mode
+#define ODPF_EXPERTONLY 2 // " expert mode
+#define ODPF_BOLDGROUPS 4 // give group box titles a bold font
+#define ODPF_UNICODE 8 // string fields in OPTIONSDIALOGPAGE are WCHAR*
+#define ODPF_USERINFOTAB 16 // options page is tabbed
+#define ODPF_DONTTRANSLATE 32 // do not translate option page title
+
+#if defined( _UNICODE )
+ #define ODPF_TCHAR ODPF_UNICODE
+#else
+ #define ODPF_TCHAR 0
+#endif
+
+#define PSN_EXPERTCHANGED 2 //sent to pages via WM_NOTIFY when the expert checkbox is clicked. lParam=new state
+#define PSM_ISEXPERT (WM_USER+101) //returns true/false
+#define PSM_GETBOLDFONT (WM_USER+102) //returns HFONT used for group box titles
+#define MS_OPT_ADDPAGE "Opt/AddPage"
+
+//Opens the options dialog, optionally at the specified page v0.1.2.1+
+//wParam=0
+//lParam=(LPARAM)(OPENOPTIONSDIALOG*)&ood;
+//Returns 0 on success, nonzero on failure
+//The behaviour if the options dialog is already open is that it will just be
+//activated, the page won't be changed. This may change in the future.
+typedef struct {
+ int cbSize;
+ const char *pszGroup; //set to NULL if it's a root item
+ const char *pszPage; //set to NULL to just open the options at no
+ //specific page
+ const char *pszTab; //set to NULL to just open the options at no
+ //specific tab
+} OPENOPTIONSDIALOG;
+#define MS_OPT_OPENOPTIONS "Opt/OpenOptions"
+
+//Opens the options dialog, with only specified page v0.8.0.x+
+#define MS_OPT_OPENOPTIONSPAGE "Opt/OpenOptionsPage"
+
+#define SETTING_SHOWEXPERT_DEFAULT 1
+
+#endif //M_OPTIONS_H__
diff --git a/include/m_plugins.h b/include/m_plugins.h new file mode 100644 index 0000000000..480ecb0967 --- /dev/null +++ b/include/m_plugins.h @@ -0,0 +1,85 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_PLUGINS_H__
+#define M_PLUGINS_H__
+
+/*
+ Undocumented: Do NOT use.
+ Version: 0.3.4.1+ (2004/10/04)
+*/
+#define DBPE_DONE 1
+#define DBPE_CONT 0
+#define DBPE_HALT (-1)
+typedef struct PLUGIN_DB_ENUM {
+ int cbSize;
+ // 0 = continue, 1 = found, -1 = stop now
+ int (*pfnEnumCallback) ( const char * pluginname, /*DATABASELINK*/ void * link, LPARAM lParam);
+ LPARAM lParam;
+} PLUGIN_DB_ENUM;
+#define MS_PLUGINS_ENUMDBPLUGINS "Plugins/DbEnumerate"
+
+
+//#define DEFMOD_PROTOCOLICQ 1 //removed from v0.3 alpha
+//#define DEFMOD_PROTOCOLMSN 2 //removed from v0.1.2.0+
+#define DEFMOD_UIFINDADD 3
+#define DEFMOD_UIUSERINFO 4
+#define DEFMOD_SRMESSAGE 5
+#define DEFMOD_SRURL 6
+#define DEFMOD_SREMAIL 7
+#define DEFMOD_SRAUTH 8
+#define DEFMOD_SRFILE 9
+#define DEFMOD_UIHELP 10
+#define DEFMOD_UIHISTORY 11
+//#define DEFMOD_RNDCHECKUPD 12 //removed from v0.3.1 alpha
+//#define DEFMOD_RNDICQIMPORT 13 //removed from v0.3 alpha
+#define DEFMOD_RNDAUTOAWAY 14
+#define DEFMOD_RNDUSERONLINE 15
+//#define DEFMOD_RNDCRYPT 16 // v0.1.0.1-v0.1.2.0
+#define DEFMOD_SRAWAY 17 // v0.1.0.1+
+#define DEFMOD_RNDIGNORE 18 // v0.1.0.1+
+#define DEFMOD_UIVISIBILITY 19 // v0.1.1.0+, options page only
+#define DEFMOD_UICLUI 20 // v0.1.1.0+
+//#define DEFMOD_UIPLUGINOPTS 21 // removed from 0.4.0.1
+//#define DEFMOD_PROTOCOLNETLIB 22 // removed from 0.8.0.5
+#define DEFMOD_RNDIDLE 23 // v0.3.4a+
+#define DEFMOD_CLISTALL 24 // v0.3.4a+ (2004/09/28)
+#define DEFMOD_DB 25 // v0.3.4.3+ (2004/10/11)
+//#define DEFMOD_FONTSERVICE 26 // v0.7.0+ (2006/11/17)
+#define DEFMOD_UPDATENOTIFY 27
+#define DEFMOD_SSL 28 // v0.8.0+
+#define DEFMOD_HIGHEST 28
+
+//plugins/getdisabledefaultarray
+//gets an array of the modules that the plugins report they want to replace
+//wParam=lParam=0
+//returns a pointer to an array of INT_PTR, with elements 1 or 0 indexed by the
+//DEFMOD_ constants. 1 to signify that the default module shouldn't be loaded.
+//this is primarily for use by the core's module initialiser, but could also
+//be used by modules that are doing naughty things that are very
+//feature-dependent
+#define MS_PLUGINS_GETDISABLEDEFAULTARRAY "Plugins/GetDisableDefaultArray"
+
+#endif // M_PLUGINS_H__
+
+
diff --git a/include/m_png.h b/include/m_png.h new file mode 100644 index 0000000000..75f1170fc8 --- /dev/null +++ b/include/m_png.h @@ -0,0 +1,64 @@ +/*
+Plugin of Miranda IM for reading/writing PNG images.
+Copyright (c) 2004-5 George Hazan (ghazan@postman.ru)
+
+Portions of this code are gotten from the libpng codebase.
+Copyright 2000, Willem van Schaik. For conditions of distribution and
+use, see the copyright/license/disclaimer notice in png.h
+
+Miranda IM: the free icq client for MS Windows
+Copyright (C) 2000-2002 Richard Hughes, Roland Rabien & Tristan Van de Vreede
+
+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.
+
+File name : $Source: /cvsroot/miranda/miranda/include/m_png.h,v $
+Revision : $Revision: 2876 $
+Last change on : $Date: 2006-05-17 00:56:03 +0300 (Ср, 17 май 2006) $
+Last change by : $Author: rainwater $
+
+*/
+
+/* Image/Dib2Png
+Converts a Device Independent Bitmap to a png stored in memory
+ wParam=0
+ lParam=(WPARAM)(DIB2PNG*)descr
+*/
+
+typedef struct
+{
+ BITMAPINFO* pbmi;
+ BYTE* pDiData;
+ BYTE* pResult;
+ long* pResultLen;
+}
+ DIB2PNG;
+
+#define MS_DIB2PNG "Image/Dib2Png"
+
+/* Image/Png2Dib
+Converts a png stored in memory to a Device Independent Bitmap
+ wParam=0
+ lParam=(WPARAM)(PNG2DIB*)descr
+*/
+
+typedef struct
+{
+ BYTE* pSource;
+ DWORD cbSourceSize;
+ BITMAPINFOHEADER** pResult;
+}
+ PNG2DIB;
+
+#define MS_PNG2DIB "Image/Png2Dib"
diff --git a/include/m_popup.h b/include/m_popup.h new file mode 100644 index 0000000000..62d64ea73d --- /dev/null +++ b/include/m_popup.h @@ -0,0 +1,424 @@ +/*
+===============================================================================
+ PopUp plugin
+Plugin Name: PopUp
+Plugin authors: Luca Santarelli aka hrk (hrk@users.sourceforge.net)
+ Victor Pavlychko aka zazoo (nullbie@gmail.com)
+===============================================================================
+The purpose of this plugin is to give developers a common "platform/interface"
+to show PopUps. It is born from the source code of NewStatusNotify, another
+plugin I've made.
+
+Remember that users *must* have this plugin enabled, or they won't get any
+popup. Write this in the requirements, do whatever you wish ;-)... but tell
+them!
+===============================================================================
+*/
+
+#ifndef M_POPUP_H
+#define M_POPUP_H
+
+/*
+NOTE! Since Popup 1.0.1.2 there is a main meun group called "PopUps" where I
+have put a "Enable/Disable" item. You can add your own "enable/disable" items
+by adding these lines before you call MS_CLIST_ADDMAINMENUITEM:
+mi.pszPopUpName = Translate("PopUps");
+mi.position = 0; //You don't need it and it's better if you put it to zero.
+*/
+
+#define MAX_CONTACTNAME 2048
+#define MAX_SECONDLINE 2048
+
+// This is the basic data you'll need to fill and pass to the service function.
+typedef struct
+{
+ HANDLE lchContact; // Handle to the contact, can be NULL (main contact).
+ HICON lchIcon; // Handle to a icon to be shown. Cannot be NULL.
+ union
+ {
+ char lptzContactName[MAX_CONTACTNAME]; // This is the contact name or the first line in the plugin. Cannot be NULL.
+ char lpzContactName[MAX_CONTACTNAME];
+ };
+ union
+ {
+ char lptzText[MAX_SECONDLINE]; // This is the second line text. Users can choose to hide it. Cannot be NULL.
+ char lpzText[MAX_SECONDLINE];
+ };
+ COLORREF colorBack; // COLORREF to be used for the background. Can be NULL, default will be used.
+ COLORREF colorText; // COLORREF to be used for the text. Can be NULL, default will be used.
+ WNDPROC PluginWindowProc; // Read below. Can be NULL; default will be used.
+ void * PluginData; // Read below. Can be NULL.
+} POPUPDATA, * LPPOPUPDATA;
+
+// Extended popup data
+typedef struct
+{
+ HANDLE lchContact;
+ HICON lchIcon;
+ union
+ {
+ char lptzContactName[MAX_CONTACTNAME];
+ char lpzContactName[MAX_CONTACTNAME];
+ };
+ union
+ {
+ char lptzText[MAX_SECONDLINE];
+ char lpzText[MAX_SECONDLINE];
+ };
+ COLORREF colorBack;
+ COLORREF colorText;
+ WNDPROC PluginWindowProc;
+ void * PluginData;
+ int iSeconds; // Custom delay time in seconds. -1 means "forever", 0 means "default time".
+ char cZero[16]; // Some unused bytes which may come useful in the future.
+} POPUPDATAEX, *LPPOPUPDATAEX;
+
+// Unicode version of POPUPDATAEX
+typedef struct
+{
+ HANDLE lchContact;
+ HICON lchIcon;
+ union
+ {
+ WCHAR lptzContactName[MAX_CONTACTNAME];
+ WCHAR lpwzContactName[MAX_CONTACTNAME];
+ };
+ union
+ {
+ WCHAR lptzText[MAX_SECONDLINE];
+ WCHAR lpwzText[MAX_SECONDLINE];
+ };
+ COLORREF colorBack;
+ COLORREF colorText;
+ WNDPROC PluginWindowProc;
+ void * PluginData;
+ int iSeconds;
+ char cZero[16];
+} POPUPDATAW, *LPPOPUPDATAW;
+
+#if defined(_UNICODE) || defined(UNICODE)
+ typedef POPUPDATAW POPUPDATAT;
+ typedef LPPOPUPDATAW LPPOPUPDATAT;
+#else
+ typedef POPUPDATAEX POPUPDATAT;
+ typedef LPPOPUPDATAEX LPPOPUPDATAT;
+#endif
+
+/* PopUp/AddPopup
+Creates, adds and shows a popup, given a (valid) POPUPDATA structure pointer.
+
+wParam = (WPARAM)(*POPUPDATA)PopUpDataAddress
+lParam = 0
+
+Returns: > 0 on success, 0 if creation went bad, -1 if the PopUpData contained unacceptable values.
+NOTE: it returns -1 if the PopUpData was not valid, if there were already too many popups, if the module was disabled.
+Otherwise, it can return anything else...
+
+Popup Plus 2.0.4.0+
+You may pass additional creation flags via lParam:
+ APF_RETURN_HWND ....... function returns handle to newly created popup window (however this calls are a bit slower)
+ APF_CUSTOM_POPUP ...... new popup is created in hidden state and doesn't obey to popup queue rules.
+ you may control it via UM_* messages and custom window procedure
+*/
+#define APF_RETURN_HWND 0x1
+#define APF_CUSTOM_POPUP 0x2
+
+#define MS_POPUP_ADDPOPUP "PopUp/AddPopUp"
+static INT_PTR __inline PUAddPopUp(POPUPDATA* ppdp) {
+ return CallService(MS_POPUP_ADDPOPUP, (WPARAM)ppdp,0);
+}
+
+#define MS_POPUP_ADDPOPUPEX "PopUp/AddPopUpEx"
+static INT_PTR __inline PUAddPopUpEx(POPUPDATAEX* ppdp) {
+ return CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)ppdp,0);
+}
+
+#define MS_POPUP_ADDPOPUPW "PopUp/AddPopUpW"
+static INT_PTR __inline PUAddPopUpW(POPUPDATAW* ppdp) {
+ return CallService(MS_POPUP_ADDPOPUPW, (WPARAM)ppdp,0);
+}
+
+#if defined(_UNICODE) || defined(UNICODE)
+ #define MS_POPUP_ADDPOPUPT MS_POPUP_ADDPOPUPW
+ #define PUAddPopUpT PUAddPopUpW
+#else
+ #define MS_POPUP_ADDPOPUPT MS_POPUP_ADDPOPUPEX
+ #define PUAddPopUpT PUAddPopUpEx
+#endif
+
+
+/* PopUp/GetContact
+Returns the handle to the contact associated to the specified PopUpWindow.
+
+wParam = (WPARAM)(HWND)hPopUpWindow
+lParam = 0;
+
+Returns: the HANDLE of the contact. Can return NULL, meaning it's the main contact. -1 means failure.
+*/
+#define MS_POPUP_GETCONTACT "PopUp/GetContact"
+static HANDLE __inline PUGetContact(HWND hPopUpWindow) {
+ return (HANDLE)CallService(MS_POPUP_GETCONTACT, (WPARAM)hPopUpWindow,0);
+}
+
+/* PopUp/GetPluginData
+Returns custom plugin date associated with popup
+
+wParam = (WPARAM)(HWND)hPopUpWindow
+lParam = (LPARAM)(PLUGINDATA*)PluginDataAddress;
+
+Returns: the address of the PLUGINDATA structure. Can return NULL, meaning nothing was given. -1 means failure.
+
+IMPORTANT NOTE: it doesn't seem to work if you do:
+CallService(..., (LPARAM)aPointerToAStruct);
+and then use that struct.
+Do this, instead:
+aPointerToStruct = CallService(..., (LPARAM)aPointerToAStruct);
+and it will work. Just look at the example I've written above (PopUpDlgProc).
+
+*/
+#define MS_POPUP_GETPLUGINDATA "PopUp/GetPluginData"
+static void __inline * PUGetPluginData(HWND hPopUpWindow) {
+ long * uselessPointer = NULL;
+ return (void*)CallService(MS_POPUP_GETPLUGINDATA,(WPARAM)hPopUpWindow,(LPARAM)uselessPointer);
+}
+
+/* PopUp/IsSecondLineShown
+Checks if second line is enable
+
+wParam = 0
+lParam = 0
+
+Returns: 0 if the user has chosen not to have the second line, 1 if he choose to have the second line.
+*/
+#define MS_POPUP_ISSECONDLINESHOWN "PopUp/IsSecondLineShown"
+static BOOL __inline PUIsSecondLineShown() {
+ return (BOOL)CallService(MS_POPUP_ISSECONDLINESHOWN,0,0);
+}
+
+/* PopUp/Query
+
+Requests an action or an answer from PopUp module.
+
+wParam = (WPARAM)wpQuery
+
+returns 0 on success, -1 on error, 1 on stupid calls ;-)
+*/
+
+#define PUQS_ENABLEPOPUPS 1 // returns 0 if state was changed, 1 if state wasn't changed
+#define PUQS_DISABLEPOPUPS 2 // " "
+#define PUQS_GETSTATUS 3 //Returns 1 (TRUE) if popups are enabled, 0 (FALSE) if popups are disabled.
+
+#define MS_POPUP_QUERY "PopUp/Query"
+
+/* UM_FREEPLUGINDATA
+Process this message if you have allocated your own memory. (i.e.: POPUPDATA.PluginData != NULL)
+
+wParam = 0
+lParam = 0
+*/
+#define UM_FREEPLUGINDATA (WM_USER + 0x0200)
+
+/* UM_DESTROYPOPUP
+Send this message when you want to destroy the popup, or use the function below.
+
+wParam = 0
+lParam = 0
+*/
+#define UM_DESTROYPOPUP (WM_USER + 0x0201)
+static int __inline PUDeletePopUp(HWND hWndPopUp) {
+ return (int)SendMessage(hWndPopUp, UM_DESTROYPOPUP,0,0);
+}
+
+/* UM_INITPOPUP
+This message is sent to the PopUp when its creation has been finished, so POPUPDATA (and thus your PluginData) is reachable.
+Catch it if you needed to catch WM_CREATE or WM_INITDIALOG, which you'll never ever get in your entire popup-life.
+Return value: if you process this message, return 0. If you don't process it, return 0. Do whatever you like ;-)
+
+wParam = (WPARAM)(HWND)hPopUpWindow (this is useless, you get message inside your popup window)
+lParam = 0
+*/
+#define UM_INITPOPUP (WM_USER + 0x0202)
+
+/* PopUp/Changetext
+Changes the text displayed in the second line of the popup.
+
+wParam = (WPARAM)(HWND)hPopUpWindow
+lParam = (LPARAM)(char*)lpzNewText
+
+returns: > 0 for success, -1 for failure, 0 if the failure is due to second line not being shown. (but you could call
+PUIsSecondLineShown() before changing the text...)
+*/
+#define MS_POPUP_CHANGETEXT "PopUp/Changetext"
+static int __inline PUChangeText(HWND hWndPopUp, LPCTSTR lpzNewText) {
+ return (int)CallService(MS_POPUP_CHANGETEXT, (WPARAM)hWndPopUp, (LPARAM)lpzNewText);
+}
+
+#define MS_POPUP_CHANGETEXTW "PopUp/ChangetextW"
+static int __inline PUChangeTextW(HWND hWndPopUp, LPCWSTR lpwzNewText) {
+ return (int)CallService(MS_POPUP_CHANGETEXTW, (WPARAM)hWndPopUp, (LPARAM)lpwzNewText);
+}
+
+#if defined(_UNICODE) || defined(UNICODE)
+ #define MS_POPUP_CHANGETEXTT MS_POPUP_CHANGETEXTW
+ #define PUChangeTextT PUChangeTextW
+#else
+ #define MS_POPUP_CHANGETEXTT MS_POPUP_CHANGETEXT
+ #define PUChangeTextT PUChangeText
+#endif
+
+/* PopUp/Change
+Changes the entire popup
+
+wParam = (WPARAM)(HWND)hPopUpWindow
+lParam = (LPARAM)(POPUPDATAEX*)newData
+*/
+#define MS_POPUP_CHANGE "PopUp/Change"
+static int __inline PUChange(HWND hWndPopUp, POPUPDATAEX *newData) {
+ return (int)CallService(MS_POPUP_CHANGE, (WPARAM)hWndPopUp, (LPARAM)newData);
+}
+
+#define MS_POPUP_CHANGEW "PopUp/ChangeW"
+static int __inline PUChangeW(HWND hWndPopUp, POPUPDATAW *newData) {
+ return (int)CallService(MS_POPUP_CHANGEW, (WPARAM)hWndPopUp, (LPARAM)newData);
+}
+
+#if defined(_UNICODE) || defined(UNICODE)
+ #define MS_POPUP_CHANGET MS_POPUP_CHANGEW
+ #define PUChangeT PUChangeW
+#else
+ #define MS_POPUP_CHANGET MS_POPUP_CHANGE
+ #define PUChangeT PUChange
+#endif
+
+/* UM_CHANGEPOPUP
+This message is triggered by Change/ChangeText services. You also may post it directly :)
+
+wParam = Modification type
+lParam = value of type defined by wParam
+*/
+
+#define CPT_TEXT 1 // lParam = (char *)text
+#define CPT_TEXTW 2 // lParam = (WCHAR *)text
+#define CPT_TITLE 3 // lParam = (char *)title
+#define CPT_TITLEW 4 // lParam = (WCHAR *)title
+#define CPT_DATA 5 // lParam = (POPUPDATA *)data
+#define CPT_DATAEX 6 // lParam = (POPUPDATAEX *)data
+#define CPT_DATAW 7 // lParam = (POPUPDATAW *)data
+
+#define UM_CHANGEPOPUP (WM_USER + 0x0203)
+
+#if defined(_UNICODE) || defined(UNICODE)
+ #define CPT_TEXTT CPT_TEXTW
+ #define CPT_TITLET CPT_TITLEW
+ #define CPT_DATAT CPT_DATAW
+#else
+ #define CPT_TEXTT CPT_TEXT
+ #define CPT_TITLET CPT_TITLE
+ #define CPT_DATAT CPT_DATA
+#endif
+
+/* PopUp/ShowMessage
+This is mainly for developers.
+Shows a warning message in a PopUp. It's useful if you need a "MessageBox" like function, but you don't want a modal
+window (which will interfere with a DialogProcedure. MessageBox steals focus and control, this one not.
+
+wParam = (char *)lpzMessage
+lParam = 0;
+
+Returns: 0 if the popup was shown, -1 in case of failure.
+*/
+#define SM_WARNING 0x01 //Triangle icon.
+#define SM_NOTIFY 0x02 //Exclamation mark icon.
+#define MS_POPUP_SHOWMESSAGE "PopUp/ShowMessage"
+#define MS_POPUP_SHOWMESSAGEW "PopUp/ShowMessageW"
+
+static int __inline PUShowMessage(char *lpzText, DWORD kind) {
+ return (int)CallService(MS_POPUP_SHOWMESSAGE, (WPARAM)lpzText,(LPARAM)kind);
+}
+
+static int __inline PUShowMessageW(wchar_t *lpwzText, DWORD kind) {
+ return (int)CallService(MS_POPUP_SHOWMESSAGEW, (WPARAM)lpwzText,(LPARAM)kind);
+}
+
+#ifdef _UNICODE
+#define PUShowMessageT PUShowMessageW
+#else
+#define PUShowMessageT PUShowMessage
+#endif
+
+//------------- Class API ----------------//
+
+typedef struct {
+ int cbSize;
+ int flags;
+ char *pszName;
+ union {
+ char *pszDescription;
+ wchar_t *pwszDescription;
+ TCHAR *ptszDescription;
+ };
+
+ HICON hIcon;
+
+ COLORREF colorBack;
+ COLORREF colorText;
+
+ WNDPROC PluginWindowProc;
+
+ int iSeconds;
+} POPUPCLASS;
+
+#define PCF_UNICODE 0x0001
+
+#ifdef _UNICODE
+#define PCF_TCHAR PCF_UNICODE
+#else
+#define PCF_TCHAR 0
+#endif
+
+// wParam = 0
+// lParam = (POPUPCLASS *)&pc
+#define MS_POPUP_REGISTERCLASS "PopUp/RegisterClass"
+
+typedef struct {
+ int cbSize;
+ char *pszClassName;
+ union {
+ const char *pszTitle;
+ const wchar_t *pwszTitle;
+ const TCHAR *ptszTitle;
+ };
+ union {
+ const char *pszText;
+ const wchar_t *pwszText;
+ const TCHAR *ptszText;
+ };
+ void *PluginData;
+ HANDLE hContact;
+} POPUPDATACLASS;
+
+// wParam = 0
+// lParam = (POPUPDATACLASS *)&pdc
+#define MS_POPUP_ADDPOPUPCLASS "PopUp/AddPopupClass"
+
+static INT_PTR __inline ShowClassPopup(char *name, char *title, char *text) {
+ POPUPDATACLASS d = {sizeof(d), name};
+ d.pszTitle = title;
+ d.pszText = text;
+ return CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&d);
+}
+
+static INT_PTR __inline ShowClassPopupW(char *name, wchar_t *title, wchar_t *text) {
+ POPUPDATACLASS d = {sizeof(d), name};
+ d.pwszTitle = title;
+ d.pwszText = text;
+ return CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&d);
+}
+
+#ifdef _UNICODE
+#define ShowClassPopupT ShowClassPopupW
+#else
+#define ShowClassPopupT ShowClassPopup
+#endif
+
+#endif // __m_popup_h__
diff --git a/include/m_protocols.h b/include/m_protocols.h new file mode 100644 index 0000000000..f4a5ebe3f0 --- /dev/null +++ b/include/m_protocols.h @@ -0,0 +1,504 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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.
+*/
+
+//this module was created in v0.1.1.0
+
+#ifndef M_PROTOCOLS_H__
+#define M_PROTOCOLS_H__ 1
+
+#include "statusmodes.h"
+
+//call a specific protocol service. See the PS_ constants in m_protosvc.h
+#if MIRANDA_VER < 0x800
+__inline static INT_PTR CallProtoService(const char *szModule,const char *szService,WPARAM wParam,LPARAM lParam)
+{
+ char str[MAXMODULELABELLENGTH];
+ _snprintf(str, sizeof(str), "%s%s", szModule, szService);
+ str[MAXMODULELABELLENGTH-1] = 0;
+ return CallService(str,wParam,lParam);
+}
+#endif
+
+//send a general request through the protocol chain for a contact
+//wParam=0
+//lParam=(LPARAM)(CCSDATA*)&ccs
+//returns the value as documented in the PS_ definition (m_protosvc.h)
+
+typedef struct {
+ HANDLE hContact;
+ const char *szProtoService; //a PS_ constant
+ WPARAM wParam;
+ LPARAM lParam;
+} CCSDATA;
+
+#define MS_PROTO_CALLCONTACTSERVICE "Proto/CallContactService"
+
+#if MIRANDA_VER < 0x800
+__inline static INT_PTR CallContactService(HANDLE hContact,const char *szProtoService,WPARAM wParam,LPARAM lParam)
+{
+ CCSDATA ccs;
+ ccs.hContact=hContact;
+ ccs.szProtoService=szProtoService;
+ ccs.wParam=wParam;
+ ccs.lParam=lParam;
+ return CallService(MS_PROTO_CALLCONTACTSERVICE,0,(LPARAM)&ccs);
+}
+#endif
+
+//a general network 'ack'
+//wParam=0
+//lParam=(LPARAM)(ACKDATA*)&ack
+//Note that just because definitions are here doesn't mean they will be sent.
+//Read the documentation for the function you are calling to see what replies
+//you will receive.
+typedef struct {
+ int cbSize;
+ const char *szModule; //the name of the protocol module which initiated this ack
+ HANDLE hContact;
+ int type; //an ACKTYPE_ constant
+ int result; //an ACKRESULT_ constant
+ HANDLE hProcess; //a caller-defined process code
+ LPARAM lParam; //caller-defined extra info
+} ACKDATA;
+#define ACKTYPE_MESSAGE 0
+#define ACKTYPE_URL 1
+#define ACKTYPE_FILE 2
+#define ACKTYPE_CHAT 3
+#define ACKTYPE_AWAYMSG 4
+#define ACKTYPE_AUTHREQ 5
+#define ACKTYPE_ADDED 6
+#define ACKTYPE_GETINFO 7
+#define ACKTYPE_SETINFO 8
+#define ACKTYPE_LOGIN 9
+#define ACKTYPE_SEARCH 10
+#define ACKTYPE_NEWUSER 11
+#define ACKTYPE_STATUS 12
+#define ACKTYPE_CONTACTS 13 //send/recv of contacts
+#define ACKTYPE_AVATAR 14 //send/recv of avatars from a protocol
+#define ACKTYPE_EMAIL 15 //notify if the unread emails changed
+
+#define ACKRESULT_SUCCESS 0
+#define ACKRESULT_FAILED 1
+
+//'in progress' result codes:
+#define ACKRESULT_CONNECTING 100
+#define ACKRESULT_CONNECTED 101
+#define ACKRESULT_INITIALISING 102
+#define ACKRESULT_SENTREQUEST 103 //waiting for reply...
+#define ACKRESULT_DATA 104 //blob of file data sent/recved, or search result
+#define ACKRESULT_NEXTFILE 105 //file transfer went to next file
+#define ACKRESULT_FILERESUME 106 //a file is about to be received, see PS_FILERESUME
+#define ACKRESULT_DENIED 107 //a file send has been denied
+#define ACKRESULT_STATUS 108 //an ack or a series of acks to do with a task have a status change
+#define ACKRESULT_LISTENING 109 //waiting for connection
+#define ACKRESULT_CONNECTPROXY 110 //connecting to file proxy
+#define ACKRESULT_SEARCHRESULT 111 //result of extended search
+
+#define ME_PROTO_ACK "Proto/Ack"
+
+// v0.3.2+: When result is ACKRESULT_FAILED or ACKRESULT_DENIED, lParam can point to
+// a human readable string with an explanation. For example: "The message was too
+// long to be delivered". If no error message is specified, lParam must be NULL.
+// Right now only explanations from ACKTYPE_MESSAGE is shown.
+
+//when type==ACKTYPE_FILE && (result==ACKRESULT_DATA || result==ACKRESULT_FILERESUME),
+//lParam points to this
+
+#if MIRANDA_VER >= 0x0900
+ #define FNAMECHAR TCHAR
+#else
+ #define FNAMECHAR char
+#endif
+
+#define PFTS_RECEIVING 0
+#define PFTS_SENDING 1
+#define PFTS_UNICODE 2
+#define PFTS_UTF 4
+
+#if defined( _UNICODE )
+ #define PFTS_TCHAR PFTS_UNICODE
+#else
+ #define PFTS_TCHAR 0
+#endif
+
+typedef struct tagPROTOFILETRANSFERSTATUS_V1
+{
+ size_t cbSize;
+ HANDLE hContact;
+ int sending;
+ char **files;
+ int totalFiles;
+ int currentFileNumber;
+ unsigned long totalBytes;
+ unsigned long totalProgress;
+ char *workingDir;
+ char *currentFile;
+ unsigned long currentFileSize;
+ unsigned long currentFileProgress;
+ unsigned long currentFileTime; //as seconds since 1970
+}
+PROTOFILETRANSFERSTATUS_V1;
+
+#if MIRANDA_VER < 0x0900
+
+typedef PROTOFILETRANSFERSTATUS_V1 PROTOFILETRANSFERSTATUS;
+
+#else
+
+typedef struct tagPROTOFILETRANSFERSTATUS
+{
+ size_t cbSize;
+ HANDLE hContact;
+ DWORD flags; // one of PFTS_* constants
+
+ union {
+ char **pszFiles;
+ TCHAR **ptszFiles;
+ WCHAR **pwszFiles;
+ };
+
+ int totalFiles;
+ int currentFileNumber;
+ unsigned __int64 totalBytes;
+ unsigned __int64 totalProgress;
+
+ union {
+ char *szWorkingDir;
+ TCHAR *tszWorkingDir;
+ WCHAR *wszWorkingDir;
+ };
+
+ union {
+ char *szCurrentFile;
+ TCHAR *tszCurrentFile;
+ WCHAR *wszCurrentFile;
+ };
+
+ unsigned __int64 currentFileSize;
+ unsigned __int64 currentFileProgress;
+ unsigned __int64 currentFileTime; //as seconds since 1970
+}
+PROTOFILETRANSFERSTATUS;
+
+#endif
+
+//Enumerate the currently running protocols
+//wParam=(WPARAM)(int*)&numberOfProtocols
+//lParam=(LPARAM)(PROTOCOLDESCRIPTOR***)&ppProtocolDescriptors
+//Returns 0 on success, nonzero on failure
+//Neither wParam nor lParam may be NULL
+//The list returned by this service is the protocol modules currently installed
+//and running. It is not the complete list of all protocols that have ever been
+//installed.
+//IMPORTANT NOTE #1: the list returned is not static, it may be changed in the
+//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
+//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.
+//Note that a protocol module need not be an interface to an Internet server,
+//they can be encryption and loads of other things, too.
+//And yes, before you ask, that is triple indirection. Deal with it.
+//Access members using ppProtocolDescriptors[index]->element
+
+#define PROTOCOLDESCRIPTOR_V3_SIZE (sizeof(size_t)+sizeof(INT_PTR)+sizeof(char*))
+
+ // initializes an empty account
+typedef struct tagPROTO_INTERFACE* ( *pfnInitProto )( const char* szModuleName, const TCHAR* szUserName );
+
+// deallocates an account instance
+typedef int ( *pfnUninitProto )( struct tagPROTO_INTERFACE* );
+
+// removes an account from the database
+typedef int ( *pfnDestroyProto )( struct tagPROTO_INTERFACE* );
+
+typedef struct {
+ size_t cbSize;
+ char *szName; // unique name of the module
+ int type; // module type, see PROTOTYPE_ constants
+
+ // 0.8.0+ additions
+ #if MIRANDA_VER >= 0x800
+ pfnInitProto fnInit; // initializes an empty account
+ pfnUninitProto fnUninit; // deallocates an account instance
+ pfnDestroyProto fnDestroy; // removes an account
+ #endif
+}
+ PROTOCOLDESCRIPTOR;
+
+// v0.3.3+:
+//
+// For recv, it will go from lower to higher, so in this case:
+// check ignore, decrypt (encryption), translate
+//
+// For send, it will go translate, encrypt, ignore(??), send
+//
+// The DB will store higher numbers here, LOWER in the protocol chain, and lower numbers
+// here HIGHER in the protocol chain
+//
+#define PROTOTYPE_IGNORE 50 // added during v0.3.3
+#define PROTOTYPE_PROTOCOL 1000
+#define PROTOTYPE_ENCRYPTION 2000
+#define PROTOTYPE_FILTER 3000
+#define PROTOTYPE_TRANSLATION 4000
+#define PROTOTYPE_OTHER 10000 //avoid using this if at all possible
+#define PROTOTYPE_DISPROTO 20000
+
+#if MIRANDA_VER >= 0x800
+ #define MS_PROTO_ENUMPROTOS "Proto/EnumProtos"
+ #define MS_PROTO_ENUMPROTOCOLS "Proto/EnumAccounts"
+#else
+ #define MS_PROTO_ENUMPROTOCOLS "Proto/EnumProtocols"
+#endif
+
+//determines if a protocol module is loaded or not
+//wParam=0
+//lParam=(LPARAM)(const char*)szName
+//Returns a pointer to the PROTOCOLDESCRIPTOR if the protocol is loaded, or
+//NULL if it isn't.
+#define MS_PROTO_ISPROTOCOLLOADED "Proto/IsProtocolLoaded"
+
+//gets the network-level protocol associated with a contact
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=0
+//Returns a char* 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.
+#define MS_PROTO_GETCONTACTBASEPROTO "Proto/GetContactBaseProto"
+
+//determines whether the specified contact has the given protocol in its chain
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=(LPARAM)(const char*)szName
+//Returns -1 if it is base protocol, positive number if it is filter and 0 if it doesn't
+#define MS_PROTO_ISPROTOONCONTACT "Proto/IsProtoOnContact"
+
+#define PROTOTYPE_SELFTYPING_OFF 0
+#define PROTOTYPE_SELFTYPING_ON 1
+//This service is for notifying protocols that the user is typing a message v0.3.3+
+//in a message dialog.
+//This is typically sent by a message dialog when a user in the clist is typing.
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=(LPARAM)(int)typing state
+//NOTE: Only protocols should generally call this service
+#define MS_PROTO_SELFISTYPING "Proto/SelfIsTyping"
+
+#define PROTOTYPE_CONTACTTYPING_OFF 0
+#define PROTOTYPE_CONTACTTYPING_INFINITE 2147483647
+//This service is for notifying message dialogs/other plugins of a user typing. v0.3.3+
+//This is typically sent by a protocol when a user in the clist is typing.
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=(LPARAM)(int)time (secs)
+//NOTE: The time in seconds is used to tell a message dialog (or other plugin)
+//how long to display its notification. If time is 0, then notification
+//of typing ends.
+//NOTE: Only protocols should generally call this service
+#define MS_PROTO_CONTACTISTYPING "Proto/ContactIsTyping"
+
+//This hook notifies when a user is typing. If a message dialog supports sending v0.3.3+
+//typing notifications it should hook this event and fire the
+//ProtoService PSS_USERISTYPING to the contacts protocol *after* verifying
+//that the hContact is not NULL and the the user wishes to send notifications
+//to this user (checked visibility, individual typing blocking, etc).
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=(LPARAM)(int)typing state
+#define ME_PROTO_CONTACTISTYPING "Proto/ContactIsTypingEvent"
+
+// -------------- accounts support --------------------- 0.8.0+
+
+typedef struct tagACCOUNT
+{
+ int cbSize; // sizeof this structure
+ char* szModuleName; // unique physical account name (matches database module name)
+ int type; // always equal to PROTOTYPE_PROTOCOL
+ TCHAR* tszAccountName; // user-defined account name
+ char* szProtoName; // physical protocol name
+ int bIsEnabled; // is account enabled?
+ int bIsVisible; // is account visible?
+ int iOrder; // account order in various menus & lists
+ BOOL bOldProto; // old-styled account (one instance per dll)
+ struct tagPROTO_INTERFACE* ppro; // pointer to the underlying object
+
+ HWND hwndAccMgrUI;
+ BOOL bAccMgrUIChanged;
+ BOOL bDynDisabled; // dynamic disable flag, is never written to db
+}
+ PROTOACCOUNT;
+
+//account enumeration service
+//wParam=(WPARAM)(int*)piNumAccounts
+//lParam=(LPARAM)(PROTOACCOUNT**)paAccounts
+#define MS_PROTO_ENUMACCOUNTS "Proto/EnumAccounts"
+
+__inline static INT_PTR ProtoEnumAccounts( int* accNumber, PROTOACCOUNT*** accArray )
+{ return CallService( MS_PROTO_ENUMACCOUNTS, ( WPARAM )accNumber, (LPARAM)accArray );
+}
+
+//retrieves an account's interface by its physical name (database module)
+//wParam=0
+//lParam=(LPARAM)(char*)szAccountName
+//return value = PROTOACCOUNT* or NULL
+#define MS_PROTO_GETACCOUNT "Proto/GetAccount"
+
+__inline static PROTOACCOUNT* ProtoGetAccount( const char* accName )
+{ return (PROTOACCOUNT*)CallService( MS_PROTO_GETACCOUNT, 0, (LPARAM)accName );
+}
+
+//this event is fired when the accounts list gets changed
+//wParam = event type (1 - added, 2 - changed, 3 - deleted, 4 - upgraded, 5 - enabled/disabled)
+//lParam = (LPARAM)(PROTOACCOUNT*) - account being changed
+
+#define PRAC_ADDED 1
+#define PRAC_CHANGED 2
+#define PRAC_REMOVED 3
+#define PRAC_UPGRADED 4
+#define PRAC_CHECKED 5
+
+
+#define ME_PROTO_ACCLISTCHANGED "Proto/AccListChanged"
+
+//displays the Account Manager
+//wParam=0
+//lParam=0
+#define MS_PROTO_SHOWACCMGR "Protos/ShowAccountManager"
+
+//determines if an account is enabled or not
+//wParam = 0
+//lParam = (LPARAM)(PROTOACCOUNT*)
+//Returns 1 if an account is valid and enabled, 0 otherwise
+#define MS_PROTO_ISACCOUNTENABLED "Proto/IsAccountEnabled"
+
+__inline static int IsAccountEnabled( const PROTOACCOUNT* pa )
+{
+#if MIRANDA_VER < 0x0900
+ return pa && (( pa->bIsEnabled && !pa->bDynDisabled ) || pa->bOldProto );
+#else
+ return (int)CallService( MS_PROTO_ISACCOUNTENABLED, 0, (LPARAM)pa );
+#endif
+}
+
+//determines if an account is locked or not
+//wParam = 0
+//lParam = (LPARAM)(char*)szAccountName
+//Returns 1 if an account is locked and not supposed to change status, 0 otherwise
+#define MS_PROTO_ISACCOUNTLOCKED "Proto/IsAccountLocked"
+
+
+//gets the account associated with a contact
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=0
+//Returns a char* 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.
+#define MS_PROTO_GETCONTACTBASEACCOUNT "Proto/GetContactBaseAccount"
+
+/* -------------- avatar support ---------------------
+
+First a protocol must report it supports PF4_AVATARS via PS_GETCAPS, secondly
+it will return the following acks for certain events, the protocol must use
+ProtoBroadcastAck(), listeners must hook ME_PROTO_ACK, note that lParam = ACKDATA*
+
+*/
+
+/*
+
+ The following ACKs MUST be sent in order of .result via ProtoBroadcastAck()
+
+ .szModule = protocol module
+ .hContact = contact the avatar is for, or 0 if its for the user
+ .type = ACKTYPE_AVATAR
+ .result = ACKRESULT_CONNECTING, ACKRESULT_CONNECTED, ACKRESULT_SENTREQUEST, ACKRESULT_DATA
+ .hProcess = protocol specific
+ .lParam = 0
+
+ Once the transfer is complete the following ACKs MUST be sent by the protocol
+
+ .result = ACKRESULT_SUCCESS or ACKRESULT_FAILED
+ .hProcess = (HANDLE) &PROTO_AVATAR_INFORMATION
+ .lParam = 0;
+
+ Anytime before or during the ack or series of acks ACKRESULT_STATUS maybe sent, this might
+ be sent a long while before anything else happens (or after anything happening) For avatars
+ it allows callers to identify status information to do with the avatar, including the time
+ before background transport has been created, so that you know an avatar will be exchanged
+ sometime in the future.
+
+ 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.
+
+*/
+
+#define PA_FORMAT_UNKNOWN 0 // the protocol can not determine much about the "bitmap"
+#define PA_FORMAT_PNG 1 // the image is PNG
+#define PA_FORMAT_JPEG 2
+#define PA_FORMAT_ICON 3
+#define PA_FORMAT_BMP 4
+#define PA_FORMAT_GIF 5
+#define PA_FORMAT_SWF 6
+#define PA_FORMAT_XML 7
+
+typedef struct {
+ int cbSize; // sizeof()
+ HANDLE hContact; // this might have to be set by the caller too
+ int format; // PA_FORMAT_*
+ char filename[MAX_PATH]; // full path to filename which contains the avatar
+} PROTO_AVATAR_INFORMATION;
+
+#ifdef _UNICODE
+typedef struct {
+ int cbSize; // sizeof()
+ HANDLE hContact; // this might have to be set by the caller too
+ int format; // PA_FORMAT_*
+ WCHAR filename[MAX_PATH]; // full path to filename which contains the avatar
+} PROTO_AVATAR_INFORMATIONW;
+#endif
+
+#define GAIF_FORCE 1 // force an update of the avatar if there is none
+
+#define GAIR_SUCCESS 0 // information about the avatar has been returned
+#define GAIR_WAITFOR 1 // you must hook ME_PROTO_ACK and wait for replies about avatar status
+#define GAIR_NOAVATAR 2 // sorry, this contact has no avatars
+
+/*
+ wParam : GAIF_*
+ lParam : (LPARAM) &PROTO_AVATAR_INFORMATION
+ Affect : Make a request to the protocol to return information about a hContact's avatar (or main user)
+ it can return information, tell you there is none, or if forced start requesting an avatar.
+ Note:
+ Version: 0.3.4+ (2004/09/13)
+*/
+#define PS_GETAVATARINFO "/GetAvatarInformation"
+
+#ifdef _UNICODE
+ #define PS_GETAVATARINFOW "/GetAvatarInformationW"
+ #define PS_GETAVATARINFOT PS_GETAVATARINFOW
+
+ #define PROTO_AVATAR_INFORMATIONT PROTO_AVATAR_INFORMATIONW
+#else
+ #define PS_GETAVATARINFOT PS_GETAVATARINFO
+ #define PROTO_AVATAR_INFORMATIONT PROTO_AVATAR_INFORMATION
+#endif
+#endif // M_PROTOCOLS_H
diff --git a/include/m_protoint.h b/include/m_protoint.h new file mode 100644 index 0000000000..9133309a4c --- /dev/null +++ b/include/m_protoint.h @@ -0,0 +1,169 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_PROTOINT_H__
+#define M_PROTOINT_H__ 1
+
+typedef enum
+{
+ EV_PROTO_ONLOAD,
+ EV_PROTO_ONREADYTOEXIT,
+ EV_PROTO_ONEXIT,
+ EV_PROTO_ONRENAME,
+ EV_PROTO_ONOPTIONS,
+ EV_PROTO_ONERASE,
+ EV_PROTO_ONMENU,
+ EV_PROTO_ONCONTACTDELETED,
+ EV_PROTO_DBSETTINGSCHANGED,
+}
+ PROTOEVENTTYPE;
+
+#if MIRANDA_VER >= 0x0900
+ #define PROTOCHAR TCHAR
+ #define PROTOFILEEVENT PROTORECVFILET
+#else
+ #define PROTOCHAR char
+ #define PROTOFILEEVENT PROTORECVFILE
+#endif
+
+#ifndef __cplusplus
+typedef struct tagPROTO_INTERFACE_VTBL
+{
+ HANDLE ( *AddToList )( struct tagPROTO_INTERFACE*, int flags, PROTOSEARCHRESULT* psr );
+ HANDLE ( *AddToListByEvent )( struct tagPROTO_INTERFACE*, int flags, int iContact, HANDLE hDbEvent );
+
+ int ( *Authorize )( struct tagPROTO_INTERFACE*, HANDLE hContact );
+ int ( *AuthDeny )( struct tagPROTO_INTERFACE*, HANDLE hContact, const TCHAR* szReason );
+ int ( *AuthRecv )( struct tagPROTO_INTERFACE*, HANDLE hContact, PROTORECVEVENT* );
+ int ( *AuthRequest )( struct tagPROTO_INTERFACE*, HANDLE hContact, const TCHAR* szMessage );
+
+ HANDLE ( *ChangeInfo )( struct tagPROTO_INTERFACE*, int iInfoType, void* pInfoData );
+
+ HANDLE ( *FileAllow )( struct tagPROTO_INTERFACE*, HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath );
+ int ( *FileCancel )( struct tagPROTO_INTERFACE*, HANDLE hContact, HANDLE hTransfer );
+ int ( *FileDeny )( struct tagPROTO_INTERFACE*, HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason );
+ int ( *FileResume )( struct tagPROTO_INTERFACE*, HANDLE hTransfer, int* action, const PROTOCHAR** szFilename );
+
+ DWORD_PTR ( *GetCaps )( struct tagPROTO_INTERFACE*, int type, HANDLE hContact );
+ HICON ( *GetIcon )( struct tagPROTO_INTERFACE*, int iconIndex );
+ int ( *GetInfo )( struct tagPROTO_INTERFACE*, HANDLE hContact, int infoType );
+
+ HANDLE ( *SearchBasic )( struct tagPROTO_INTERFACE*, const PROTOCHAR* id );
+ HANDLE ( *SearchByEmail )( struct tagPROTO_INTERFACE*, const PROTOCHAR* email );
+ HANDLE ( *SearchByName )( struct tagPROTO_INTERFACE*, const PROTOCHAR* nick, const PROTOCHAR* firstName, const PROTOCHAR* lastName );
+ HWND ( *SearchAdvanced )( struct tagPROTO_INTERFACE*, HWND owner );
+ HWND ( *CreateExtendedSearchUI )( struct tagPROTO_INTERFACE*, HWND owner );
+
+ int ( *RecvContacts )( struct tagPROTO_INTERFACE*, HANDLE hContact, PROTORECVEVENT* );
+ int ( *RecvFile )( struct tagPROTO_INTERFACE*, HANDLE hContact, PROTOFILEEVENT* );
+ int ( *RecvMsg )( struct tagPROTO_INTERFACE*, HANDLE hContact, PROTORECVEVENT* );
+ int ( *RecvUrl )( struct tagPROTO_INTERFACE*, HANDLE hContact, PROTORECVEVENT* );
+
+ int ( *SendContacts )( struct tagPROTO_INTERFACE*, HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList );
+ HANDLE ( *SendFile )( struct tagPROTO_INTERFACE*, HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles );
+ int ( *SendMsg )( struct tagPROTO_INTERFACE*, HANDLE hContact, int flags, const char* msg );
+ int ( *SendUrl )( struct tagPROTO_INTERFACE*, HANDLE hContact, int flags, const char* url );
+
+ int ( *SetApparentMode )( struct tagPROTO_INTERFACE*, HANDLE hContact, int mode );
+ int ( *SetStatus )( struct tagPROTO_INTERFACE*, int iNewStatus );
+
+ HANDLE ( *GetAwayMsg )( struct tagPROTO_INTERFACE*, HANDLE hContact );
+ int ( *RecvAwayMsg )( struct tagPROTO_INTERFACE*, HANDLE hContact, int mode, PROTORECVEVENT* evt );
+ int ( *SendAwayMsg )( struct tagPROTO_INTERFACE*, HANDLE hContact, HANDLE hProcess, const char* msg );
+ int ( *SetAwayMsg )( struct tagPROTO_INTERFACE*, int iStatus, const PROTOCHAR* msg );
+
+ int ( *UserIsTyping )( struct tagPROTO_INTERFACE*, HANDLE hContact, int type );
+
+ int ( *OnEvent )( struct tagPROTO_INTERFACE*, PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam );
+}
+ PROTO_INTERFACE_VTBL;
+#endif
+
+typedef struct tagPROTO_INTERFACE
+{
+ #ifndef __cplusplus
+ PROTO_INTERFACE_VTBL* vtbl;
+ #endif
+
+ int m_iStatus,
+ m_iDesiredStatus,
+ m_iXStatus,
+ m_iVersion; // version 2 or higher designate support of Unicode services
+ TCHAR* m_tszUserName;
+ char* m_szProtoName;
+ char* m_szModuleName;
+
+ DWORD reserved[ 40 ];
+
+ #ifdef __cplusplus
+ virtual HANDLE __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ) = 0;
+ virtual HANDLE __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ) = 0;
+
+ virtual int __cdecl Authorize( HANDLE hDbEvent ) = 0;
+ virtual int __cdecl AuthDeny( HANDLE hDbEvent, const PROTOCHAR* szReason ) = 0;
+ virtual int __cdecl AuthRecv( HANDLE hContact, PROTORECVEVENT* ) = 0;
+ virtual int __cdecl AuthRequest( HANDLE hContact, const PROTOCHAR* szMessage ) = 0;
+
+ virtual HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData ) = 0;
+
+ virtual HANDLE __cdecl FileAllow( HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath ) = 0;
+ virtual int __cdecl FileCancel( HANDLE hContact, HANDLE hTransfer ) = 0;
+ virtual int __cdecl FileDeny( HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason ) = 0;
+ virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename ) = 0;
+
+ virtual DWORD_PTR __cdecl GetCaps( int type, HANDLE hContact = NULL ) = 0;
+ virtual HICON __cdecl GetIcon( int iconIndex ) = 0;
+ virtual int __cdecl GetInfo( HANDLE hContact, int infoType ) = 0;
+
+ virtual HANDLE __cdecl SearchBasic( const PROTOCHAR* id ) = 0;
+ virtual HANDLE __cdecl SearchByEmail( const PROTOCHAR* email ) = 0;
+ virtual HANDLE __cdecl SearchByName( const PROTOCHAR* nick, const PROTOCHAR* firstName, const PROTOCHAR* lastName ) = 0;
+ virtual HWND __cdecl SearchAdvanced( HWND owner ) = 0;
+ virtual HWND __cdecl CreateExtendedSearchUI( HWND owner ) = 0;
+
+ virtual int __cdecl RecvContacts( HANDLE hContact, PROTORECVEVENT* ) = 0;
+ virtual int __cdecl RecvFile( HANDLE hContact, PROTOFILEEVENT* ) = 0;
+ virtual int __cdecl RecvMsg( HANDLE hContact, PROTORECVEVENT* ) = 0;
+ virtual int __cdecl RecvUrl( HANDLE hContact, PROTORECVEVENT* ) = 0;
+
+ virtual int __cdecl SendContacts( HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList ) = 0;
+ virtual HANDLE __cdecl SendFile( HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles ) = 0;
+ virtual int __cdecl SendMsg( HANDLE hContact, int flags, const char* msg ) = 0;
+ virtual int __cdecl SendUrl( HANDLE hContact, int flags, const char* url ) = 0;
+
+ virtual int __cdecl SetApparentMode( HANDLE hContact, int mode ) = 0;
+ virtual int __cdecl SetStatus( int iNewStatus ) = 0;
+
+ virtual HANDLE __cdecl GetAwayMsg( HANDLE hContact ) = 0;
+ virtual int __cdecl RecvAwayMsg( HANDLE hContact, int mode, PROTORECVEVENT* evt ) = 0;
+ virtual int __cdecl SendAwayMsg( HANDLE hContact, HANDLE hProcess, const char* msg ) = 0;
+ virtual int __cdecl SetAwayMsg( int iStatus, const PROTOCHAR* msg ) = 0;
+
+ virtual int __cdecl UserIsTyping( HANDLE hContact, int type ) = 0;
+
+ virtual int __cdecl OnEvent( PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam ) = 0;
+ #endif
+}
+ PROTO_INTERFACE;
+
+#endif // M_PROTOINT_H__
diff --git a/include/m_protomod.h b/include/m_protomod.h new file mode 100644 index 0000000000..bae8146373 --- /dev/null +++ b/include/m_protomod.h @@ -0,0 +1,136 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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.
+*/
+//this module was created in v0.1.1.0
+
+//this header file is for the use of protocol modules only. Other users should
+//use the functions exposed in m_protocols.h and m_protosvc.h
+
+#ifndef M_PROTOMOD_H__
+#define M_PROTOMOD_H__ 1
+
+#include <stdio.h>
+
+#include "m_protocols.h"
+
+//notify the protocol manager that you're around
+//wParam=0
+//lParam=(PROTOCOLDESCRIPTOR*)&descriptor
+//returns 0 on success, nonzero on failure
+//This service must be called in your module's Load() routine.
+//descriptor.type can be a value other than the PROTOTYPE_ constants specified
+//above to provide more precise positioning information for the contact
+//protocol lists. It is strongly recommended that you give values relative to
+//the constants, however, by adding or subtracting small integers (<=100).
+//PROTOTYPE_PROTOCOL modules must not do this. The value must be exact.
+//See MS_PROTO_ENUMPROTOCOLS for more notes.
+#define MS_PROTO_REGISTERMODULE "Proto/RegisterModule"
+
+//adds the specified protocol module to the chain for a contact
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=(LPARAM)(const char*)szName
+//returns 0 on success, nonzero on failure
+//The module is added in the correct position according to the type given when
+//it was registered.
+#define MS_PROTO_ADDTOCONTACT "Proto/AddToContact"
+
+//removes the specified protocol module from the chain for a contact
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=(LPARAM)(const char*)szName
+//returns 0 on success, nonzero on failure
+#define MS_PROTO_REMOVEFROMCONTACT "Proto/RemoveFromContact"
+
+//Create a protocol service
+//Protocol services are called with wParam and lParam as standard if they are
+//to be called with CallProtoService() (as PS_ services are)
+//If they are called with CallContactService() (PSS_ and PSR_ services) then
+//they are called with lParam=(CCSDATA*)&ccs and wParam an opaque internal
+//reference that should be passed unchanged to MS_PROTO_CHAIN*.
+__inline static HANDLE CreateProtoServiceFunction(const char *szModule,const char *szService,MIRANDASERVICE serviceProc)
+{
+ char str[MAXMODULELABELLENGTH];
+ _snprintf(str, sizeof(str), "%s%s", szModule, szService);
+ str[MAXMODULELABELLENGTH-1] = 0;
+ return CreateServiceFunction(str,serviceProc);
+}
+
+//Call the next service in the chain for this send operation
+//wParam=wParam
+//lParam=lParam
+//The return value should be returned immediately
+//wParam and lParam should be passed as the parameters that your service was
+//called with. wParam must remain untouched but lParam is a CCSDATA structure
+//that can be copied and modified if needed.
+//Typically, the last line of any chaining protocol function is
+//return CallService(MS_PROTO_CHAINSEND,wParam,lParam);
+#define MS_PROTO_CHAINSEND "Proto/ChainSend"
+
+//Call the next service in the chain for this receive operation
+//wParam=wParam
+//lParam=lParam
+//The return value should be returned immediately
+//wParam and lParam should be passed as the parameters that your service was
+//called with. wParam must remain untouched but lParam is a CCSDATA structure
+//that can be copied and modified if needed.
+//When being initiated by the network-access protocol module, wParam should be
+//zero.
+//Thread safety: ms_proto_chainrecv is completely thread safe since 0.1.2.0
+//Calls to it are translated to the main thread and passed on from there. The
+//function will not return until all callees have returned, irrepective of
+//differences between threads the functions are in.
+#define MS_PROTO_CHAINRECV "Proto/ChainRecv"
+
+//Broadcast a ME_PROTO_ACK event
+//wParam=0
+//lParam=(LPARAM)(ACKDATA*)&ack
+//returns the return value of the notifyeventhooks() call
+//Thread safety: me_proto_ack is completely thread safe since 0.1.2.0
+//See the notes in core/modules.h under NotifyEventHooks()
+#define MS_PROTO_BROADCASTACK "Proto/BroadcastAck"
+__inline static INT_PTR ProtoBroadcastAck(const char *szModule,HANDLE hContact,int type,int result,HANDLE hProcess,LPARAM lParam)
+{
+ ACKDATA ack={0};
+ ack.cbSize=sizeof(ACKDATA);
+ ack.szModule=szModule; ack.hContact=hContact;
+ ack.type=type; ack.result=result;
+ ack.hProcess=hProcess; ack.lParam=lParam;
+ return CallService(MS_PROTO_BROADCASTACK,0,(LPARAM)&ack);
+}
+
+/* -- Added during 0.3.4 (2004/09/27) development! -----
+*/
+
+/*
+ wParam: (HANDLE)hContact
+ lParam: 0
+ Affect: Given a hContact, return the protocol that is registered for it, or NULL if no such protocol exists,
+ the returned string does not have to be freed and is valid even for multiple threads.
+ Note: Prior to 2004/09/28 this service WAS NOT THREAD SAFE and was slower
+ Note: Prior to 2004/09/28 this service would return NULL for a hContact if the protocol module
+ associated with the hContact was not currently loaded, no such check is performed now.
+ Version: 0.3.4 (2004/09/28)
+*/
+#define MS_PROTODIR_PROTOFROMCONTACT MS_PROTO_GETCONTACTBASEPROTO
+
+#endif // M_PROTOMOD_H__
+
+
diff --git a/include/m_protosvc.h b/include/m_protosvc.h new file mode 100644 index 0000000000..5f997b593c --- /dev/null +++ b/include/m_protosvc.h @@ -0,0 +1,835 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2009 Miranda ICQ/IM 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.
+*/
+
+//this module was created in v0.1.1.0
+
+//none of these services should be used on their own (ie using CallService,
+//CreateServiceFunction(), etc), hence the PS_ prefix. Instead use the services
+//exposed in m_protocols.h
+
+#ifndef M_PROTOSVC_H__
+#define M_PROTOSVC_H__ 1
+
+#include "m_protocols.h"
+
+/* ***** Unicode Services note ********
+******************************************
+
+Only new style protocols (Miranda 0.9+) with m_iVersion set to 2 or higher
+support Unicode services documented below, all other support only ANSI.
+
+For all other that do not support Unicode services, Miranda core will
+convert Unicode to ANSI and call the appropriate service.
+*/
+
+/*************************** NON-CONTACT SERVICES ************************/
+//these should be called with CallProtoService()
+
+//Get the capability flags of the module.
+//wParam=flagNum
+//lParam=0
+//Returns a bitfield corresponding to wParam. See the #defines below
+//Should return 0 for unknown values of flagNum
+//Non-network-access modules should return flags to represent the things they
+//actually actively use, not the values that it is known to pass through
+//correctly
+#define PFLAGNUM_1 1
+#define PF1_IMSEND 0x00000001 //supports IM sending
+#define PF1_IMRECV 0x00000002 //supports IM receiving
+#define PF1_IM (PF1_IMSEND|PF1_IMRECV)
+#define PF1_URLSEND 0x00000004 //supports separate URL sending
+#define PF1_URLRECV 0x00000008 //supports separate URL receiving
+#define PF1_URL (PF1_URLSEND|PF1_URLRECV)
+#define PF1_FILESEND 0x00000010 //supports file sending
+#define PF1_FILERECV 0x00000020 //supports file receiving
+#define PF1_FILE (PF1_FILESEND|PF1_FILERECV)
+#define PF1_MODEMSGSEND 0x00000040 //supports broadcasting away messages
+#define PF1_MODEMSGRECV 0x00000080 //supports reading others' away messages
+#define PF1_MODEMSG (PF1_MODEMSGSEND|PF1_MODEMSGRECV)
+#define PF1_SERVERCLIST 0x00000100 //contact lists are stored on the server, not locally. See notes below
+#define PF1_AUTHREQ 0x00000200 //will get authorisation requests for some or all contacts
+#define PF1_ADDED 0x00000400 //will get 'you were added' notifications
+#define PF1_VISLIST 0x00000800 //has an invisible list
+#define PF1_INVISLIST 0x00001000 //has a visible list for when in invisible mode
+#define PF1_INDIVSTATUS 0x00002000 //supports setting different status modes to each contact
+#define PF1_EXTENSIBLE 0x00004000 //the protocol is extensible and supports plugin-defined messages
+#define PF1_PEER2PEER 0x00008000 //supports direct (not server mediated) communication between clients
+#define PF1_NEWUSER 0x00010000 //supports creation of new user IDs
+#define PF1_CHAT 0x00020000 //has a realtime chat capability
+#define PF1_INDIVMODEMSG 0x00040000 //supports replying to a mode message request with different text depending on the contact requesting
+#define PF1_BASICSEARCH 0x00080000 //supports a basic user searching facility
+#define PF1_EXTSEARCH 0x00100000 //supports one or more protocol-specific extended search schemes
+#define PF1_CANRENAMEFILE 0x00200000 //supports renaming of incoming files as they are transferred
+#define PF1_FILERESUME 0x00400000 //can resume broken file transfers, see PS_FILERESUME below
+#define PF1_ADDSEARCHRES 0x00800000 //can add search results to the contact list
+#define PF1_CONTACTSEND 0x01000000 //can send contacts to other users
+#define PF1_CONTACTRECV 0x02000000 //can receive contacts from other users
+#define PF1_CONTACT (PF1_CONTACTSEND|PF1_CONTACTRECV)
+#define PF1_CHANGEINFO 0x04000000 //can change our user information stored on server
+#define PF1_SEARCHBYEMAIL 0x08000000 //supports a search by e-mail feature
+#define PF1_USERIDISEMAIL 0x10000000 //set if the uniquely identifying field of the network is the e-mail address
+#define PF1_SEARCHBYNAME 0x20000000 //supports searching by nick/first/last names
+#define PF1_EXTSEARCHUI 0x40000000 //has a dialog box to allow searching all the possible fields
+#define PF1_NUMERICUSERID 0x80000000 //the unique user IDs for this protocol are numeric
+
+#define PFLAGNUM_2 2 //the status modes that the protocol supports
+#define PF2_ONLINE 0x00000001 //an unadorned online mode
+#define PF2_INVISIBLE 0x00000002
+#define PF2_SHORTAWAY 0x00000004 //Away on ICQ, BRB on MSN
+#define PF2_LONGAWAY 0x00000008 //NA on ICQ, Away on MSN
+#define PF2_LIGHTDND 0x00000010 //Occupied on ICQ, Busy on MSN
+#define PF2_HEAVYDND 0x00000020 //DND on ICQ
+#define PF2_FREECHAT 0x00000040
+#define PF2_OUTTOLUNCH 0x00000080
+#define PF2_ONTHEPHONE 0x00000100
+#define PF2_IDLE 0x00000200 //added during 0.3.4 (2004/09/13)
+
+//the status modes that the protocol supports
+//away-style messages for. Uses the PF2_ flags.
+// PFLAGNUM_3 is implemented by protocol services that support away messages
+// there may be no support and 0 will be returned, if there is
+// support it will consist of a set of PF2_* bits
+#define PFLAGNUM_3 3
+
+// given a status will return what bit flags to test for
+static __inline unsigned long Proto_Status2Flag(int status)
+{
+ switch(status) {
+ case ID_STATUS_ONLINE: return PF2_ONLINE;
+ case ID_STATUS_OFFLINE: return 0;
+ case ID_STATUS_INVISIBLE: return PF2_INVISIBLE;
+ case ID_STATUS_OUTTOLUNCH: return PF2_OUTTOLUNCH;
+ case ID_STATUS_ONTHEPHONE: return PF2_ONTHEPHONE;
+ case ID_STATUS_AWAY: return PF2_SHORTAWAY;
+ case ID_STATUS_NA: return PF2_LONGAWAY;
+ case ID_STATUS_OCCUPIED: return PF2_LIGHTDND;
+ case ID_STATUS_DND: return PF2_HEAVYDND;
+ case ID_STATUS_FREECHAT: return PF2_FREECHAT;
+ case ID_STATUS_IDLE: return PF2_IDLE;
+ }
+ return 0;
+}
+
+#define PFLAGNUM_4 4 //misc options
+#define PF4_FORCEAUTH 0x00000001 // forces auth requests to be sent when adding users
+#define PF4_FORCEADDED 0x00000002 // forces "you were added" requests to be sent
+#define PF4_NOCUSTOMAUTH 0x00000004 // protocol doesn't support custom auth text (doesn't show auth text box)
+#define PF4_SUPPORTTYPING 0x00000008 // protocol supports user is typing messages v0.3.3+
+#define PF4_SUPPORTIDLE 0x00000010 // protocol understands idle, added during v0.3.4+ (2004/09/13)
+#define PF4_AVATARS 0x00000020 // protocol has avatar support, added during v0.3.4 (2004/09/13)
+#define PF4_OFFLINEFILES 0x00000040 // protocols supports sending files to offline users (v0.5.2)
+#define PF4_IMSENDUTF 0x00000080 // protocol is able to process messages in utf-8 (v.0.7.0+)
+#define PF4_IMSENDOFFLINE 0x00000100 // protocol supports sending offline messages (v0.8.0+)
+#define PF4_INFOSETTINGSVC 0x00000200 // protocol supports user info translation services (v0.8.0+)
+#define PF4_NOAUTHDENYREASON 0x00000400 // protocol doesn't support authorization deny reason (v0.9.0+)
+
+#define PFLAG_UNIQUEIDTEXT 100 //returns a static buffer of text describing the unique field by which this protocol identifies users (already translated), or NULL
+
+#define PFLAG_MAXCONTACTSPERPACKET 200 //v0.1.2.2+: returns the maximum number of contacts which can be sent in a single PSS_CONTACTS, lParam=(LPARAM)hContact.
+
+#define PFLAG_UNIQUEIDSETTING 300 // returns the setting name of where the unique id is stored
+
+#define PFLAG_MAXLENOFMESSAGE 400 // v0.3.2+: return the maximum length of an instant message, lParam=(LPARAM)hContact
+
+/*
+
+ A protocol might not support this cap, it allows a protocol to say that PFLAGNUM_2 is for
+ statuses contacts supports, and that PFLAGNUM_5 is for statuses a protocol can SET TO ITSELF,
+ if this is not replied to, then PFLAGNUM_2 is alone in telling you which statuses a protocol
+ can set to and what statuses a contact can set to as well.
+
+ E.g. A protocol might report 'wireless' users but a login of the protocol from Miranda can
+ not set itself to 'wireless' so PFLAGNUM_2 would return PF2_ONTHEPHONE and PFLAGNUM_5 would
+ return PF2_ONTHEPHONE as well, this means "I will get contacts who are on the phone but you can
+ not set on the phone" and so on.
+
+ Do note that the reply here is a NEGATION of bitflags reported for PFLAGNUM_2, e.g. returning
+ PF2_ONTHEPHONE for PFLAGNUM_2 and returning the same for PFLAGNUM_5 says that you DO NOT SUPPORT
+ PF2_ONTHEPHONE for the user to PS_SETSTATUS to, but you will expect other contacts to have
+ that status, e.g. you can get onthephone for users but can't go online with onthephone.
+
+ The same PF2_* status flags are used in the reply.
+
+Added during 0.3.4 (2004/09/14)
+*/
+#define PFLAGNUM_5 5
+
+/* Deleting contacts from protocols that store the contact list on the server:
+If a contact is deleted while the protocol is online, it is expected that the
+protocol will have hooked me_db_contact_deleted and take the appropriate
+action by itself.
+If a contact is deleted while the protocol is offline, the contact list will
+display a message to the user about the problem, and set the byte setting
+"CList"/"Delete" to 1. Each time such a protocol changes status from offline
+or connecting to online the contact list will check for contacts with this
+flag set and delete them at that time. Your hook for me_db_contact_deleted
+will pick this up and everything will be good.
+*/
+#define PS_GETCAPS "/GetCaps"
+
+//Get a human-readable name for the protocol
+//wParam=cchName
+//lParam=(LPARAM)(char*)szName
+//Returns 0 on success, nonzero on failure
+//cchName is the number of characters in the buffer szName
+//This should be translated before being returned
+//Some example strings are:
+//"ICQ", "AIM", "RSA-1024 Encryption"
+#define PS_GETNAME "/GetName"
+
+//Loads one of the protocol-specific icons
+//wParam=whichIcon
+//lParam=0
+//Returns the HICON, or NULL on failure
+//The returned HICON must be DestroyIcon()ed.
+//The UI should overlay the online icon with a further UI-specified icon to
+//represent the exact status mode.
+#define PLI_PROTOCOL 1 //An icon representing the protocol (eg the multicoloured flower for ICQ)
+#define PLI_ONLINE 2 //Online state icon for that protocol (eg green flower for ICQ)
+#define PLI_OFFLINE 3 //Offline state icon for that protocol (eg red flower for ICQ)
+#define PLIF_LARGE 0 //OR with one of the above to get the large (32x32 by default) icon
+#define PLIF_SMALL 0x10000 //OR with one of the above to get the small (16x16 by default) icon
+#define PLIF_ICOLIB 0x20000 //the returned HICON is managed by IcoLib, DO NOT DestroyIcon() it
+#define PLIF_ICOLIBHANDLE 0x40000 //the function will return IcoLib handle not HICON
+#define PS_LOADICON "/LoadIcon"
+
+//Change the protocol's status mode
+//wParam=newMode, from ui/contactlist/statusmodes.h
+//lParam=0
+//returns 0 on success, nonzero on failure
+//Will send an ack with:
+//type=ACKTYPE_STATUS, result=ACKRESULT_SUCCESS, hProcess=(HANDLE)previousMode, lParam=newMode
+//when the change completes. This ack is sent for all changes, not just ones
+//caused by calling this function.
+//Note that newMode can be ID_STATUS_CONNECTING<=newMode<ID_STATUS_CONNECTING+
+//MAX_CONNECT_RETRIES to signify that it's connecting and it's the nth retry.
+//Protocols are initially always in offline mode.
+//Non-network-level protocol modules do not have the concept of a status and
+//should leave this service unimplemented
+//If a protocol doesn't support the specific status mode, it should pick the
+//closest one that it does support, and change to that.
+//If the new mode requires that the protocol switch from offline to online then
+//it will do so, but errors will be reported in the form of an additional ack:
+//type=ACKTYPE_LOGIN, result=ACKRESULT_FAILURE, hProcess=NULL, lParam=LOGINERR_
+// (added during 0.3.4.3) the protocol will send LOGINERR_OTHERLOCATION if the login
+// was disconnected because of a login at another location
+#define LOGINERR_WRONGPASSWORD 1
+#define LOGINERR_NONETWORK 2
+#define LOGINERR_PROXYFAILURE 3
+#define LOGINERR_BADUSERID 4
+#define LOGINERR_NOSERVER 5
+#define LOGINERR_TIMEOUT 6
+#define LOGINERR_WRONGPROTOCOL 7
+#define LOGINERR_OTHERLOCATION 8
+//protocols may define more error codes starting at 1000
+#define PS_SETSTATUS "/SetStatus"
+
+//Sets the status-mode specific message for yourself
+//wParam=status mode
+//lParam=(LPARAM)(const char*)szMessage
+//Returns 0 on success, nonzero on failure
+//Note that this service will not be available unless PF1_MODEMSGSEND is set
+//and PF1_INDIVMODEMSG is *not* set.
+//If PF1_INDIVMODEMSG is set, then see PSS_AWAYMSG for details of
+//the operation of away messages
+//Protocol modules must support szMessage=NULL. It may either mean to use an
+//empty message, or (preferably) to not reply at all to any requests
+#define PS_SETAWAYMSG "/SetAwayMsg"
+#define PS_SETAWAYMSGW "/SetAwayMsgW"
+
+//Get the status mode that a protocol is currently in
+//wParam=lParam=0
+//Returns the status mode
+//Non-network-level protocol modules do not have the concept of a status and
+//should leave this service unimplemented
+#define PS_GETSTATUS "/GetStatus"
+
+//Allow somebody to add us to their contact list
+//wParam=(WPARAM)(HANDLE)hDbEvent
+//lParam=0
+//Returns 0 on success, nonzero on failure
+//Auth requests come in the form of an event added to the database for the NULL
+//user. The form is:
+//DWORD protocolSpecific
+//ASCIIZ nick, firstName, lastName, e-mail, requestReason
+//hDbEvent must be the handle of such an event
+//One or more fields may be empty if the protocol doesn't support them
+#define PS_AUTHALLOW "/Authorize"
+
+//Deny an authorisation request
+//wParam=(WPARAM)(HANDLE)hDbEvent
+//lParam=(LPARAM)(const TCHAR*)szReason
+//Returns 0 on success, nonzero on failure
+//Protocol modules must be able to cope with szReason=NULL
+#define PS_AUTHDENY "/AuthDeny"
+#define PS_AUTHDENYW "/AuthDenyW"
+
+// Send a "You were added" event
+// wParam=lParam=0
+// Returns 0 on success, nonzero on failure
+#define PSS_ADDED "/YouWereAdded"
+
+//Create account manager UI form
+//wParam=0
+//lParam=(LPARAM)(HWND)hwndAccMgr
+//Returns handle on newly created form.
+//Size for best fit is 186x134 DLUs, please avoid groupboxes
+//paddind and advanced options. This should provide minimal setup
+//for initial connect.
+#define PS_CREATEACCMGRUI "/CreateAccMgrUI"
+
+//Send a basic search request
+//wParam=0
+//lParam=(LPARAM)(const TCHAR*)szId
+//Returns a handle for the search, or zero on failure
+//All protocols identify users uniquely by a single field. This service will
+//search by that field.
+//Note that if users are identified by an integer (eg ICQ) szId should be a
+//string containing that integer, not the integer itself.
+//All search replies (even protocol-specific extended searches) are replied by
+//means of a series of acks:
+//result acks, one of more of:
+//type=ACKTYPE_SEARCH, result=ACKRESULT_DATA, lParam=(LPARAM)(PROTOSEARCHRESULT*)&psr
+//ending ack:
+//type=ACKTYPE_SEARCH, result=ACKRESULT_SUCCESS, lParam=0
+//Note that the pointers in the structure are not guaranteed to be valid after
+//the ack is complete.
+
+#define PSR_UNICODE 1 // return Unicode status
+#if defined( _UNICODE )
+ #define PSR_TCHAR PSR_UNICODE
+#else
+ #define PSR_TCHAR 0
+#endif
+
+
+typedef struct {
+ int cbSize;
+ FNAMECHAR *nick;
+ FNAMECHAR *firstName;
+ FNAMECHAR *lastName;
+ FNAMECHAR *email;
+ FNAMECHAR *id;
+ int flags;
+ char reserved[8*sizeof(HANDLE)/sizeof(DWORD)];
+ //Protocols may extend this structure with extra members at will and supply
+ //a larger cbSize to reflect the new information, but they must not change
+ //any elements above this comment
+ //The 'reserved' field is part of the basic structure, not space to
+ //overwrite with protocol-specific information.
+ //If modules do this, they should take steps to ensure that information
+ //they put there will be retained by anyone trying to save this structure.
+} PROTOSEARCHRESULT;
+#define PS_BASICSEARCH "/BasicSearch"
+#define PS_BASICSEARCHW "/BasicSearchW"
+
+//Search for users by e-mail address v0.1.2.1+
+//wParam=0
+//lParam=(LPARAM)(TCHAR*)szEmail
+//Returns a HANDLE to the search, or NULL on failure
+//Results are returned as for PS_BASICSEARCH.
+//This function is only available if the PF1_SEARCHBYEMAIL capability is set
+//If the PF1_USERIDISEMAIL capability is set then this function and
+//PS_BASICSEARCH should have the same result (and it's best if they are the
+//same function).
+#define PS_SEARCHBYEMAIL "/SearchByEmail"
+#define PS_SEARCHBYEMAILW "/SearchByEmailW"
+
+//Search for users by name v0.1.2.1+
+//wParam=0
+//lParam=(LPARAM)(PROTOSEARCHBYNAME*)&psbn
+//Returns a HANDLE to the search, or NULL on failure
+//Results are returned as for PS_BASICSEARCH.
+//This function is only available if the PF1_SEARCHBYNAME capability is set
+typedef struct {
+ TCHAR *pszNick;
+ TCHAR *pszFirstName;
+ TCHAR *pszLastName;
+} PROTOSEARCHBYNAME;
+#define PS_SEARCHBYNAME "/SearchByName"
+#define PS_SEARCHBYNAMEW "/SearchByNameW"
+
+//Create the advanced search dialog box v0.1.2.1+
+//wParam=0
+//lParam=(HWND)hwndOwner
+//Returns a HWND, or NULL on failure
+//This function is only available if the PF1_EXTSEARCHUI capability is set
+//Advanced search is very protocol-specific so it is left to the protocol
+//itself to supply a dialog containing the options. This dialog should not
+//have a title bar and contain only search fields. The rest of the UI is
+//supplied by Miranda.
+//The dialog should be created with CreateDialog() or its kin and still be
+//hidden when this function returns.
+//The dialog will be destroyed when the find/add dialog is closed.
+#define PS_CREATEADVSEARCHUI "/CreateAdvSearchUI"
+
+//Search using the advanced search dialog v0.1.2.1+
+//wParam=0
+//lParam=(LPARAM)(HWND)hwndAdvancedSearchDlg
+//Returns a HANDLE to the search, or NULL on failure
+//Results are returned as for PS_BASICSEARCH.
+//This function is only available if the PF1_EXTSEARCHUI capability is set
+#define PS_SEARCHBYADVANCED "/SearchByAdvanced"
+
+typedef struct {
+ size_t nSize;
+ int nFieldCount;
+ TCHAR ** pszFields;
+ PROTOSEARCHRESULT psr;
+} CUSTOMSEARCHRESULTS;
+
+//Adds a search result to the contact list
+//wParam=flags
+//lParam=(LPARAM)(PROTOSEARCHRESULT*)&psr
+//Returns a HANDLE to the new contact, or NULL on failure
+//psr must be a result returned by a search function, since the extended
+//information past the end of the official structure may contain important
+//data required by the protocol.
+//The protocol library should not allow duplicate contacts to be added, but if
+//such a request is received it should return the original hContact, and do the
+//appropriate thing with the temporary flag (ie newflag=(oldflag&thisflag))
+#define PALF_TEMPORARY 1 //add the contact temporarily and invisibly, just to get user info or something
+#define PS_ADDTOLIST "/AddToList"
+
+//Adds a contact to the contact list given an auth, added or contacts event
+//wParam=MAKEWPARAM(flags,iContact)
+//lParam=(LPARAM)(HANDLE)hDbEvent
+//Returns a HANDLE to the new contact, or NULL on failure
+//hDbEvent must be either EVENTTYPE_AUTHREQ or EVENTTYPE_ADDED
+//flags are the same as for PS_ADDTOLIST.
+//iContact is only used for contacts events. It is the 0-based index of the
+//contact in the event to add. There is no way to add two or more contacts at
+//once, you should just do lots of calls.
+#define PS_ADDTOLISTBYEVENT "/AddToListByEvent"
+
+//Changes our user details as stored on the server v0.1.2.0+
+//wParam=infoType
+//lParam=(LPARAM)(void*)pInfoData
+//Returns a HANDLE to the change request, or NULL on failure
+//The details information that is stored on the server is very protocol-
+//specific, so this service just supplies an outline for protocols to use.
+//See protocol-specific documentation for what infoTypes are available and
+//what pInfoData should be for each infoType.
+//Sends an ack type=ACKTYPE_SETINFO, result=ACKRESULT_SUCCESS/FAILURE,
+//lParam=0 on completion.
+#define PS_CHANGEINFO "/ChangeInfo"
+
+//Informs the protocol of the users chosen resume behaviour v0.1.2.2+
+//wParam=(WPARAM)(HANDLE)hFileTransfer
+//lParam=(LPARAM)(PROTOFILERESUME*)&pfr
+//Returns 0 on success, nonzero on failure
+//If the protocol supports file resume (PF1_FILERESUME) then before each
+//individual file receive begins (note: not just each file that already exists)
+//it will broadcast an ack with type=ACKTYPE_FILE, result=ACKRESULT_RESUME,
+//hProcess=hFileTransfer, lParam=(LPARAM)(PROTOFILETRANSFERSTATUS*)&fts. If the
+//UI processes this ack it must return nonzero from its hook. If all the hooks
+//complete without returning nonzero then the protocol will assume that no
+//resume UI was available and will continue the file receive with a default
+//behaviour (overwrite for ICQ). If a hook does return nonzero then that UI
+//must call this function, PS_FILERESUME, at some point. When the protocol
+//module receives this call it will proceed with the file receive using the
+//given information.
+//Having said that PS_FILERESUME must be called, it is also acceptable to call
+//PSS_FILECANCEL to completely abort the transfer instead.
+#define FILERESUME_OVERWRITE 1
+#define FILERESUME_RESUME 2
+#define FILERESUME_RENAME 3
+#define FILERESUME_SKIP 4
+typedef struct {
+ int action; //a FILERESUME_ flag
+ const FNAMECHAR *szFilename; //full path. Only valid if action==FILERESUME_RENAME
+} PROTOFILERESUME;
+#define PS_FILERESUME "/FileResume"
+#define PS_FILERESUMEW "/FileResumeW"
+
+//Asks a protocol to join the chatroom from contact v0.8.0+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=(LPARAM)0
+//Returns 0 on success, nonzero on failure
+#define PS_JOINCHAT "/JoinChat"
+
+//Asks a protocol to leave the chatroom from contact v0.8.0+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=(LPARAM)0
+//Returns 0 on success, nonzero on failure
+#define PS_LEAVECHAT "/LeaveChat"
+
+//Asks a protocol to read contact information and translate them (for a lookup fields) v0.8.0+
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=(LPARAM)(DBCONTACTGETSETTING*)&dbcgs
+//The flag PF4_INFOSETTINGSVC indicates that a protocol supports this. Basically it should
+//do the same as MS_DB_CONTACT_GETSETTING_STR, except that for a lookup settings (e.g. Language)
+//it returns string instead of an ID stored in the database.
+//Caller is responsible for free()ing dbcgs.pValue->pszVal and pbVal if they are
+//returned. You must **NOT** do this from your version of free() you have to use Miranda's free()
+//you can get a function pointer to Miranda's free() via MS_SYSTEM_GET_MMI, see m_system.h
+//Returns 0 on success or nonzero if the setting name was not found or hContact
+//was invalid
+#define PS_GETINFOSETTING "/GetInfoSetting"
+
+// Asks protocol for the status message for a status
+// wParam=(WORD) 0 for current status or a status id
+// lParam=SGMA_xxx
+// Returns status msg or NULL if there is none. The protocol have to handle only the current
+// status. Handling messages for other statuses is optional.
+// Remember to mir_free the return value
+
+#define SGMA_UNICODE 1 // return Unicode status
+#if defined( _UNICODE )
+ #define SGMA_TCHAR SGMA_UNICODE
+#else
+ #define SGMA_TCHAR 0
+#endif
+
+#define PS_GETMYAWAYMSG "/GetMyAwayMsg"
+
+// Set nickname for the user
+// wParam=(WPARAM)SMNN_xxx
+// lParam=(LPARAM)(char *) The new nickname for the user
+// return=0 for success
+
+#define SMNN_UNICODE 1 // return Unicode status
+#if defined( _UNICODE )
+ #define SMNN_TCHAR SMNN_UNICODE
+#else
+ #define SMNN_TCHAR 0
+#endif
+
+#define PS_SETMYNICKNAME "/SetNickname"
+
+// Get the max allowed length for the user nickname
+// Optional, default value is 1024
+// wParam=(WPARAM)0
+// lParam=(LPARAM)0
+// return= <=0 for error, >0 the max length of the nick
+#define PS_GETMYNICKNAMEMAXLENGTH "/GetMyNicknameMaxLength"
+
+// WAYD = What are you doing
+#define WAYD_UNICODE 1 // return Unicode texts
+#if defined( _UNICODE )
+ #define WAYD_TCHAR WAYD_UNICODE
+#else
+ #define WAYD_TCHAR 0
+#endif
+
+// Get the WAYD message for the user
+// wParam=(WPARAM)WAYD_xxx
+// lParam=(LPARAM)0
+// Returns the text or NULL if there is none. Remember to mir_free the return value.
+#define PS_GETMYWAYD "/GetMyWAYD"
+
+// Sets the WAYD message for the user
+// wParam=(WPARAM)WAYD_xxx
+// lParam=(LPARAM)(WCHAR * or char *)The message
+// Returns 0 on success, nonzero on failure
+#define PS_SETMYWAYD "/SetMyWAYD"
+
+// Get the max allowed length that a WAYD message can have
+// Optional, default value is 1024
+// wParam=(WPARAM)0
+// lParam=(LPARAM)0
+// Returns the max length
+#define PS_GETMYWAYDMAXLENGTH "/GetMyWAYDMaxLength"
+
+/****************************** SENDING SERVICES *************************/
+//these should be called with CallContactService()
+
+//Updates a contact's details from the server
+//wParam=flags
+//lParam=0
+//returns 0 on success, nonzero on failure
+//Will update all the information in the database, and then send acks with
+//type=ACKTYPE_GETINFO, result=ACKRESULT_SUCCESS, hProcess=(HANDLE)(int)nReplies, lParam=thisReply
+//Since some protocols do not allow the library to tell when it has got all
+//the information so it can send a final ack, one ack will be sent after each
+//chunk of data has been received. nReplies contains the number of distinct
+//acks that will be sent to get all the information, thisReply is the zero-
+//based index of this ack. When thisReply=0 the 'minimal' information has just
+//been received. All other numbering is arbitrary.
+#define SGIF_MINIMAL 1 //get only the most basic information. This should
+ //contain at least a Nick and e-mail.
+#define SGIF_ONOPEN 2 //set when the User Info form is being opened
+#define PSS_GETINFO "/GetInfo"
+
+//Send an instant message
+//wParam=flags
+//lParam=(LPARAM)(const char*)szMessage
+//returns a hProcess corresponding to the one in the ack event.
+//Will send an ack when the message actually gets sent
+//type=ACKTYPE_MESSAGE, result=success/failure, (char*)lParam=error message or NULL.
+//Protocols modules are free to define flags starting at 0x10000
+//The event will *not* be added to the database automatically.
+#define PSS_MESSAGE "/SendMsg"
+
+//Send an URL message
+//wParam=flags
+//lParam=(LPARAM)(const char*)szMessage
+//returns a hProcess corresponding to the one in the ack event.
+//szMessage should be encoded as the URL followed by the description, the
+//separator being a single nul (\0). If there is no description, do not forget
+//to end the URL with two nuls.
+//Will send an ack when the message actually gets sent
+//type=ACKTYPE_URL, result=success/failure, (char*)lParam=error message or NULL.
+//Protocols modules are free to define flags starting at 0x10000
+//The event will *not* be added to the database automatically.
+#define PSS_URL "/SendUrl"
+
+//Send a set of contacts
+//wParam=MAKEWPARAM(flags,nContacts)
+//lParam=(LPARAM)(HANDLE*)hContactsList
+//returns a hProcess corresponding to the one in the ack event, NULL on
+//failure.
+//hContactsList is an array of nContacts handles to contacts. If this array
+//includes one or more contacts that cannot be transferred using this protocol
+//the function will fail.
+//Will send an ack when the contacts actually get sent
+//type=ACKTYPE_CONTACTS, result=success/failure, (char*)lParam=error message or NULL.
+//No flags have yet been defined.
+//The event will *not* be added to the database automatically.
+#define PSS_CONTACTS "/SendContacts"
+
+//Send a request to retrieve somebody's mode message.
+//wParam=lParam=0
+//returns an hProcess identifying the request, or 0 on failure
+//This function will fail if the contact's current status mode doesn't have an
+//associated message
+//The reply will be in the form of an ack:
+//type=ACKTYPE_AWAYMSG, result=success/failure, lParam=(const char*)szMessage
+#define PSS_GETAWAYMSG "/GetAwayMsg"
+
+//Sends an away message reply to a user
+//wParam=(WPARAM)(HANDLE)hProcess (of ack)
+//lParam=(LPARAM)(const char*)szMessage
+//Returns 0 on success, nonzero on failure
+//This function must only be used if the protocol has PF1_MODEMSGSEND and
+//PF1_INDIVMODEMSG set. Otherwise, PS_SETAWAYMESSAGE should be used.
+//This function must only be called in response to an ack that a user has
+//requested our away message. The ack is sent as:
+//type=ACKTYPE_AWAYMSG, result=ACKRESULT_SENTREQUEST, lParam=0
+#define PSS_AWAYMSG "/SendAwayMsg"
+
+//Allows a file transfer to begin
+//wParam=(WPARAM)(HANDLE)hTransfer
+//lParam=(LPARAM)(const TCHAR*)szPath
+//Returns a new handle to the transfer, to be used from now on
+//If szPath does not point to a directory then:
+// if a single file is being transferred and the protocol supports file
+// renaming (PF1_CANRENAMEFILE) then the file is given this name
+// otherwise the filename is removed and the file(s) are placed in the
+// resulting directory
+//File transfers are marked by an EVENTTYPE_FILE added to the database. The
+//format is:
+//DWORD hTransfer
+//ASCIIZ filename(s), description
+#define PSS_FILEALLOW "/FileAllow"
+#define PSS_FILEALLOWW "/FileAllowW"
+
+//Refuses a file transfer request
+//wParam=(WPARAM)(HANDLE)hTransfer
+//lParam=(LPARAM)(const TCHAR*)szReason
+//Returns 0 on success, nonzero on failure
+#define PSS_FILEDENY "/FileDeny"
+#define PSS_FILEDENYW "/FileDenyW"
+
+//Cancel an in-progress file transfer
+//wParam=(WPARAM)(HANDLE)hTransfer
+//lParam=0
+//Returns 0 on success, nonzero on failure
+#define PSS_FILECANCEL "/FileCancel"
+
+//Initiate a file send
+//wParam=(WPARAM)(const TCHAR*)szDescription
+//lParam=(LPARAM)(TCHAR **)ppszFiles
+//Returns a transfer handle on success, NULL on failure
+//All notification is done through acks, with type=ACKTYPE_FILE
+//If result=ACKRESULT_FAILED then lParam=(LPARAM)(const char*)szReason
+#define PSS_FILE "/SendFile"
+#define PSS_FILEW "/SendFileW"
+
+//Set the status mode you will appear in to a user
+//wParam=statusMode
+//lParam=0
+//Returns 0 on success, nonzero on failure
+//Set statusMode=0 to revert to normal behaviour for the contact
+//ID_STATUS_ONLINE is possible iff PF1_VISLIST
+//ID_STATUS_OFFLINE is possible iff PF1_INVISLIST
+//Other modes are possible iff PF1_INDIVSTATUS
+#define PSS_SETAPPARENTMODE "/SetApparentMode"
+
+// Send an auth request
+// wParam=0
+// lParam=(const TCHAR *)szMessage
+// Returns 0 on success, nonzero on failure
+#define PSS_AUTHREQUEST "/AuthRequest"
+#define PSS_AUTHREQUESTW "/AuthRequestW"
+
+// Send "User is Typing" (user is typing a message to the user) v0.3.3+
+// wParam=(WPARAM)(HANDLE)hContact
+// lParam=(LPARAM)(int)typing type - see PROTOTYPE_SELFTYPING_X defines in m_protocols.h
+#define PSS_USERISTYPING "/UserIsTyping"
+
+/**************************** RECEIVING SERVICES *************************/
+//These services are not for calling by general modules. They serve a specific
+//role in communicating through protocol module chains before the whole app is
+//notified that an event has occurred.
+//When the respective event is received over the network, the network-level
+//protocol module initiates the chain by calling MS_PROTO_CHAINRECV with wParam
+//set to zero and lParam pointing to the CCSDATA structure.
+//Protocol modules should continue the message up the chain by calling
+//MS_PROTO_CHAINRECV with the same wParam they received and a modified (or not)
+//lParam (CCSDATA). If they do not do this and return nonzero then all further
+//processing for the event will cease and the event will be ignored.
+//Once all non-network protocol modules have been called (in reverse order),
+//the network protocol module will be called so that it can finish its
+//processing using the modified information.
+//This final processing should consist of the protocol module adding the
+//event to the database, and it is the ME_DB_EVENT_ADDED event that people who
+//just want to know the final result should hook.
+//In all cases, the database should store what the user read/wrote.
+
+//An instant message has been received
+//wParam=0
+//lParam=(LPARAM)(PROTORECVEVENT*)&pre
+//DB event: EVENTTYPE_MESSAGE, blob contains szMessage without 0 terminator
+//Return 0 - success, other failure
+typedef struct {
+ DWORD flags;
+ DWORD timestamp; //unix time
+ char *szMessage;
+ LPARAM lParam; //extra space for the network level protocol module
+} PROTORECVEVENT;
+#define PREF_CREATEREAD 1 //create the database event with the 'read' flag set
+#define PREF_UNICODE 2
+#define PREF_RTL 4 // 0.5+ addition: support for right-to-left messages
+#define PREF_UTF 8 // message is in utf-8 (0.7.0+)
+
+#if defined( _UNICODE )
+ #define PREF_TCHAR PREF_UNICODE
+#else
+ #define PREF_TCHAR 0
+#endif
+
+#define PSR_MESSAGE "/RecvMessage"
+
+#define MS_PROTO_RECVMSG "Proto/RecvMessage"
+
+//An URL has been received
+//wParam=0
+//lParam=(LPARAM)(PROTORECVEVENT*)&pre
+//szMessage is encoded the same as for PSS_URL
+//DB event: EVENTTYPE_URL, blob contains szMessage without 0 terminator
+#define PSR_URL "/RecvUrl"
+
+//Contacts have been received
+//wParam=0
+//lParam=(LPARAM)(PROTORECVEVENT*)&pre
+//pre.szMessage is actually a (PROTOSEARCHRESULT**) list.
+//pre.lParam is the number of contacts in that list.
+//pre.flags can contain PREF_UTF defining the strings as utf-8 encoded (0.7.0+)
+//PS_ADDTOLIST can be used to add the contacts to the contact list.
+#define PSR_CONTACTS "/RecvContacts"
+
+/* contacts database event format (EVENTTYPE_CONTACTS)
+repeat {
+ ASCIIZ userNick
+ ASCIIZ userId
+}
+userNick should be a human-readable description of the user. It need not
+be the nick, or even confined to displaying just one type of
+information. The dbe.flags can contain DBEF_UTF defining userNick as utf-8
+encoded.
+userId should be a machine-readable representation of the unique
+protocol identifying field of the user. Because of the need to be
+zero-terminated, binary data should be converted to text.
+Use PS_ADDTOLISTBYEVENT to add the contacts from one of these to the list.
+*/
+
+//File(s) have been received (0.9.x)
+//wParam=0
+//lParam=(LPARAM)(PROTORECVFILE*)&prf
+typedef struct {
+ DWORD flags;
+ DWORD timestamp; //unix time
+ TCHAR *tszDescription;
+ int fileCount;
+ TCHAR **ptszFiles;
+ LPARAM lParam; //extra space for the network level protocol module
+} PROTORECVFILET;
+
+#define MS_PROTO_RECVFILET "Proto/RecvFileT"
+
+#define PSR_FILE "/RecvFile"
+
+// left for compatibility with the old Miranda versions.
+
+typedef struct {
+ DWORD flags;
+ DWORD timestamp; //unix time
+ char *szDescription;
+ char **pFiles;
+ LPARAM lParam; //extra space for the network level protocol module
+} PROTORECVFILE;
+#define MS_PROTO_RECVFILE "Proto/RecvFile"
+
+//An away message reply has been received
+//wParam=statusMode
+//lParam=(LPARAM)(PROTORECVEVENT*)&pre
+#define PSR_AWAYMSG "/RecvAwayMsg"
+
+//An authorization request has been received
+//wParam=0
+//lParam=(LPARAM)(PROTORECVEVENT*)&pre
+//pre.szMessage is same format as blob
+//pre.lParam is the size of the blob
+#define PSR_AUTH "/RecvAuth"
+
+
+#ifdef _UNICODE
+
+#define PS_SETAWAYMSGT PS_SETAWAYMSGW
+#define PSS_FILET PSS_FILEW
+#define PSS_FILEALLOWT PSS_FILEALLOWW
+#define PSS_FILEDENYT PSS_FILEDENYW
+#define PSS_AUTHREQUESTT PSS_AUTHREQUESTW
+#define PS_AUTHDENYT PS_AUTHDENYW
+#define PS_FILERESUMET PS_FILERESUMEW
+#define PS_BASICSEARCHT PS_BASICSEARCHW
+#define PS_SEARCHBYNAMET PS_SEARCHBYNAMEW
+#define PS_SEARCHBYEMAILT PS_SEARCHBYEMAILW
+
+#else
+
+#define PS_SETAWAYMSGT PS_SETAWAYMSG
+#define PSS_FILET PSS_FILE
+#define PSS_FILEALLOWT PSS_FILEALLOW
+#define PSS_FILEDENYT PSS_FILEDENY
+#define PSS_AUTHREQUESTT PSS_AUTHREQUEST
+#define PS_AUTHDENYT PS_AUTHDENY
+#define PS_FILERESUMET PS_FILERESUME
+#define PS_BASICSEARCHT PS_BASICSEARCH
+#define PS_SEARCHBYNAMET PS_SEARCHBYNAME
+#define PS_SEARCHBYEMAILT PS_SEARCHBYEMAIL
+
+#endif
+
+#endif // M_PROTOSVC_H__
diff --git a/include/m_skin.h b/include/m_skin.h new file mode 100644 index 0000000000..22c36ff11a --- /dev/null +++ b/include/m_skin.h @@ -0,0 +1,238 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_SKIN_H__
+#define M_SKIN_H__ 1
+
+//loads an icon from the user's custom skin library, or from the exe if there
+//isn't one of them
+//wParam=id of icon to load - see below
+//lParam=0
+//returns an hIcon for the new icon. Do *not* DestroyIcon() the return value
+//returns NULL if id is invalid, but will always succeed for a valid id
+#define MS_SKIN_LOADICON "Skin/Icons/Load"
+//nice function to wrap this:
+__inline static HICON LoadSkinnedIcon(int id) {return (HICON)CallService(MS_SKIN_LOADICON,id,0);}
+__inline static HANDLE LoadSkinnedIconHandle(int id) {return (HANDLE)CallService(MS_SKIN_LOADICON,id,1);}
+__inline static HICON LoadSkinnedIconBig(int id) {return (HICON)CallService(MS_SKIN_LOADICON,id,2);}
+
+//event icons
+#define SKINICON_EVENT_MESSAGE 100
+#define SKINICON_EVENT_URL 101
+#define SKINICON_EVENT_FILE 102
+
+//other icons
+#define SKINICON_OTHER_MIRANDA 200
+#define SKINICON_OTHER_EXIT 201
+#define SKINICON_OTHER_SHOWHIDE 202
+#define SKINICON_OTHER_GROUPOPEN 203 //v0.1.1.0+
+#define SKINICON_OTHER_USERONLINE 204 //v0.1.0.1+
+#define SKINICON_OTHER_GROUPSHUT 205 //v0.1.1.0+
+#define SKINICON_OTHER_CONNECTING 206 //v0.1.0.1+
+#define SKINICON_OTHER_ADDCONTACT 207 //v0.7.0.2+
+#define SKINICON_OTHER_USERDETAILS 208 //v0.7.0.2+
+#define SKINICON_OTHER_HISTORY 209 //v0.7.0.2+
+#define SKINICON_OTHER_DOWNARROW 210 //v0.7.0.2+
+#define SKINICON_OTHER_FINDUSER 211 //v0.7.0.2+
+#define SKINICON_OTHER_OPTIONS 212 //v0.7.0.2+
+#define SKINICON_OTHER_SENDEMAIL 213 //v0.7.0.2+
+#define SKINICON_OTHER_DELETE 214 //v0.7.0.2+
+#define SKINICON_OTHER_RENAME 215 //v0.7.0.2+
+#define SKINICON_OTHER_SMS 216 //v0.7.0.2+
+#define SKINICON_OTHER_SEARCHALL 217 //v0.7.0.2+
+#define SKINICON_OTHER_TICK 218 //v0.7.0.2+
+#define SKINICON_OTHER_NOTICK 219 //v0.7.0.2+
+#define SKINICON_OTHER_HELP 220 //v0.7.0.2+
+#define SKINICON_OTHER_MIRANDAWEB 221 //v0.7.0.2+
+#define SKINICON_OTHER_TYPING 222 //v0.7.0.2+
+#define SKINICON_OTHER_SMALLDOT 223 //v0.7.0.2+
+#define SKINICON_OTHER_FILLEDBLOB 224 //v0.7.0.2+
+#define SKINICON_OTHER_EMPTYBLOB 225 //v0.7.0.2+
+#define SKINICON_OTHER_UNICODE 226 //v0.7.0.19+
+#define SKINICON_OTHER_ANSI 227 //v0.7.0.19+
+#define SKINICON_OTHER_LOADED 228 //v0.7.0.19+
+#define SKINICON_OTHER_NOTLOADED 229 //v0.7.0.19+
+#define SKINICON_OTHER_UNDO 230 //v0.8.0.4+
+#define SKINICON_OTHER_WINDOW 231 //v0.8.0.4+
+#define SKINICON_OTHER_WINDOWS 232 //v0.8.0.4+
+#define SKINICON_OTHER_ACCMGR 233 //v0.8.0.4+
+#define SKINICON_OTHER_MAINMENU 234 //v0.8.0.12+
+#define SKINICON_OTHER_STATUS 235 //v0.8.0.12+
+#define SKINICON_CHAT_JOIN 236 //v0.8.0.27+
+#define SKINICON_CHAT_LEAVE 237 //v0.8.0.27+
+#define SKINICON_OTHER_STATUS_LOCKED 238 //v0.8.0.28+
+#define SKINICON_OTHER_GROUP 239 //v0.8.0.29+
+#define SKINICON_OTHER_ON 240 //v0.9.0.9+
+#define SKINICON_OTHER_OFF 241 //v0.9.0.9+
+
+//menu icons are owned by the module that uses them so are not and should not
+//be skinnable. Except exit and show/hide
+
+//status mode icons. NOTE: These are deprecated in favour of LoadSkinnedProtoIcon()
+#define SKINICON_STATUS_OFFLINE 0
+#define SKINICON_STATUS_ONLINE 1
+#define SKINICON_STATUS_AWAY 2
+#define SKINICON_STATUS_NA 3
+#define SKINICON_STATUS_OCCUPIED 4
+#define SKINICON_STATUS_DND 5
+#define SKINICON_STATUS_FREE4CHAT 6
+#define SKINICON_STATUS_INVISIBLE 7
+#define SKINICON_STATUS_ONTHEPHONE 8
+#define SKINICON_STATUS_OUTTOLUNCH 9
+
+//Loads an icon representing the status mode for a particular protocol.
+//wParam=(WPARAM)(const char*)szProto
+//lParam=status
+//returns an hIcon for the new icon. Do *not* DestroyIcon() the return value
+//returns NULL on failure
+//if szProto is NULL the function will load the user's selected 'all protocols'
+//status icon.
+#define MS_SKIN_LOADPROTOICON "Skin/Icons/LoadProto"
+#define MS_SKIN_LOADPROTOICONBIG "Skin/Icons/LoadProtoBig"
+//nice function to wrap this:
+__inline static HICON LoadSkinnedProtoIcon(const char *szProto,int status) {return (HICON)CallService(MS_SKIN_LOADPROTOICON,(WPARAM)szProto,status);}
+__inline static HICON LoadSkinnedProtoIconBig(const char *szProto,int status) {return (HICON)CallService(MS_SKIN_LOADPROTOICONBIG,(WPARAM)szProto,status);}
+
+//add a new sound so it has a default and can be changed in the options dialog
+//wParam=0
+//lParam=(LPARAM)(SKINSOUNDDESC*)ssd;
+//returns 0 on success, nonzero otherwise
+
+#define SSDF_UNICODE 0x0001
+
+#if defined( _UNICODE )
+ #define SSDF_TCHAR SSDF_UNICODE
+#else
+ #define SSDF_TCHAR 0
+#endif
+
+typedef struct {
+ int cbSize;
+ const char *pszName; // name to refer to sound when playing and in db
+ union {
+ const char *pszDescription; // [TRANSLATED-BY-CORE] description for options dialog
+ const TCHAR *ptszDescription;
+ };
+ union {
+ const char *pszDefaultFile; // default sound file to use
+ const TCHAR *ptszDefaultFile;
+ };
+ union {
+ const char *pszSection; // [TRANSLATED-BY-CORE] section name used to group sounds (NULL is acceptable) (added during 0.3.4+ (2004/10/*))
+ const TCHAR *ptszSection;
+ };
+ #if MIRANDA_VER >= 0x0900
+ DWORD dwFlags;
+ #endif
+} SKINSOUNDDESCEX;
+
+#define SKINSOUNDDESC_SIZE_V1 (offsetof(SKINSOUNDDESCEX, pszSection))
+#if MIRANDA_VER >= 0x0900
+#define SKINSOUNDDESC_SIZE_V2 (offsetof(SKINSOUNDDESCEX, dwFlags))
+#endif
+
+// Old struct pre 0.3.4
+typedef struct {
+ int cbSize;
+ const char *pszName; // name to refer to sound when playing and in db
+ const char *pszDescription; // [TRANSLATED-BY-CORE] description for options dialog
+ const char *pszDefaultFile; // default sound file to use
+} SKINSOUNDDESC;
+
+#define MS_SKIN_ADDNEWSOUND "Skin/Sounds/AddNew"
+
+// inline only works after 0.3.4+ (2004/10/*)
+__inline static INT_PTR SkinAddNewSoundEx(const char *name,const char *section,const char *description)
+{
+ SKINSOUNDDESCEX ssd;
+ ZeroMemory(&ssd,sizeof(ssd));
+ ssd.cbSize=sizeof(ssd);
+ ssd.pszName=name;
+ ssd.pszSection=section;
+ ssd.pszDescription=description;
+ return CallService(MS_SKIN_ADDNEWSOUND, 0, (LPARAM)&ssd);
+}
+
+__inline static INT_PTR SkinAddNewSound(const char *name,const char *description,const char *defaultFile)
+{
+ SKINSOUNDDESC ssd;
+ ZeroMemory(&ssd,sizeof(ssd));
+ ssd.cbSize=sizeof(ssd);
+ ssd.pszName=name;
+ ssd.pszDescription=description;
+ ssd.pszDefaultFile=defaultFile;
+ return CallService(MS_SKIN_ADDNEWSOUND, 0, (LPARAM)&ssd);
+}
+
+// 0.9.0+
+#if MIRANDA_VER >= 0x0900
+__inline static INT_PTR SkinAddNewSoundExT(const char *name,const TCHAR *section,const TCHAR *description)
+{
+ SKINSOUNDDESCEX ssd = { 0 };
+ ssd.cbSize=sizeof(ssd);
+ ssd.dwFlags=SSDF_TCHAR;
+ ssd.pszName=name;
+ ssd.ptszSection=section;
+ ssd.ptszDescription=description;
+ return CallService(MS_SKIN_ADDNEWSOUND, 0, (LPARAM)&ssd);
+}
+
+__inline static INT_PTR SkinAddNewSoundT(const char *name,const TCHAR *description,const TCHAR *defaultFile)
+{
+ SKINSOUNDDESCEX ssd = { 0 };
+ ssd.cbSize=sizeof(ssd);
+ ssd.pszName=name;
+ ssd.dwFlags=SSDF_TCHAR;
+ ssd.ptszDescription=description;
+ ssd.ptszDefaultFile=defaultFile;
+ return CallService(MS_SKIN_ADDNEWSOUND, 0, (LPARAM)&ssd);
+}
+#endif
+
+//play a named sound event
+//wParam=0
+//lParam=(LPARAM)(const char*)pszName
+//pszName should have been added with Skin/Sounds/AddNew, but if not the
+//function will not fail, it will play the Windows default sound instead.
+#define MS_SKIN_PLAYSOUND "Skin/Sounds/Play"
+__inline static INT_PTR SkinPlaySound(const char *name) {return CallService(MS_SKIN_PLAYSOUND,0,(LPARAM)name);}
+
+//sent when the icons DLL has been changed in the options dialog, and everyone
+//should re-make their image lists
+//wParam=lParam=0
+#define ME_SKIN_ICONSCHANGED "Skin/IconsChanged"
+
+
+/*
+ wParam: 0 when playing sound (1 when sound is being previewed)
+ lParam: (char*) pszSoundFile
+ Affect: This hook is fired when the sound module needs to play a sound
+ Note : This event has default processing, if no one HookEvent()'s this event then it will
+ use the default hook code, which uses PlaySound()
+ Version: 0.3.4a (2004/09/15)
+*/
+#define ME_SKIN_PLAYINGSOUND "Skin/Sounds/Playing"
+
+//random ideas for the future:
+// Skin/LoadNetworkAnim - get some silly spinner thing when we want to be busy
+
+#endif //M_SKIN_H__
diff --git a/include/m_ssl.h b/include/m_ssl.h new file mode 100644 index 0000000000..cba88e13c8 --- /dev/null +++ b/include/m_ssl.h @@ -0,0 +1,64 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_SSL_H__
+#define M_SSL_H__ 1
+
+#include <newpluginapi.h>
+
+DECLARE_HANDLE(HSSL);
+
+typedef struct
+{
+ int cbSize;
+
+ HSSL ( *connect ) ( SOCKET s, const char* host, int verify );
+ BOOL ( *pending ) ( HSSL ssl );
+ int ( *read ) ( HSSL ssl, char *buf, int num, int peek );
+ int ( *write ) ( HSSL ssl, const char *buf, int num );
+ void ( *shutdown )( HSSL ssl );
+ void ( *sfree ) ( HSSL ssl );
+}
+ SSL_API;
+
+/* every protocol should declare this variable to use the SSL API */
+extern SSL_API si;
+
+/*
+a service to obtain the SSL API
+
+wParam = 0;
+lParam = (LPARAM)(SSL_API*).
+
+returns TRUE if all is Ok, and FALSE otherwise
+*/
+
+#define MS_SYSTEM_GET_SI "Miranda/System/GetSslApi"
+
+__forceinline INT_PTR mir_getSI( SSL_API* dest )
+{
+ dest->cbSize = sizeof(*dest);
+ return CallService(MS_SYSTEM_GET_SI, 0, (LPARAM)dest);
+}
+
+#endif // M_SSL_H__
diff --git a/include/m_stdhdr.h b/include/m_stdhdr.h new file mode 100644 index 0000000000..eedf55946c --- /dev/null +++ b/include/m_stdhdr.h @@ -0,0 +1,74 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_STDHDR_H__
+#define M_STDHDR_H__ 1
+
+#if defined( UNICODE ) && !defined( _UNICODE )
+# define _UNICODE
+#endif
+
+#ifndef _WIN64
+#define _USE_32BIT_TIME_T
+#endif
+
+#include <tchar.h>
+
+#if _MSC_VER < 1400
+# include <malloc.h> // to avoid a crazy bug in VS2003 header files
+#endif
+
+#ifndef __GNUC__
+# ifdef _DEBUG
+# define _CRTDBG_MAP_ALLOC
+# include <stdlib.h>
+# include <crtdbg.h>
+# define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
+# else
+# include <stdlib.h>
+# endif
+#else
+# include <stdlib.h>
+/* GCC has not __try/except */
+# define __try
+# define __except(x) if (0) /* don't execute handler */
+# define __finally
+/* neither _ASSERT */
+# ifdef _DEBUG
+# include <assert.h>
+# define _ASSERT assert
+# else
+# define _ASSERT(x)
+# endif
+/* neither some CRT debugging things */
+# define _CRTDBG_REPORT_FLAG -1
+# define _CRTDBG_LEAK_CHECK_DF 0x20
+# define _CrtSetDbgFlag(x) 0
+#endif
+
+#if _MSC_VER >= 1400
+# include <malloc.h> // to avoid a warning in VS2005 & 2008
+#endif
+
+
+#endif // M_STDHDR_H__
diff --git a/include/m_system.h b/include/m_system.h new file mode 100644 index 0000000000..25b04ffd87 --- /dev/null +++ b/include/m_system.h @@ -0,0 +1,648 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_SYSTEM_H__
+#define M_SYSTEM_H__ 1
+
+#include <tchar.h>
+
+#ifndef MIRANDANAME
+ #define MIRANDANAME "Miranda IM"
+#endif
+#ifndef MIRANDACLASS
+ #define MIRANDACLASS "Miranda"
+#endif
+
+// set the default compatibility lever for Miranda 0.4.x
+#ifndef MIRANDA_VER
+ #define MIRANDA_VER 0x0400
+#endif
+
+#ifndef _MSC_VER
+ #ifndef FORCEINLINE
+ #define FORCEINLINE __inline
+ #endif
+ #define __forceinline static FORCEINLINE
+#else
+ #pragma warning(disable:4244 4245)
+#endif
+
+//miranda/system/modulesloaded
+//called after all modules have been successfully initialised
+//wParam=lParam=0
+//used to resolve double-dependencies in the module load order
+#define ME_SYSTEM_MODULESLOADED "Miranda/System/ModulesLoaded"
+
+//miranda/system/shutdown event
+//called just before the application terminates
+//the database is still guaranteed to be running during this hook.
+//wParam=lParam=0
+#define ME_SYSTEM_SHUTDOWN "Miranda/System/Shutdown"
+
+//restarts miranda ( 0.8+ )
+//wParam=lParam=0
+#define MS_SYSTEM_RESTART "Miranda/System/Restart"
+
+//miranda/system/oktoexit event
+//called before the app goes into shutdown routine to make sure everyone is
+//happy to exit
+//wParam=lParam=0
+//return nonzero to stop the exit cycle
+#define ME_SYSTEM_OKTOEXIT "Miranda/System/OkToExitEvent"
+
+//miranda/system/oktoexit service
+//Check if everyone is happy to exit
+//wParam=lParam=0
+//if everyone acknowleges OK to exit then returns true, otherwise false
+#define MS_SYSTEM_OKTOEXIT "Miranda/System/OkToExit"
+
+//gets the version number of Miranda encoded as a DWORD v0.1.0.1+
+//wParam=lParam=0
+//returns the version number, encoded as one version per byte, therefore
+//version 1.2.3.10 is 0x0102030a
+#define MS_SYSTEM_GETVERSION "Miranda/System/GetVersion"
+
+//gets the version of Miranda encoded as text v0.1.0.1+
+//wParam=cch
+//lParam=(LPARAM)(char*)pszVersion
+//cch is the size of the buffer pointed to by pszVersion, in bytes
+//may return a build qualifier, such as "0.1.0.1 alpha"
+//returns 0 on success, nonzero on failure
+#define MS_SYSTEM_GETVERSIONTEXT "Miranda/System/GetVersionText"
+
+//Adds a HANDLE to the list to be checked in the main message loop v0.1.2.0+
+//wParam=(WPARAM)(HANDLE)hObject
+//lParam=(LPARAM)(const char*)pszService
+//returns 0 on success or nonzero on failure
+//Causes pszService to be CallService()d (wParam=hObject,lParam=0) from the
+//main thread whenever hObject is signalled.
+//The Miranda message loop has a MsgWaitForMultipleObjects() call in it to
+//implement this feature. See the documentation for that function for
+//information on what objects are supported.
+//There is a limit of MAXIMUM_WAIT_OBJECTS minus one (MWO is defined in winnt.h
+//to be 64) on the number of handles MSFMO() can process. This service will
+//return nonzero if that many handles are already being waited on.
+
+//As of writing, the following parts of Miranda are thread-safe, so can be
+//called from any thread:
+//All of modules.h except NotifyEventHooks()
+//Read-only parts of m_database.h (since the write parts will call hooks)
+//All of m_langpack.h
+//for all other routines your mileage may vary, but I would strongly recommend
+//that you call them from the main thread, or ask about it on plugin-dev if you
+//think it really ought to work.
+
+//Update during 0.1.2.0 development, 16/10/01:
+//NotifyEventHooks() now translates all calls into the context of the main
+//thread, which means that all of m_database.h is now completely safe.
+
+//Update during 0.1.2.2 development, 17/4/02:
+//The main thread's message loop now also deals with asynchronous procedure
+//calls. Loop up QueueUserAPC() for a neater way to accomplish a lot of the
+//things that used to require ms_system_waitonhandle.
+
+//Miranda is compiled with the multithreaded runtime - don't forget to do the
+//same with your plugin.
+#define MS_SYSTEM_WAITONHANDLE "Miranda/System/WaitOnHandle"
+
+//Removes a HANDLE from the wait list v0.1.2.0+
+//wParam=(WPARAM)(HANDLE)hObject
+//lParam=0
+//returns 0 on success or nonzero on failure.
+#define MS_SYSTEM_REMOVEWAIT "Miranda/System/RemoveWait"
+
+/* Returns Miranda's RTL/CRT function poiners to malloc() free() realloc() -- 0.1.2.2+
+This is useful for preallocation of memory for use with Miranda's services
+that Miranda can free -- or reallocation of a block of memory passed with a service.
+Do not use with memory unless it is explicitly expected the memory *can*
+or *shall* be used in this way. the passed structure is expected to have it's .cbSize initialised
+
+wParam=0, lParam = (LPARAM) &MM_INTERFACE
+*/
+
+struct MM_INTERFACE
+{
+ size_t cbSize;
+ void* (*mmi_malloc) (size_t);
+ void* (*mmi_realloc) (void*, size_t);
+ void (*mmi_free) (void*);
+
+ #if MIRANDA_VER >= 0x0600
+ void* (*mmi_calloc) (size_t);
+ char* (*mmi_strdup) (const char *src);
+ wchar_t* (*mmi_wstrdup) (const wchar_t *src);
+ #endif
+ #if MIRANDA_VER >= 0x0700
+ int (*mir_snprintf) (char *buffer, size_t count, const char* fmt, ...);
+ int (*mir_sntprintf) (TCHAR *buffer, size_t count, const TCHAR* fmt, ...);
+ int (*mir_vsnprintf) (char *buffer, size_t count, const char* fmt, va_list va);
+ int (*mir_vsntprintf) (TCHAR *buffer, size_t count, const TCHAR* fmt, va_list va);
+
+ wchar_t* (*mir_a2u_cp) (const char* src, int codepage);
+ wchar_t* (*mir_a2u)(const char* src);
+ char* (*mir_u2a_cp)(const wchar_t* src, int codepage);
+ char* (*mir_u2a)( const wchar_t* src);
+ #endif
+};
+
+#define MS_SYSTEM_GET_MMI "Miranda/System/GetMMI"
+
+__forceinline INT_PTR mir_getMMI( struct MM_INTERFACE* dest )
+{
+ dest->cbSize = sizeof(*dest);
+ return CallService( MS_SYSTEM_GET_MMI, 0, (LPARAM)dest );
+}
+
+#ifndef _STATIC
+ extern struct MM_INTERFACE mmi;
+ #define mir_alloc(n) mmi.mmi_malloc(n)
+ #define mir_free(ptr) mmi.mmi_free(ptr)
+ #define mir_realloc(ptr,size) mmi.mmi_realloc(ptr,size)
+
+ #if MIRANDA_VER >= 0x0600
+ #define mir_calloc(n) mmi.mmi_calloc(n)
+ #define mir_strdup(str) mmi.mmi_strdup(str)
+ #define mir_wstrdup(str) mmi.mmi_wstrdup(str)
+ #else
+ __forceinline char* mir_strdup(const char *src)
+ { return (src == NULL) ? NULL : strcpy(( char* )mir_alloc( strlen(src)+1 ), src );
+ }
+
+ __forceinline WCHAR* mir_wstrdup(const WCHAR *src)
+ { return (src == NULL) ? NULL : wcscpy(( WCHAR* )mir_alloc(( wcslen(src)+1 )*sizeof( WCHAR )), src );
+ }
+ #endif
+ #if MIRANDA_VER >= 0x0700
+ #define mir_snprintf mmi.mir_snprintf
+ #define mir_sntprintf mmi.mir_sntprintf
+ #define mir_vsnprintf mmi.mir_vsnprintf
+ #define mir_vsntprintf mmi.mir_vsntprintf
+
+ #define mir_a2u_cp(src,cp) mmi.mir_a2u_cp(src,cp)
+ #define mir_a2u(src) mmi.mir_a2u(src)
+ #define mir_u2a_cp(src,cp) mmi.mir_u2a_cp(src,cp)
+ #define mir_u2a(src) mmi.mir_u2a(src)
+ #endif
+#else
+ char* mir_strdup(const char *src);
+ WCHAR* mir_wstrdup(const WCHAR *src);
+#endif
+
+#if defined( _UNICODE )
+ #define mir_tstrdup mir_wstrdup
+#else
+ #define mir_tstrdup mir_strdup
+#endif
+
+#define miranda_sys_free mir_free
+#define memoryManagerInterface mmi
+
+/* Returns the pointer to the simple lists manager.
+If the sortFunc member of the list gets assigned, the list becomes sorted
+
+wParam=0, lParam = (LPARAM)LIST_INTERFACE*
+*/
+
+#define LIST_INTERFACE_V1_SIZE (sizeof(size_t)+7*sizeof(void*))
+#define LIST_INTERFACE_V2_SIZE (sizeof(size_t)+9*sizeof(void*))
+#define LIST_INTERFACE_V3_SIZE (sizeof(size_t)+11*sizeof(void*))
+
+typedef int ( *FSortFunc )( void*, void* );
+
+// Assumes first 32 bit value of the data is the numeric key
+// and uses it to perform sort/search operations, this results
+// in much better performance as no compare function calls needed
+// Incredibly useful for Hash Tables
+#define NumericKeySort (FSortFunc)(void*) -1
+#define HandleKeySort (FSortFunc)(void*) -2
+#define PtrKeySort (FSortFunc)(void*) -3
+
+typedef struct
+{
+ void** items;
+ int realCount;
+ int limit;
+ int increment;
+
+ FSortFunc sortFunc;
+}
+ SortedList;
+
+struct LIST_INTERFACE
+{
+ size_t cbSize;
+
+ SortedList* ( *List_Create )( int, int );
+ void ( *List_Destroy )( SortedList* );
+
+ void* ( *List_Find )( SortedList*, void* );
+ int ( *List_GetIndex )( SortedList*, void*, int* );
+ int ( *List_Insert )( SortedList*, void*, int );
+ int ( *List_Remove )( SortedList*, int );
+ int ( *List_IndexOf )( SortedList*, void* );
+
+ #if MIRANDA_VER >= 0x0600
+ int ( *List_InsertPtr)( SortedList* list, void* p );
+ int ( *List_RemovePtr)( SortedList* list, void* p );
+ #endif
+
+ #if MIRANDA_VER >= 0x0800
+ void ( *List_Copy )( SortedList* src, SortedList* dst, size_t );
+ void ( *List_ObjCopy )( SortedList* src, SortedList* dst, size_t );
+ #endif
+};
+
+#define MS_SYSTEM_GET_LI "Miranda/System/GetLI"
+
+__forceinline INT_PTR mir_getLI( struct LIST_INTERFACE* dest )
+{
+ dest->cbSize = sizeof(*dest);
+ return CallService( MS_SYSTEM_GET_LI, 0, (LPARAM)dest );
+}
+
+/*
+ UTF8 Manager interface. 0.5.2+
+
+ Contains functions for utf8-strings encoding & decoding
+*/
+
+#define UTF8_INTERFACE_SIZEOF_V1 (sizeof(size_t)+5*sizeof(void*))
+#define UTF8_INTERFACE_SIZEOF_V2 (sizeof(size_t)+6*sizeof(void*))
+
+struct UTF8_INTERFACE
+{
+ size_t cbSize;
+
+ // decodes utf8 and places the result back into the same buffer.
+ // if the second parameter is present, the additional wchar_t* string gets allocated,
+ // and filled with the decoded utf8 content without any information loss.
+ // this string should be freed using mir_free()
+ char* ( *utf8_decode )( char* str, wchar_t** ucs2 );
+ char* ( *utf8_decodecp )( char* str, int codepage, wchar_t** ucs2 );
+
+ // encodes an ANSI string into a utf8 format using the current langpack code page,
+ // or CP_ACP, if lanpack is missing
+ // the resulting string should be freed using mir_free
+ char* ( *utf8_encode )( const char* src );
+ char* ( *utf8_encodecp )( const char* src, int codepage );
+
+ // encodes an WCHAR string into a utf8 format
+ // the resulting string should be freed using mir_free
+ char* ( *utf8_encodeW )( const wchar_t* src );
+
+ // decodes utf8 and returns the result as wchar_t* that should be freed using mir_free()
+ // the input buffer remains unchanged
+ wchar_t* ( *utf8_decodeW )( const char* str );
+
+ // returns the predicted length of the utf-8 string
+ #if MIRANDA_VER >= 0x0900
+ int ( *utf8_lenW )( const wchar_t* src );
+ #endif
+};
+
+#define MS_SYSTEM_GET_UTFI "Miranda/System/GetUTFI"
+
+__forceinline INT_PTR mir_getUTFI( struct UTF8_INTERFACE* dest )
+{
+ dest->cbSize = sizeof(*dest);
+ return CallService( MS_SYSTEM_GET_UTFI, 0, (LPARAM)dest );
+}
+
+extern struct UTF8_INTERFACE utfi;
+
+#define mir_utf8decode(A,B) utfi.utf8_decode(A,B)
+#define mir_utf8decodecp(A,B,C) utfi.utf8_decodecp(A,B,C)
+#define mir_utf8decodeW(A) utfi.utf8_decodeW(A)
+#define mir_utf8encode(A) utfi.utf8_encode(A)
+#define mir_utf8encodecp(A,B) utfi.utf8_encodecp(A,B)
+#define mir_utf8encodeW(A) utfi.utf8_encodeW(A)
+#define mir_utf8lenW(A) utfi.utf8_lenW(A)
+
+__forceinline char* mir_utf8decodeA(const char* src)
+{
+ char* tmp = mir_strdup(src);
+ mir_utf8decode(tmp, NULL);
+ return tmp;
+}
+
+#if defined( _UNICODE )
+ #define mir_utf8decodeT mir_utf8decodeW
+ #define mir_utf8encodeT mir_utf8encodeW
+#else
+ #define mir_utf8decodeT mir_utf8decodeA
+ #define mir_utf8encodeT mir_utf8encode
+#endif
+
+/*
+
+ -- Thread Safety --
+
+ Proper thread safe shutdown was implemented in 0.3.0.0 (2003/04/18)
+ and not before, therefore it is improper that any MT plugins be used
+ with earlier versions of Miranda (as hav0c will result)
+
+ Note: This does not apply to MT plugins which included their own
+ thread-safe shutdown routines.
+
+ Shutdown thread safety works thusly:
+
+ All new threads must call MS_SYSTEM_THREAD_PUSH and MS_SYSTEM_THREAD_POP
+ when they return.
+
+ Due to the nature of thread creation, it is illegal to assume
+ just a call pair of MS_SYSTEM_THREAD_PUSH inside the thread will
+ be enough -- the source thread may only return when the new child
+ thread has actually executed MS_SYSTEM_THREAD_PUSH
+
+ This is because a thread maybe in an undefined state at the point
+ when the thread creation routine returns, thus Miranda may exit
+ thinking it is safe to do so, because MS_SYSTEM_THREAD_PUSH was not
+ called in time.
+
+ See miranda.c for how this can be done using an event object
+ which is signalled just after the MS_SYSTEM_THREAD_PUSH call is executed
+ and so the source thread knows that the created thread is known to Miranda.
+
+ -- What happens when Miranda exits --
+
+ Miranda will firstly set an event object to signalled, this will
+ make MS_SYSTEM_TERMINATED return TRUE, it will then fire ME_SYSTEM_PRESHUTDOWN
+ at this point, no plugins or modules are unloaded.
+
+ Miranda will then enumerate all active threads and queue an APC call
+ to each thread, so any thread in an alertable state will become active,
+ this functionailty may not be required by your threads: but if you use
+ the Winsock2 event object system or Sleep() please use the alertable
+ wait functions, so that the thread will 'wake up' when Miranda queues
+ a message to it, SleepEx() will return WAIT_IO_COMPLETION if this happens.
+
+ After all threads have been signalled, Miranda will spin on the unwind thread stack waiting
+ for it to become empty, in this time, it will carry on processing thread
+ switches, clearing it's own APC calls (used by NotifyEventHooks(), CallServiceSync())
+
+ So a thread should be written in this kind of form:
+
+ void mythread(void *arg)
+ {
+ // assume all thread pushing/popping is done by forkthread()
+ int run=1;
+ for (;run;)
+ {
+ Beep(4391,500);
+ SleepEx(1500,TRUE);
+ if (Miranda_Terminated()) {
+ Beep(5000,150); run=0;
+ } //if
+ } //for
+ }
+
+ The above will make a nice Beep every 1.5 seconds and when the UI
+ quits, it will make a lower beep and then return.
+
+ As many copies of this thread maybe running, the creator does not need
+ to worry about what to do with previous threads, as long as they're on the
+ unwind stack.If there are any global resources (and they're mutex) you can free() them
+ at Unload(), which will only be called, after all threads have returned.
+
+ -- Summary --
+
+ MS_SYSTEM_TERMINATED (will start returning TRUE)
+ ME_SYSTEM_PRESHUTDOWN will be fired (The CList won't be visible at this point)
+
+ All PROTOTYPE_PROTOCOL registered plugins will be sent ID_STATUS_OFFLINE
+ automatically.
+
+ All the threads will be notified via QueueUserAPC() and then Miranda
+ will poll on the unwind thread queue until it is empty.
+
+ ME_SYSTEM_SHUTDOWN will be fired, the database will be unloaded, the core
+ will be unloaded -- Miranda will return.
+
+*/
+
+/* 0.5.2+
+wParam=function address
+lParam=function parameter
+
+registers a thread in the core and forks it
+
+*/
+
+typedef void (__cdecl *pThreadFunc)(void*);
+
+#define MS_SYSTEM_FORK_THREAD "Miranda/Thread/Fork"
+
+__forceinline HANDLE mir_forkthread( pThreadFunc aFunc, void* arg )
+{
+ return (HANDLE)CallService( MS_SYSTEM_FORK_THREAD, (WPARAM)aFunc, (LPARAM)arg );
+}
+
+/* 0.5.2+
+wParam=void* - thread owner object
+lParam=FORK_THREADEX_PARAMS*
+
+registers a thread in the core and forks it
+passes the extended parameters info and returns the thread id
+
+*/
+
+typedef unsigned (__stdcall *pThreadFuncEx)(void* param);
+typedef unsigned (__cdecl *pThreadFuncOwner)(void *owner, void* param);
+
+typedef struct
+{
+ pThreadFuncEx pFunc;
+ int iStackSize;
+ void* arg;
+ unsigned* threadID;
+}
+ FORK_THREADEX_PARAMS;
+
+#define MS_SYSTEM_FORK_THREAD_EX "Miranda/Thread/ForkEx"
+
+static __inline HANDLE mir_forkthreadex( pThreadFuncEx aFunc, void* arg, int stackSize, unsigned* pThreadID )
+{
+ FORK_THREADEX_PARAMS params;
+ params.pFunc = aFunc;
+ params.arg = arg;
+ params.iStackSize = stackSize;
+ params.threadID = pThreadID;
+ return (HANDLE)CallService( MS_SYSTEM_FORK_THREAD_EX, 0, (LPARAM)¶ms );
+}
+
+/* 0.8.0+
+wParam=(void*)owner
+lParam=FORK_THREADEX_PARAMS*
+
+registers a thread, owned by some object, in the core and forks it
+passes the owner info and extended parameters info and returns the thread id
+
+*/
+
+static __inline HANDLE mir_forkthreadowner( pThreadFuncOwner aFunc, void* owner, void* arg, unsigned* pThreadID )
+{
+ FORK_THREADEX_PARAMS params;
+ params.pFunc = ( pThreadFuncEx )aFunc;
+ params.arg = arg;
+ params.iStackSize = 0;
+ params.threadID = pThreadID;
+ return (HANDLE)CallService( MS_SYSTEM_FORK_THREAD_EX, (WPARAM)owner, (LPARAM)¶ms );
+}
+
+
+/*
+wParam=0
+lParam=0
+
+Add a thread to the unwind wait stack that Miranda will poll on
+when it is tearing down modules.
+
+This must be called in the context of the thread that is to be pushed
+i.e. there are no args, it works out what thread is being called
+and gets itself a handle to the calling thread.
+
+*/
+#define MS_SYSTEM_THREAD_PUSH "Miranda/Thread/Push"
+
+/*
+wParam=0
+lParam=0
+
+Remove a thread from the unwind wait stack -- it is expected
+that the call be made in the context of the thread to be removed.
+
+Miranda will begin to tear down modules and plugins if/when the
+last thread from the unwind stack is removed.
+*/
+#define MS_SYSTEM_THREAD_POP "Miranda/Thread/Pop"
+
+/*
+wParam=0
+lParam=0
+
+This hook is fired just before the thread unwind stack is used,
+it allows MT plugins to shutdown threads if they have any special
+processing to do, etc.
+
+*/
+#define ME_SYSTEM_PRESHUTDOWN "Miranda/System/PShutdown"
+
+/*
+wParam=0
+lParam=0
+
+Returns TRUE when Miranda has got WM_QUIT and is in the process
+of shutting down
+*/
+#define MS_SYSTEM_TERMINATED "Miranda/SysTerm"
+
+/*
+ wParam : 0
+ lParam : (address) void (__cdecl *callback) (void)
+ Affect : Setup a function pointer to be called after main loop iterations, it allows for
+ idle processing, See notes
+ Returns: 1 on success, 0 on failure
+
+ Notes : This service will only allow one function to be registered, if one is registered, 0 will be returned
+ Remember that this uses __cdecl.
+ Version: Added during 0.3.4+
+
+*/
+#define MS_SYSTEM_SETIDLECALLBACK "Miranda/SetIdleCallback"
+
+/*
+ wParam : 0
+ lParam : &tick
+ Affect : return the last window tick where a monitored event was seen, currently WM_CHAR/WM_MOUSEMOVE
+ Returns: Always returns 0
+ Version: Added during 0.3.4+ (2004/09/12)
+*/
+#define MS_SYSTEM_GETIDLE "Miranda/GetIdle"
+
+/*
+ wParam: cchMax (max length of buffer)
+ lParam: pointer to buffer to fill
+ Affect: Returns the build timestamp of the core, as a string of YYYYMMDDhhmmss, this service might
+ not exist and therefore the build is before 2004-09-30
+ Returns: zero on success, non zero on failure
+ Version: 0.3.4a+ (2004/09/30)
+ DEFUNCT: This service was removed on 0.3.4.3+ (2004/11/19) use APILEVEL
+*/
+#define MS_SYSTEM_GETBUILDSTRING "Miranda/GetBuildString"
+
+#ifdef _STATIC
+INT_PTR MirandaIsTerminated(WPARAM, LPARAM);
+
+__inline static INT_PTR Miranda_Terminated(void)
+{
+ return MirandaIsTerminated(0, 0);
+}
+#else
+__inline static INT_PTR Miranda_Terminated(void)
+{
+ return CallService(MS_SYSTEM_TERMINATED,0,0);
+}
+#endif
+
+/* Missing service catcher
+Is being called when one calls the non-existent service.
+All parameters are stored in the special structure
+
+The event handler takes 0 as wParam and TMissingServiceParams* as lParam.
+
+0.4.3+ addition (2006/03/27)
+*/
+
+typedef struct
+{
+ const char* name;
+ WPARAM wParam;
+ LPARAM lParam;
+}
+ MISSING_SERVICE_PARAMS;
+
+#define ME_SYSTEM_MISSINGSERVICE "System/MissingService"
+
+/* Unhandled exceptions filter
+Is being called inside any thread launched via mir_forkthread, including the main thread.
+If a plugin's author executes a large piece of code inside __try/__except, he should
+obtain this filter and call it inside the __except section
+
+0.8.0+ addition (2008/07/20)
+*/
+
+typedef DWORD ( __cdecl *pfnExceptionFilter )( DWORD code, EXCEPTION_POINTERS* info );
+
+#define MS_SYSTEM_GETEXCEPTFILTER "System/GetExceptFilter"
+
+__inline static pfnExceptionFilter Miranda_GetExceptFilter( void )
+{ return ( pfnExceptionFilter )CallService( MS_SYSTEM_GETEXCEPTFILTER, 0, 0 );
+}
+
+#define MS_SYSTEM_SETEXCEPTFILTER "System/SetExceptFilter"
+
+__inline static pfnExceptionFilter Miranda_SetExceptFilter( pfnExceptionFilter foo )
+{ return ( pfnExceptionFilter )CallService( MS_SYSTEM_SETEXCEPTFILTER, 0, (LPARAM)foo );
+}
+
+
+#endif // M_SYSTEM_H
diff --git a/include/m_system_cpp.h b/include/m_system_cpp.h new file mode 100644 index 0000000000..8c19d7c6f8 --- /dev/null +++ b/include/m_system_cpp.h @@ -0,0 +1,184 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_SYSTEM_CPP_H__
+#define M_SYSTEM_CPP_H__ 1
+
+#include "m_system.h"
+
+#if defined( __cplusplus ) && MIRANDA_VER >= 0x0600
+extern LIST_INTERFACE li;
+
+#define NumericKeySortT -1
+#define HandleKeySortT -2
+#define PtrKeySortT -3
+
+template<class T> struct LIST
+{
+ typedef int ( *FTSortFunc )( const T* p1, const T* p2 );
+
+ __inline LIST( int aincr, FTSortFunc afunc = NULL )
+ { memset( this, 0, sizeof( *this ));
+ increment = aincr;
+ sortFunc = afunc;
+ }
+
+ __inline LIST( int aincr, INT_PTR id )
+ { memset( this, 0, sizeof( *this ));
+ increment = aincr;
+ sortFunc = FTSortFunc( id );
+ }
+
+ __inline T* operator[]( int idx ) const { return ( idx >= 0 && idx < count ) ? items[idx] : NULL; }
+ __inline int getCount( void ) const { return count; }
+ __inline T** getArray( void ) const { return items; }
+
+ #if defined( _STATIC )
+ __inline LIST( const LIST& x )
+ { items = NULL;
+ List_Copy(( SortedList* )&x, ( SortedList* )this, sizeof( T ));
+ }
+
+ __inline int getIndex( T* p ) const
+ { int idx;
+ return ( !List_GetIndex(( SortedList* )this, p, &idx )) ? -1 : idx;
+ }
+
+ __inline void destroy( void ) { List_Destroy(( SortedList* )this ); }
+
+ __inline T* find( T* p ) { return ( T* )List_Find(( SortedList* )this, p ); }
+ __inline int indexOf( T* p ) { return List_IndexOf(( SortedList* )this, p ); }
+ __inline int insert( T* p, int idx ) { return List_Insert(( SortedList* )this, p, idx ); }
+ __inline int remove( int idx ) { return List_Remove(( SortedList* )this, idx ); }
+
+ __inline int insert( T* p ) { return List_InsertPtr(( SortedList* )this, p ); }
+ __inline int remove( T* p ) { return List_RemovePtr(( SortedList* )this, p ); }
+ #else
+ __inline LIST( const LIST& x )
+ { items = NULL;
+ li.List_Copy(( SortedList* )&x, ( SortedList* )this, sizeof( T ));
+ }
+
+ __inline int getIndex( T* p ) const
+ { int idx;
+ return ( !li.List_GetIndex(( SortedList* )this, p, &idx )) ? -1 : idx;
+ }
+
+ __inline void destroy( void ) { li.List_Destroy(( SortedList* )this ); }
+
+ __inline T* find( T* p ) { return ( T* )li.List_Find(( SortedList* )this, p ); }
+ __inline int indexOf( T* p ) { return li.List_IndexOf(( SortedList* )this, p ); }
+ __inline int insert( T* p, int idx ) { return li.List_Insert(( SortedList* )this, p, idx ); }
+ __inline int remove( int idx ) { return li.List_Remove(( SortedList* )this, idx ); }
+
+ __inline int insert( T* p ) { return li.List_InsertPtr(( SortedList* )this, p ); }
+ __inline int remove( T* p ) { return li.List_RemovePtr(( SortedList* )this, p ); }
+ #endif
+
+protected:
+ T** items;
+ int count, limit, increment;
+ FTSortFunc sortFunc;
+};
+
+template<class T> struct OBJLIST : public LIST<T>
+{
+ typedef int ( *FTSortFunc )( const T* p1, const T* p2 );
+
+ __inline OBJLIST( int aincr, FTSortFunc afunc = NULL ) :
+ LIST<T>( aincr, afunc )
+ {}
+
+ __inline OBJLIST( int aincr, INT_PTR id ) :
+ LIST<T>( aincr, ( FTSortFunc ) id )
+ {}
+
+ __inline OBJLIST( const OBJLIST& x ) :
+ LIST<T>( x.increment, x.sortFunc )
+ { items = NULL;
+ #if defined( _STATIC )
+ List_ObjCopy(( SortedList* )&x, ( SortedList* )this, sizeof( T ));
+ #else
+ li.List_ObjCopy(( SortedList* )&x, ( SortedList* )this, sizeof( T ));
+ #endif
+ }
+
+ __inline OBJLIST& operator=( const OBJLIST& x )
+ { destroy();
+ #if defined( _STATIC )
+ List_ObjCopy(( SortedList* )&x, ( SortedList* )this, sizeof( T ));
+ #else
+ li.List_ObjCopy(( SortedList* )&x, ( SortedList* )this, sizeof( T ));
+ #endif
+ return *this;
+ }
+
+ ~OBJLIST()
+ {
+ #if !defined( _STATIC )
+ if (li.cbSize != 0)
+ #endif
+ destroy();
+ }
+
+ __inline void destroy( void )
+ {
+ for ( int i=0; i < this->count; i++ )
+ delete this->items[i];
+
+ #if defined( _STATIC )
+ List_Destroy(( SortedList* )this );
+ #else
+ li.List_Destroy(( SortedList* )this );
+ #endif
+ }
+
+ __inline int remove( int idx ) {
+ delete this->items[idx];
+ #if defined( _STATIC )
+ return List_Remove(( SortedList* )this, idx );
+ #else
+ return li.List_Remove(( SortedList* )this, idx );
+ #endif
+ }
+
+ __inline int remove( T* p )
+ {
+ #if defined( _STATIC )
+ if ( li.List_RemovePtr(( SortedList* )this, p ) != -1 )
+ #else
+ if ( li.List_RemovePtr(( SortedList* )this, p ) != -1 )
+ #endif
+ {
+ delete p;
+ return 1;
+ }
+ return 0;
+ }
+
+ __inline T& operator[]( int idx ) const { return *this->items[idx]; }
+};
+
+#endif
+
+#endif // M_SYSTEM_CPP_H
+
diff --git a/include/m_timezones.h b/include/m_timezones.h new file mode 100644 index 0000000000..35a5651696 --- /dev/null +++ b/include/m_timezones.h @@ -0,0 +1,96 @@ +/*
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2010 Miranda ICQ/IM 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_TIMEZONES_H
+#define __M_TIMEZONES_H
+
+#define MIM_TZ_NAMELEN 64
+
+#define TZF_PLF_CB 1 // UI element is assumed to be a combo box
+#define TZF_PLF_LB 2 // UI element is assumed to be a list box
+#define TZF_DIFONLY 4
+#define TZF_KNOWNONLY 8
+
+#define LOCAL_TIME_HANDLE NULL
+#define UTC_TIME_HANDLE ((void*)-1)
+
+typedef struct
+{
+ size_t cbSize;
+
+ HANDLE ( *createByName )( LPCTSTR tszName, DWORD dwFlags );
+ HANDLE ( *createByContact )( HANDLE hContact, DWORD dwFlags );
+ void ( *storeByContact )( HANDLE hContact, HANDLE hTZ );
+
+ int ( *printDateTime )( HANDLE hTZ, LPCTSTR szFormat, LPTSTR szDest, int cbDest, DWORD dwFlags );
+ int ( *printTimeStamp )( HANDLE hTZ, time_t ts, LPCTSTR szFormat, LPTSTR szDest, int cbDest, DWORD dwFlags );
+
+ int ( *prepareList )( HANDLE hContact, HWND hWnd, DWORD dwFlags );
+ int ( *selectListItem )( HANDLE hContact, HWND hWnd, DWORD dwFlags );
+ void ( *storeListResults )( HANDLE hContact, HWND hWnd, DWORD dwFlags );
+
+ int ( *getTimeZoneTime )( HANDLE hTZ, SYSTEMTIME *st );
+ time_t ( *timeStampToTimeZoneTimeStamp )( HANDLE hTZ, time_t ts );
+
+ LPTIME_ZONE_INFORMATION ( *getTzi )( HANDLE hTZ );
+ LPCTSTR ( *getTzName )( HANDLE hTZ );
+
+#ifdef __cplusplus
+ int printDateTimeByContact (HANDLE hContact, LPCTSTR szFormat, LPTSTR szDest, int cbDest, DWORD dwFlags)
+ { return printDateTime(createByContact(hContact, dwFlags), szFormat, szDest, cbDest, dwFlags); }
+
+ int printTimeStampByContact(HANDLE hContact, time_t ts, LPCTSTR szFormat, LPTSTR szDest, int cbDest, DWORD dwFlags)
+ { return printTimeStamp(createByContact(hContact, dwFlags), ts, szFormat, szDest, cbDest, dwFlags); }
+
+ LPTIME_ZONE_INFORMATION getTziByContact(HANDLE hContact)
+ { return getTzi(createByContact(hContact, 0)); }
+
+ int getTimeZoneTimeByContact(HANDLE hContact, SYSTEMTIME *st)
+ { return getTimeZoneTime(createByContact(hContact, 0), st); }
+
+ time_t timeStampToTimeZoneTimeStampByContact(HANDLE hContact, time_t ts)
+ { return timeStampToTimeZoneTimeStamp(createByContact(hContact, 0), ts); }
+#endif
+
+} TIME_API;
+
+/* every protocol should declare this variable to use the Time API */
+extern TIME_API tmi;
+
+/*
+a service to obtain the Time API
+
+wParam = 0;
+lParam = (LPARAM)(TIME_API*).
+
+returns TRUE if all is Ok, and FALSE otherwise
+*/
+
+#define MS_SYSTEM_GET_TMI "Miranda/System/GetTimeApi"
+
+__forceinline int mir_getTMI(TIME_API* dest)
+{
+ dest->cbSize = sizeof(*dest);
+ return CallService(MS_SYSTEM_GET_TMI, 0, (LPARAM)dest);
+}
+
+#endif /* __M_TIMEZONES_H */
diff --git a/include/m_url.h b/include/m_url.h new file mode 100644 index 0000000000..e943fb6c01 --- /dev/null +++ b/include/m_url.h @@ -0,0 +1,35 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_URL_H__
+#define M_URL_H__ 1
+
+//bring up the send URL dialog for a user
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=0
+//returns 0 on success or nonzero on failure
+//returns immediately, before the url is sent
+#define MS_URL_SENDURL "SRUrl/SendCommand"
+
+#endif // M_URL_H__
+
diff --git a/include/m_userinfo.h b/include/m_userinfo.h new file mode 100644 index 0000000000..a30243e8ea --- /dev/null +++ b/include/m_userinfo.h @@ -0,0 +1,76 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_USERINFO_H__
+#define M_USERINFO_H__ 1
+
+#include "m_options.h"
+
+//show the User Details dialog box
+//wParam=(WPARAM)(HANDLE)hContact
+//lParam=0
+#define MS_USERINFO_SHOWDIALOG "UserInfo/ShowDialog"
+
+/* UserInfo/Initialise v0.1.2.0+
+The user opened a details dialog. Modules should do whatever initialisation
+they need and call userinfo/addpage one or more times if they want pages
+displayed in the options dialog
+wParam=addInfo
+lParam=(LPARAM)hContact
+addInfo should be passed straight to the wParam of userinfo/addpage
+NB: The built-in userinfo module is loaded after all plugins, so calling
+HookEvent() in your plugin's Load() function will fail if you specify this
+hook. Look up core/m_system.h:me_system_modulesloaded.
+*/
+#define ME_USERINFO_INITIALISE "UserInfo/Initialise"
+
+/* UserInfo/AddPage v0.1.2.0+
+Must only be called during an userinfo/initialise hook
+Adds a page to the details dialog
+wParam=addInfo
+lParam=(LPARAM)(OPTIONSDIALOGPAGE*)odp
+addInfo must have come straight from the wParam of userinfo/initialise
+Pages in the details dialog operate just like pages in property sheets. See the
+Microsoft documentation for info on how they operate.
+When the pages receive WM_INITDIALOG, lParam=(LPARAM)hContact
+Strings in the structure can be released as soon as the service returns, but
+icons must be kept around. This is not a problem if you're loading them from a
+resource
+The 3 'group' elements in the structure are ignored, and will always be ignored
+Unlike the options dialog, the details dialog does not resize to fit its
+largest page. Details dialog pages should be 222x132 dlus.
+The details dialog (currently) has no Cancel button. I'm waiting to see if it's
+sensible to have one.
+Pages will be sent PSN_INFOCHANGED through WM_NOTIFY (idFrom=0) when a protocol
+ack is broadcast for the correct contact and with type=ACKTYPE_GETINFO.
+To help you out, PSN_INFOCHANGED will also be sent to each page just after it's
+created.
+All PSN_ WM_NOTIFY messages have PSHNOTIFY.lParam=(LPARAM)hContact
+*/
+#define PSN_INFOCHANGED 1
+#define PSN_PARAMCHANGED 2
+#define PSM_FORCECHANGED (WM_USER+100) //force-send a PSN_INFOCHANGED to all pages
+#define MS_USERINFO_ADDPAGE "UserInfo/AddPage"
+
+#endif // M_USERINFO_H__
+
diff --git a/include/m_utils.h b/include/m_utils.h new file mode 100644 index 0000000000..75185bb1ee --- /dev/null +++ b/include/m_utils.h @@ -0,0 +1,612 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2012 Miranda ICQ/IM 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_UTILS_H__
+#define M_UTILS_H__ 1
+
+#ifdef _MSC_VER
+ #pragma warning(disable:4201)
+#endif
+
+#include <stdio.h>
+
+#if !defined(M_SYSTEM_H__)
+#include "m_system.h"
+#endif
+
+//this entire module is v0.1.0.1+
+//this module cannot be redefined by a plugin, because it's not useful for it
+//to be possible
+//There are some more utility services in the database for dealing with time
+//and simple string scrambling, but they are very db-orientated
+
+/* Opens a URL in the user's default web browser v0.1.0.1+
+wParam=bOpenInNewWindow
+lParam=(LPARAM)(const char*)szUrl
+returns 0 always
+bOpenInNewWindow should be zero to open the URL in the browser window the user
+last used, or nonzero to open in a new browser window. If there's no browser
+running, one will be opened to show the URL.
+*/
+#define MS_UTILS_OPENURL "Utils/OpenURL"
+
+/* Resizes a dialog by calling a custom routine to move the individual
+controls v0.1.0.1+
+wParam=0
+lParam=(LPARAM)(UTILRESIZEDIALOG*)&urd
+Returns 0 on success, or nonzero on failure
+Does not support dialogtemplateex dialog boxes, and will return failure if you
+try to resize one
+The dialog itself should have been resized prior to calling this service
+pfnResizer is called once for each control in the dialog
+pfnResizer should return a combination of one rd_anchorx_ and one rd_anchory
+constant
+*/
+typedef struct {
+ int cbSize;
+ UINT wId; //control ID
+ RECT rcItem; //original control rectangle, relative to dialog
+ //modify in-place to specify the new position
+ SIZE dlgOriginalSize; //size of dialog client area in template
+ SIZE dlgNewSize; //current size of dialog client area
+} UTILRESIZECONTROL;
+typedef int (*DIALOGRESIZERPROC)(HWND hwndDlg,LPARAM lParam,UTILRESIZECONTROL *urc);
+typedef struct {
+ int cbSize;
+ HWND hwndDlg;
+ HINSTANCE hInstance; //module containing the dialog template
+ LPCSTR lpTemplate; //dialog template
+ LPARAM lParam; //caller-defined
+ DIALOGRESIZERPROC pfnResizer;
+} UTILRESIZEDIALOG;
+#define RD_ANCHORX_CUSTOM 0 //function did everything required to the x axis, do no more processing
+#define RD_ANCHORX_LEFT 0 //move the control to keep it constant distance from the left edge of the dialog
+#define RD_ANCHORX_RIGHT 1 //move the control to keep it constant distance from the right edge of the dialog
+#define RD_ANCHORX_WIDTH 2 //size the control to keep it constant distance from both edges of the dialog
+#define RD_ANCHORX_CENTRE 4 //move the control to keep it constant distance from the centre of the dialog
+#define RD_ANCHORY_CUSTOM 0
+#define RD_ANCHORY_TOP 0
+#define RD_ANCHORY_BOTTOM 8
+#define RD_ANCHORY_HEIGHT 16
+#define RD_ANCHORY_CENTRE 32
+#define MS_UTILS_RESIZEDIALOG "Utils/ResizeDialog"
+
+/* Gets the name of a country given its number v0.1.2.0+
+wParam=countryId
+lParam=0
+Returns a pointer to the string containing the country name on success,
+or NULL on failure
+*/
+#define MS_UTILS_GETCOUNTRYBYNUMBER "Utils/GetCountryByNumber"
+
+/* Gets the full list of country IDs v0.1.2.0+
+wParam=(WPARAM)(int*)piCount
+lParam=(LPARAM)(struct CountryListEntry**)ppList
+Returns 0 always
+Neither wParam nor lParam can be NULL.
+The list is sorted alphabetically by country name, on the assumption that it's
+quicker to search numbers out of order than it is to search names out of order
+*/
+struct CountryListEntry {
+ int id;
+ const char *szName;
+};
+#define MS_UTILS_GETCOUNTRYLIST "Utils/GetCountryList"
+
+/******************************* Window lists *******************************/
+
+//allocate a window list v0.1.0.1+
+//wParam=lParam=0
+//returns a handle to the new window list
+#define MS_UTILS_ALLOCWINDOWLIST "Utils/AllocWindowList"
+
+//adds a window to the specified window list v0.1.0.1+
+//wParam=0
+//lParam=(LPARAM)(WINDOWLISTENTRY*)&wle
+//returns 0 on success, nonzero on failure
+typedef struct {
+ HANDLE hList;
+ HWND hwnd;
+ HANDLE hContact;
+} WINDOWLISTENTRY;
+#define MS_UTILS_ADDTOWINDOWLIST "Utils/AddToWindowList"
+__inline static INT_PTR WindowList_Add(HANDLE hList,HWND hwnd,HANDLE hContact) {
+ WINDOWLISTENTRY wle;
+ wle.hList=hList; wle.hwnd=hwnd; wle.hContact=hContact;
+ return CallService(MS_UTILS_ADDTOWINDOWLIST,0,(LPARAM)&wle);
+}
+//removes a window from the specified window list v0.1.0.1+
+//wParam=(WPARAM)(HANDLE)hList
+//lParam=(LPARAM)(HWND)hwnd
+//returns 0 on success, nonzero on failure
+#define MS_UTILS_REMOVEFROMWINDOWLIST "Utils/RemoveFromWindowList"
+__inline static INT_PTR WindowList_Remove(HANDLE hList,HWND hwnd) {
+ return CallService(MS_UTILS_REMOVEFROMWINDOWLIST,(WPARAM)hList,(LPARAM)hwnd);
+}
+
+//finds a window given the hContact v0.1.0.1+
+//wParam=(WPARAM)(HANDLE)hList
+//lParam=(WPARAM)(HANDLE)hContact
+//returns the window handle on success, or NULL on failure
+#define MS_UTILS_FINDWINDOWINLIST "Utils/FindWindowInList"
+__inline static HWND WindowList_Find(HANDLE hList,HANDLE hContact) {
+ return (HWND)CallService(MS_UTILS_FINDWINDOWINLIST,(WPARAM)hList,(LPARAM)hContact);
+}
+
+//broadcasts a message to all windows in a list v0.1.0.1+
+//wParam=(WPARAM)(HANDLE)hList
+//lParam=(LPARAM)(MSG*)&msg
+//returns 0 on success, nonzero on failure
+//Only msg.message, msg.wParam and msg.lParam are used
+#define MS_UTILS_BROADCASTTOWINDOWLIST "Utils/BroadcastToWindowList"
+__inline static INT_PTR WindowList_Broadcast(HANDLE hList,UINT message,WPARAM wParam,LPARAM lParam) {
+ MSG msg;
+ msg.message=message; msg.wParam=wParam; msg.lParam=lParam;
+ return CallService(MS_UTILS_BROADCASTTOWINDOWLIST,(WPARAM)hList,(LPARAM)&msg);
+}
+
+/*
+ Description: Broadcast a message to all windows in the given list using PostMessage()
+ Version: 0.3.0.0+
+ Inline helper: WindowList_BroadcastAsync
+
+ wParam=(WPARAM)(HANDLE)hList
+ lParam=(LPARAM)(MSG*)&msg
+
+ Returns 0 on success, nonzero on failure, this service does not fail, even if PostMessage() fails for whatever reason
+
+*/
+#define MS_UTILS_BROADCASTTOWINDOWLIST_ASYNC "Utils/BroadcastToWindowListAsync"
+
+__inline static INT_PTR WindowList_BroadcastAsync(HANDLE hList,UINT message,WPARAM wParam,LPARAM lParam) {
+ MSG msg;
+ msg.message=message; msg.wParam=wParam; msg.lParam=lParam;
+ return CallService(MS_UTILS_BROADCASTTOWINDOWLIST_ASYNC,(WPARAM)hList,(LPARAM)&msg);
+}
+
+/***************************** Hyperlink windows ********************************/
+
+//there aren't any services here, because you don't need them.
+#define WNDCLASS_HYPERLINK _T("Hyperlink")
+//the control will obey the SS_LEFT (0), SS_CENTER (1), and SS_RIGHT (2) styles
+//the control will send STN_CLICKED via WM_COMMAND when the link itself is clicked
+
+// Use this in a SendMessage to set the color of the url when control is enabled
+// wParam=DWORD color
+// lParam=not used
+#define HLK_SETENABLECOLOUR (WM_USER+101) // added in 0.3.1
+// Use this in a SendMessage to set the color of the url when control is disabled
+// wParam=DWORD color
+// lParam=not used
+#define HLK_SETDISABLECOLOUR (WM_USER+102) // added in 0.3.1
+
+/***************************** Window Position Saving ***************************/
+
+//saves the position of a window in the database v0.1.1.0+
+//wParam=0
+//lParam=(LPARAM)(SAVEWINDOWPOS*)&swp
+//returns 0 on success, nonzero on failure
+typedef struct {
+ HWND hwnd;
+ HANDLE hContact;
+ const char *szModule; //module name to store the setting in
+ const char *szNamePrefix; //text to prefix on "x", "width", etc, to form setting names
+} SAVEWINDOWPOS;
+#define MS_UTILS_SAVEWINDOWPOSITION "Utils/SaveWindowPos"
+__inline static INT_PTR Utils_SaveWindowPosition(HWND hwnd,HANDLE hContact,const char *szModule,const char *szNamePrefix) {
+ SAVEWINDOWPOS swp;
+ swp.hwnd=hwnd; swp.hContact=hContact; swp.szModule=szModule; swp.szNamePrefix=szNamePrefix;
+ return CallService(MS_UTILS_SAVEWINDOWPOSITION,0,(LPARAM)&swp);
+}
+
+//restores the position of a window from the database v0.1.1.0+
+//wParam=flags
+//lParam=(LPARAM)(SAVEWINDOWPOS*)&swp
+//returns 0 on success, nonzero on failure
+//if no position was found in the database, the function returns 1 and does
+//nothing
+//the NoSize version won't use stored size information: the window is left the
+//same size.
+#define RWPF_NOSIZE 1 //don't use stored size info: leave dialog same size
+#define RWPF_NOMOVE 2 //don't use stored position
+#define RWPF_NOACTIVATE 4 //show but don't activate v0.3.3.0+
+#define RWPF_HIDDEN 8 //make it hidden
+#define MS_UTILS_RESTOREWINDOWPOSITION "Utils/RestoreWindowPos"
+__inline static INT_PTR Utils_RestoreWindowPositionEx(HWND hwnd,int flags,HANDLE hContact,const char *szModule,const char *szNamePrefix) {
+ SAVEWINDOWPOS swp;
+ swp.hwnd=hwnd; swp.hContact=hContact; swp.szModule=szModule; swp.szNamePrefix=szNamePrefix;
+ return CallService(MS_UTILS_RESTOREWINDOWPOSITION,flags,(LPARAM)&swp);
+}
+__inline static INT_PTR Utils_RestoreWindowPosition(HWND hwnd,HANDLE hContact,const char *szModule,const char *szNamePrefix) {
+ return Utils_RestoreWindowPositionEx(hwnd, 0, hContact, szModule, szNamePrefix);
+}
+__inline static INT_PTR Utils_RestoreWindowPositionNoSize(HWND hwnd,HANDLE hContact,const char *szModule,const char *szNamePrefix) {
+ return Utils_RestoreWindowPositionEx(hwnd, RWPF_NOSIZE, hContact, szModule, szNamePrefix);
+}
+__inline static INT_PTR Utils_RestoreWindowPositionNoMove(HWND hwnd,HANDLE hContact,const char *szModule,const char *szNamePrefix) {
+ return Utils_RestoreWindowPositionEx(hwnd, RWPF_NOMOVE, hContact, szModule, szNamePrefix);
+}
+
+//Moves a RECT inside screen if it is outside.It works with multiple monitors v0.9.0.4+
+//wParam=RECT *
+//lParam=0
+//returns <0 on error, 0 if not changed the rect, 1 if changed the rect
+#define MS_UTILS_ASSERTINSIDESCREEN "Utils/AssertInsideScreen"
+__inline static INT_PTR Utils_AssertInsideScreen(RECT *rc) {
+ return CallService(MS_UTILS_ASSERTINSIDESCREEN,(WPARAM)rc,0);
+}
+
+/************************ Colour Picker Control (0.1.2.1+) **********************/
+
+#define WNDCLASS_COLOURPICKER _T("ColourPicker")
+
+#define CPM_SETCOLOUR 0x1000 //lParam=new colour
+#define CPM_GETCOLOUR 0x1001 //returns colour
+#define CPM_SETDEFAULTCOLOUR 0x1002 //lParam=default, used as first custom colour
+#define CPM_GETDEFAULTCOLOUR 0x1003 //returns colour
+#define CPN_COLOURCHANGED 1 //sent through WM_COMMAND
+
+/***************************** Bitmap Filter (0.1.2.1+) *************************/
+
+//Loads a bitmap v0.1.2.1+
+//wParam=0
+//lParam=(LPARAM)(const char*)filename
+//returns HBITMAP on success, NULL on failure
+//This function uses OleLoadPicturePath() so supports BMP, JPEG and GIF. It may
+//support PNG on future versions of Windows (or XP for that matter)
+//For speed, if the file extension is .bmp or .rle it'll use LoadImage() so as
+//to avoid the big lag loading OLE.
+//Remember to DeleteObject() when you're done
+#define MS_UTILS_LOADBITMAP "Utils/LoadBitmap"
+
+#ifdef _UNICODE
+ #define MS_UTILS_LOADBITMAPW "Utils/LoadBitmapW"
+ #define MS_UTILS_LOADBITMAPT MS_UTILS_LOADBITMAPW
+#else
+ #define MS_UTILS_LOADBITMAPT MS_UTILS_LOADBITMAP
+#endif
+
+//Gets the filter strings for use in the open file dialog v0.1.2.1+
+//wParam=cbLengthOfBuffer
+//lParam=(LPARAM)(char*)pszBuffer
+//Returns 0 on success, nonzero on failure
+//See the MSDN under OPENFILENAME.lpstrFilter for the formatting
+//An 'All Bitmaps' item is always first and 'All Files' is last.
+//The returned string is already translated.
+#define MS_UTILS_GETBITMAPFILTERSTRINGS "Utils/GetBitmapFilterStrings"
+
+//Saves a path to a relative path (from the miranda directory)
+//Only saves as a relative path if the file is in the miranda directory (or
+//sub directory)
+//wParam=(WPARAM)(char*)pszPath
+//lParam=(LPARAM)(char*)pszNewPath
+//pszPath is the path to convert and pszNewPath is the buffer that
+//the new path is copied too. pszNewPath MUST be of the size MAX_PATH.
+//Returns numbers of chars copied.
+//Unicode version is available since 0.6.2
+#define MS_UTILS_PATHTORELATIVE "Utils/PathToRelative"
+
+//Saves a path to a absolute path (from the miranda directory)
+//wParam=(WPARAM)(char*)pszPath
+//lParam=(LPARAM)(char*)pszNewPath
+//pszPath is the path to convert and pszNewPath is the buffer that
+//the new path is copied too. pszNewPath MUST be of the size MAX_PATH.
+//Returns numbers of chars copied.
+//Unicode version is available since 0.6.2
+#define MS_UTILS_PATHTOABSOLUTE "Utils/PathToAbsolute"
+
+//Creates a directory tree (even more than one directories levels are missing) 0.7.0+
+//wParam=0 (unused)
+//lParam=(LPARAM)(char*)pszPath - directory to be created
+//Returns 0 on success error code otherwise
+//Unicode version is available since 0.7.0
+#define MS_UTILS_CREATEDIRTREE "Utils/CreateDirTree"
+
+// Generates Random number of any length
+//wParam=size - length of the random number to generate
+//lParam=(LPARAM)(char*)pszArray - pointer to array to fill with random number
+//Always returns 0
+#define MS_UTILS_GETRANDOM "Utils/GetRandom"
+
+//Replace variables in text
+//wParam=(char*/TCHAR*/WCHAR*)string (depends on RVF_UNICODE/RVF_TCHAR flag)
+//lParam=(REPLACEVARSDATA *) data about variables, item with key=0 terminates the list
+//returns new string, use mir_free to destroy
+
+// variables known by the core:
+// ----------------------------
+// %miranda_profile% -> same as MS_DB_GETPROFILEPATH, base folder for all profiles
+// %miranda_userdata% -> the active profile folder (home of the .dat file and all
+// profile data)
+// %miranda_path% -> home path of the miranda installation (installation path
+// of miranda32/64.exe
+// %miranda_profilename% -> Name of the profile in use. Essentially, the name of the
+// .dat file without file name extension. Also: the folder name
+// relative to %miranda_profile% where all profile data is stored.
+// %miranda_logpath% -> base folder for log files. This is \Logs relative to the
+// current profile folder.
+// %miranda_avatarcache% -> base folder for all protocol avatars. internal use only.
+//
+// the following variables operate on contacts. REPLACEVARSDATA::hContact must be
+// supplied by the caller.
+//
+// %nick% -> a contact nick name.
+// %proto% -> internal protocol name for a given contact. NOT the user-
+// defined account name.
+// %userid% -> Unique ID for a given contact (UIN, JID etc.)
+
+// the following variables are system variables - unrelated to miranda profiles.
+
+// %appdata% -> same as %APPDATA% environment variable.
+// %destkop% -> location of the desktop folder in a user's profile.
+// %mydocuments% -> location of the "My Documents" shell folder.
+
+typedef struct
+{
+ union
+ {
+ TCHAR *lptzKey;
+ char *lpszKey;
+ WCHAR *lpwzKey;
+ };
+ union
+ {
+ TCHAR *lptzValue;
+ char *lpszValue;
+ WCHAR *lpwzValue;
+ };
+} REPLACEVARSARRAY;
+
+typedef struct
+{
+ int cbSize;
+ DWORD dwFlags;
+ HANDLE hContact;
+ REPLACEVARSARRAY *variables;
+} REPLACEVARSDATA;
+
+#define RVF_UNICODE 1
+#ifdef _UNICODE
+ #define RVF_TCHAR RVF_UNICODE
+#else
+ #define RVF_TCHAR 0
+#endif
+
+#define MS_UTILS_REPLACEVARS "Utils/ReplaceVars"
+
+__inline static char* Utils_ReplaceVars(const char *szData) {
+ REPLACEVARSDATA dat = {0};
+ dat.cbSize = sizeof(dat);
+ return (char*)CallService(MS_UTILS_REPLACEVARS, (WPARAM)szData, (LPARAM)&dat);
+}
+__inline static TCHAR* Utils_ReplaceVarsT(const TCHAR *szData) {
+ REPLACEVARSDATA dat = {0};
+ dat.cbSize = sizeof(dat);
+ dat.dwFlags = RVF_TCHAR;
+ return (TCHAR*)CallService(MS_UTILS_REPLACEVARS, (WPARAM)szData, (LPARAM)&dat);
+}
+#ifdef _UNICODE
+ #define MS_UTILS_PATHTORELATIVEW "Utils/PathToRelativeW"
+ #define MS_UTILS_PATHTOABSOLUTEW "Utils/PathToAbsoluteW"
+ #define MS_UTILS_CREATEDIRTREEW "Utils/CreateDirTreeW"
+ #define MS_UTILS_GETBITMAPFILTERSTRINGSW "Utils/GetBitmapFilterStringsW"
+
+ #define MS_UTILS_PATHTORELATIVET MS_UTILS_PATHTORELATIVEW
+ #define MS_UTILS_PATHTOABSOLUTET MS_UTILS_PATHTOABSOLUTEW
+ #define MS_UTILS_CREATEDIRTREET MS_UTILS_CREATEDIRTREEW
+ #define MS_UTILS_GETBITMAPFILTERSTRINGST MS_UTILS_GETBITMAPFILTERSTRINGSW
+#else
+ #define MS_UTILS_PATHTORELATIVET MS_UTILS_PATHTORELATIVE
+ #define MS_UTILS_PATHTOABSOLUTET MS_UTILS_PATHTOABSOLUTE
+ #define MS_UTILS_CREATEDIRTREET MS_UTILS_CREATEDIRTREE
+ #define MS_UTILS_GETBITMAPFILTERSTRINGST MS_UTILS_GETBITMAPFILTERSTRINGS
+#endif
+
+/*
+ MD5 interface. 0.7.0.12
+
+ Contains functions for md5 handling
+*/
+/* Define the state of the MD5 Algorithm. */
+typedef unsigned char mir_md5_byte_t; /* 8-bit byte */
+typedef unsigned int mir_md5_word_t; /* 32-bit word */
+
+typedef struct mir_md5_state_s {
+ mir_md5_word_t count[2]; /* message length in bits, lsw first */
+ mir_md5_word_t abcd[4]; /* digest buffer */
+ mir_md5_byte_t buf[64]; /* accumulate block */
+} mir_md5_state_t;
+
+struct MD5_INTERFACE
+{
+ int cbSize;
+ void (*md5_init) (mir_md5_state_t *pms);
+ void (*md5_append) (mir_md5_state_t *pms, const mir_md5_byte_t *data, int nbytes);
+ void (*md5_finish) (mir_md5_state_t *pms, mir_md5_byte_t digest[16]);
+ void (*md5_hash) (const mir_md5_byte_t *data, int len, mir_md5_byte_t digest[16]);
+};
+
+#define MS_SYSTEM_GET_MD5I "Miranda/System/GetMD5I"
+
+static __inline INT_PTR mir_getMD5I( struct MD5_INTERFACE* dest )
+{
+ dest->cbSize = sizeof(*dest);
+ return CallService( MS_SYSTEM_GET_MD5I, 0, (LPARAM)dest );
+}
+
+extern struct MD5_INTERFACE md5i;
+
+#define mir_md5_init(A) md5i.md5_init(A)
+#define mir_md5_append(A,B,C) md5i.md5_append(A,B,C)
+#define mir_md5_finish(A,B) md5i.md5_finish(A,B)
+#define mir_md5_hash(A,B,C) md5i.md5_hash(A,B,C)
+
+/*
+ SHA1 interface. 0.7.0.12
+
+ Contains functions for SHA1 handling
+*/
+typedef unsigned char mir_sha1_byte_t;
+typedef unsigned long mir_sha1_long_t;
+#define MIR_SHA1_HASH_SIZE 20
+
+typedef struct {
+ mir_sha1_long_t H[5];
+ mir_sha1_long_t W[80];
+ int lenW;
+ mir_sha1_long_t sizeHi,sizeLo;
+} mir_sha1_ctx;
+
+struct SHA1_INTERFACE
+{
+ int cbSize;
+ void (*sha1_init) (mir_sha1_ctx *ctx);
+ void (*sha1_append) (mir_sha1_ctx *ctx, mir_sha1_byte_t *dataIn, int len);
+ void (*sha1_finish) (mir_sha1_ctx *ctx, mir_sha1_byte_t hashout[20]);
+ void (*sha1_hash) (mir_sha1_byte_t *dataIn, int len, mir_sha1_byte_t hashout[20]);
+};
+
+#define MS_SYSTEM_GET_SHA1I "Miranda/System/GetSHA1I"
+
+static __inline INT_PTR mir_getSHA1I( struct SHA1_INTERFACE* dest )
+{
+ dest->cbSize = sizeof(*dest);
+ return CallService( MS_SYSTEM_GET_SHA1I, 0, (LPARAM)dest );
+}
+
+extern struct SHA1_INTERFACE sha1i;
+
+#define mir_sha1_init(A) sha1i.sha1_init(A)
+#define mir_sha1_append(A,B,C) sha1i.sha1_append(A,B,C)
+#define mir_sha1_finish(A,B) sha1i.sha1_finish(A,B)
+#define mir_sha1_hash(A,B,C) sha1i.sha1_hash(A,B,C)
+
+// Added in 0.4.0.1
+// Here are some string wrappers that are more safe than the win32 versions
+
+#if MIRANDA_VER < 0x0700
+static __inline int mir_snprintf(char *buffer, size_t count, const char* fmt, ...) {
+ va_list va;
+ int len;
+
+ va_start(va, fmt);
+ len = _vsnprintf(buffer, count-1, fmt, va);
+ va_end(va);
+ buffer[count-1] = 0;
+ return len;
+}
+
+static __inline int mir_sntprintf(TCHAR *buffer, size_t count, const TCHAR* fmt, ...) {
+ va_list va;
+ int len;
+
+ va_start(va, fmt);
+ len = _vsntprintf(buffer, count-1, fmt, va);
+ va_end(va);
+ buffer[count-1] = 0;
+ return len;
+}
+
+static __inline int mir_vsnprintf(char *buffer, size_t count, const char* fmt, va_list va) {
+ int len;
+
+ len = _vsnprintf(buffer, count-1, fmt, va);
+ buffer[count-1] = 0;
+ return len;
+}
+
+static __inline int mir_vsntprintf(TCHAR *buffer, size_t count, const TCHAR* fmt, va_list va) {
+ int len;
+
+ len = _vsntprintf(buffer, count-1, fmt, va);
+ buffer[count-1] = 0;
+ return len;
+}
+#endif
+
+// allows to include TCHAR* strings into mir_snprintf and NetLib_Logf calls
+#if defined( _UNICODE )
+ #define TCHAR_STR_PARAM "%S"
+#else
+ #define TCHAR_STR_PARAM "%s"
+#endif
+
+#if MIRANDA_VER < 0x0700
+static __inline wchar_t* mir_a2u_cp( const char* src, int codepage )
+{
+ int cbLen = MultiByteToWideChar( codepage, 0, src, -1, NULL, 0 );
+ wchar_t* result = ( wchar_t* )mir_alloc( sizeof( wchar_t )*(cbLen+1));
+ if ( result == NULL )
+ return NULL;
+
+ MultiByteToWideChar( codepage, 0, src, -1, result, cbLen );
+ result[ cbLen ] = 0;
+ return result;
+}
+
+static __inline wchar_t* mir_a2u( const char* src )
+{
+ return mir_a2u_cp( src, CallService("LangPack/GetCodePage", 0, 0 ));
+}
+
+static __inline char* mir_u2a_cp( const wchar_t* src, int codepage )
+{
+ int cbLen = WideCharToMultiByte( codepage, 0, src, -1, NULL, 0, NULL, NULL );
+ char* result = ( char* )mir_alloc( cbLen+1 );
+ if ( result == NULL )
+ return NULL;
+
+ WideCharToMultiByte( codepage, 0, src, -1, result, cbLen, NULL, NULL );
+ result[ cbLen ] = 0;
+ return result;
+}
+
+static __inline char* mir_u2a( const wchar_t* src )
+{
+ return mir_u2a_cp( src, CallService("LangPack/GetCodePage", 0, 0 ));
+}
+#endif
+
+#ifdef _UNICODE
+ #define mir_t2a(s) mir_u2a(s)
+ #define mir_a2t(s) mir_a2u(s)
+ #define mir_t2u(s) mir_wstrdup(s)
+ #define mir_u2t(s) mir_wstrdup(s)
+
+ #define mir_t2a_cp(s,c) mir_u2a_cp(s,c)
+ #define mir_a2t_cp(s,c) mir_a2u_cp(s,c)
+ #define mir_t2u_cp(s,c) mir_wstrdup(s)
+ #define mir_u2t_cp(s,c) mir_wstrdup(s)
+#else
+ #define mir_t2a(s) mir_strdup(s)
+ #define mir_a2t(s) mir_strdup(s)
+ #define mir_t2u(s) mir_a2u(s)
+ #define mir_u2t(s) mir_u2a(s)
+
+ #define mir_t2a_cp(s,c) mir_strdup(s)
+ #define mir_a2t_cp(s,c) mir_strdup(s)
+ #define mir_t2u_cp(s,c) mir_a2u_cp(s,c)
+ #define mir_u2t_cp(s,c) mir_u2a_cp(s,c)
+#endif
+
+#endif // M_UTILS_H__
diff --git a/include/m_version.h b/include/m_version.h new file mode 100644 index 0000000000..17fb37c564 --- /dev/null +++ b/include/m_version.h @@ -0,0 +1,37 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2010 Miranda ICQ/IM 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_VERSION_H__
+#define M_VERSION_H__
+
+#ifndef MIRANDA_MAKE_VERSION
+#define MIRANDA_MAKE_VERSION(a,b,c,d) (((((DWORD)(a))&0xFF)<<24)|((((DWORD)(b))&0xFF)<<16)|((((DWORD)(c))&0xFF)<<8)|(((DWORD)(d))&0xFF))
+#endif
+
+#define MIRANDA_VERSION_FILEVERSION 0,10,0,3
+#define MIRANDA_VERSION_STRING "0.10.0.3"
+#define MIRANDA_VERSION_DISPLAY "0.10.0 alpha build #3"
+#define MIRANDA_VERSION_DWORD MIRANDA_MAKE_VERSION(0, 10, 0, 3)
+#define MIRANDA_VERSION_CORE MIRANDA_MAKE_VERSION(0, 10, 0, 0)
+#define MIRANDA_VERSION_CORE_STRING "0.10.0.0"
+
+#endif // M_VERSION_H__
diff --git a/include/m_xml.h b/include/m_xml.h new file mode 100644 index 0000000000..c65a8caa93 --- /dev/null +++ b/include/m_xml.h @@ -0,0 +1,140 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_XML_H__
+#define M_XML_H__
+
+#include <tchar.h>
+#include <newpluginapi.h>
+
+DECLARE_HANDLE(HXML);
+typedef int XML_ELEMENT_POS; // XML_ELEMENT_POS is not interchangeable with simple indexes
+
+typedef enum
+{
+ XML_ELEM_TYPE_CHILD = 0,
+ XML_ELEM_TYPE_ATTRIBUTE = 1,
+ XML_ELEM_TYPE_TEXT = 2,
+ XML_ELEM_TYPE_CLEAR = 3,
+}
+ XML_ELEMENT_TYPE;
+
+typedef struct
+{
+ size_t cbSize;
+
+ HXML ( *createNode )( LPCTSTR name, LPCTSTR text, char isDeclaration );
+ void ( *destroyNode )( HXML node );
+
+ HXML ( *parseString )( LPCTSTR string, int* datalen, LPCTSTR tag );
+ LPTSTR ( *toString )( HXML node, int* datalen );
+
+ HXML ( *addChild )( HXML parent, LPCTSTR name, LPCTSTR text );
+ void ( *addChild2 )( HXML child, HXML parent );
+ HXML ( *copyNode )( HXML parent );
+ HXML ( *getChild )( HXML parent, int number );
+ int ( *getChildCount )( HXML );
+ HXML ( *getChildByAttrValue )( HXML parent, LPCTSTR name, LPCTSTR attrName, LPCTSTR attrValue );
+ HXML ( *getFirstChild )( HXML parent );
+ HXML ( *getNthChild )( HXML parent, LPCTSTR name, int i );
+ HXML ( *getNextChild )( HXML parent, LPCTSTR name, int *i );
+ HXML ( *getChildByPath )( HXML parent, LPCTSTR path, char createNodeIfMissing );
+ HXML ( *getNextNode )( HXML node );
+ LPCTSTR ( *getName )( HXML );
+ HXML ( *getParent )( HXML );
+ LPCTSTR ( *getText )( HXML ); // = getTextByIndex(HXML, 0)
+ void ( *setText )( HXML, LPCTSTR ); // = setTextByIndex(HXML, LPCTSTR, 0)
+
+ LPCTSTR ( *getAttr )( HXML, int i );
+ LPCTSTR ( *getAttrName )( HXML, int i );
+ LPCTSTR ( *getAttrValue )( HXML, LPCTSTR attrName );
+ int ( *getAttrCount )( HXML );
+ void ( *addAttr )( HXML, LPCTSTR attrName, LPCTSTR attrValue );
+ void ( *addAttrInt )( HXML, LPCTSTR attrName, int attrValue );
+
+ void ( *freeMem )( void* );
+
+#if MIRANDA_VER >= 0x0900
+ // methods added in XML API v2
+ char ( *isDeclaration )( HXML );
+ LPTSTR ( *toStringWithFormatting )( HXML node, int* datalen );
+ HXML ( *deepCopy )( HXML );
+ void ( *setAttrByIndex )( HXML, int i, LPCTSTR value );
+ void ( *setAttrByName )( HXML, LPCTSTR name, LPCTSTR value );
+ HXML ( *addChildEx )( HXML parent, LPCTSTR name, char isDeclaration, XML_ELEMENT_POS n );
+ void ( *addChildEx2 )( HXML child, HXML parent, XML_ELEMENT_POS n );
+ int ( *getTextCount )( HXML );
+ LPCTSTR ( *getTextByIndex )( HXML, int i );
+ void ( *addText )( HXML, LPCTSTR, XML_ELEMENT_POS n );
+ void ( *setTextByIndex )( HXML, int i, LPCTSTR );
+ int ( *getClearCount )( HXML );
+ LPCTSTR ( *getClear )( HXML, int i, LPCTSTR *openTag, LPCTSTR *closeTag );
+ void ( *addClear )( HXML, LPCTSTR lpszValue, LPCTSTR openTag, LPCTSTR closeTag, XML_ELEMENT_POS n );
+ void ( *setClear )( HXML, int i, LPCTSTR lpszValue );
+ int ( *getElementCount )( HXML );
+ int ( *getElement )( HXML, XML_ELEMENT_POS n, XML_ELEMENT_TYPE *type, HXML *child, LPCTSTR *value, LPCTSTR *name, LPCTSTR *openTag, LPCTSTR *closeTag );
+ // With getElement() it's possible to enumerate all the different contents (attribute,child,text, clear) of the current node. The order is reflecting the order of the original file/string. NOTE: 0 <= i < getElementCount().
+ // type, child, value, name, openTag, closeTag will be filled on return, depending on type:
+ // for XML_ELEM_TYPE_CHILD, child is valid;
+ // for XML_ELEM_TYPE_ATTRIBUTE, name and value are valid;
+ // for XML_ELEM_TYPE_TEXT, value is valid;
+ // for XML_ELEM_TYPE_CLEAR, value, openTag and closeTag are valid.
+
+ void ( *deleteNodeContent )( HXML ); // forces the deletion of the content of this node and the subtree
+ void ( *deleteAttrByIndex )( HXML, int i );
+ void ( *deleteAttrByName )( HXML, LPCTSTR name );
+ void ( *deleteText )( HXML, int i );
+ void ( *deleteClear )( HXML, int i );
+
+ XML_ELEMENT_POS ( *positionOfChildByIndex )( HXML, int i );
+ XML_ELEMENT_POS ( *positionOfChildByNode )( HXML, HXML );
+ XML_ELEMENT_POS ( *positionOfChildByName )( HXML, LPCTSTR name, int i );
+ XML_ELEMENT_POS ( *positionOfText )( HXML, int i );
+ XML_ELEMENT_POS ( *positionOfClear )( HXML, int i );
+#endif
+}
+ XML_API;
+
+#define XML_API_SIZEOF_V1 (sizeof(size_t)+26*sizeof(void*))
+
+/* every protocol should declare this variable to use the XML API */
+extern XML_API xi;
+
+/*
+a service to obtain the XML API
+
+wParam = 0;
+lParam = (LPARAM)(XML_API*).
+
+returns TRUE if all is Ok, and FALSE otherwise
+*/
+
+#define MS_SYSTEM_GET_XI "Miranda/System/GetXmlApi"
+
+__forceinline int mir_getXI( XML_API* dest )
+{
+ dest->cbSize = sizeof(*dest);
+ return CallService( MS_SYSTEM_GET_XI, 0, (LPARAM)dest );
+}
+
+#endif // M_XML_H__
diff --git a/include/mingw/shobjidl.h b/include/mingw/shobjidl.h new file mode 100644 index 0000000000..e1dc1c625f --- /dev/null +++ b/include/mingw/shobjidl.h @@ -0,0 +1,50 @@ +/* MinGW misses shobjidl.h,extracted from WinAPI documenttion */
+
+#ifndef _SHOBJIDL_H
+#define _SHOBJIDL_H
+
+#ifdef __MINGW32__
+#include <initguid.h>
+#define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK
+
+DEFINE_GUID(IID_IDropTargetHelper,0x4657278b,0x411b,0x11d2,0x83,0x9a,0x00,0xc0,0x4f,0xd9,0x18,0xd0);
+DEFINE_GUID(IID_IPersistFolder2,0x1ac3d9f0,0x175c,0x11d1,0x95,0xbe,0x00,0x60,0x97,0x97,0xea,0x4f);
+DEFINE_GUID(IID_IShellFolder2,0x93f2f68c,0x1d1b,0x11d3,0xa3,0x0e,0x00,0xc0,0x4f,0x79,0xab,0xd1);
+DEFINE_GUID(IID_IPersistFolder3,0xcef04fdf,0xfe72,0x11d2,0x87,0xa5,0x00,0xc0,0x4f,0x68,0x37,0xcf);
+
+/*** IUnknown methods ***/
+#define IShellExecuteHookW_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IShellExecuteHookW_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IShellExecuteHookW_Release(p) (p)->lpVtbl->Release(p)
+/*** IShellExecuteHookW methods ***/
+#define IShellExecuteHookW_Execute(p,a) (p)->lpVtbl->Execute(p,a)
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IShellExtInit_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IShellExtInit_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IShellExtInit_Release(p) (p)->lpVtbl->Release(p)
+/*** IShellExtInit methods ***/
+#define IShellExtInit_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
+#endif
+
+DEFINE_GUID(CLSID_TaskbarList,0x56fdf344,0xfd6d,0x11d0,0x95,0x8a,0x0,0x60,0x97,0xc9,0xa0,0x90);
+DEFINE_GUID(IID_ITaskbarList,0x56fdf342,0xfd6d,0x11d0,0x95,0x8a,0x0,0x60,0x97,0xc9,0xa0,0x90);
+
+DECLARE_INTERFACE_(ITaskbarList,IUnknown)
+{
+/*** IUnknown methods ***/
+STDMETHOD(QueryInterface) (THIS_ REFIID riid,void **ppv) PURE;
+STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+STDMETHOD_(ULONG,Release) (THIS) PURE;
+/*** ITaskbarList specific methods ***/
+STDMETHOD(HrInit) (THIS) PURE;
+STDMETHOD(AddTab) (THIS_ HWND hwnd) PURE;
+STDMETHOD(DeleteTab) (THIS_ HWND hwnd) PURE;
+STDMETHOD(ActivateTab) (THIS_ HWND hwnd) PURE;
+STDMETHOD(SetActiveAlt) (THIS_ HWND hwnd) PURE;
+};
+typedef ITaskbarList *LPITaskbarList;
+
+#endif /* __MINGW32__ */
+#endif /* _SHOBJIDL_H */
diff --git a/include/mingw/tom.h b/include/mingw/tom.h new file mode 100644 index 0000000000..d2898ba0bd --- /dev/null +++ b/include/mingw/tom.h @@ -0,0 +1,4248 @@ +/*** Autogenerated by WIDL 1.0 from tom.idl - Do not edit ***/
+#include <rpc.h>
+#include <rpcndr.h>
+
+#ifndef __WIDL_TOM_H
+#define __WIDL_TOM_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <oaidl.h>
+typedef enum tagTomConstants {
+ tomFalse = 0,
+ tomTrue = -1,
+ tomUndefined = -9999999,
+ tomToggle = -9999998,
+ tomAutoColor = -9999997,
+ tomDefault = -9999996,
+ tomSuspend = -9999995,
+ tomResume = -9999994,
+ tomApplyNow = 0,
+ tomApplyLater = 1,
+ tomTrackParms = 2,
+ tomCacheParms = 3,
+ tomBackward = 0xffffffff,
+ tomForward = 0xffffffff,
+ tomMove = 0,
+ tomExtend = 1,
+ tomNoSelection = 0,
+ tomSelectionIP = 1,
+ tomSelectionNormal = 2,
+ tomSelectionFrame = 3,
+ tomSelectionColumn = 4,
+ tomSelectionRow = 5,
+ tomSelectionBlock = 6,
+ tomSelectionInlineShape = 7,
+ tomSelectionShape = 8,
+ tomSelStartActive = 1,
+ tomSelAtEOL = 2,
+ tomSelOvertype = 4,
+ tomSelActive = 8,
+ tomSelReplace = 16,
+ tomEnd = 0,
+ tomStart = 32,
+ tomCollapseEnd = 0,
+ tomCollapseStart = 1,
+ tomClientCoord = 256,
+ tomNone = 0,
+ tomSingle = 1,
+ tomWords = 2,
+ tomDouble = 3,
+ tomDotted = 4,
+ tomDash = 5,
+ tomDashDot = 6,
+ tomDashDotDot = 7,
+ tomWave = 8,
+ tomThick = 9,
+ tomHair = 10,
+ tomLineSpaceSingle = 0,
+ tomLineSpace1pt5 = 1,
+ tomLineSpaceDouble = 2,
+ tomLineSpaceAtLeast = 3,
+ tomLineSpaceExactly = 4,
+ tomLineSpaceMultiple = 5,
+ tomAlignLeft = 0,
+ tomAlignCenter = 1,
+ tomAlignRight = 2,
+ tomAlignJustify = 3,
+ tomAlignDecimal = 3,
+ tomAlignBar = 4,
+ tomAlignInterWord = 3,
+ tomAlignInterLetter = 4,
+ tomAlignScaled = 5,
+ tomAlignGlyphs = 6,
+ tomAlignSnapGrid = 7,
+ tomSpaces = 0,
+ tomDots = 1,
+ tomDashes = 2,
+ tomLines = 3,
+ tomThickLines = 4,
+ tomEquals = 5,
+ tomTabBack = -3,
+ tomTabNext = -2,
+ tomTabHere = -1,
+ tomListBullet = 1,
+ tomListNumberAsArabic = 2,
+ tomListNumberAsLCLetter = 3,
+ tomListNumberAsUCLetter = 4,
+ tomListNumberAsLCRoman = 5,
+ tomListNumberAsUCRoman = 6,
+ tomListNumberAsSequence = 7,
+ tomListParentheses = 0x10000,
+ tomListPeriod = 0x20000,
+ tomListPlain = 0x30000,
+ tomCharacter = 1,
+ tomWord = 2,
+ tomSentence = 3,
+ tomParagraph = 4,
+ tomLine = 5,
+ tomStory = 6,
+ tomScreen = 7,
+ tomSection = 8,
+ tomColumn = 9,
+ tomRow = 10,
+ tomWindow = 11,
+ tomCell = 12,
+ tomCharFormat = 13,
+ tomParaFormat = 14,
+ tomTable = 15,
+ tomObject = 16,
+ tomMatchWord = 2,
+ tomMatchCase = 4,
+ tomMatchPattern = 8,
+ tomUnknownStory = 0,
+ tomMainTextStory = 1,
+ tomFootnotesStory = 2,
+ tomEndnotesStory = 3,
+ tomCommentsStory = 4,
+ tomTextFrameStory = 5,
+ tomEvenPagesHeaderStory = 6,
+ tomPrimaryHeaderStory = 7,
+ tomEvenPagesFooterStory = 8,
+ tomPrimaryFooterStory = 9,
+ tomFirstPageHeaderStory = 10,
+ tomFirstPageFooterStory = 11,
+ tomNoAnimation = 0,
+ tomLasVegasLights = 1,
+ tomBlinkingBackground = 2,
+ tomSparkleText = 3,
+ tomMarchingBlackAnts = 4,
+ tomMarchingRedAnts = 5,
+ tomShimmer = 6,
+ tomWipeDown = 7,
+ tomWipeRight = 8,
+ tomAnimationMax = 8,
+ tomLowerCase = 0,
+ tomUpperCase = 1,
+ tomTitleCase = 2,
+ tomSentenceCase = 4,
+ tomToggleCase = 5,
+ tomReadOnly = 0x100,
+ tomShareDenyRead = 0x200,
+ tomShareDenyWrite = 0x400,
+ tomPasteFile = 0x1000,
+ tomCreateNew = 0x10,
+ tomCreateAlways = 0x20,
+ tomOpenExisting = 0x30,
+ tomOpenAlways = 0x40,
+ tomTruncateExisting = 0x50,
+ tomRTF = 0x1,
+ tomText = 0x2,
+ tomHTML = 0x3,
+ tomWordDocument = 0x4,
+ tomBold = 0xffffffff,
+ tomItalic = 0xffffffff,
+ tomUnderline = 0xffffffff,
+ tomStrikeout = 0xffffffff,
+ tomProtected = 0xffffffff,
+ tomLink = 0xffffffff,
+ tomSmallCaps = 0xffffffff,
+ tomAllCaps = 0xffffffff,
+ tomHidden = 0xffffffff,
+ tomOutline = 0xffffffff,
+ tomShadow = 0xffffffff,
+ tomEmboss = 0xffffffff,
+ tomImprint = 0xffffffff,
+ tomDisabled = 0xffffffff,
+ tomRevised = 0xffffffff,
+ tomNormalCaret = 0,
+ tomKoreanBlockCaret = 0x1,
+ tomIncludeInset = 0x1,
+ tomIgnoreCurrentFont = 0,
+ tomMatchFontCharset = 0x1,
+ tomMatchFontSignature = 0x2,
+ tomCharset = 0x80000000,
+ tomRE10Mode = 0x1,
+ tomNoIME = 0x80000,
+ tomSelfIME = 0x40000
+} tomConstants;
+#ifndef __ITextRange_FWD_DEFINED__
+#define __ITextRange_FWD_DEFINED__
+typedef interface ITextRange ITextRange;
+#endif
+
+#ifndef __ITextSelection_FWD_DEFINED__
+#define __ITextSelection_FWD_DEFINED__
+typedef interface ITextSelection ITextSelection;
+#endif
+
+#ifndef __ITextStoryRanges_FWD_DEFINED__
+#define __ITextStoryRanges_FWD_DEFINED__
+typedef interface ITextStoryRanges ITextStoryRanges;
+#endif
+
+#ifndef __ITextDocument_FWD_DEFINED__
+#define __ITextDocument_FWD_DEFINED__
+typedef interface ITextDocument ITextDocument;
+#endif
+
+/*****************************************************************************
+ * ITextDocument interface
+ */
+#ifndef __ITextDocument_INTERFACE_DEFINED__
+#define __ITextDocument_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ITextDocument, 0x8cc497c0, 0xa1df, 0x11ce, 0x80,0x98, 0x00,0xaa,0x00,0x47,0xbe,0x5d);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ITextDocument : public IDispatch
+{
+ virtual HRESULT STDMETHODCALLTYPE GetName(
+ BSTR *pName) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetSelection(
+ ITextSelection **ppSel) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetStoryCount(
+ long *pCount) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetStoryRanges(
+ ITextStoryRanges **ppStories) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetSaved(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetSaved(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetDefaultTabStop(
+ float *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetDefaultTabStop(
+ float Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE New(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Open(
+ VARIANT *pVar,
+ long Flags,
+ long CodePage) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Save(
+ VARIANT *pVar,
+ long Flags,
+ long CodePage) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Freeze(
+ long *pCount) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Unfreeze(
+ long *pCount) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE BeginEditCollection(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE EndEditCollection(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Undo(
+ long Count,
+ long *prop) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Redo(
+ long Count,
+ long *prop) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Range(
+ long cp1,
+ long cp2,
+ ITextRange **ppRange) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE RangeFromPoint(
+ long x,
+ long y,
+ ITextRange **ppRange) = 0;
+
+};
+#else
+typedef struct ITextDocumentVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ ITextDocument* This,
+ REFIID riid,
+ void **ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ ITextDocument* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ ITextDocument* This);
+
+ /*** IDispatch methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
+ ITextDocument* This,
+ UINT *pctinfo);
+
+ HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
+ ITextDocument* This,
+ UINT iTInfo,
+ LCID lcid,
+ ITypeInfo **ppTInfo);
+
+ HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
+ ITextDocument* This,
+ REFIID riid,
+ LPOLESTR *rgszNames,
+ UINT cNames,
+ LCID lcid,
+ DISPID *rgDispId);
+
+ HRESULT (STDMETHODCALLTYPE *Invoke)(
+ ITextDocument* This,
+ DISPID dispIdMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ DISPPARAMS *pDispParams,
+ VARIANT *pVarResult,
+ EXCEPINFO *pExcepInfo,
+ UINT *puArgErr);
+
+ /*** ITextDocument methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetName)(
+ ITextDocument* This,
+ BSTR *pName);
+
+ HRESULT (STDMETHODCALLTYPE *GetSelection)(
+ ITextDocument* This,
+ ITextSelection **ppSel);
+
+ HRESULT (STDMETHODCALLTYPE *GetStoryCount)(
+ ITextDocument* This,
+ long *pCount);
+
+ HRESULT (STDMETHODCALLTYPE *GetStoryRanges)(
+ ITextDocument* This,
+ ITextStoryRanges **ppStories);
+
+ HRESULT (STDMETHODCALLTYPE *GetSaved)(
+ ITextDocument* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetSaved)(
+ ITextDocument* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetDefaultTabStop)(
+ ITextDocument* This,
+ float *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetDefaultTabStop)(
+ ITextDocument* This,
+ float Value);
+
+ HRESULT (STDMETHODCALLTYPE *New)(
+ ITextDocument* This);
+
+ HRESULT (STDMETHODCALLTYPE *Open)(
+ ITextDocument* This,
+ VARIANT *pVar,
+ long Flags,
+ long CodePage);
+
+ HRESULT (STDMETHODCALLTYPE *Save)(
+ ITextDocument* This,
+ VARIANT *pVar,
+ long Flags,
+ long CodePage);
+
+ HRESULT (STDMETHODCALLTYPE *Freeze)(
+ ITextDocument* This,
+ long *pCount);
+
+ HRESULT (STDMETHODCALLTYPE *Unfreeze)(
+ ITextDocument* This,
+ long *pCount);
+
+ HRESULT (STDMETHODCALLTYPE *BeginEditCollection)(
+ ITextDocument* This);
+
+ HRESULT (STDMETHODCALLTYPE *EndEditCollection)(
+ ITextDocument* This);
+
+ HRESULT (STDMETHODCALLTYPE *Undo)(
+ ITextDocument* This,
+ long Count,
+ long *prop);
+
+ HRESULT (STDMETHODCALLTYPE *Redo)(
+ ITextDocument* This,
+ long Count,
+ long *prop);
+
+ HRESULT (STDMETHODCALLTYPE *Range)(
+ ITextDocument* This,
+ long cp1,
+ long cp2,
+ ITextRange **ppRange);
+
+ HRESULT (STDMETHODCALLTYPE *RangeFromPoint)(
+ ITextDocument* This,
+ long x,
+ long y,
+ ITextRange **ppRange);
+
+ END_INTERFACE
+} ITextDocumentVtbl;
+interface ITextDocument {
+ CONST_VTBL ITextDocumentVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ITextDocument_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ITextDocument_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ITextDocument_Release(This) (This)->lpVtbl->Release(This)
+/*** IDispatch methods ***/
+#define ITextDocument_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
+#define ITextDocument_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
+#define ITextDocument_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
+#define ITextDocument_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
+/*** ITextDocument methods ***/
+#define ITextDocument_GetName(This,pName) (This)->lpVtbl->GetName(This,pName)
+#define ITextDocument_GetSelection(This,ppSel) (This)->lpVtbl->GetSelection(This,ppSel)
+#define ITextDocument_GetStoryCount(This,pCount) (This)->lpVtbl->GetStoryCount(This,pCount)
+#define ITextDocument_GetStoryRanges(This,ppStories) (This)->lpVtbl->GetStoryRanges(This,ppStories)
+#define ITextDocument_GetSaved(This,pValue) (This)->lpVtbl->GetSaved(This,pValue)
+#define ITextDocument_SetSaved(This,Value) (This)->lpVtbl->SetSaved(This,Value)
+#define ITextDocument_GetDefaultTabStop(This,pValue) (This)->lpVtbl->GetDefaultTabStop(This,pValue)
+#define ITextDocument_SetDefaultTabStop(This,Value) (This)->lpVtbl->SetDefaultTabStop(This,Value)
+#define ITextDocument_New(This) (This)->lpVtbl->New(This)
+#define ITextDocument_Open(This,pVar,Flags,CodePage) (This)->lpVtbl->Open(This,pVar,Flags,CodePage)
+#define ITextDocument_Save(This,pVar,Flags,CodePage) (This)->lpVtbl->Save(This,pVar,Flags,CodePage)
+#define ITextDocument_Freeze(This,pCount) (This)->lpVtbl->Freeze(This,pCount)
+#define ITextDocument_Unfreeze(This,pCount) (This)->lpVtbl->Unfreeze(This,pCount)
+#define ITextDocument_BeginEditCollection(This) (This)->lpVtbl->BeginEditCollection(This)
+#define ITextDocument_EndEditCollection(This) (This)->lpVtbl->EndEditCollection(This)
+#define ITextDocument_Undo(This,Count,prop) (This)->lpVtbl->Undo(This,Count,prop)
+#define ITextDocument_Redo(This,Count,prop) (This)->lpVtbl->Redo(This,Count,prop)
+#define ITextDocument_Range(This,cp1,cp2,ppRange) (This)->lpVtbl->Range(This,cp1,cp2,ppRange)
+#define ITextDocument_RangeFromPoint(This,x,y,ppRange) (This)->lpVtbl->RangeFromPoint(This,x,y,ppRange)
+#endif
+
+#endif
+
+HRESULT STDMETHODCALLTYPE ITextDocument_GetName_Proxy(
+ ITextDocument* This,
+ BSTR *pName);
+void __RPC_STUB ITextDocument_GetName_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_GetSelection_Proxy(
+ ITextDocument* This,
+ ITextSelection **ppSel);
+void __RPC_STUB ITextDocument_GetSelection_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_GetStoryCount_Proxy(
+ ITextDocument* This,
+ long *pCount);
+void __RPC_STUB ITextDocument_GetStoryCount_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_GetStoryRanges_Proxy(
+ ITextDocument* This,
+ ITextStoryRanges **ppStories);
+void __RPC_STUB ITextDocument_GetStoryRanges_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_GetSaved_Proxy(
+ ITextDocument* This,
+ long *pValue);
+void __RPC_STUB ITextDocument_GetSaved_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_SetSaved_Proxy(
+ ITextDocument* This,
+ long Value);
+void __RPC_STUB ITextDocument_SetSaved_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_GetDefaultTabStop_Proxy(
+ ITextDocument* This,
+ float *pValue);
+void __RPC_STUB ITextDocument_GetDefaultTabStop_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_SetDefaultTabStop_Proxy(
+ ITextDocument* This,
+ float Value);
+void __RPC_STUB ITextDocument_SetDefaultTabStop_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_New_Proxy(
+ ITextDocument* This);
+void __RPC_STUB ITextDocument_New_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_Open_Proxy(
+ ITextDocument* This,
+ VARIANT *pVar,
+ long Flags,
+ long CodePage);
+void __RPC_STUB ITextDocument_Open_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_Save_Proxy(
+ ITextDocument* This,
+ VARIANT *pVar,
+ long Flags,
+ long CodePage);
+void __RPC_STUB ITextDocument_Save_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_Freeze_Proxy(
+ ITextDocument* This,
+ long *pCount);
+void __RPC_STUB ITextDocument_Freeze_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_Unfreeze_Proxy(
+ ITextDocument* This,
+ long *pCount);
+void __RPC_STUB ITextDocument_Unfreeze_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_BeginEditCollection_Proxy(
+ ITextDocument* This);
+void __RPC_STUB ITextDocument_BeginEditCollection_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_EndEditCollection_Proxy(
+ ITextDocument* This);
+void __RPC_STUB ITextDocument_EndEditCollection_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_Undo_Proxy(
+ ITextDocument* This,
+ long Count,
+ long *prop);
+void __RPC_STUB ITextDocument_Undo_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_Redo_Proxy(
+ ITextDocument* This,
+ long Count,
+ long *prop);
+void __RPC_STUB ITextDocument_Redo_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_Range_Proxy(
+ ITextDocument* This,
+ long cp1,
+ long cp2,
+ ITextRange **ppRange);
+void __RPC_STUB ITextDocument_Range_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextDocument_RangeFromPoint_Proxy(
+ ITextDocument* This,
+ long x,
+ long y,
+ ITextRange **ppRange);
+void __RPC_STUB ITextDocument_RangeFromPoint_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+
+#endif /* __ITextDocument_INTERFACE_DEFINED__ */
+
+#ifndef __ITextFont_FWD_DEFINED__
+#define __ITextFont_FWD_DEFINED__
+typedef interface ITextFont ITextFont;
+#endif
+
+#ifndef __ITextPara_FWD_DEFINED__
+#define __ITextPara_FWD_DEFINED__
+typedef interface ITextPara ITextPara;
+#endif
+
+/*****************************************************************************
+ * ITextRange interface
+ */
+#ifndef __ITextRange_INTERFACE_DEFINED__
+#define __ITextRange_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ITextRange, 0x8cc497c2, 0xa1df, 0x11ce, 0x80,0x98, 0x00,0xaa,0x00,0x47,0xbe,0x5d);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ITextRange : public IDispatch
+{
+ virtual HRESULT STDMETHODCALLTYPE GetText(
+ BSTR *pbstr) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetText(
+ BSTR bstr) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetChar(
+ long *pch) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetChar(
+ long ch) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetDuplicate(
+ ITextRange **ppRange) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetFormattedText(
+ ITextRange **ppRange) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetFormattedText(
+ ITextRange *pRange) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetStart(
+ long *pcpFirst) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetStart(
+ long cpFirst) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetEnd(
+ long *pcpLim) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetEnd(
+ long cpLim) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetFont(
+ ITextFont **pFont) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetFont(
+ ITextFont *pFont) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetPara(
+ ITextPara **ppPara) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetPara(
+ ITextPara *pPara) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetStoryLength(
+ long *pcch) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetStoryType(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Collapse(
+ long bStart) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Expand(
+ long Unit,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetIndex(
+ long Unit,
+ long *pIndex) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetIndex(
+ long Unit,
+ long Index,
+ long Extend) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetRange(
+ long cpActive,
+ long cpOther) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE InRange(
+ ITextRange *pRange,
+ long *pb) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE InStory(
+ ITextRange *pRange,
+ long *pb) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE IsEqual(
+ ITextRange *pRange,
+ long *pb) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Select(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE StartOf(
+ long Unit,
+ long Extend,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE EndOf(
+ long Unit,
+ long Extend,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Move(
+ long Unit,
+ long Count,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE MoveStart(
+ long Unit,
+ long Count,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE MoveEnd(
+ long Unit,
+ long Count,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE MoveWhile(
+ VARIANT *Cset,
+ long Count,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE MoveStartWhile(
+ VARIANT *Cset,
+ long Count,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE MoveEndWhile(
+ VARIANT *Cset,
+ long Count,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE MoveUntil(
+ VARIANT *Cset,
+ long Count,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE MoveStartUntil(
+ VARIANT *Cset,
+ long Count,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE MoveEndUntil(
+ VARIANT *Cset,
+ long Count,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE FindText(
+ BSTR bstr,
+ long cch,
+ long Flags,
+ long *pLength) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE FindTextStart(
+ BSTR bstr,
+ long cch,
+ long Flags,
+ long *pLength) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE FindTextEnd(
+ BSTR bstr,
+ long cch,
+ long Flags,
+ long *pLength) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Delete(
+ long Unit,
+ long Count,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Cut(
+ VARIANT *pVar) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Copy(
+ VARIANT *pVar) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Paste(
+ VARIANT *pVar,
+ long Format) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CanPaste(
+ VARIANT *pVar,
+ long Format,
+ long *pb) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CanEdit(
+ long *pb) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ChangeCase(
+ long Type) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetPoint(
+ long Type,
+ long *cx,
+ long *cy) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetPoint(
+ long x,
+ long y,
+ long Type,
+ long Extend) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ScrollIntoView(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetEmbeddedObject(
+ IUnknown **ppv) = 0;
+
+};
+#else
+typedef struct ITextRangeVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ ITextRange* This,
+ REFIID riid,
+ void **ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ ITextRange* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ ITextRange* This);
+
+ /*** IDispatch methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
+ ITextRange* This,
+ UINT *pctinfo);
+
+ HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
+ ITextRange* This,
+ UINT iTInfo,
+ LCID lcid,
+ ITypeInfo **ppTInfo);
+
+ HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
+ ITextRange* This,
+ REFIID riid,
+ LPOLESTR *rgszNames,
+ UINT cNames,
+ LCID lcid,
+ DISPID *rgDispId);
+
+ HRESULT (STDMETHODCALLTYPE *Invoke)(
+ ITextRange* This,
+ DISPID dispIdMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ DISPPARAMS *pDispParams,
+ VARIANT *pVarResult,
+ EXCEPINFO *pExcepInfo,
+ UINT *puArgErr);
+
+ /*** ITextRange methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetText)(
+ ITextRange* This,
+ BSTR *pbstr);
+
+ HRESULT (STDMETHODCALLTYPE *SetText)(
+ ITextRange* This,
+ BSTR bstr);
+
+ HRESULT (STDMETHODCALLTYPE *GetChar)(
+ ITextRange* This,
+ long *pch);
+
+ HRESULT (STDMETHODCALLTYPE *SetChar)(
+ ITextRange* This,
+ long ch);
+
+ HRESULT (STDMETHODCALLTYPE *GetDuplicate)(
+ ITextRange* This,
+ ITextRange **ppRange);
+
+ HRESULT (STDMETHODCALLTYPE *GetFormattedText)(
+ ITextRange* This,
+ ITextRange **ppRange);
+
+ HRESULT (STDMETHODCALLTYPE *SetFormattedText)(
+ ITextRange* This,
+ ITextRange *pRange);
+
+ HRESULT (STDMETHODCALLTYPE *GetStart)(
+ ITextRange* This,
+ long *pcpFirst);
+
+ HRESULT (STDMETHODCALLTYPE *SetStart)(
+ ITextRange* This,
+ long cpFirst);
+
+ HRESULT (STDMETHODCALLTYPE *GetEnd)(
+ ITextRange* This,
+ long *pcpLim);
+
+ HRESULT (STDMETHODCALLTYPE *SetEnd)(
+ ITextRange* This,
+ long cpLim);
+
+ HRESULT (STDMETHODCALLTYPE *GetFont)(
+ ITextRange* This,
+ ITextFont **pFont);
+
+ HRESULT (STDMETHODCALLTYPE *SetFont)(
+ ITextRange* This,
+ ITextFont *pFont);
+
+ HRESULT (STDMETHODCALLTYPE *GetPara)(
+ ITextRange* This,
+ ITextPara **ppPara);
+
+ HRESULT (STDMETHODCALLTYPE *SetPara)(
+ ITextRange* This,
+ ITextPara *pPara);
+
+ HRESULT (STDMETHODCALLTYPE *GetStoryLength)(
+ ITextRange* This,
+ long *pcch);
+
+ HRESULT (STDMETHODCALLTYPE *GetStoryType)(
+ ITextRange* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *Collapse)(
+ ITextRange* This,
+ long bStart);
+
+ HRESULT (STDMETHODCALLTYPE *Expand)(
+ ITextRange* This,
+ long Unit,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *GetIndex)(
+ ITextRange* This,
+ long Unit,
+ long *pIndex);
+
+ HRESULT (STDMETHODCALLTYPE *SetIndex)(
+ ITextRange* This,
+ long Unit,
+ long Index,
+ long Extend);
+
+ HRESULT (STDMETHODCALLTYPE *SetRange)(
+ ITextRange* This,
+ long cpActive,
+ long cpOther);
+
+ HRESULT (STDMETHODCALLTYPE *InRange)(
+ ITextRange* This,
+ ITextRange *pRange,
+ long *pb);
+
+ HRESULT (STDMETHODCALLTYPE *InStory)(
+ ITextRange* This,
+ ITextRange *pRange,
+ long *pb);
+
+ HRESULT (STDMETHODCALLTYPE *IsEqual)(
+ ITextRange* This,
+ ITextRange *pRange,
+ long *pb);
+
+ HRESULT (STDMETHODCALLTYPE *Select)(
+ ITextRange* This);
+
+ HRESULT (STDMETHODCALLTYPE *StartOf)(
+ ITextRange* This,
+ long Unit,
+ long Extend,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *EndOf)(
+ ITextRange* This,
+ long Unit,
+ long Extend,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *Move)(
+ ITextRange* This,
+ long Unit,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveStart)(
+ ITextRange* This,
+ long Unit,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveEnd)(
+ ITextRange* This,
+ long Unit,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveWhile)(
+ ITextRange* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveStartWhile)(
+ ITextRange* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveEndWhile)(
+ ITextRange* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveUntil)(
+ ITextRange* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveStartUntil)(
+ ITextRange* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveEndUntil)(
+ ITextRange* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *FindText)(
+ ITextRange* This,
+ BSTR bstr,
+ long cch,
+ long Flags,
+ long *pLength);
+
+ HRESULT (STDMETHODCALLTYPE *FindTextStart)(
+ ITextRange* This,
+ BSTR bstr,
+ long cch,
+ long Flags,
+ long *pLength);
+
+ HRESULT (STDMETHODCALLTYPE *FindTextEnd)(
+ ITextRange* This,
+ BSTR bstr,
+ long cch,
+ long Flags,
+ long *pLength);
+
+ HRESULT (STDMETHODCALLTYPE *Delete)(
+ ITextRange* This,
+ long Unit,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *Cut)(
+ ITextRange* This,
+ VARIANT *pVar);
+
+ HRESULT (STDMETHODCALLTYPE *Copy)(
+ ITextRange* This,
+ VARIANT *pVar);
+
+ HRESULT (STDMETHODCALLTYPE *Paste)(
+ ITextRange* This,
+ VARIANT *pVar,
+ long Format);
+
+ HRESULT (STDMETHODCALLTYPE *CanPaste)(
+ ITextRange* This,
+ VARIANT *pVar,
+ long Format,
+ long *pb);
+
+ HRESULT (STDMETHODCALLTYPE *CanEdit)(
+ ITextRange* This,
+ long *pb);
+
+ HRESULT (STDMETHODCALLTYPE *ChangeCase)(
+ ITextRange* This,
+ long Type);
+
+ HRESULT (STDMETHODCALLTYPE *GetPoint)(
+ ITextRange* This,
+ long Type,
+ long *cx,
+ long *cy);
+
+ HRESULT (STDMETHODCALLTYPE *SetPoint)(
+ ITextRange* This,
+ long x,
+ long y,
+ long Type,
+ long Extend);
+
+ HRESULT (STDMETHODCALLTYPE *ScrollIntoView)(
+ ITextRange* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetEmbeddedObject)(
+ ITextRange* This,
+ IUnknown **ppv);
+
+ END_INTERFACE
+} ITextRangeVtbl;
+interface ITextRange {
+ CONST_VTBL ITextRangeVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ITextRange_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ITextRange_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ITextRange_Release(This) (This)->lpVtbl->Release(This)
+/*** IDispatch methods ***/
+#define ITextRange_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
+#define ITextRange_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
+#define ITextRange_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
+#define ITextRange_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
+/*** ITextRange methods ***/
+#define ITextRange_GetText(This,pbstr) (This)->lpVtbl->GetText(This,pbstr)
+#define ITextRange_SetText(This,bstr) (This)->lpVtbl->SetText(This,bstr)
+#define ITextRange_GetChar(This,pch) (This)->lpVtbl->GetChar(This,pch)
+#define ITextRange_SetChar(This,ch) (This)->lpVtbl->SetChar(This,ch)
+#define ITextRange_GetDuplicate(This,ppRange) (This)->lpVtbl->GetDuplicate(This,ppRange)
+#define ITextRange_GetFormattedText(This,ppRange) (This)->lpVtbl->GetFormattedText(This,ppRange)
+#define ITextRange_SetFormattedText(This,pRange) (This)->lpVtbl->SetFormattedText(This,pRange)
+#define ITextRange_GetStart(This,pcpFirst) (This)->lpVtbl->GetStart(This,pcpFirst)
+#define ITextRange_SetStart(This,cpFirst) (This)->lpVtbl->SetStart(This,cpFirst)
+#define ITextRange_GetEnd(This,pcpLim) (This)->lpVtbl->GetEnd(This,pcpLim)
+#define ITextRange_SetEnd(This,cpLim) (This)->lpVtbl->SetEnd(This,cpLim)
+#define ITextRange_GetFont(This,pFont) (This)->lpVtbl->GetFont(This,pFont)
+#define ITextRange_SetFont(This,pFont) (This)->lpVtbl->SetFont(This,pFont)
+#define ITextRange_GetPara(This,ppPara) (This)->lpVtbl->GetPara(This,ppPara)
+#define ITextRange_SetPara(This,pPara) (This)->lpVtbl->SetPara(This,pPara)
+#define ITextRange_GetStoryLength(This,pcch) (This)->lpVtbl->GetStoryLength(This,pcch)
+#define ITextRange_GetStoryType(This,pValue) (This)->lpVtbl->GetStoryType(This,pValue)
+#define ITextRange_Collapse(This,bStart) (This)->lpVtbl->Collapse(This,bStart)
+#define ITextRange_Expand(This,Unit,pDelta) (This)->lpVtbl->Expand(This,Unit,pDelta)
+#define ITextRange_GetIndex(This,Unit,pIndex) (This)->lpVtbl->GetIndex(This,Unit,pIndex)
+#define ITextRange_SetIndex(This,Unit,Index,Extend) (This)->lpVtbl->SetIndex(This,Unit,Index,Extend)
+#define ITextRange_SetRange(This,cpActive,cpOther) (This)->lpVtbl->SetRange(This,cpActive,cpOther)
+#define ITextRange_InRange(This,pRange,pb) (This)->lpVtbl->InRange(This,pRange,pb)
+#define ITextRange_InStory(This,pRange,pb) (This)->lpVtbl->InStory(This,pRange,pb)
+#define ITextRange_IsEqual(This,pRange,pb) (This)->lpVtbl->IsEqual(This,pRange,pb)
+#define ITextRange_Select(This) (This)->lpVtbl->Select(This)
+#define ITextRange_StartOf(This,Unit,Extend,pDelta) (This)->lpVtbl->StartOf(This,Unit,Extend,pDelta)
+#define ITextRange_EndOf(This,Unit,Extend,pDelta) (This)->lpVtbl->EndOf(This,Unit,Extend,pDelta)
+#define ITextRange_Move(This,Unit,Count,pDelta) (This)->lpVtbl->Move(This,Unit,Count,pDelta)
+#define ITextRange_MoveStart(This,Unit,Count,pDelta) (This)->lpVtbl->MoveStart(This,Unit,Count,pDelta)
+#define ITextRange_MoveEnd(This,Unit,Count,pDelta) (This)->lpVtbl->MoveEnd(This,Unit,Count,pDelta)
+#define ITextRange_MoveWhile(This,Cset,Count,pDelta) (This)->lpVtbl->MoveWhile(This,Cset,Count,pDelta)
+#define ITextRange_MoveStartWhile(This,Cset,Count,pDelta) (This)->lpVtbl->MoveStartWhile(This,Cset,Count,pDelta)
+#define ITextRange_MoveEndWhile(This,Cset,Count,pDelta) (This)->lpVtbl->MoveEndWhile(This,Cset,Count,pDelta)
+#define ITextRange_MoveUntil(This,Cset,Count,pDelta) (This)->lpVtbl->MoveUntil(This,Cset,Count,pDelta)
+#define ITextRange_MoveStartUntil(This,Cset,Count,pDelta) (This)->lpVtbl->MoveStartUntil(This,Cset,Count,pDelta)
+#define ITextRange_MoveEndUntil(This,Cset,Count,pDelta) (This)->lpVtbl->MoveEndUntil(This,Cset,Count,pDelta)
+#define ITextRange_FindText(This,bstr,cch,Flags,pLength) (This)->lpVtbl->FindText(This,bstr,cch,Flags,pLength)
+#define ITextRange_FindTextStart(This,bstr,cch,Flags,pLength) (This)->lpVtbl->FindTextStart(This,bstr,cch,Flags,pLength)
+#define ITextRange_FindTextEnd(This,bstr,cch,Flags,pLength) (This)->lpVtbl->FindTextEnd(This,bstr,cch,Flags,pLength)
+#define ITextRange_Delete(This,Unit,Count,pDelta) (This)->lpVtbl->Delete(This,Unit,Count,pDelta)
+#define ITextRange_Cut(This,pVar) (This)->lpVtbl->Cut(This,pVar)
+#define ITextRange_Copy(This,pVar) (This)->lpVtbl->Copy(This,pVar)
+#define ITextRange_Paste(This,pVar,Format) (This)->lpVtbl->Paste(This,pVar,Format)
+#define ITextRange_CanPaste(This,pVar,Format,pb) (This)->lpVtbl->CanPaste(This,pVar,Format,pb)
+#define ITextRange_CanEdit(This,pb) (This)->lpVtbl->CanEdit(This,pb)
+#define ITextRange_ChangeCase(This,Type) (This)->lpVtbl->ChangeCase(This,Type)
+#define ITextRange_GetPoint(This,Type,cx,cy) (This)->lpVtbl->GetPoint(This,Type,cx,cy)
+#define ITextRange_SetPoint(This,x,y,Type,Extend) (This)->lpVtbl->SetPoint(This,x,y,Type,Extend)
+#define ITextRange_ScrollIntoView(This,Value) (This)->lpVtbl->ScrollIntoView(This,Value)
+#define ITextRange_GetEmbeddedObject(This,ppv) (This)->lpVtbl->GetEmbeddedObject(This,ppv)
+#endif
+
+#endif
+
+HRESULT STDMETHODCALLTYPE ITextRange_GetText_Proxy(
+ ITextRange* This,
+ BSTR *pbstr);
+void __RPC_STUB ITextRange_GetText_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_SetText_Proxy(
+ ITextRange* This,
+ BSTR bstr);
+void __RPC_STUB ITextRange_SetText_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_GetChar_Proxy(
+ ITextRange* This,
+ long *pch);
+void __RPC_STUB ITextRange_GetChar_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_SetChar_Proxy(
+ ITextRange* This,
+ long ch);
+void __RPC_STUB ITextRange_SetChar_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_GetDuplicate_Proxy(
+ ITextRange* This,
+ ITextRange **ppRange);
+void __RPC_STUB ITextRange_GetDuplicate_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_GetFormattedText_Proxy(
+ ITextRange* This,
+ ITextRange **ppRange);
+void __RPC_STUB ITextRange_GetFormattedText_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_SetFormattedText_Proxy(
+ ITextRange* This,
+ ITextRange *pRange);
+void __RPC_STUB ITextRange_SetFormattedText_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_GetStart_Proxy(
+ ITextRange* This,
+ long *pcpFirst);
+void __RPC_STUB ITextRange_GetStart_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_SetStart_Proxy(
+ ITextRange* This,
+ long cpFirst);
+void __RPC_STUB ITextRange_SetStart_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_GetEnd_Proxy(
+ ITextRange* This,
+ long *pcpLim);
+void __RPC_STUB ITextRange_GetEnd_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_SetEnd_Proxy(
+ ITextRange* This,
+ long cpLim);
+void __RPC_STUB ITextRange_SetEnd_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_GetFont_Proxy(
+ ITextRange* This,
+ ITextFont **pFont);
+void __RPC_STUB ITextRange_GetFont_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_SetFont_Proxy(
+ ITextRange* This,
+ ITextFont *pFont);
+void __RPC_STUB ITextRange_SetFont_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_GetPara_Proxy(
+ ITextRange* This,
+ ITextPara **ppPara);
+void __RPC_STUB ITextRange_GetPara_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_SetPara_Proxy(
+ ITextRange* This,
+ ITextPara *pPara);
+void __RPC_STUB ITextRange_SetPara_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_GetStoryLength_Proxy(
+ ITextRange* This,
+ long *pcch);
+void __RPC_STUB ITextRange_GetStoryLength_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_GetStoryType_Proxy(
+ ITextRange* This,
+ long *pValue);
+void __RPC_STUB ITextRange_GetStoryType_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_Collapse_Proxy(
+ ITextRange* This,
+ long bStart);
+void __RPC_STUB ITextRange_Collapse_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_Expand_Proxy(
+ ITextRange* This,
+ long Unit,
+ long *pDelta);
+void __RPC_STUB ITextRange_Expand_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_GetIndex_Proxy(
+ ITextRange* This,
+ long Unit,
+ long *pIndex);
+void __RPC_STUB ITextRange_GetIndex_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_SetIndex_Proxy(
+ ITextRange* This,
+ long Unit,
+ long Index,
+ long Extend);
+void __RPC_STUB ITextRange_SetIndex_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_SetRange_Proxy(
+ ITextRange* This,
+ long cpActive,
+ long cpOther);
+void __RPC_STUB ITextRange_SetRange_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_InRange_Proxy(
+ ITextRange* This,
+ ITextRange *pRange,
+ long *pb);
+void __RPC_STUB ITextRange_InRange_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_InStory_Proxy(
+ ITextRange* This,
+ ITextRange *pRange,
+ long *pb);
+void __RPC_STUB ITextRange_InStory_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_IsEqual_Proxy(
+ ITextRange* This,
+ ITextRange *pRange,
+ long *pb);
+void __RPC_STUB ITextRange_IsEqual_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_Select_Proxy(
+ ITextRange* This);
+void __RPC_STUB ITextRange_Select_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_StartOf_Proxy(
+ ITextRange* This,
+ long Unit,
+ long Extend,
+ long *pDelta);
+void __RPC_STUB ITextRange_StartOf_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_EndOf_Proxy(
+ ITextRange* This,
+ long Unit,
+ long Extend,
+ long *pDelta);
+void __RPC_STUB ITextRange_EndOf_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_Move_Proxy(
+ ITextRange* This,
+ long Unit,
+ long Count,
+ long *pDelta);
+void __RPC_STUB ITextRange_Move_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_MoveStart_Proxy(
+ ITextRange* This,
+ long Unit,
+ long Count,
+ long *pDelta);
+void __RPC_STUB ITextRange_MoveStart_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_MoveEnd_Proxy(
+ ITextRange* This,
+ long Unit,
+ long Count,
+ long *pDelta);
+void __RPC_STUB ITextRange_MoveEnd_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_MoveWhile_Proxy(
+ ITextRange* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+void __RPC_STUB ITextRange_MoveWhile_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_MoveStartWhile_Proxy(
+ ITextRange* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+void __RPC_STUB ITextRange_MoveStartWhile_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_MoveEndWhile_Proxy(
+ ITextRange* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+void __RPC_STUB ITextRange_MoveEndWhile_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_MoveUntil_Proxy(
+ ITextRange* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+void __RPC_STUB ITextRange_MoveUntil_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_MoveStartUntil_Proxy(
+ ITextRange* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+void __RPC_STUB ITextRange_MoveStartUntil_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_MoveEndUntil_Proxy(
+ ITextRange* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+void __RPC_STUB ITextRange_MoveEndUntil_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_FindText_Proxy(
+ ITextRange* This,
+ BSTR bstr,
+ long cch,
+ long Flags,
+ long *pLength);
+void __RPC_STUB ITextRange_FindText_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_FindTextStart_Proxy(
+ ITextRange* This,
+ BSTR bstr,
+ long cch,
+ long Flags,
+ long *pLength);
+void __RPC_STUB ITextRange_FindTextStart_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_FindTextEnd_Proxy(
+ ITextRange* This,
+ BSTR bstr,
+ long cch,
+ long Flags,
+ long *pLength);
+void __RPC_STUB ITextRange_FindTextEnd_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_Delete_Proxy(
+ ITextRange* This,
+ long Unit,
+ long Count,
+ long *pDelta);
+void __RPC_STUB ITextRange_Delete_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_Cut_Proxy(
+ ITextRange* This,
+ VARIANT *pVar);
+void __RPC_STUB ITextRange_Cut_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_Copy_Proxy(
+ ITextRange* This,
+ VARIANT *pVar);
+void __RPC_STUB ITextRange_Copy_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_Paste_Proxy(
+ ITextRange* This,
+ VARIANT *pVar,
+ long Format);
+void __RPC_STUB ITextRange_Paste_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_CanPaste_Proxy(
+ ITextRange* This,
+ VARIANT *pVar,
+ long Format,
+ long *pb);
+void __RPC_STUB ITextRange_CanPaste_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_CanEdit_Proxy(
+ ITextRange* This,
+ long *pb);
+void __RPC_STUB ITextRange_CanEdit_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_ChangeCase_Proxy(
+ ITextRange* This,
+ long Type);
+void __RPC_STUB ITextRange_ChangeCase_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_GetPoint_Proxy(
+ ITextRange* This,
+ long Type,
+ long *cx,
+ long *cy);
+void __RPC_STUB ITextRange_GetPoint_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_SetPoint_Proxy(
+ ITextRange* This,
+ long x,
+ long y,
+ long Type,
+ long Extend);
+void __RPC_STUB ITextRange_SetPoint_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_ScrollIntoView_Proxy(
+ ITextRange* This,
+ long Value);
+void __RPC_STUB ITextRange_ScrollIntoView_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextRange_GetEmbeddedObject_Proxy(
+ ITextRange* This,
+ IUnknown **ppv);
+void __RPC_STUB ITextRange_GetEmbeddedObject_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+
+#endif /* __ITextRange_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ITextSelection interface
+ */
+#ifndef __ITextSelection_INTERFACE_DEFINED__
+#define __ITextSelection_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ITextSelection, 0x8cc497c1, 0xa1df, 0x11ce, 0x80,0x98, 0x00,0xaa,0x00,0x47,0xbe,0x5d);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ITextSelection : public ITextRange
+{
+ virtual HRESULT STDMETHODCALLTYPE GetFlags(
+ long *pFlags) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetFlags(
+ long Flags) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetType(
+ long *pType) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE MoveLeft(
+ long Unit,
+ long Count,
+ long Extend,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE MoveRight(
+ long Unit,
+ long Count,
+ long Extend,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE MoveUp(
+ long Unit,
+ long Count,
+ long Extend,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE MoveDown(
+ long Unit,
+ long Count,
+ long Extend,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE HomeKey(
+ long Unit,
+ long Extend,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE EndKey(
+ long Unit,
+ long Extend,
+ long *pDelta) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE TypeText(
+ BSTR bstr) = 0;
+
+};
+#else
+typedef struct ITextSelectionVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ ITextSelection* This,
+ REFIID riid,
+ void **ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ ITextSelection* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ ITextSelection* This);
+
+ /*** IDispatch methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
+ ITextSelection* This,
+ UINT *pctinfo);
+
+ HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
+ ITextSelection* This,
+ UINT iTInfo,
+ LCID lcid,
+ ITypeInfo **ppTInfo);
+
+ HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
+ ITextSelection* This,
+ REFIID riid,
+ LPOLESTR *rgszNames,
+ UINT cNames,
+ LCID lcid,
+ DISPID *rgDispId);
+
+ HRESULT (STDMETHODCALLTYPE *Invoke)(
+ ITextSelection* This,
+ DISPID dispIdMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ DISPPARAMS *pDispParams,
+ VARIANT *pVarResult,
+ EXCEPINFO *pExcepInfo,
+ UINT *puArgErr);
+
+ /*** ITextRange methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetText)(
+ ITextSelection* This,
+ BSTR *pbstr);
+
+ HRESULT (STDMETHODCALLTYPE *SetText)(
+ ITextSelection* This,
+ BSTR bstr);
+
+ HRESULT (STDMETHODCALLTYPE *GetChar)(
+ ITextSelection* This,
+ long *pch);
+
+ HRESULT (STDMETHODCALLTYPE *SetChar)(
+ ITextSelection* This,
+ long ch);
+
+ HRESULT (STDMETHODCALLTYPE *GetDuplicate)(
+ ITextSelection* This,
+ ITextRange **ppRange);
+
+ HRESULT (STDMETHODCALLTYPE *GetFormattedText)(
+ ITextSelection* This,
+ ITextRange **ppRange);
+
+ HRESULT (STDMETHODCALLTYPE *SetFormattedText)(
+ ITextSelection* This,
+ ITextRange *pRange);
+
+ HRESULT (STDMETHODCALLTYPE *GetStart)(
+ ITextSelection* This,
+ long *pcpFirst);
+
+ HRESULT (STDMETHODCALLTYPE *SetStart)(
+ ITextSelection* This,
+ long cpFirst);
+
+ HRESULT (STDMETHODCALLTYPE *GetEnd)(
+ ITextSelection* This,
+ long *pcpLim);
+
+ HRESULT (STDMETHODCALLTYPE *SetEnd)(
+ ITextSelection* This,
+ long cpLim);
+
+ HRESULT (STDMETHODCALLTYPE *GetFont)(
+ ITextSelection* This,
+ ITextFont **pFont);
+
+ HRESULT (STDMETHODCALLTYPE *SetFont)(
+ ITextSelection* This,
+ ITextFont *pFont);
+
+ HRESULT (STDMETHODCALLTYPE *GetPara)(
+ ITextSelection* This,
+ ITextPara **ppPara);
+
+ HRESULT (STDMETHODCALLTYPE *SetPara)(
+ ITextSelection* This,
+ ITextPara *pPara);
+
+ HRESULT (STDMETHODCALLTYPE *GetStoryLength)(
+ ITextSelection* This,
+ long *pcch);
+
+ HRESULT (STDMETHODCALLTYPE *GetStoryType)(
+ ITextSelection* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *Collapse)(
+ ITextSelection* This,
+ long bStart);
+
+ HRESULT (STDMETHODCALLTYPE *Expand)(
+ ITextSelection* This,
+ long Unit,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *GetIndex)(
+ ITextSelection* This,
+ long Unit,
+ long *pIndex);
+
+ HRESULT (STDMETHODCALLTYPE *SetIndex)(
+ ITextSelection* This,
+ long Unit,
+ long Index,
+ long Extend);
+
+ HRESULT (STDMETHODCALLTYPE *SetRange)(
+ ITextSelection* This,
+ long cpActive,
+ long cpOther);
+
+ HRESULT (STDMETHODCALLTYPE *InRange)(
+ ITextSelection* This,
+ ITextRange *pRange,
+ long *pb);
+
+ HRESULT (STDMETHODCALLTYPE *InStory)(
+ ITextSelection* This,
+ ITextRange *pRange,
+ long *pb);
+
+ HRESULT (STDMETHODCALLTYPE *IsEqual)(
+ ITextSelection* This,
+ ITextRange *pRange,
+ long *pb);
+
+ HRESULT (STDMETHODCALLTYPE *Select)(
+ ITextSelection* This);
+
+ HRESULT (STDMETHODCALLTYPE *StartOf)(
+ ITextSelection* This,
+ long Unit,
+ long Extend,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *EndOf)(
+ ITextSelection* This,
+ long Unit,
+ long Extend,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *Move)(
+ ITextSelection* This,
+ long Unit,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveStart)(
+ ITextSelection* This,
+ long Unit,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveEnd)(
+ ITextSelection* This,
+ long Unit,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveWhile)(
+ ITextSelection* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveStartWhile)(
+ ITextSelection* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveEndWhile)(
+ ITextSelection* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveUntil)(
+ ITextSelection* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveStartUntil)(
+ ITextSelection* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveEndUntil)(
+ ITextSelection* This,
+ VARIANT *Cset,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *FindText)(
+ ITextSelection* This,
+ BSTR bstr,
+ long cch,
+ long Flags,
+ long *pLength);
+
+ HRESULT (STDMETHODCALLTYPE *FindTextStart)(
+ ITextSelection* This,
+ BSTR bstr,
+ long cch,
+ long Flags,
+ long *pLength);
+
+ HRESULT (STDMETHODCALLTYPE *FindTextEnd)(
+ ITextSelection* This,
+ BSTR bstr,
+ long cch,
+ long Flags,
+ long *pLength);
+
+ HRESULT (STDMETHODCALLTYPE *Delete)(
+ ITextSelection* This,
+ long Unit,
+ long Count,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *Cut)(
+ ITextSelection* This,
+ VARIANT *pVar);
+
+ HRESULT (STDMETHODCALLTYPE *Copy)(
+ ITextSelection* This,
+ VARIANT *pVar);
+
+ HRESULT (STDMETHODCALLTYPE *Paste)(
+ ITextSelection* This,
+ VARIANT *pVar,
+ long Format);
+
+ HRESULT (STDMETHODCALLTYPE *CanPaste)(
+ ITextSelection* This,
+ VARIANT *pVar,
+ long Format,
+ long *pb);
+
+ HRESULT (STDMETHODCALLTYPE *CanEdit)(
+ ITextSelection* This,
+ long *pb);
+
+ HRESULT (STDMETHODCALLTYPE *ChangeCase)(
+ ITextSelection* This,
+ long Type);
+
+ HRESULT (STDMETHODCALLTYPE *GetPoint)(
+ ITextSelection* This,
+ long Type,
+ long *cx,
+ long *cy);
+
+ HRESULT (STDMETHODCALLTYPE *SetPoint)(
+ ITextSelection* This,
+ long x,
+ long y,
+ long Type,
+ long Extend);
+
+ HRESULT (STDMETHODCALLTYPE *ScrollIntoView)(
+ ITextSelection* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetEmbeddedObject)(
+ ITextSelection* This,
+ IUnknown **ppv);
+
+ /*** ITextSelection methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetFlags)(
+ ITextSelection* This,
+ long *pFlags);
+
+ HRESULT (STDMETHODCALLTYPE *SetFlags)(
+ ITextSelection* This,
+ long Flags);
+
+ HRESULT (STDMETHODCALLTYPE *GetType)(
+ ITextSelection* This,
+ long *pType);
+
+ HRESULT (STDMETHODCALLTYPE *MoveLeft)(
+ ITextSelection* This,
+ long Unit,
+ long Count,
+ long Extend,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveRight)(
+ ITextSelection* This,
+ long Unit,
+ long Count,
+ long Extend,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveUp)(
+ ITextSelection* This,
+ long Unit,
+ long Count,
+ long Extend,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *MoveDown)(
+ ITextSelection* This,
+ long Unit,
+ long Count,
+ long Extend,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *HomeKey)(
+ ITextSelection* This,
+ long Unit,
+ long Extend,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *EndKey)(
+ ITextSelection* This,
+ long Unit,
+ long Extend,
+ long *pDelta);
+
+ HRESULT (STDMETHODCALLTYPE *TypeText)(
+ ITextSelection* This,
+ BSTR bstr);
+
+ END_INTERFACE
+} ITextSelectionVtbl;
+interface ITextSelection {
+ CONST_VTBL ITextSelectionVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ITextSelection_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ITextSelection_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ITextSelection_Release(This) (This)->lpVtbl->Release(This)
+/*** IDispatch methods ***/
+#define ITextSelection_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
+#define ITextSelection_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
+#define ITextSelection_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
+#define ITextSelection_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
+/*** ITextRange methods ***/
+#define ITextSelection_GetText(This,pbstr) (This)->lpVtbl->GetText(This,pbstr)
+#define ITextSelection_SetText(This,bstr) (This)->lpVtbl->SetText(This,bstr)
+#define ITextSelection_GetChar(This,pch) (This)->lpVtbl->GetChar(This,pch)
+#define ITextSelection_SetChar(This,ch) (This)->lpVtbl->SetChar(This,ch)
+#define ITextSelection_GetDuplicate(This,ppRange) (This)->lpVtbl->GetDuplicate(This,ppRange)
+#define ITextSelection_GetFormattedText(This,ppRange) (This)->lpVtbl->GetFormattedText(This,ppRange)
+#define ITextSelection_SetFormattedText(This,pRange) (This)->lpVtbl->SetFormattedText(This,pRange)
+#define ITextSelection_GetStart(This,pcpFirst) (This)->lpVtbl->GetStart(This,pcpFirst)
+#define ITextSelection_SetStart(This,cpFirst) (This)->lpVtbl->SetStart(This,cpFirst)
+#define ITextSelection_GetEnd(This,pcpLim) (This)->lpVtbl->GetEnd(This,pcpLim)
+#define ITextSelection_SetEnd(This,cpLim) (This)->lpVtbl->SetEnd(This,cpLim)
+#define ITextSelection_GetFont(This,pFont) (This)->lpVtbl->GetFont(This,pFont)
+#define ITextSelection_SetFont(This,pFont) (This)->lpVtbl->SetFont(This,pFont)
+#define ITextSelection_GetPara(This,ppPara) (This)->lpVtbl->GetPara(This,ppPara)
+#define ITextSelection_SetPara(This,pPara) (This)->lpVtbl->SetPara(This,pPara)
+#define ITextSelection_GetStoryLength(This,pcch) (This)->lpVtbl->GetStoryLength(This,pcch)
+#define ITextSelection_GetStoryType(This,pValue) (This)->lpVtbl->GetStoryType(This,pValue)
+#define ITextSelection_Collapse(This,bStart) (This)->lpVtbl->Collapse(This,bStart)
+#define ITextSelection_Expand(This,Unit,pDelta) (This)->lpVtbl->Expand(This,Unit,pDelta)
+#define ITextSelection_GetIndex(This,Unit,pIndex) (This)->lpVtbl->GetIndex(This,Unit,pIndex)
+#define ITextSelection_SetIndex(This,Unit,Index,Extend) (This)->lpVtbl->SetIndex(This,Unit,Index,Extend)
+#define ITextSelection_SetRange(This,cpActive,cpOther) (This)->lpVtbl->SetRange(This,cpActive,cpOther)
+#define ITextSelection_InRange(This,pRange,pb) (This)->lpVtbl->InRange(This,pRange,pb)
+#define ITextSelection_InStory(This,pRange,pb) (This)->lpVtbl->InStory(This,pRange,pb)
+#define ITextSelection_IsEqual(This,pRange,pb) (This)->lpVtbl->IsEqual(This,pRange,pb)
+#define ITextSelection_Select(This) (This)->lpVtbl->Select(This)
+#define ITextSelection_StartOf(This,Unit,Extend,pDelta) (This)->lpVtbl->StartOf(This,Unit,Extend,pDelta)
+#define ITextSelection_EndOf(This,Unit,Extend,pDelta) (This)->lpVtbl->EndOf(This,Unit,Extend,pDelta)
+#define ITextSelection_Move(This,Unit,Count,pDelta) (This)->lpVtbl->Move(This,Unit,Count,pDelta)
+#define ITextSelection_MoveStart(This,Unit,Count,pDelta) (This)->lpVtbl->MoveStart(This,Unit,Count,pDelta)
+#define ITextSelection_MoveEnd(This,Unit,Count,pDelta) (This)->lpVtbl->MoveEnd(This,Unit,Count,pDelta)
+#define ITextSelection_MoveWhile(This,Cset,Count,pDelta) (This)->lpVtbl->MoveWhile(This,Cset,Count,pDelta)
+#define ITextSelection_MoveStartWhile(This,Cset,Count,pDelta) (This)->lpVtbl->MoveStartWhile(This,Cset,Count,pDelta)
+#define ITextSelection_MoveEndWhile(This,Cset,Count,pDelta) (This)->lpVtbl->MoveEndWhile(This,Cset,Count,pDelta)
+#define ITextSelection_MoveUntil(This,Cset,Count,pDelta) (This)->lpVtbl->MoveUntil(This,Cset,Count,pDelta)
+#define ITextSelection_MoveStartUntil(This,Cset,Count,pDelta) (This)->lpVtbl->MoveStartUntil(This,Cset,Count,pDelta)
+#define ITextSelection_MoveEndUntil(This,Cset,Count,pDelta) (This)->lpVtbl->MoveEndUntil(This,Cset,Count,pDelta)
+#define ITextSelection_FindText(This,bstr,cch,Flags,pLength) (This)->lpVtbl->FindText(This,bstr,cch,Flags,pLength)
+#define ITextSelection_FindTextStart(This,bstr,cch,Flags,pLength) (This)->lpVtbl->FindTextStart(This,bstr,cch,Flags,pLength)
+#define ITextSelection_FindTextEnd(This,bstr,cch,Flags,pLength) (This)->lpVtbl->FindTextEnd(This,bstr,cch,Flags,pLength)
+#define ITextSelection_Delete(This,Unit,Count,pDelta) (This)->lpVtbl->Delete(This,Unit,Count,pDelta)
+#define ITextSelection_Cut(This,pVar) (This)->lpVtbl->Cut(This,pVar)
+#define ITextSelection_Copy(This,pVar) (This)->lpVtbl->Copy(This,pVar)
+#define ITextSelection_Paste(This,pVar,Format) (This)->lpVtbl->Paste(This,pVar,Format)
+#define ITextSelection_CanPaste(This,pVar,Format,pb) (This)->lpVtbl->CanPaste(This,pVar,Format,pb)
+#define ITextSelection_CanEdit(This,pb) (This)->lpVtbl->CanEdit(This,pb)
+#define ITextSelection_ChangeCase(This,Type) (This)->lpVtbl->ChangeCase(This,Type)
+#define ITextSelection_GetPoint(This,Type,cx,cy) (This)->lpVtbl->GetPoint(This,Type,cx,cy)
+#define ITextSelection_SetPoint(This,x,y,Type,Extend) (This)->lpVtbl->SetPoint(This,x,y,Type,Extend)
+#define ITextSelection_ScrollIntoView(This,Value) (This)->lpVtbl->ScrollIntoView(This,Value)
+#define ITextSelection_GetEmbeddedObject(This,ppv) (This)->lpVtbl->GetEmbeddedObject(This,ppv)
+/*** ITextSelection methods ***/
+#define ITextSelection_GetFlags(This,pFlags) (This)->lpVtbl->GetFlags(This,pFlags)
+#define ITextSelection_SetFlags(This,Flags) (This)->lpVtbl->SetFlags(This,Flags)
+#define ITextSelection_GetType(This,pType) (This)->lpVtbl->GetType(This,pType)
+#define ITextSelection_MoveLeft(This,Unit,Count,Extend,pDelta) (This)->lpVtbl->MoveLeft(This,Unit,Count,Extend,pDelta)
+#define ITextSelection_MoveRight(This,Unit,Count,Extend,pDelta) (This)->lpVtbl->MoveRight(This,Unit,Count,Extend,pDelta)
+#define ITextSelection_MoveUp(This,Unit,Count,Extend,pDelta) (This)->lpVtbl->MoveUp(This,Unit,Count,Extend,pDelta)
+#define ITextSelection_MoveDown(This,Unit,Count,Extend,pDelta) (This)->lpVtbl->MoveDown(This,Unit,Count,Extend,pDelta)
+#define ITextSelection_HomeKey(This,Unit,Extend,pDelta) (This)->lpVtbl->HomeKey(This,Unit,Extend,pDelta)
+#define ITextSelection_EndKey(This,Unit,Extend,pDelta) (This)->lpVtbl->EndKey(This,Unit,Extend,pDelta)
+#define ITextSelection_TypeText(This,bstr) (This)->lpVtbl->TypeText(This,bstr)
+#endif
+
+#endif
+
+HRESULT STDMETHODCALLTYPE ITextSelection_GetFlags_Proxy(
+ ITextSelection* This,
+ long *pFlags);
+void __RPC_STUB ITextSelection_GetFlags_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextSelection_SetFlags_Proxy(
+ ITextSelection* This,
+ long Flags);
+void __RPC_STUB ITextSelection_SetFlags_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextSelection_GetType_Proxy(
+ ITextSelection* This,
+ long *pType);
+void __RPC_STUB ITextSelection_GetType_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextSelection_MoveLeft_Proxy(
+ ITextSelection* This,
+ long Unit,
+ long Count,
+ long Extend,
+ long *pDelta);
+void __RPC_STUB ITextSelection_MoveLeft_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextSelection_MoveRight_Proxy(
+ ITextSelection* This,
+ long Unit,
+ long Count,
+ long Extend,
+ long *pDelta);
+void __RPC_STUB ITextSelection_MoveRight_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextSelection_MoveUp_Proxy(
+ ITextSelection* This,
+ long Unit,
+ long Count,
+ long Extend,
+ long *pDelta);
+void __RPC_STUB ITextSelection_MoveUp_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextSelection_MoveDown_Proxy(
+ ITextSelection* This,
+ long Unit,
+ long Count,
+ long Extend,
+ long *pDelta);
+void __RPC_STUB ITextSelection_MoveDown_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextSelection_HomeKey_Proxy(
+ ITextSelection* This,
+ long Unit,
+ long Extend,
+ long *pDelta);
+void __RPC_STUB ITextSelection_HomeKey_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextSelection_EndKey_Proxy(
+ ITextSelection* This,
+ long Unit,
+ long Extend,
+ long *pDelta);
+void __RPC_STUB ITextSelection_EndKey_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextSelection_TypeText_Proxy(
+ ITextSelection* This,
+ BSTR bstr);
+void __RPC_STUB ITextSelection_TypeText_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+
+#endif /* __ITextSelection_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ITextFont interface
+ */
+#ifndef __ITextFont_INTERFACE_DEFINED__
+#define __ITextFont_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ITextFont, 0x8cc497c3, 0xa1df, 0x11ce, 0x80,0x98, 0x00,0xaa,0x00,0x47,0xbe,0x5d);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ITextFont : public IDispatch
+{
+ virtual HRESULT STDMETHODCALLTYPE GetDuplicate(
+ ITextFont **ppFont) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetDuplicate(
+ ITextFont *pFont) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CanChange(
+ long *pB) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE IsEqual(
+ ITextFont *pFont,
+ long *pB) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Reset(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetStyle(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetStyle(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetAllCaps(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetAllCaps(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetAnimation(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetAnimation(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetBackColor(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBackColor(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetBold(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBold(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetEmboss(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetEmboss(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetForeColor(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetForeColor(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetHidden(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetHidden(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetEngrave(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetEngrave(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetItalic(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetItalic(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetKerning(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetKerning(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetLanguageID(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetLanguageID(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetName(
+ BSTR *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetName(
+ BSTR Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetOutline(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetOutline(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetPosition(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetPosition(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetProtected(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetProtected(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetShadow(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetShadow(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetSize(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetSize(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetSmallCaps(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetSmallCaps(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetSpacing(
+ float *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetSpacing(
+ float Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetStrikeThrough(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetStrikeThrough(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetSubscript(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetSubscript(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetSuperscript(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetSuperscript(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetUnderline(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetUnderline(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetWeight(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetWeight(
+ long Value) = 0;
+
+};
+#else
+typedef struct ITextFontVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ ITextFont* This,
+ REFIID riid,
+ void **ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ ITextFont* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ ITextFont* This);
+
+ /*** IDispatch methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
+ ITextFont* This,
+ UINT *pctinfo);
+
+ HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
+ ITextFont* This,
+ UINT iTInfo,
+ LCID lcid,
+ ITypeInfo **ppTInfo);
+
+ HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
+ ITextFont* This,
+ REFIID riid,
+ LPOLESTR *rgszNames,
+ UINT cNames,
+ LCID lcid,
+ DISPID *rgDispId);
+
+ HRESULT (STDMETHODCALLTYPE *Invoke)(
+ ITextFont* This,
+ DISPID dispIdMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ DISPPARAMS *pDispParams,
+ VARIANT *pVarResult,
+ EXCEPINFO *pExcepInfo,
+ UINT *puArgErr);
+
+ /*** ITextFont methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetDuplicate)(
+ ITextFont* This,
+ ITextFont **ppFont);
+
+ HRESULT (STDMETHODCALLTYPE *SetDuplicate)(
+ ITextFont* This,
+ ITextFont *pFont);
+
+ HRESULT (STDMETHODCALLTYPE *CanChange)(
+ ITextFont* This,
+ long *pB);
+
+ HRESULT (STDMETHODCALLTYPE *IsEqual)(
+ ITextFont* This,
+ ITextFont *pFont,
+ long *pB);
+
+ HRESULT (STDMETHODCALLTYPE *Reset)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetStyle)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetStyle)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetAllCaps)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetAllCaps)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetAnimation)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetAnimation)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetBackColor)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetBackColor)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetBold)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetBold)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetEmboss)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetEmboss)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetForeColor)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetForeColor)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetHidden)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetHidden)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetEngrave)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetEngrave)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetItalic)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetItalic)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetKerning)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetKerning)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetLanguageID)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetLanguageID)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetName)(
+ ITextFont* This,
+ BSTR *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetName)(
+ ITextFont* This,
+ BSTR Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetOutline)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetOutline)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetPosition)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetPosition)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetProtected)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetProtected)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetShadow)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetShadow)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetSize)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetSize)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetSmallCaps)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetSmallCaps)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetSpacing)(
+ ITextFont* This,
+ float *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetSpacing)(
+ ITextFont* This,
+ float Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetStrikeThrough)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetStrikeThrough)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetSubscript)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetSubscript)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetSuperscript)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetSuperscript)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetUnderline)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetUnderline)(
+ ITextFont* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetWeight)(
+ ITextFont* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetWeight)(
+ ITextFont* This,
+ long Value);
+
+ END_INTERFACE
+} ITextFontVtbl;
+interface ITextFont {
+ CONST_VTBL ITextFontVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ITextFont_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ITextFont_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ITextFont_Release(This) (This)->lpVtbl->Release(This)
+/*** IDispatch methods ***/
+#define ITextFont_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
+#define ITextFont_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
+#define ITextFont_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
+#define ITextFont_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
+/*** ITextFont methods ***/
+#define ITextFont_GetDuplicate(This,ppFont) (This)->lpVtbl->GetDuplicate(This,ppFont)
+#define ITextFont_SetDuplicate(This,pFont) (This)->lpVtbl->SetDuplicate(This,pFont)
+#define ITextFont_CanChange(This,pB) (This)->lpVtbl->CanChange(This,pB)
+#define ITextFont_IsEqual(This,pFont,pB) (This)->lpVtbl->IsEqual(This,pFont,pB)
+#define ITextFont_Reset(This,Value) (This)->lpVtbl->Reset(This,Value)
+#define ITextFont_GetStyle(This,pValue) (This)->lpVtbl->GetStyle(This,pValue)
+#define ITextFont_SetStyle(This,Value) (This)->lpVtbl->SetStyle(This,Value)
+#define ITextFont_GetAllCaps(This,pValue) (This)->lpVtbl->GetAllCaps(This,pValue)
+#define ITextFont_SetAllCaps(This,Value) (This)->lpVtbl->SetAllCaps(This,Value)
+#define ITextFont_GetAnimation(This,pValue) (This)->lpVtbl->GetAnimation(This,pValue)
+#define ITextFont_SetAnimation(This,Value) (This)->lpVtbl->SetAnimation(This,Value)
+#define ITextFont_GetBackColor(This,pValue) (This)->lpVtbl->GetBackColor(This,pValue)
+#define ITextFont_SetBackColor(This,Value) (This)->lpVtbl->SetBackColor(This,Value)
+#define ITextFont_GetBold(This,pValue) (This)->lpVtbl->GetBold(This,pValue)
+#define ITextFont_SetBold(This,Value) (This)->lpVtbl->SetBold(This,Value)
+#define ITextFont_GetEmboss(This,pValue) (This)->lpVtbl->GetEmboss(This,pValue)
+#define ITextFont_SetEmboss(This,Value) (This)->lpVtbl->SetEmboss(This,Value)
+#define ITextFont_GetForeColor(This,pValue) (This)->lpVtbl->GetForeColor(This,pValue)
+#define ITextFont_SetForeColor(This,Value) (This)->lpVtbl->SetForeColor(This,Value)
+#define ITextFont_GetHidden(This,pValue) (This)->lpVtbl->GetHidden(This,pValue)
+#define ITextFont_SetHidden(This,Value) (This)->lpVtbl->SetHidden(This,Value)
+#define ITextFont_GetEngrave(This,pValue) (This)->lpVtbl->GetEngrave(This,pValue)
+#define ITextFont_SetEngrave(This,Value) (This)->lpVtbl->SetEngrave(This,Value)
+#define ITextFont_GetItalic(This,pValue) (This)->lpVtbl->GetItalic(This,pValue)
+#define ITextFont_SetItalic(This,Value) (This)->lpVtbl->SetItalic(This,Value)
+#define ITextFont_GetKerning(This,pValue) (This)->lpVtbl->GetKerning(This,pValue)
+#define ITextFont_SetKerning(This,Value) (This)->lpVtbl->SetKerning(This,Value)
+#define ITextFont_GetLanguageID(This,pValue) (This)->lpVtbl->GetLanguageID(This,pValue)
+#define ITextFont_SetLanguageID(This,Value) (This)->lpVtbl->SetLanguageID(This,Value)
+#define ITextFont_GetName(This,pValue) (This)->lpVtbl->GetName(This,pValue)
+#define ITextFont_SetName(This,Value) (This)->lpVtbl->SetName(This,Value)
+#define ITextFont_GetOutline(This,pValue) (This)->lpVtbl->GetOutline(This,pValue)
+#define ITextFont_SetOutline(This,Value) (This)->lpVtbl->SetOutline(This,Value)
+#define ITextFont_GetPosition(This,pValue) (This)->lpVtbl->GetPosition(This,pValue)
+#define ITextFont_SetPosition(This,Value) (This)->lpVtbl->SetPosition(This,Value)
+#define ITextFont_GetProtected(This,pValue) (This)->lpVtbl->GetProtected(This,pValue)
+#define ITextFont_SetProtected(This,Value) (This)->lpVtbl->SetProtected(This,Value)
+#define ITextFont_GetShadow(This,pValue) (This)->lpVtbl->GetShadow(This,pValue)
+#define ITextFont_SetShadow(This,Value) (This)->lpVtbl->SetShadow(This,Value)
+#define ITextFont_GetSize(This,pValue) (This)->lpVtbl->GetSize(This,pValue)
+#define ITextFont_SetSize(This,Value) (This)->lpVtbl->SetSize(This,Value)
+#define ITextFont_GetSmallCaps(This,pValue) (This)->lpVtbl->GetSmallCaps(This,pValue)
+#define ITextFont_SetSmallCaps(This,Value) (This)->lpVtbl->SetSmallCaps(This,Value)
+#define ITextFont_GetSpacing(This,pValue) (This)->lpVtbl->GetSpacing(This,pValue)
+#define ITextFont_SetSpacing(This,Value) (This)->lpVtbl->SetSpacing(This,Value)
+#define ITextFont_GetStrikeThrough(This,pValue) (This)->lpVtbl->GetStrikeThrough(This,pValue)
+#define ITextFont_SetStrikeThrough(This,Value) (This)->lpVtbl->SetStrikeThrough(This,Value)
+#define ITextFont_GetSubscript(This,pValue) (This)->lpVtbl->GetSubscript(This,pValue)
+#define ITextFont_SetSubscript(This,Value) (This)->lpVtbl->SetSubscript(This,Value)
+#define ITextFont_GetSuperscript(This,pValue) (This)->lpVtbl->GetSuperscript(This,pValue)
+#define ITextFont_SetSuperscript(This,Value) (This)->lpVtbl->SetSuperscript(This,Value)
+#define ITextFont_GetUnderline(This,pValue) (This)->lpVtbl->GetUnderline(This,pValue)
+#define ITextFont_SetUnderline(This,Value) (This)->lpVtbl->SetUnderline(This,Value)
+#define ITextFont_GetWeight(This,pValue) (This)->lpVtbl->GetWeight(This,pValue)
+#define ITextFont_SetWeight(This,Value) (This)->lpVtbl->SetWeight(This,Value)
+#endif
+
+#endif
+
+HRESULT STDMETHODCALLTYPE ITextFont_GetDuplicate_Proxy(
+ ITextFont* This,
+ ITextFont **ppFont);
+void __RPC_STUB ITextFont_GetDuplicate_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetDuplicate_Proxy(
+ ITextFont* This,
+ ITextFont *pFont);
+void __RPC_STUB ITextFont_SetDuplicate_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_CanChange_Proxy(
+ ITextFont* This,
+ long *pB);
+void __RPC_STUB ITextFont_CanChange_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_IsEqual_Proxy(
+ ITextFont* This,
+ ITextFont *pFont,
+ long *pB);
+void __RPC_STUB ITextFont_IsEqual_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_Reset_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_Reset_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetStyle_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetStyle_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetStyle_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetStyle_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetAllCaps_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetAllCaps_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetAllCaps_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetAllCaps_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetAnimation_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetAnimation_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetAnimation_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetAnimation_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetBackColor_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetBackColor_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetBackColor_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetBackColor_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetBold_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetBold_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetBold_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetBold_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetEmboss_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetEmboss_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetEmboss_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetEmboss_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetForeColor_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetForeColor_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetForeColor_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetForeColor_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetHidden_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetHidden_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetHidden_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetHidden_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetEngrave_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetEngrave_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetEngrave_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetEngrave_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetItalic_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetItalic_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetItalic_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetItalic_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetKerning_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetKerning_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetKerning_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetKerning_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetLanguageID_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetLanguageID_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetLanguageID_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetLanguageID_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetName_Proxy(
+ ITextFont* This,
+ BSTR *pValue);
+void __RPC_STUB ITextFont_GetName_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetName_Proxy(
+ ITextFont* This,
+ BSTR Value);
+void __RPC_STUB ITextFont_SetName_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetOutline_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetOutline_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetOutline_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetOutline_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetPosition_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetPosition_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetPosition_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetPosition_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetProtected_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetProtected_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetProtected_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetProtected_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetShadow_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetShadow_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetShadow_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetShadow_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetSize_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetSize_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetSize_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetSize_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetSmallCaps_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetSmallCaps_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetSmallCaps_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetSmallCaps_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetSpacing_Proxy(
+ ITextFont* This,
+ float *pValue);
+void __RPC_STUB ITextFont_GetSpacing_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetSpacing_Proxy(
+ ITextFont* This,
+ float Value);
+void __RPC_STUB ITextFont_SetSpacing_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetStrikeThrough_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetStrikeThrough_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetStrikeThrough_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetStrikeThrough_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetSubscript_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetSubscript_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetSubscript_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetSubscript_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetSuperscript_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetSuperscript_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetSuperscript_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetSuperscript_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetUnderline_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetUnderline_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetUnderline_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetUnderline_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_GetWeight_Proxy(
+ ITextFont* This,
+ long *pValue);
+void __RPC_STUB ITextFont_GetWeight_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextFont_SetWeight_Proxy(
+ ITextFont* This,
+ long Value);
+void __RPC_STUB ITextFont_SetWeight_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+
+#endif /* __ITextFont_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ITextPara interface
+ */
+#ifndef __ITextPara_INTERFACE_DEFINED__
+#define __ITextPara_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ITextPara, 0x8cc497c4, 0xa1df, 0x11ce, 0x80,0x98, 0x00,0xaa,0x00,0x47,0xbe,0x5d);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ITextPara : public IDispatch
+{
+ virtual HRESULT STDMETHODCALLTYPE GetDuplicate(
+ ITextPara **ppPara) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetDuplicate(
+ ITextPara *pPara) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CanChange(
+ long *pB) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE IsEqual(
+ ITextPara *pPara,
+ long *pB) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Reset(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetStyle(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetStyle(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetAlignment(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetAlignment(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetHyphenation(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetHyphenation(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetFirstLineIndent(
+ float *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetKeepTogether(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetKeepTogether(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetKeepWithNext(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetKeepWithNext(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetLeftIndent(
+ float *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetLineSpacing(
+ float *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetLineSpacingRule(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetListAlignment(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetListAlignment(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetListLevelIndex(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetListLevelIndex(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetListStart(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetListStart(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetListTab(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetListTab(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetListType(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetListType(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetNoLineNumber(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetNoLineNumber(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetPageBreakBefore(
+ long *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetPageBreakBefore(
+ long Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetRightIndent(
+ float *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetRightIndent(
+ float Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetIndents(
+ float StartIndent,
+ float LeftIndent,
+ float RightIndent) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetLineSpacing(
+ long LineSpacingRule,
+ float LineSpacing) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetSpaceAfter(
+ float *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetSpaceAfter(
+ float Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetSpaceBefore(
+ float *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetSpaceBefore(
+ float Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetWindowControl(
+ float *pValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetWindowControl(
+ float Value) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetTabCount(
+ long *pCount) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddTab(
+ float tbPos,
+ long tbAlign,
+ long tbLeader) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ClearAllTabs(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE DeleteTab(
+ float tbPos) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetTab(
+ long iTab,
+ float *ptbPos,
+ long *ptbAlign,
+ long *ptbLeader) = 0;
+
+};
+#else
+typedef struct ITextParaVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ ITextPara* This,
+ REFIID riid,
+ void **ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ ITextPara* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ ITextPara* This);
+
+ /*** IDispatch methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
+ ITextPara* This,
+ UINT *pctinfo);
+
+ HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
+ ITextPara* This,
+ UINT iTInfo,
+ LCID lcid,
+ ITypeInfo **ppTInfo);
+
+ HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
+ ITextPara* This,
+ REFIID riid,
+ LPOLESTR *rgszNames,
+ UINT cNames,
+ LCID lcid,
+ DISPID *rgDispId);
+
+ HRESULT (STDMETHODCALLTYPE *Invoke)(
+ ITextPara* This,
+ DISPID dispIdMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ DISPPARAMS *pDispParams,
+ VARIANT *pVarResult,
+ EXCEPINFO *pExcepInfo,
+ UINT *puArgErr);
+
+ /*** ITextPara methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetDuplicate)(
+ ITextPara* This,
+ ITextPara **ppPara);
+
+ HRESULT (STDMETHODCALLTYPE *SetDuplicate)(
+ ITextPara* This,
+ ITextPara *pPara);
+
+ HRESULT (STDMETHODCALLTYPE *CanChange)(
+ ITextPara* This,
+ long *pB);
+
+ HRESULT (STDMETHODCALLTYPE *IsEqual)(
+ ITextPara* This,
+ ITextPara *pPara,
+ long *pB);
+
+ HRESULT (STDMETHODCALLTYPE *Reset)(
+ ITextPara* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetStyle)(
+ ITextPara* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetStyle)(
+ ITextPara* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetAlignment)(
+ ITextPara* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetAlignment)(
+ ITextPara* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetHyphenation)(
+ ITextPara* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetHyphenation)(
+ ITextPara* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetFirstLineIndent)(
+ ITextPara* This,
+ float *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *GetKeepTogether)(
+ ITextPara* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetKeepTogether)(
+ ITextPara* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetKeepWithNext)(
+ ITextPara* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetKeepWithNext)(
+ ITextPara* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetLeftIndent)(
+ ITextPara* This,
+ float *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *GetLineSpacing)(
+ ITextPara* This,
+ float *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *GetLineSpacingRule)(
+ ITextPara* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *GetListAlignment)(
+ ITextPara* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetListAlignment)(
+ ITextPara* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetListLevelIndex)(
+ ITextPara* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetListLevelIndex)(
+ ITextPara* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetListStart)(
+ ITextPara* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetListStart)(
+ ITextPara* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetListTab)(
+ ITextPara* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetListTab)(
+ ITextPara* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetListType)(
+ ITextPara* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetListType)(
+ ITextPara* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetNoLineNumber)(
+ ITextPara* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetNoLineNumber)(
+ ITextPara* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetPageBreakBefore)(
+ ITextPara* This,
+ long *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetPageBreakBefore)(
+ ITextPara* This,
+ long Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetRightIndent)(
+ ITextPara* This,
+ float *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetRightIndent)(
+ ITextPara* This,
+ float Value);
+
+ HRESULT (STDMETHODCALLTYPE *SetIndents)(
+ ITextPara* This,
+ float StartIndent,
+ float LeftIndent,
+ float RightIndent);
+
+ HRESULT (STDMETHODCALLTYPE *SetLineSpacing)(
+ ITextPara* This,
+ long LineSpacingRule,
+ float LineSpacing);
+
+ HRESULT (STDMETHODCALLTYPE *GetSpaceAfter)(
+ ITextPara* This,
+ float *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetSpaceAfter)(
+ ITextPara* This,
+ float Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetSpaceBefore)(
+ ITextPara* This,
+ float *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetSpaceBefore)(
+ ITextPara* This,
+ float Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetWindowControl)(
+ ITextPara* This,
+ float *pValue);
+
+ HRESULT (STDMETHODCALLTYPE *SetWindowControl)(
+ ITextPara* This,
+ float Value);
+
+ HRESULT (STDMETHODCALLTYPE *GetTabCount)(
+ ITextPara* This,
+ long *pCount);
+
+ HRESULT (STDMETHODCALLTYPE *AddTab)(
+ ITextPara* This,
+ float tbPos,
+ long tbAlign,
+ long tbLeader);
+
+ HRESULT (STDMETHODCALLTYPE *ClearAllTabs)(
+ ITextPara* This);
+
+ HRESULT (STDMETHODCALLTYPE *DeleteTab)(
+ ITextPara* This,
+ float tbPos);
+
+ HRESULT (STDMETHODCALLTYPE *GetTab)(
+ ITextPara* This,
+ long iTab,
+ float *ptbPos,
+ long *ptbAlign,
+ long *ptbLeader);
+
+ END_INTERFACE
+} ITextParaVtbl;
+interface ITextPara {
+ CONST_VTBL ITextParaVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ITextPara_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ITextPara_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ITextPara_Release(This) (This)->lpVtbl->Release(This)
+/*** IDispatch methods ***/
+#define ITextPara_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
+#define ITextPara_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
+#define ITextPara_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
+#define ITextPara_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
+/*** ITextPara methods ***/
+#define ITextPara_GetDuplicate(This,ppPara) (This)->lpVtbl->GetDuplicate(This,ppPara)
+#define ITextPara_SetDuplicate(This,pPara) (This)->lpVtbl->SetDuplicate(This,pPara)
+#define ITextPara_CanChange(This,pB) (This)->lpVtbl->CanChange(This,pB)
+#define ITextPara_IsEqual(This,pPara,pB) (This)->lpVtbl->IsEqual(This,pPara,pB)
+#define ITextPara_Reset(This,Value) (This)->lpVtbl->Reset(This,Value)
+#define ITextPara_GetStyle(This,pValue) (This)->lpVtbl->GetStyle(This,pValue)
+#define ITextPara_SetStyle(This,Value) (This)->lpVtbl->SetStyle(This,Value)
+#define ITextPara_GetAlignment(This,pValue) (This)->lpVtbl->GetAlignment(This,pValue)
+#define ITextPara_SetAlignment(This,Value) (This)->lpVtbl->SetAlignment(This,Value)
+#define ITextPara_GetHyphenation(This,pValue) (This)->lpVtbl->GetHyphenation(This,pValue)
+#define ITextPara_SetHyphenation(This,Value) (This)->lpVtbl->SetHyphenation(This,Value)
+#define ITextPara_GetFirstLineIndent(This,pValue) (This)->lpVtbl->GetFirstLineIndent(This,pValue)
+#define ITextPara_GetKeepTogether(This,pValue) (This)->lpVtbl->GetKeepTogether(This,pValue)
+#define ITextPara_SetKeepTogether(This,Value) (This)->lpVtbl->SetKeepTogether(This,Value)
+#define ITextPara_GetKeepWithNext(This,pValue) (This)->lpVtbl->GetKeepWithNext(This,pValue)
+#define ITextPara_SetKeepWithNext(This,Value) (This)->lpVtbl->SetKeepWithNext(This,Value)
+#define ITextPara_GetLeftIndent(This,pValue) (This)->lpVtbl->GetLeftIndent(This,pValue)
+#define ITextPara_GetLineSpacing(This,pValue) (This)->lpVtbl->GetLineSpacing(This,pValue)
+#define ITextPara_GetLineSpacingRule(This,pValue) (This)->lpVtbl->GetLineSpacingRule(This,pValue)
+#define ITextPara_GetListAlignment(This,pValue) (This)->lpVtbl->GetListAlignment(This,pValue)
+#define ITextPara_SetListAlignment(This,Value) (This)->lpVtbl->SetListAlignment(This,Value)
+#define ITextPara_GetListLevelIndex(This,pValue) (This)->lpVtbl->GetListLevelIndex(This,pValue)
+#define ITextPara_SetListLevelIndex(This,Value) (This)->lpVtbl->SetListLevelIndex(This,Value)
+#define ITextPara_GetListStart(This,pValue) (This)->lpVtbl->GetListStart(This,pValue)
+#define ITextPara_SetListStart(This,Value) (This)->lpVtbl->SetListStart(This,Value)
+#define ITextPara_GetListTab(This,pValue) (This)->lpVtbl->GetListTab(This,pValue)
+#define ITextPara_SetListTab(This,Value) (This)->lpVtbl->SetListTab(This,Value)
+#define ITextPara_GetListType(This,pValue) (This)->lpVtbl->GetListType(This,pValue)
+#define ITextPara_SetListType(This,Value) (This)->lpVtbl->SetListType(This,Value)
+#define ITextPara_GetNoLineNumber(This,pValue) (This)->lpVtbl->GetNoLineNumber(This,pValue)
+#define ITextPara_SetNoLineNumber(This,Value) (This)->lpVtbl->SetNoLineNumber(This,Value)
+#define ITextPara_GetPageBreakBefore(This,pValue) (This)->lpVtbl->GetPageBreakBefore(This,pValue)
+#define ITextPara_SetPageBreakBefore(This,Value) (This)->lpVtbl->SetPageBreakBefore(This,Value)
+#define ITextPara_GetRightIndent(This,pValue) (This)->lpVtbl->GetRightIndent(This,pValue)
+#define ITextPara_SetRightIndent(This,Value) (This)->lpVtbl->SetRightIndent(This,Value)
+#define ITextPara_SetIndents(This,StartIndent,LeftIndent,RightIndent) (This)->lpVtbl->SetIndents(This,StartIndent,LeftIndent,RightIndent)
+#define ITextPara_SetLineSpacing(This,LineSpacingRule,LineSpacing) (This)->lpVtbl->SetLineSpacing(This,LineSpacingRule,LineSpacing)
+#define ITextPara_GetSpaceAfter(This,pValue) (This)->lpVtbl->GetSpaceAfter(This,pValue)
+#define ITextPara_SetSpaceAfter(This,Value) (This)->lpVtbl->SetSpaceAfter(This,Value)
+#define ITextPara_GetSpaceBefore(This,pValue) (This)->lpVtbl->GetSpaceBefore(This,pValue)
+#define ITextPara_SetSpaceBefore(This,Value) (This)->lpVtbl->SetSpaceBefore(This,Value)
+#define ITextPara_GetWindowControl(This,pValue) (This)->lpVtbl->GetWindowControl(This,pValue)
+#define ITextPara_SetWindowControl(This,Value) (This)->lpVtbl->SetWindowControl(This,Value)
+#define ITextPara_GetTabCount(This,pCount) (This)->lpVtbl->GetTabCount(This,pCount)
+#define ITextPara_AddTab(This,tbPos,tbAlign,tbLeader) (This)->lpVtbl->AddTab(This,tbPos,tbAlign,tbLeader)
+#define ITextPara_ClearAllTabs(This) (This)->lpVtbl->ClearAllTabs(This)
+#define ITextPara_DeleteTab(This,tbPos) (This)->lpVtbl->DeleteTab(This,tbPos)
+#define ITextPara_GetTab(This,iTab,ptbPos,ptbAlign,ptbLeader) (This)->lpVtbl->GetTab(This,iTab,ptbPos,ptbAlign,ptbLeader)
+#endif
+
+#endif
+
+HRESULT STDMETHODCALLTYPE ITextPara_GetDuplicate_Proxy(
+ ITextPara* This,
+ ITextPara **ppPara);
+void __RPC_STUB ITextPara_GetDuplicate_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetDuplicate_Proxy(
+ ITextPara* This,
+ ITextPara *pPara);
+void __RPC_STUB ITextPara_SetDuplicate_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_CanChange_Proxy(
+ ITextPara* This,
+ long *pB);
+void __RPC_STUB ITextPara_CanChange_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_IsEqual_Proxy(
+ ITextPara* This,
+ ITextPara *pPara,
+ long *pB);
+void __RPC_STUB ITextPara_IsEqual_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_Reset_Proxy(
+ ITextPara* This,
+ long Value);
+void __RPC_STUB ITextPara_Reset_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetStyle_Proxy(
+ ITextPara* This,
+ long *pValue);
+void __RPC_STUB ITextPara_GetStyle_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetStyle_Proxy(
+ ITextPara* This,
+ long Value);
+void __RPC_STUB ITextPara_SetStyle_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetAlignment_Proxy(
+ ITextPara* This,
+ long *pValue);
+void __RPC_STUB ITextPara_GetAlignment_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetAlignment_Proxy(
+ ITextPara* This,
+ long Value);
+void __RPC_STUB ITextPara_SetAlignment_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetHyphenation_Proxy(
+ ITextPara* This,
+ long *pValue);
+void __RPC_STUB ITextPara_GetHyphenation_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetHyphenation_Proxy(
+ ITextPara* This,
+ long Value);
+void __RPC_STUB ITextPara_SetHyphenation_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetFirstLineIndent_Proxy(
+ ITextPara* This,
+ float *pValue);
+void __RPC_STUB ITextPara_GetFirstLineIndent_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetKeepTogether_Proxy(
+ ITextPara* This,
+ long *pValue);
+void __RPC_STUB ITextPara_GetKeepTogether_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetKeepTogether_Proxy(
+ ITextPara* This,
+ long Value);
+void __RPC_STUB ITextPara_SetKeepTogether_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetKeepWithNext_Proxy(
+ ITextPara* This,
+ long *pValue);
+void __RPC_STUB ITextPara_GetKeepWithNext_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetKeepWithNext_Proxy(
+ ITextPara* This,
+ long Value);
+void __RPC_STUB ITextPara_SetKeepWithNext_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetLeftIndent_Proxy(
+ ITextPara* This,
+ float *pValue);
+void __RPC_STUB ITextPara_GetLeftIndent_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetLineSpacing_Proxy(
+ ITextPara* This,
+ float *pValue);
+void __RPC_STUB ITextPara_GetLineSpacing_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetLineSpacingRule_Proxy(
+ ITextPara* This,
+ long *pValue);
+void __RPC_STUB ITextPara_GetLineSpacingRule_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetListAlignment_Proxy(
+ ITextPara* This,
+ long *pValue);
+void __RPC_STUB ITextPara_GetListAlignment_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetListAlignment_Proxy(
+ ITextPara* This,
+ long Value);
+void __RPC_STUB ITextPara_SetListAlignment_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetListLevelIndex_Proxy(
+ ITextPara* This,
+ long *pValue);
+void __RPC_STUB ITextPara_GetListLevelIndex_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetListLevelIndex_Proxy(
+ ITextPara* This,
+ long Value);
+void __RPC_STUB ITextPara_SetListLevelIndex_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetListStart_Proxy(
+ ITextPara* This,
+ long *pValue);
+void __RPC_STUB ITextPara_GetListStart_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetListStart_Proxy(
+ ITextPara* This,
+ long Value);
+void __RPC_STUB ITextPara_SetListStart_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetListTab_Proxy(
+ ITextPara* This,
+ long *pValue);
+void __RPC_STUB ITextPara_GetListTab_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetListTab_Proxy(
+ ITextPara* This,
+ long Value);
+void __RPC_STUB ITextPara_SetListTab_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetListType_Proxy(
+ ITextPara* This,
+ long *pValue);
+void __RPC_STUB ITextPara_GetListType_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetListType_Proxy(
+ ITextPara* This,
+ long Value);
+void __RPC_STUB ITextPara_SetListType_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetNoLineNumber_Proxy(
+ ITextPara* This,
+ long *pValue);
+void __RPC_STUB ITextPara_GetNoLineNumber_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetNoLineNumber_Proxy(
+ ITextPara* This,
+ long Value);
+void __RPC_STUB ITextPara_SetNoLineNumber_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetPageBreakBefore_Proxy(
+ ITextPara* This,
+ long *pValue);
+void __RPC_STUB ITextPara_GetPageBreakBefore_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetPageBreakBefore_Proxy(
+ ITextPara* This,
+ long Value);
+void __RPC_STUB ITextPara_SetPageBreakBefore_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetRightIndent_Proxy(
+ ITextPara* This,
+ float *pValue);
+void __RPC_STUB ITextPara_GetRightIndent_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetRightIndent_Proxy(
+ ITextPara* This,
+ float Value);
+void __RPC_STUB ITextPara_SetRightIndent_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetIndents_Proxy(
+ ITextPara* This,
+ float StartIndent,
+ float LeftIndent,
+ float RightIndent);
+void __RPC_STUB ITextPara_SetIndents_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetLineSpacing_Proxy(
+ ITextPara* This,
+ long LineSpacingRule,
+ float LineSpacing);
+void __RPC_STUB ITextPara_SetLineSpacing_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetSpaceAfter_Proxy(
+ ITextPara* This,
+ float *pValue);
+void __RPC_STUB ITextPara_GetSpaceAfter_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetSpaceAfter_Proxy(
+ ITextPara* This,
+ float Value);
+void __RPC_STUB ITextPara_SetSpaceAfter_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetSpaceBefore_Proxy(
+ ITextPara* This,
+ float *pValue);
+void __RPC_STUB ITextPara_GetSpaceBefore_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetSpaceBefore_Proxy(
+ ITextPara* This,
+ float Value);
+void __RPC_STUB ITextPara_SetSpaceBefore_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetWindowControl_Proxy(
+ ITextPara* This,
+ float *pValue);
+void __RPC_STUB ITextPara_GetWindowControl_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_SetWindowControl_Proxy(
+ ITextPara* This,
+ float Value);
+void __RPC_STUB ITextPara_SetWindowControl_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetTabCount_Proxy(
+ ITextPara* This,
+ long *pCount);
+void __RPC_STUB ITextPara_GetTabCount_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_AddTab_Proxy(
+ ITextPara* This,
+ float tbPos,
+ long tbAlign,
+ long tbLeader);
+void __RPC_STUB ITextPara_AddTab_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_ClearAllTabs_Proxy(
+ ITextPara* This);
+void __RPC_STUB ITextPara_ClearAllTabs_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_DeleteTab_Proxy(
+ ITextPara* This,
+ float tbPos);
+void __RPC_STUB ITextPara_DeleteTab_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextPara_GetTab_Proxy(
+ ITextPara* This,
+ long iTab,
+ float *ptbPos,
+ long *ptbAlign,
+ long *ptbLeader);
+void __RPC_STUB ITextPara_GetTab_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+
+#endif /* __ITextPara_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ITextStoryRanges interface
+ */
+#ifndef __ITextStoryRanges_INTERFACE_DEFINED__
+#define __ITextStoryRanges_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ITextStoryRanges, 0x8cc497c5, 0xa1df, 0x11ce, 0x80,0x98, 0x00,0xaa,0x00,0x47,0xbe,0x5d);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ITextStoryRanges : public IDispatch
+{
+ virtual HRESULT STDMETHODCALLTYPE _NewEnum(
+ IUnknown **ppUnkEnum) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Item(
+ long Index,
+ ITextRange **ppRange) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetCount(
+ long *pCount) = 0;
+
+};
+#else
+typedef struct ITextStoryRangesVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ ITextStoryRanges* This,
+ REFIID riid,
+ void **ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ ITextStoryRanges* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ ITextStoryRanges* This);
+
+ /*** IDispatch methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
+ ITextStoryRanges* This,
+ UINT *pctinfo);
+
+ HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
+ ITextStoryRanges* This,
+ UINT iTInfo,
+ LCID lcid,
+ ITypeInfo **ppTInfo);
+
+ HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
+ ITextStoryRanges* This,
+ REFIID riid,
+ LPOLESTR *rgszNames,
+ UINT cNames,
+ LCID lcid,
+ DISPID *rgDispId);
+
+ HRESULT (STDMETHODCALLTYPE *Invoke)(
+ ITextStoryRanges* This,
+ DISPID dispIdMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ DISPPARAMS *pDispParams,
+ VARIANT *pVarResult,
+ EXCEPINFO *pExcepInfo,
+ UINT *puArgErr);
+
+ /*** ITextStoryRanges methods ***/
+ HRESULT (STDMETHODCALLTYPE *_NewEnum)(
+ ITextStoryRanges* This,
+ IUnknown **ppUnkEnum);
+
+ HRESULT (STDMETHODCALLTYPE *Item)(
+ ITextStoryRanges* This,
+ long Index,
+ ITextRange **ppRange);
+
+ HRESULT (STDMETHODCALLTYPE *GetCount)(
+ ITextStoryRanges* This,
+ long *pCount);
+
+ END_INTERFACE
+} ITextStoryRangesVtbl;
+interface ITextStoryRanges {
+ CONST_VTBL ITextStoryRangesVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ITextStoryRanges_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ITextStoryRanges_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ITextStoryRanges_Release(This) (This)->lpVtbl->Release(This)
+/*** IDispatch methods ***/
+#define ITextStoryRanges_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
+#define ITextStoryRanges_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
+#define ITextStoryRanges_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
+#define ITextStoryRanges_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
+/*** ITextStoryRanges methods ***/
+#define ITextStoryRanges__NewEnum(This,ppUnkEnum) (This)->lpVtbl->_NewEnum(This,ppUnkEnum)
+#define ITextStoryRanges_Item(This,Index,ppRange) (This)->lpVtbl->Item(This,Index,ppRange)
+#define ITextStoryRanges_GetCount(This,pCount) (This)->lpVtbl->GetCount(This,pCount)
+#endif
+
+#endif
+
+HRESULT STDMETHODCALLTYPE ITextStoryRanges__NewEnum_Proxy(
+ ITextStoryRanges* This,
+ IUnknown **ppUnkEnum);
+void __RPC_STUB ITextStoryRanges__NewEnum_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextStoryRanges_Item_Proxy(
+ ITextStoryRanges* This,
+ long Index,
+ ITextRange **ppRange);
+void __RPC_STUB ITextStoryRanges_Item_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ITextStoryRanges_GetCount_Proxy(
+ ITextStoryRanges* This,
+ long *pCount);
+void __RPC_STUB ITextStoryRanges_GetCount_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+
+#endif /* __ITextStoryRanges_INTERFACE_DEFINED__ */
+
+/* Begin additional prototypes for all interfaces */
+
+ULONG __RPC_USER BSTR_UserSize (ULONG *, ULONG, BSTR *);
+unsigned char * __RPC_USER BSTR_UserMarshal (ULONG *, unsigned char *, BSTR *);
+unsigned char * __RPC_USER BSTR_UserUnmarshal(ULONG *, unsigned char *, BSTR *);
+void __RPC_USER BSTR_UserFree (ULONG *, BSTR *);
+ULONG __RPC_USER VARIANT_UserSize (ULONG *, ULONG, VARIANT *);
+unsigned char * __RPC_USER VARIANT_UserMarshal (ULONG *, unsigned char *, VARIANT *);
+unsigned char * __RPC_USER VARIANT_UserUnmarshal(ULONG *, unsigned char *, VARIANT *);
+void __RPC_USER VARIANT_UserFree (ULONG *, VARIANT *);
+
+/* End additional prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __WIDL_TOM_H */
diff --git a/include/msapi/vsstyle.h b/include/msapi/vsstyle.h new file mode 100644 index 0000000000..b65e223b51 --- /dev/null +++ b/include/msapi/vsstyle.h @@ -0,0 +1,1606 @@ +//-------------------------------------------------------------------------//
+// VisualStyle Style Guide symbols
+//-------------------------------------------------------------------------//
+
+#ifndef __VSSTYLE_H__
+#define __VSSTYLE_H__
+
+//
+// property symbol definitions
+//
+
+#define TMTVS_RESERVEDLOW 100000
+#define TMTVS_RESERVEDHIGH 19999
+
+
+
+//
+// AEROWIZARDSTYLE class parts and states
+//
+#define VSCLASS_AEROWIZARDSTYLE L"AEROWIZARDSTYLE"
+#define VSCLASS_AEROWIZARD L"AEROWIZARD"
+
+enum AEROWIZARDPARTS {
+ AW_TITLEBAR = 1,
+ AW_HEADERAREA = 2,
+ AW_CONTENTAREA = 3,
+ AW_COMMANDAREA = 4,
+ AW_BUTTON = 5,
+};
+
+#define AEROWIZARDSTYLEPARTS AEROWIZARDPARTS;
+
+enum TITLEBARSTATES {
+ AW_S_TITLEBAR_ACTIVE = 1,
+ AW_S_TITLEBAR_INACTIVE = 2,
+};
+
+enum HEADERAREASTATES {
+ AW_S_HEADERAREA_NOMARGIN = 1,
+};
+
+enum CONTENTAREASTATES {
+ AW_S_CONTENTAREA_NOMARGIN = 1,
+};
+
+
+//
+// BUTTONSTYLE class parts and states
+//
+#define VSCLASS_BUTTONSTYLE L"BUTTONSTYLE"
+#define VSCLASS_BUTTON L"BUTTON"
+
+enum BUTTONPARTS {
+ BP_PUSHBUTTON = 1,
+ BP_RADIOBUTTON = 2,
+ BP_CHECKBOX = 3,
+ BP_GROUPBOX = 4,
+ BP_USERBUTTON = 5,
+ BP_COMMANDLINK = 6,
+ BP_COMMANDLINKGLYPH = 7,
+};
+
+#define BUTTONSTYLEPARTS BUTTONPARTS;
+
+enum PUSHBUTTONSTATES {
+ PBS_NORMAL = 1,
+ PBS_HOT = 2,
+ PBS_PRESSED = 3,
+ PBS_DISABLED = 4,
+ PBS_DEFAULTED = 5,
+ PBS_DEFAULTED_ANIMATING = 6,
+};
+
+enum RADIOBUTTONSTATES {
+ RBS_UNCHECKEDNORMAL = 1,
+ RBS_UNCHECKEDHOT = 2,
+ RBS_UNCHECKEDPRESSED = 3,
+ RBS_UNCHECKEDDISABLED = 4,
+ RBS_CHECKEDNORMAL = 5,
+ RBS_CHECKEDHOT = 6,
+ RBS_CHECKEDPRESSED = 7,
+ RBS_CHECKEDDISABLED = 8,
+};
+
+enum CHECKBOXSTATES {
+ CBS_UNCHECKEDNORMAL = 1,
+ CBS_UNCHECKEDHOT = 2,
+ CBS_UNCHECKEDPRESSED = 3,
+ CBS_UNCHECKEDDISABLED = 4,
+ CBS_CHECKEDNORMAL = 5,
+ CBS_CHECKEDHOT = 6,
+ CBS_CHECKEDPRESSED = 7,
+ CBS_CHECKEDDISABLED = 8,
+ CBS_MIXEDNORMAL = 9,
+ CBS_MIXEDHOT = 10,
+ CBS_MIXEDPRESSED = 11,
+ CBS_MIXEDDISABLED = 12,
+ CBS_IMPLICITNORMAL = 13,
+ CBS_IMPLICITHOT = 14,
+ CBS_IMPLICITPRESSED = 15,
+ CBS_IMPLICITDISABLED = 16,
+ CBS_EXCLUDEDNORMAL = 17,
+ CBS_EXCLUDEDHOT = 18,
+ CBS_EXCLUDEDPRESSED = 19,
+ CBS_EXCLUDEDDISABLED = 20,
+};
+
+enum GROUPBOXSTATES {
+ GBS_NORMAL = 1,
+ GBS_DISABLED = 2,
+};
+
+enum COMMANDLINKSTATES {
+ CMDLS_NORMAL = 1,
+ CMDLS_HOT = 2,
+ CMDLS_PRESSED = 3,
+ CMDLS_DISABLED = 4,
+ CMDLS_DEFAULTED = 5,
+ CMDLS_DEFAULTED_ANIMATING = 6,
+};
+
+enum COMMANDLINKGLYPHSTATES {
+ CMDLGS_NORMAL = 1,
+ CMDLGS_HOT = 2,
+ CMDLGS_PRESSED = 3,
+ CMDLGS_DISABLED = 4,
+ CMDLGS_DEFAULTED = 5,
+};
+
+
+//
+// COMBOBOXSTYLE class parts and states
+//
+#define VSCLASS_COMBOBOXSTYLE L"COMBOBOXSTYLE"
+#define VSCLASS_COMBOBOX L"COMBOBOX"
+
+enum COMBOBOXPARTS {
+ CP_DROPDOWNBUTTON = 1,
+ CP_BACKGROUND = 2,
+ CP_TRANSPARENTBACKGROUND = 3,
+ CP_BORDER = 4,
+ CP_READONLY = 5,
+ CP_DROPDOWNBUTTONRIGHT = 6,
+ CP_DROPDOWNBUTTONLEFT = 7,
+ CP_CUEBANNER = 8,
+};
+
+#define COMBOBOXSTYLEPARTS COMBOBOXPARTS;
+
+enum COMBOBOXSTYLESTATES {
+ CBXS_NORMAL = 1,
+ CBXS_HOT = 2,
+ CBXS_PRESSED = 3,
+ CBXS_DISABLED = 4,
+};
+
+enum DROPDOWNBUTTONRIGHTSTATES {
+ CBXSR_NORMAL = 1,
+ CBXSR_HOT = 2,
+ CBXSR_PRESSED = 3,
+ CBXSR_DISABLED = 4,
+};
+
+enum DROPDOWNBUTTONLEFTSTATES {
+ CBXSL_NORMAL = 1,
+ CBXSL_HOT = 2,
+ CBXSL_PRESSED = 3,
+ CBXSL_DISABLED = 4,
+};
+
+enum TRANSPARENTBACKGROUNDSTATES {
+ CBTBS_NORMAL = 1,
+ CBTBS_HOT = 2,
+ CBTBS_DISABLED = 3,
+ CBTBS_FOCUSED = 4,
+};
+
+enum BORDERSTATES {
+ CBB_NORMAL = 1,
+ CBB_HOT = 2,
+ CBB_FOCUSED = 3,
+ CBB_DISABLED = 4,
+};
+
+enum READONLYSTATES {
+ CBRO_NORMAL = 1,
+ CBRO_HOT = 2,
+ CBRO_PRESSED = 3,
+ CBRO_DISABLED = 4,
+};
+
+enum CUEBANNERSTATES {
+ CBCB_NORMAL = 1,
+ CBCB_HOT = 2,
+ CBCB_PRESSED = 3,
+ CBCB_DISABLED = 4,
+};
+
+
+//
+// COMMUNICATIONSSTYLE class parts and states
+//
+#define VSCLASS_COMMUNICATIONSSTYLE L"COMMUNICATIONSSTYLE"
+#define VSCLASS_COMMUNICATIONS L"COMMUNICATIONS"
+
+enum COMMUNICATIONSPARTS {
+ CSST_TAB = 1,
+};
+
+#define COMMUNICATIONSSTYLEPARTS COMMUNICATIONSPARTS;
+
+enum TABSTATES {
+ CSTB_NORMAL = 1,
+ CSTB_HOT = 2,
+ CSTB_SELECTED = 3,
+};
+
+
+//
+// CONTROLPANELSTYLE class parts and states
+//
+#define VSCLASS_CONTROLPANELSTYLE L"CONTROLPANELSTYLE"
+#define VSCLASS_CONTROLPANEL L"CONTROLPANEL"
+
+enum CONTROLPANELPARTS {
+ CPANEL_NAVIGATIONPANE = 1,
+ CPANEL_CONTENTPANE = 2,
+ CPANEL_NAVIGATIONPANELABEL = 3,
+ CPANEL_CONTENTPANELABEL = 4,
+ CPANEL_TITLE = 5,
+ CPANEL_BODYTEXT = 6,
+ CPANEL_HELPLINK = 7,
+ CPANEL_TASKLINK = 8,
+ CPANEL_GROUPTEXT = 9,
+ CPANEL_CONTENTLINK = 10,
+ CPANEL_SECTIONTITLELINK = 11,
+ CPANEL_LARGECOMMANDAREA = 12,
+ CPANEL_SMALLCOMMANDAREA = 13,
+ CPANEL_BUTTON = 14,
+ CPANEL_MESSAGETEXT = 15,
+ CPANEL_NAVIGATIONPANELINE = 16,
+ CPANEL_CONTENTPANELINE = 17,
+ CPANEL_BANNERAREA = 18,
+ CPANEL_BODYTITLE = 19,
+};
+
+#define CONTROLPANELSTYLEPARTS CONTROLPANELPARTS;
+
+enum HELPLINKSTATES {
+ CPHL_NORMAL = 1,
+ CPHL_HOT = 2,
+ CPHL_PRESSED = 3,
+ CPHL_DISABLED = 4,
+};
+
+enum TASKLINKSTATES {
+ CPTL_NORMAL = 1,
+ CPTL_HOT = 2,
+ CPTL_PRESSED = 3,
+ CPTL_DISABLED = 4,
+ CPTL_PAGE = 5,
+};
+
+enum CONTENTLINKSTATES {
+ CPCL_NORMAL = 1,
+ CPCL_HOT = 2,
+ CPCL_PRESSED = 3,
+ CPCL_DISABLED = 4,
+};
+
+enum SECTIONTITLELINKSTATES {
+ CPSTL_NORMAL = 1,
+ CPSTL_HOT = 2,
+};
+
+
+//
+// DATEPICKERSTYLE class parts and states
+//
+#define VSCLASS_DATEPICKERSTYLE L"DATEPICKERSTYLE"
+#define VSCLASS_DATEPICKER L"DATEPICKER"
+
+enum DATEPICKERPARTS {
+ DP_DATETEXT = 1,
+ DP_DATEBORDER = 2,
+ DP_SHOWCALENDARBUTTONRIGHT = 3,
+};
+
+#define DATEPICKERSTYLEPARTS DATEPICKERPARTS;
+
+enum DATETEXTSTATES {
+ DPDT_NORMAL = 1,
+ DPDT_DISABLED = 2,
+ DPDT_SELECTED = 3,
+};
+
+enum DATEBORDERSTATES {
+ DPDB_NORMAL = 1,
+ DPDB_HOT = 2,
+ DPDB_FOCUSED = 3,
+ DPDB_DISABLED = 4,
+};
+
+enum SHOWCALENDARBUTTONRIGHTSTATES {
+ DPSCBR_NORMAL = 1,
+ DPSCBR_HOT = 2,
+ DPSCBR_PRESSED = 3,
+ DPSCBR_DISABLED = 4,
+};
+
+
+//
+// DRAGDROPSTYLE class parts and states
+//
+#define VSCLASS_DRAGDROPSTYLE L"DRAGDROPSTYLE"
+#define VSCLASS_DRAGDROP L"DRAGDROP"
+
+enum DRAGDROPPARTS {
+ DD_COPY = 1,
+ DD_MOVE = 2,
+ DD_UPDATEMETADATA = 3,
+ DD_CREATELINK = 4,
+ DD_WARNING = 5,
+ DD_NONE = 6,
+ DD_IMAGEBG = 7,
+ DD_TEXTBG = 8,
+};
+
+#define DRAGDROPSTYLEPARTS DRAGDROPPARTS;
+
+enum COPYSTATES {
+ DDCOPY_HIGHLIGHT = 1,
+ DDCOPY_NOHIGHLIGHT = 2,
+};
+
+enum MOVESTATES {
+ DDMOVE_HIGHLIGHT = 1,
+ DDMOVE_NOHIGHLIGHT = 2,
+};
+
+enum UPDATEMETADATASTATES {
+ DDUPDATEMETADATA_HIGHLIGHT = 1,
+ DDUPDATEMETADATA_NOHIGHLIGHT = 2,
+};
+
+enum CREATELINKSTATES {
+ DDCREATELINK_HIGHLIGHT = 1,
+ DDCREATELINK_NOHIGHLIGHT = 2,
+};
+
+enum WARNINGSTATES {
+ DDWARNING_HIGHLIGHT = 1,
+ DDWARNING_NOHIGHLIGHT = 2,
+};
+
+enum NONESTATES {
+ DDNONE_HIGHLIGHT = 1,
+ DDNONE_NOHIGHLIGHT = 2,
+};
+
+
+//
+// EDITSTYLE class parts and states
+//
+#define VSCLASS_EDITSTYLE L"EDITSTYLE"
+#define VSCLASS_EDIT L"EDIT"
+
+enum EDITPARTS {
+ EP_EDITTEXT = 1,
+ EP_CARET = 2,
+ EP_BACKGROUND = 3,
+ EP_PASSWORD = 4,
+ EP_BACKGROUNDWITHBORDER = 5,
+ EP_EDITBORDER_NOSCROLL = 6,
+ EP_EDITBORDER_HSCROLL = 7,
+ EP_EDITBORDER_VSCROLL = 8,
+ EP_EDITBORDER_HVSCROLL = 9,
+};
+
+#define EDITSTYLEPARTS EDITPARTS;
+
+enum EDITTEXTSTATES {
+ ETS_NORMAL = 1,
+ ETS_HOT = 2,
+ ETS_SELECTED = 3,
+ ETS_DISABLED = 4,
+ ETS_FOCUSED = 5,
+ ETS_READONLY = 6,
+ ETS_ASSIST = 7,
+ ETS_CUEBANNER = 8,
+};
+
+enum BACKGROUNDSTATES {
+ EBS_NORMAL = 1,
+ EBS_HOT = 2,
+ EBS_DISABLED = 3,
+ EBS_FOCUSED = 4,
+ EBS_READONLY = 5,
+ EBS_ASSIST = 6,
+};
+
+enum BACKGROUNDWITHBORDERSTATES {
+ EBWBS_NORMAL = 1,
+ EBWBS_HOT = 2,
+ EBWBS_DISABLED = 3,
+ EBWBS_FOCUSED = 4,
+};
+
+enum EDITBORDER_NOSCROLLSTATES {
+ EPSN_NORMAL = 1,
+ EPSN_HOT = 2,
+ EPSN_FOCUSED = 3,
+ EPSN_DISABLED = 4,
+};
+
+enum EDITBORDER_HSCROLLSTATES {
+ EPSH_NORMAL = 1,
+ EPSH_HOT = 2,
+ EPSH_FOCUSED = 3,
+ EPSH_DISABLED = 4,
+};
+
+enum EDITBORDER_VSCROLLSTATES {
+ EPSV_NORMAL = 1,
+ EPSV_HOT = 2,
+ EPSV_FOCUSED = 3,
+ EPSV_DISABLED = 4,
+};
+
+enum EDITBORDER_HVSCROLLSTATES {
+ EPSHV_NORMAL = 1,
+ EPSHV_HOT = 2,
+ EPSHV_FOCUSED = 3,
+ EPSHV_DISABLED = 4,
+};
+
+
+//
+// EXPLORERBARSTYLE class parts and states
+//
+#define VSCLASS_EXPLORERBARSTYLE L"EXPLORERBARSTYLE"
+#define VSCLASS_EXPLORERBAR L"EXPLORERBAR"
+
+enum EXPLORERBARPARTS {
+ EBP_HEADERBACKGROUND = 1,
+ EBP_HEADERCLOSE = 2,
+ EBP_HEADERPIN = 3,
+ EBP_IEBARMENU = 4,
+ EBP_NORMALGROUPBACKGROUND = 5,
+ EBP_NORMALGROUPCOLLAPSE = 6,
+ EBP_NORMALGROUPEXPAND = 7,
+ EBP_NORMALGROUPHEAD = 8,
+ EBP_SPECIALGROUPBACKGROUND = 9,
+ EBP_SPECIALGROUPCOLLAPSE = 10,
+ EBP_SPECIALGROUPEXPAND = 11,
+ EBP_SPECIALGROUPHEAD = 12,
+};
+
+#define EXPLORERBARSTYLEPARTS EXPLORERBARPARTS;
+
+enum HEADERCLOSESTATES {
+ EBHC_NORMAL = 1,
+ EBHC_HOT = 2,
+ EBHC_PRESSED = 3,
+};
+
+enum HEADERPINSTATES {
+ EBHP_NORMAL = 1,
+ EBHP_HOT = 2,
+ EBHP_PRESSED = 3,
+ EBHP_SELECTEDNORMAL = 4,
+ EBHP_SELECTEDHOT = 5,
+ EBHP_SELECTEDPRESSED = 6,
+};
+
+enum IEBARMENUSTATES {
+ EBM_NORMAL = 1,
+ EBM_HOT = 2,
+ EBM_PRESSED = 3,
+};
+
+enum NORMALGROUPCOLLAPSESTATES {
+ EBNGC_NORMAL = 1,
+ EBNGC_HOT = 2,
+ EBNGC_PRESSED = 3,
+};
+
+enum NORMALGROUPEXPANDSTATES {
+ EBNGE_NORMAL = 1,
+ EBNGE_HOT = 2,
+ EBNGE_PRESSED = 3,
+};
+
+enum SPECIALGROUPCOLLAPSESTATES {
+ EBSGC_NORMAL = 1,
+ EBSGC_HOT = 2,
+ EBSGC_PRESSED = 3,
+};
+
+enum SPECIALGROUPEXPANDSTATES {
+ EBSGE_NORMAL = 1,
+ EBSGE_HOT = 2,
+ EBSGE_PRESSED = 3,
+};
+
+
+//
+// FLYOUTSTYLE class parts and states
+//
+#define VSCLASS_FLYOUTSTYLE L"FLYOUTSTYLE"
+#define VSCLASS_FLYOUT L"FLYOUT"
+
+enum FLYOUTPARTS {
+ FLYOUT_HEADER = 1,
+ FLYOUT_BODY = 2,
+ FLYOUT_LABEL = 3,
+ FLYOUT_LINK = 4,
+ FLYOUT_DIVIDER = 5,
+ FLYOUT_WINDOW = 6,
+ FLYOUT_LINKAREA = 7,
+ FLYOUT_LINKHEADER = 8,
+};
+
+#define FLYOUTSTYLEPARTS FLYOUTPARTS;
+
+enum LABELSTATES {
+ FLS_NORMAL = 1,
+ FLS_SELECTED = 2,
+ FLS_EMPHASIZED = 3,
+ FLS_DISABLED = 4,
+};
+
+enum LINKSTATES {
+ FLYOUTLINK_NORMAL = 1,
+ FLYOUTLINK_HOVER = 2,
+};
+
+enum BODYSTATES {
+ FBS_NORMAL = 1,
+ FBS_EMPHASIZED = 2,
+};
+
+enum LINKHEADERSTATES {
+ FLH_NORMAL = 1,
+ FLH_HOVER = 2,
+};
+
+
+//
+// HEADERSTYLE class parts and states
+//
+#define VSCLASS_HEADERSTYLE L"HEADERSTYLE"
+#define VSCLASS_HEADER L"HEADER"
+
+enum HEADERPARTS {
+ HP_HEADERITEM = 1,
+ HP_HEADERITEMLEFT = 2,
+ HP_HEADERITEMRIGHT = 3,
+ HP_HEADERSORTARROW = 4,
+ HP_HEADERDROPDOWN = 5,
+ HP_HEADERDROPDOWNFILTER = 6,
+ HP_HEADEROVERFLOW = 7,
+};
+
+#define HEADERSTYLEPARTS HEADERPARTS;
+
+enum HEADERSTYLESTATES {
+ HBG_DETAILS = 1,
+ HBG_ICON = 2,
+};
+
+enum HEADERITEMSTATES {
+ HIS_NORMAL = 1,
+ HIS_HOT = 2,
+ HIS_PRESSED = 3,
+ HIS_SORTEDNORMAL = 4,
+ HIS_SORTEDHOT = 5,
+ HIS_SORTEDPRESSED = 6,
+ HIS_ICONNORMAL = 7,
+ HIS_ICONHOT = 8,
+ HIS_ICONPRESSED = 9,
+ HIS_ICONSORTEDNORMAL = 10,
+ HIS_ICONSORTEDHOT = 11,
+ HIS_ICONSORTEDPRESSED = 12,
+};
+
+enum HEADERITEMLEFTSTATES {
+ HILS_NORMAL = 1,
+ HILS_HOT = 2,
+ HILS_PRESSED = 3,
+};
+
+enum HEADERITEMRIGHTSTATES {
+ HIRS_NORMAL = 1,
+ HIRS_HOT = 2,
+ HIRS_PRESSED = 3,
+};
+
+enum HEADERSORTARROWSTATES {
+ HSAS_SORTEDUP = 1,
+ HSAS_SORTEDDOWN = 2,
+};
+
+enum HEADERDROPDOWNSTATES {
+ HDDS_NORMAL = 1,
+ HDDS_SOFTHOT = 2,
+ HDDS_HOT = 3,
+};
+
+enum HEADERDROPDOWNFILTERSTATES {
+ HDDFS_NORMAL = 1,
+ HDDFS_SOFTHOT = 2,
+ HDDFS_HOT = 3,
+};
+
+enum HEADEROVERFLOWSTATES {
+ HOFS_NORMAL = 1,
+ HOFS_HOT = 2,
+};
+
+
+//
+// LISTBOXSTYLE class parts and states
+//
+#define VSCLASS_LISTBOXSTYLE L"LISTBOXSTYLE"
+#define VSCLASS_LISTBOX L"LISTBOX"
+
+enum LISTBOXPARTS {
+ LBCP_BORDER_HSCROLL = 1,
+ LBCP_BORDER_HVSCROLL = 2,
+ LBCP_BORDER_NOSCROLL = 3,
+ LBCP_BORDER_VSCROLL = 4,
+ LBCP_ITEM = 5,
+};
+
+#define LISTBOXSTYLEPARTS LISTBOXPARTS;
+
+enum BORDER_HSCROLLSTATES {
+ LBPSH_NORMAL = 1,
+ LBPSH_FOCUSED = 2,
+ LBPSH_HOT = 3,
+ LBPSH_DISABLED = 4,
+};
+
+enum BORDER_HVSCROLLSTATES {
+ LBPSHV_NORMAL = 1,
+ LBPSHV_FOCUSED = 2,
+ LBPSHV_HOT = 3,
+ LBPSHV_DISABLED = 4,
+};
+
+enum BORDER_NOSCROLLSTATES {
+ LBPSN_NORMAL = 1,
+ LBPSN_FOCUSED = 2,
+ LBPSN_HOT = 3,
+ LBPSN_DISABLED = 4,
+};
+
+enum BORDER_VSCROLLSTATES {
+ LBPSV_NORMAL = 1,
+ LBPSV_FOCUSED = 2,
+ LBPSV_HOT = 3,
+ LBPSV_DISABLED = 4,
+};
+
+enum ITEMSTATES {
+ LBPSI_HOT = 1,
+ LBPSI_HOTSELECTED = 2,
+ LBPSI_SELECTED = 3,
+ LBPSI_SELECTEDNOTFOCUS = 4,
+};
+
+
+//
+// LISTVIEWSTYLE class parts and states
+//
+#define VSCLASS_LISTVIEWSTYLE L"LISTVIEWSTYLE"
+#define VSCLASS_LISTVIEW L"LISTVIEW"
+
+enum LISTVIEWPARTS {
+ LVP_LISTITEM = 1,
+ LVP_LISTGROUP = 2,
+ LVP_LISTDETAIL = 3,
+ LVP_LISTSORTEDDETAIL = 4,
+ LVP_EMPTYTEXT = 5,
+ LVP_GROUPHEADER = 6,
+ LVP_GROUPHEADERLINE = 7,
+ LVP_EXPANDBUTTON = 8,
+ LVP_COLLAPSEBUTTON = 9,
+ LVP_COLUMNDETAIL = 10,
+};
+
+#define LISTVIEWSTYLEPARTS LISTVIEWPARTS;
+
+enum LISTITEMSTATES {
+ LISS_NORMAL = 1,
+ LISS_HOT = 2,
+ LISS_SELECTED = 3,
+ LISS_DISABLED = 4,
+ LISS_SELECTEDNOTFOCUS = 5,
+ LISS_HOTSELECTED = 6,
+};
+
+enum GROUPHEADERSTATES {
+ LVGH_OPEN = 1,
+ LVGH_OPENHOT = 2,
+ LVGH_OPENSELECTED = 3,
+ LVGH_OPENSELECTEDHOT = 4,
+ LVGH_OPENSELECTEDNOTFOCUSED = 5,
+ LVGH_OPENSELECTEDNOTFOCUSEDHOT = 6,
+ LVGH_OPENMIXEDSELECTION = 7,
+ LVGH_OPENMIXEDSELECTIONHOT = 8,
+ LVGH_CLOSE = 9,
+ LVGH_CLOSEHOT = 10,
+ LVGH_CLOSESELECTED = 11,
+ LVGH_CLOSESELECTEDHOT = 12,
+ LVGH_CLOSESELECTEDNOTFOCUSED = 13,
+ LVGH_CLOSESELECTEDNOTFOCUSEDHOT = 14,
+ LVGH_CLOSEMIXEDSELECTION = 15,
+ LVGH_CLOSEMIXEDSELECTIONHOT = 16,
+};
+
+enum GROUPHEADERLINESTATES {
+ LVGHL_OPEN = 1,
+ LVGHL_OPENHOT = 2,
+ LVGHL_OPENSELECTED = 3,
+ LVGHL_OPENSELECTEDHOT = 4,
+ LVGHL_OPENSELECTEDNOTFOCUSED = 5,
+ LVGHL_OPENSELECTEDNOTFOCUSEDHOT = 6,
+ LVGHL_OPENMIXEDSELECTION = 7,
+ LVGHL_OPENMIXEDSELECTIONHOT = 8,
+ LVGHL_CLOSE = 9,
+ LVGHL_CLOSEHOT = 10,
+ LVGHL_CLOSESELECTED = 11,
+ LVGHL_CLOSESELECTEDHOT = 12,
+ LVGHL_CLOSESELECTEDNOTFOCUSED = 13,
+ LVGHL_CLOSESELECTEDNOTFOCUSEDHOT = 14,
+ LVGHL_CLOSEMIXEDSELECTION = 15,
+ LVGHL_CLOSEMIXEDSELECTIONHOT = 16,
+};
+
+enum EXPANDBUTTONSTATES {
+ LVEB_NORMAL = 1,
+ LVEB_HOVER = 2,
+ LVEB_PUSHED = 3,
+};
+
+enum COLLAPSEBUTTONSTATES {
+ LVCB_NORMAL = 1,
+ LVCB_HOVER = 2,
+ LVCB_PUSHED = 3,
+};
+
+
+//
+// MENUSTYLE class parts and states
+//
+#define VSCLASS_MENUSTYLE L"MENUSTYLE"
+#define VSCLASS_MENU L"MENU"
+
+enum MENUPARTS {
+ MENU_MENUITEM_TMSCHEMA = 1,
+ MENU_MENUDROPDOWN_TMSCHEMA = 2,
+ MENU_MENUBARITEM_TMSCHEMA = 3,
+ MENU_MENUBARDROPDOWN_TMSCHEMA = 4,
+ MENU_CHEVRON_TMSCHEMA = 5,
+ MENU_SEPARATOR_TMSCHEMA = 6,
+ MENU_BARBACKGROUND = 7,
+ MENU_BARITEM = 8,
+ MENU_POPUPBACKGROUND = 9,
+ MENU_POPUPBORDERS = 10,
+ MENU_POPUPCHECK = 11,
+ MENU_POPUPCHECKBACKGROUND = 12,
+ MENU_POPUPGUTTER = 13,
+ MENU_POPUPITEM = 14,
+ MENU_POPUPSEPARATOR = 15,
+ MENU_POPUPSUBMENU = 16,
+ MENU_SYSTEMCLOSE = 17,
+ MENU_SYSTEMMAXIMIZE = 18,
+ MENU_SYSTEMMINIMIZE = 19,
+ MENU_SYSTEMRESTORE = 20,
+};
+
+#define MENUSTYLEPARTS MENUPARTS;
+
+enum BARBACKGROUNDSTATES {
+ MB_ACTIVE = 1,
+ MB_INACTIVE = 2,
+};
+
+enum BARITEMSTATES {
+ MBI_NORMAL = 1,
+ MBI_HOT = 2,
+ MBI_PUSHED = 3,
+ MBI_DISABLED = 4,
+ MBI_DISABLEDHOT = 5,
+ MBI_DISABLEDPUSHED = 6,
+};
+
+enum POPUPCHECKSTATES {
+ MC_CHECKMARKNORMAL = 1,
+ MC_CHECKMARKDISABLED = 2,
+ MC_BULLETNORMAL = 3,
+ MC_BULLETDISABLED = 4,
+};
+
+enum POPUPCHECKBACKGROUNDSTATES {
+ MCB_DISABLED = 1,
+ MCB_NORMAL = 2,
+ MCB_BITMAP = 3,
+};
+
+enum POPUPITEMSTATES {
+ MPI_NORMAL = 1,
+ MPI_HOT = 2,
+ MPI_DISABLED = 3,
+ MPI_DISABLEDHOT = 4,
+};
+
+enum POPUPSUBMENUSTATES {
+ MSM_NORMAL = 1,
+ MSM_DISABLED = 2,
+};
+
+enum SYSTEMCLOSESTATES {
+ MSYSC_NORMAL = 1,
+ MSYSC_DISABLED = 2,
+};
+
+enum SYSTEMMAXIMIZESTATES {
+ MSYSMX_NORMAL = 1,
+ MSYSMX_DISABLED = 2,
+};
+
+enum SYSTEMMINIMIZESTATES {
+ MSYSMN_NORMAL = 1,
+ MSYSMN_DISABLED = 2,
+};
+
+enum SYSTEMRESTORESTATES {
+ MSYSR_NORMAL = 1,
+ MSYSR_DISABLED = 2,
+};
+
+
+//
+// NAVIGATION class parts and states
+//
+#define VSCLASS_NAVIGATION L"NAVIGATION"
+
+enum NAVIGATIONPARTS {
+ NAV_BACKBUTTON = 1,
+ NAV_FORWARDBUTTON = 2,
+ NAV_MENUBUTTON = 3,
+};
+
+enum NAV_BACKBUTTONSTATES {
+ NAV_BB_NORMAL = 1,
+ NAV_BB_HOT = 2,
+ NAV_BB_PRESSED = 3,
+ NAV_BB_DISABLED = 4,
+};
+
+enum NAV_FORWARDBUTTONSTATES {
+ NAV_FB_NORMAL = 1,
+ NAV_FB_HOT = 2,
+ NAV_FB_PRESSED = 3,
+ NAV_FB_DISABLED = 4,
+};
+
+enum NAV_MENUBUTTONSTATES {
+ NAV_MB_NORMAL = 1,
+ NAV_MB_HOT = 2,
+ NAV_MB_PRESSED = 3,
+ NAV_MB_DISABLED = 4,
+};
+
+
+//
+// PROGRESSSTYLE class parts and states
+//
+#define VSCLASS_PROGRESSSTYLE L"PROGRESSSTYLE"
+#define VSCLASS_PROGRESS L"PROGRESS"
+
+enum PROGRESSPARTS {
+ PP_BAR = 1,
+ PP_BARVERT = 2,
+ PP_CHUNK = 3,
+ PP_CHUNKVERT = 4,
+ PP_FILL = 5,
+ PP_FILLVERT = 6,
+ PP_PULSEOVERLAY = 7,
+ PP_MOVEOVERLAY = 8,
+ PP_PULSEOVERLAYVERT = 9,
+ PP_MOVEOVERLAYVERT = 10,
+ PP_TRANSPARENTBAR = 11,
+ PP_TRANSPARENTBARVERT = 12,
+};
+
+#define PROGRESSSTYLEPARTS PROGRESSPARTS;
+
+enum TRANSPARENTBARSTATES {
+ PBBS_NORMAL = 1,
+ PBBS_PARTIAL = 2,
+};
+
+enum TRANSPARENTBARVERTSTATES {
+ PBBVS_NORMAL = 1,
+ PBBVS_PARTIAL = 2,
+};
+
+enum FILLSTATES {
+ PBFS_NORMAL = 1,
+ PBFS_ERROR = 2,
+ PBFS_PAUSED = 3,
+ PBFS_PARTIAL = 4,
+};
+
+enum FILLVERTSTATES {
+ PBFVS_NORMAL = 1,
+ PBFVS_ERROR = 2,
+ PBFVS_PAUSED = 3,
+ PBFVS_PARTIAL = 4,
+};
+
+
+//
+// REBARSTYLE class parts and states
+//
+#define VSCLASS_REBARSTYLE L"REBARSTYLE"
+#define VSCLASS_REBAR L"REBAR"
+
+enum REBARPARTS {
+ RP_GRIPPER = 1,
+ RP_GRIPPERVERT = 2,
+ RP_BAND = 3,
+ RP_CHEVRON = 4,
+ RP_CHEVRONVERT = 5,
+ RP_BACKGROUND = 6,
+ RP_SPLITTER = 7,
+ RP_SPLITTERVERT = 8,
+};
+
+#define REBARSTYLEPARTS REBARPARTS;
+
+enum CHEVRONSTATES {
+ CHEVS_NORMAL = 1,
+ CHEVS_HOT = 2,
+ CHEVS_PRESSED = 3,
+};
+
+enum CHEVRONVERTSTATES {
+ CHEVSV_NORMAL = 1,
+ CHEVSV_HOT = 2,
+ CHEVSV_PRESSED = 3,
+};
+
+enum SPLITTERSTATES {
+ SPLITS_NORMAL = 1,
+ SPLITS_HOT = 2,
+ SPLITS_PRESSED = 3,
+};
+
+enum SPLITTERVERTSTATES {
+ SPLITSV_NORMAL = 1,
+ SPLITSV_HOT = 2,
+ SPLITSV_PRESSED = 3,
+};
+
+
+//
+// SCROLLBARSTYLE class parts and states
+//
+#define VSCLASS_SCROLLBARSTYLE L"SCROLLBARSTYLE"
+#define VSCLASS_SCROLLBAR L"SCROLLBAR"
+
+enum SCROLLBARPARTS {
+ SBP_ARROWBTN = 1,
+ SBP_THUMBBTNHORZ = 2,
+ SBP_THUMBBTNVERT = 3,
+ SBP_LOWERTRACKHORZ = 4,
+ SBP_UPPERTRACKHORZ = 5,
+ SBP_LOWERTRACKVERT = 6,
+ SBP_UPPERTRACKVERT = 7,
+ SBP_GRIPPERHORZ = 8,
+ SBP_GRIPPERVERT = 9,
+ SBP_SIZEBOX = 10,
+};
+
+#define SCROLLBARSTYLEPARTS SCROLLBARPARTS;
+
+enum ARROWBTNSTATES {
+ ABS_UPNORMAL = 1,
+ ABS_UPHOT = 2,
+ ABS_UPPRESSED = 3,
+ ABS_UPDISABLED = 4,
+ ABS_DOWNNORMAL = 5,
+ ABS_DOWNHOT = 6,
+ ABS_DOWNPRESSED = 7,
+ ABS_DOWNDISABLED = 8,
+ ABS_LEFTNORMAL = 9,
+ ABS_LEFTHOT = 10,
+ ABS_LEFTPRESSED = 11,
+ ABS_LEFTDISABLED = 12,
+ ABS_RIGHTNORMAL = 13,
+ ABS_RIGHTHOT = 14,
+ ABS_RIGHTPRESSED = 15,
+ ABS_RIGHTDISABLED = 16,
+ ABS_UPHOVER = 17,
+ ABS_DOWNHOVER = 18,
+ ABS_LEFTHOVER = 19,
+ ABS_RIGHTHOVER = 20,
+};
+
+enum SCROLLBARSTYLESTATES {
+ SCRBS_NORMAL = 1,
+ SCRBS_HOT = 2,
+ SCRBS_PRESSED = 3,
+ SCRBS_DISABLED = 4,
+ SCRBS_HOVER = 5,
+};
+
+enum SIZEBOXSTATES {
+ SZB_RIGHTALIGN = 1,
+ SZB_LEFTALIGN = 2,
+ SZB_TOPRIGHTALIGN = 3,
+ SZB_TOPLEFTALIGN = 4,
+ SZB_HALFBOTTOMRIGHTALIGN = 5,
+ SZB_HALFBOTTOMLEFTALIGN = 6,
+ SZB_HALFTOPRIGHTALIGN = 7,
+ SZB_HALFTOPLEFTALIGN = 8,
+};
+
+
+//
+// SPINSTYLE class parts and states
+//
+#define VSCLASS_SPINSTYLE L"SPINSTYLE"
+#define VSCLASS_SPIN L"SPIN"
+
+enum SPINPARTS {
+ SPNP_UP = 1,
+ SPNP_DOWN = 2,
+ SPNP_UPHORZ = 3,
+ SPNP_DOWNHORZ = 4,
+};
+
+#define SPINSTYLEPARTS SPINPARTS;
+
+enum UPSTATES {
+ UPS_NORMAL = 1,
+ UPS_HOT = 2,
+ UPS_PRESSED = 3,
+ UPS_DISABLED = 4,
+};
+
+enum DOWNSTATES {
+ DNS_NORMAL = 1,
+ DNS_HOT = 2,
+ DNS_PRESSED = 3,
+ DNS_DISABLED = 4,
+};
+
+enum UPHORZSTATES {
+ UPHZS_NORMAL = 1,
+ UPHZS_HOT = 2,
+ UPHZS_PRESSED = 3,
+ UPHZS_DISABLED = 4,
+};
+
+enum DOWNHORZSTATES {
+ DNHZS_NORMAL = 1,
+ DNHZS_HOT = 2,
+ DNHZS_PRESSED = 3,
+ DNHZS_DISABLED = 4,
+};
+
+
+//
+// STATUSSTYLE class parts and states
+//
+#define VSCLASS_STATUSSTYLE L"STATUSSTYLE"
+#define VSCLASS_STATUS L"STATUS"
+
+enum STATUSPARTS {
+ SP_PANE = 1,
+ SP_GRIPPERPANE = 2,
+ SP_GRIPPER = 3,
+};
+
+#define STATUSSTYLEPARTS STATUSPARTS;
+
+
+//
+// TABSTYLE class parts and states
+//
+#define VSCLASS_TABSTYLE L"TABSTYLE"
+#define VSCLASS_TAB L"TAB"
+
+enum TABPARTS {
+ TABP_TABITEM = 1,
+ TABP_TABITEMLEFTEDGE = 2,
+ TABP_TABITEMRIGHTEDGE = 3,
+ TABP_TABITEMBOTHEDGE = 4,
+ TABP_TOPTABITEM = 5,
+ TABP_TOPTABITEMLEFTEDGE = 6,
+ TABP_TOPTABITEMRIGHTEDGE = 7,
+ TABP_TOPTABITEMBOTHEDGE = 8,
+ TABP_PANE = 9,
+ TABP_BODY = 10,
+ TABP_AEROWIZARDBODY = 11,
+};
+
+#define TABSTYLEPARTS TABPARTS;
+
+enum TABITEMSTATES {
+ TIS_NORMAL = 1,
+ TIS_HOT = 2,
+ TIS_SELECTED = 3,
+ TIS_DISABLED = 4,
+ TIS_FOCUSED = 5,
+};
+
+enum TABITEMLEFTEDGESTATES {
+ TILES_NORMAL = 1,
+ TILES_HOT = 2,
+ TILES_SELECTED = 3,
+ TILES_DISABLED = 4,
+ TILES_FOCUSED = 5,
+};
+
+enum TABITEMRIGHTEDGESTATES {
+ TIRES_NORMAL = 1,
+ TIRES_HOT = 2,
+ TIRES_SELECTED = 3,
+ TIRES_DISABLED = 4,
+ TIRES_FOCUSED = 5,
+};
+
+enum TABITEMBOTHEDGESTATES {
+ TIBES_NORMAL = 1,
+ TIBES_HOT = 2,
+ TIBES_SELECTED = 3,
+ TIBES_DISABLED = 4,
+ TIBES_FOCUSED = 5,
+};
+
+enum TOPTABITEMSTATES {
+ TTIS_NORMAL = 1,
+ TTIS_HOT = 2,
+ TTIS_SELECTED = 3,
+ TTIS_DISABLED = 4,
+ TTIS_FOCUSED = 5,
+};
+
+enum TOPTABITEMLEFTEDGESTATES {
+ TTILES_NORMAL = 1,
+ TTILES_HOT = 2,
+ TTILES_SELECTED = 3,
+ TTILES_DISABLED = 4,
+ TTILES_FOCUSED = 5,
+};
+
+enum TOPTABITEMRIGHTEDGESTATES {
+ TTIRES_NORMAL = 1,
+ TTIRES_HOT = 2,
+ TTIRES_SELECTED = 3,
+ TTIRES_DISABLED = 4,
+ TTIRES_FOCUSED = 5,
+};
+
+enum TOPTABITEMBOTHEDGESTATES {
+ TTIBES_NORMAL = 1,
+ TTIBES_HOT = 2,
+ TTIBES_SELECTED = 3,
+ TTIBES_DISABLED = 4,
+ TTIBES_FOCUSED = 5,
+};
+
+
+//
+// TASKDIALOGSTYLE class parts and states
+//
+#define VSCLASS_TASKDIALOGSTYLE L"TASKDIALOGSTYLE"
+#define VSCLASS_TASKDIALOG L"TASKDIALOG"
+
+enum TASKDIALOGPARTS {
+ TDLG_PRIMARYPANEL = 1,
+ TDLG_MAININSTRUCTIONPANE = 2,
+ TDLG_MAINICON = 3,
+ TDLG_CONTENTPANE = 4,
+ TDLG_CONTENTICON = 5,
+ TDLG_EXPANDEDCONTENT = 6,
+ TDLG_COMMANDLINKPANE = 7,
+ TDLG_SECONDARYPANEL = 8,
+ TDLG_CONTROLPANE = 9,
+ TDLG_BUTTONSECTION = 10,
+ TDLG_BUTTONWRAPPER = 11,
+ TDLG_EXPANDOTEXT = 12,
+ TDLG_EXPANDOBUTTON = 13,
+ TDLG_VERIFICATIONTEXT = 14,
+ TDLG_FOOTNOTEPANE = 15,
+ TDLG_FOOTNOTEAREA = 16,
+ TDLG_FOOTNOTESEPARATOR = 17,
+ TDLG_EXPANDEDFOOTERAREA = 18,
+ TDLG_PROGRESSBAR = 19,
+ TDLG_IMAGEALIGNMENT = 20,
+ TDLG_RADIOBUTTONPANE = 21,
+};
+
+#define TASKDIALOGSTYLEPARTS TASKDIALOGPARTS;
+
+enum CONTENTPANESTATES {
+ TDLGCPS_STANDALONE = 1,
+};
+
+enum EXPANDOBUTTONSTATES {
+ TDLGEBS_NORMAL = 1,
+ TDLGEBS_HOVER = 2,
+ TDLGEBS_PRESSED = 3,
+ TDLGEBS_EXPANDEDNORMAL = 4,
+ TDLGEBS_EXPANDEDHOVER = 5,
+ TDLGEBS_EXPANDEDPRESSED = 6,
+};
+
+
+//
+// TEXTSTYLE class parts and states
+//
+#define VSCLASS_TEXTSTYLE L"TEXTSTYLE"
+
+enum TEXTSTYLEPARTS {
+ TEXT_MAININSTRUCTION = 1,
+ TEXT_INSTRUCTION = 2,
+ TEXT_BODYTITLE = 3,
+ TEXT_BODYTEXT = 4,
+ TEXT_SECONDARYTEXT = 5,
+ TEXT_HYPERLINKTEXT = 6,
+ TEXT_EXPANDED = 7,
+ TEXT_LABEL = 8,
+ TEXT_CONTROLLABEL = 9,
+};
+
+enum HYPERLINKTEXTSTATES {
+ TS_HYPERLINK_NORMAL = 1,
+ TS_HYPERLINK_HOT = 2,
+ TS_HYPERLINK_PRESSED = 3,
+ TS_HYPERLINK_DISABLED = 4,
+};
+
+enum CONTROLLABELSTATES {
+ TS_CONTROLLABEL_NORMAL = 1,
+ TS_CONTROLLABEL_DISABLED = 2,
+};
+
+
+//
+// TOOLBARSTYLE class parts and states
+//
+#define VSCLASS_TOOLBARSTYLE L"TOOLBARSTYLE"
+#define VSCLASS_TOOLBAR L"TOOLBAR"
+
+enum TOOLBARPARTS {
+ TP_BUTTON = 1,
+ TP_DROPDOWNBUTTON = 2,
+ TP_SPLITBUTTON = 3,
+ TP_SPLITBUTTONDROPDOWN = 4,
+ TP_SEPARATOR = 5,
+ TP_SEPARATORVERT = 6,
+ TP_DROPDOWNBUTTONGLYPH = 7,
+};
+
+#define TOOLBARSTYLEPARTS TOOLBARPARTS;
+
+enum TOOLBARSTYLESTATES {
+ TS_NORMAL = 1,
+ TS_HOT = 2,
+ TS_PRESSED = 3,
+ TS_DISABLED = 4,
+ TS_CHECKED = 5,
+ TS_HOTCHECKED = 6,
+ TS_NEARHOT = 7,
+ TS_OTHERSIDEHOT = 8,
+};
+
+
+//
+// TOOLTIPSTYLE class parts and states
+//
+#define VSCLASS_TOOLTIPSTYLE L"TOOLTIPSTYLE"
+#define VSCLASS_TOOLTIP L"TOOLTIP"
+
+enum TOOLTIPPARTS {
+ TTP_STANDARD = 1,
+ TTP_STANDARDTITLE = 2,
+ TTP_BALLOON = 3,
+ TTP_BALLOONTITLE = 4,
+ TTP_CLOSE = 5,
+ TTP_BALLOONSTEM = 6,
+ TTP_WRENCH = 7,
+};
+
+#define TOOLTIPSTYLEPARTS TOOLTIPPARTS;
+
+enum CLOSESTATES {
+ TTCS_NORMAL = 1,
+ TTCS_HOT = 2,
+ TTCS_PRESSED = 3,
+};
+
+enum STANDARDSTATES {
+ TTSS_NORMAL = 1,
+ TTSS_LINK = 2,
+};
+
+enum BALLOONSTATES {
+ TTBS_NORMAL = 1,
+ TTBS_LINK = 2,
+};
+
+enum BALLOONSTEMSTATES {
+ TTBSS_POINTINGUPLEFTWALL = 1,
+ TTBSS_POINTINGUPCENTERED = 2,
+ TTBSS_POINTINGUPRIGHTWALL = 3,
+ TTBSS_POINTINGDOWNRIGHTWALL = 4,
+ TTBSS_POINTINGDOWNCENTERED = 5,
+ TTBSS_POINTINGDOWNLEFTWALL = 6,
+};
+
+enum WRENCHSTATES {
+ TTWS_NORMAL = 1,
+ TTWS_HOT = 2,
+ TTWS_PRESSED = 3,
+};
+
+
+//
+// TRACKBARSTYLE class parts and states
+//
+#define VSCLASS_TRACKBARSTYLE L"TRACKBARSTYLE"
+#define VSCLASS_TRACKBAR L"TRACKBAR"
+
+enum TRACKBARPARTS {
+ TKP_TRACK = 1,
+ TKP_TRACKVERT = 2,
+ TKP_THUMB = 3,
+ TKP_THUMBBOTTOM = 4,
+ TKP_THUMBTOP = 5,
+ TKP_THUMBVERT = 6,
+ TKP_THUMBLEFT = 7,
+ TKP_THUMBRIGHT = 8,
+ TKP_TICS = 9,
+ TKP_TICSVERT = 10,
+};
+
+#define TRACKBARSTYLEPARTS TRACKBARPARTS;
+
+enum TRACKBARSTYLESTATES {
+ TKS_NORMAL = 1,
+};
+
+enum TRACKSTATES {
+ TRS_NORMAL = 1,
+};
+
+enum TRACKVERTSTATES {
+ TRVS_NORMAL = 1,
+};
+
+enum THUMBSTATES {
+ TUS_NORMAL = 1,
+ TUS_HOT = 2,
+ TUS_PRESSED = 3,
+ TUS_FOCUSED = 4,
+ TUS_DISABLED = 5,
+};
+
+enum THUMBBOTTOMSTATES {
+ TUBS_NORMAL = 1,
+ TUBS_HOT = 2,
+ TUBS_PRESSED = 3,
+ TUBS_FOCUSED = 4,
+ TUBS_DISABLED = 5,
+};
+
+enum THUMBTOPSTATES {
+ TUTS_NORMAL = 1,
+ TUTS_HOT = 2,
+ TUTS_PRESSED = 3,
+ TUTS_FOCUSED = 4,
+ TUTS_DISABLED = 5,
+};
+
+enum THUMBVERTSTATES {
+ TUVS_NORMAL = 1,
+ TUVS_HOT = 2,
+ TUVS_PRESSED = 3,
+ TUVS_FOCUSED = 4,
+ TUVS_DISABLED = 5,
+};
+
+enum THUMBLEFTSTATES {
+ TUVLS_NORMAL = 1,
+ TUVLS_HOT = 2,
+ TUVLS_PRESSED = 3,
+ TUVLS_FOCUSED = 4,
+ TUVLS_DISABLED = 5,
+};
+
+enum THUMBRIGHTSTATES {
+ TUVRS_NORMAL = 1,
+ TUVRS_HOT = 2,
+ TUVRS_PRESSED = 3,
+ TUVRS_FOCUSED = 4,
+ TUVRS_DISABLED = 5,
+};
+
+enum TICSSTATES {
+ TSS_NORMAL = 1,
+};
+
+enum TICSVERTSTATES {
+ TSVS_NORMAL = 1,
+};
+
+
+//
+// TREEVIEWSTYLE class parts and states
+//
+#define VSCLASS_TREEVIEWSTYLE L"TREEVIEWSTYLE"
+#define VSCLASS_TREEVIEW L"TREEVIEW"
+
+enum TREEVIEWPARTS {
+ TVP_TREEITEM = 1,
+ TVP_GLYPH = 2,
+ TVP_BRANCH = 3,
+ TVP_HOTGLYPH = 4,
+};
+
+#define TREEVIEWSTYLEPARTS TREEVIEWPARTS;
+
+enum TREEITEMSTATES {
+ TREIS_NORMAL = 1,
+ TREIS_HOT = 2,
+ TREIS_SELECTED = 3,
+ TREIS_DISABLED = 4,
+ TREIS_SELECTEDNOTFOCUS = 5,
+ TREIS_HOTSELECTED = 6,
+};
+
+enum GLYPHSTATES {
+ GLPS_CLOSED = 1,
+ GLPS_OPENED = 2,
+};
+
+enum HOTGLYPHSTATES {
+ HGLPS_CLOSED = 1,
+ HGLPS_OPENED = 2,
+};
+
+
+//
+// WINDOWSTYLE class parts and states
+//
+#define VSCLASS_WINDOWSTYLE L"WINDOWSTYLE"
+#define VSCLASS_WINDOW L"WINDOW"
+
+enum WINDOWPARTS {
+ WP_CAPTION = 1,
+ WP_SMALLCAPTION = 2,
+ WP_MINCAPTION = 3,
+ WP_SMALLMINCAPTION = 4,
+ WP_MAXCAPTION = 5,
+ WP_SMALLMAXCAPTION = 6,
+ WP_FRAMELEFT = 7,
+ WP_FRAMERIGHT = 8,
+ WP_FRAMEBOTTOM = 9,
+ WP_SMALLFRAMELEFT = 10,
+ WP_SMALLFRAMERIGHT = 11,
+ WP_SMALLFRAMEBOTTOM = 12,
+ WP_SYSBUTTON = 13,
+ WP_MDISYSBUTTON = 14,
+ WP_MINBUTTON = 15,
+ WP_MDIMINBUTTON = 16,
+ WP_MAXBUTTON = 17,
+ WP_CLOSEBUTTON = 18,
+ WP_SMALLCLOSEBUTTON = 19,
+ WP_MDICLOSEBUTTON = 20,
+ WP_RESTOREBUTTON = 21,
+ WP_MDIRESTOREBUTTON = 22,
+ WP_HELPBUTTON = 23,
+ WP_MDIHELPBUTTON = 24,
+ WP_HORZSCROLL = 25,
+ WP_HORZTHUMB = 26,
+ WP_VERTSCROLL = 27,
+ WP_VERTTHUMB = 28,
+ WP_DIALOG = 29,
+ WP_CAPTIONSIZINGTEMPLATE = 30,
+ WP_SMALLCAPTIONSIZINGTEMPLATE = 31,
+ WP_FRAMELEFTSIZINGTEMPLATE = 32,
+ WP_SMALLFRAMELEFTSIZINGTEMPLATE = 33,
+ WP_FRAMERIGHTSIZINGTEMPLATE = 34,
+ WP_SMALLFRAMERIGHTSIZINGTEMPLATE = 35,
+ WP_FRAMEBOTTOMSIZINGTEMPLATE = 36,
+ WP_SMALLFRAMEBOTTOMSIZINGTEMPLATE = 37,
+ WP_FRAME = 38,
+};
+
+#define WINDOWSTYLEPARTS WINDOWPARTS;
+
+enum FRAMESTATES {
+ FS_ACTIVE = 1,
+ FS_INACTIVE = 2,
+};
+
+enum CAPTIONSTATES {
+ CS_ACTIVE = 1,
+ CS_INACTIVE = 2,
+ CS_DISABLED = 3,
+};
+
+enum MAXCAPTIONSTATES {
+ MXCS_ACTIVE = 1,
+ MXCS_INACTIVE = 2,
+ MXCS_DISABLED = 3,
+};
+
+enum MINCAPTIONSTATES {
+ MNCS_ACTIVE = 1,
+ MNCS_INACTIVE = 2,
+ MNCS_DISABLED = 3,
+};
+
+enum HORZSCROLLSTATES {
+ HSS_NORMAL = 1,
+ HSS_HOT = 2,
+ HSS_PUSHED = 3,
+ HSS_DISABLED = 4,
+};
+
+enum HORZTHUMBSTATES {
+ HTS_NORMAL = 1,
+ HTS_HOT = 2,
+ HTS_PUSHED = 3,
+ HTS_DISABLED = 4,
+};
+
+enum VERTSCROLLSTATES {
+ VSS_NORMAL = 1,
+ VSS_HOT = 2,
+ VSS_PUSHED = 3,
+ VSS_DISABLED = 4,
+};
+
+enum VERTTHUMBSTATES {
+ VTS_NORMAL = 1,
+ VTS_HOT = 2,
+ VTS_PUSHED = 3,
+ VTS_DISABLED = 4,
+};
+
+enum SYSBUTTONSTATES {
+ SBS_NORMAL = 1,
+ SBS_HOT = 2,
+ SBS_PUSHED = 3,
+ SBS_DISABLED = 4,
+};
+
+enum MINBUTTONSTATES {
+ MINBS_NORMAL = 1,
+ MINBS_HOT = 2,
+ MINBS_PUSHED = 3,
+ MINBS_DISABLED = 4,
+};
+
+enum MAXBUTTONSTATES {
+ MAXBS_NORMAL = 1,
+ MAXBS_HOT = 2,
+ MAXBS_PUSHED = 3,
+ MAXBS_DISABLED = 4,
+};
+
+enum RESTOREBUTTONSTATES {
+ RBS_NORMAL = 1,
+ RBS_HOT = 2,
+ RBS_PUSHED = 3,
+ RBS_DISABLED = 4,
+};
+
+enum HELPBUTTONSTATES {
+ HBS_NORMAL = 1,
+ HBS_HOT = 2,
+ HBS_PUSHED = 3,
+ HBS_DISABLED = 4,
+};
+
+enum CLOSEBUTTONSTATES {
+ CBS_NORMAL = 1,
+ CBS_HOT = 2,
+ CBS_PUSHED = 3,
+ CBS_DISABLED = 4,
+};
+
+
+#endif //__VSSTYLE_H__
+
diff --git a/include/msapi/vssym32.h b/include/msapi/vssym32.h new file mode 100644 index 0000000000..ea3d3cbc9f --- /dev/null +++ b/include/msapi/vssym32.h @@ -0,0 +1,712 @@ +//-------------------------------------------------------------------------//
+// VisualStyle Core Win32/ComCtl32 symbols
+//-------------------------------------------------------------------------//
+
+#ifndef __VSSYM32_H__
+#define __VSSYM32_H__
+
+#include "vsstyle.h"
+
+//
+// enumerated property values
+//
+
+enum BGTYPE {
+ BT_IMAGEFILE = 0,
+ BT_BORDERFILL = 1,
+ BT_NONE = 2,
+};
+
+
+//
+// enumerated property values
+//
+
+enum IMAGELAYOUT {
+ IL_VERTICAL = 0,
+ IL_HORIZONTAL = 1,
+};
+
+
+//
+// enumerated property values
+//
+
+enum BORDERTYPE {
+ BT_RECT = 0,
+ BT_ROUNDRECT = 1,
+ BT_ELLIPSE = 2,
+};
+
+
+//
+// enumerated property values
+//
+
+enum FILLTYPE {
+ FT_SOLID = 0,
+ FT_VERTGRADIENT = 1,
+ FT_HORZGRADIENT = 2,
+ FT_RADIALGRADIENT = 3,
+ FT_TILEIMAGE = 4,
+};
+
+
+//
+// enumerated property values
+//
+
+enum SIZINGTYPE {
+ ST_TRUESIZE = 0,
+ ST_STRETCH = 1,
+ ST_TILE = 2,
+};
+
+
+//
+// enumerated property values
+//
+
+enum HALIGN {
+ HA_LEFT = 0,
+ HA_CENTER = 1,
+ HA_RIGHT = 2,
+};
+
+
+//
+// enumerated property values
+//
+
+enum CONTENTALIGNMENT {
+ CA_LEFT = 0,
+ CA_CENTER = 1,
+ CA_RIGHT = 2,
+};
+
+
+//
+// enumerated property values
+//
+
+enum VALIGN {
+ VA_TOP = 0,
+ VA_CENTER = 1,
+ VA_BOTTOM = 2,
+};
+
+
+//
+// enumerated property values
+//
+
+enum OFFSETTYPE {
+ OT_TOPLEFT = 0,
+ OT_TOPRIGHT = 1,
+ OT_TOPMIDDLE = 2,
+ OT_BOTTOMLEFT = 3,
+ OT_BOTTOMRIGHT = 4,
+ OT_BOTTOMMIDDLE = 5,
+ OT_MIDDLELEFT = 6,
+ OT_MIDDLERIGHT = 7,
+ OT_LEFTOFCAPTION = 8,
+ OT_RIGHTOFCAPTION = 9,
+ OT_LEFTOFLASTBUTTON = 10,
+ OT_RIGHTOFLASTBUTTON = 11,
+ OT_ABOVELASTBUTTON = 12,
+ OT_BELOWLASTBUTTON = 13,
+};
+
+
+//
+// enumerated property values
+//
+
+enum ICONEFFECT {
+ ICE_NONE = 0,
+ ICE_GLOW = 1,
+ ICE_SHADOW = 2,
+ ICE_PULSE = 3,
+ ICE_ALPHA = 4,
+};
+
+
+//
+// enumerated property values
+//
+
+enum TEXTSHADOWTYPE {
+ TST_NONE = 0,
+ TST_SINGLE = 1,
+ TST_CONTINUOUS = 2,
+};
+
+
+//
+// enumerated property values
+//
+
+enum GLYPHTYPE {
+ GT_NONE = 0,
+ GT_IMAGEGLYPH = 1,
+ GT_FONTGLYPH = 2,
+};
+
+
+//
+// enumerated property values
+//
+
+enum IMAGESELECTTYPE {
+ IST_NONE = 0,
+ IST_SIZE = 1,
+ IST_DPI = 2,
+};
+
+
+//
+// enumerated property values
+//
+
+enum TRUESIZESCALINGTYPE {
+ TSST_NONE = 0,
+ TSST_SIZE = 1,
+ TSST_DPI = 2,
+};
+
+
+//
+// enumerated property values
+//
+
+enum GLYPHFONTSIZINGTYPE {
+ GFST_NONE = 0,
+ GFST_SIZE = 1,
+ GFST_DPI = 2,
+};
+
+//
+// property symbol definitions
+//
+
+#define TMT_RESERVEDLOW 0
+#define TMT_RESERVEDHIGH 7999
+
+#define TMT_DIBDATA 2
+#define TMT_GLYPHDIBDATA 8
+#define TMT_ENUM 200
+#define TMT_STRING 201
+#define TMT_INT 202
+#define TMT_BOOL 203
+#define TMT_COLOR 204
+#define TMT_MARGINS 205
+#define TMT_FILENAME 206
+#define TMT_SIZE 207
+#define TMT_POSITION 208
+#define TMT_RECT 209
+#define TMT_FONT 210
+#define TMT_INTLIST 211
+#define TMT_HBITMAP 212
+#define TMT_DISKSTREAM 213
+#define TMT_STREAM 214
+#define TMT_BITMAPREF 215
+#define TMT_COLORSCHEMES 401
+#define TMT_SIZES 402
+#define TMT_CHARSET 403
+#define TMT_NAME 600
+#define TMT_DISPLAYNAME 601
+#define TMT_TOOLTIP 602
+#define TMT_COMPANY 603
+#define TMT_AUTHOR 604
+#define TMT_COPYRIGHT 605
+#define TMT_URL 606
+#define TMT_VERSION 607
+#define TMT_DESCRIPTION 608
+#define TMT_FIRST_RCSTRING_NAME TMT_DISPLAYNAME
+#define TMT_LAST_RCSTRING_NAME TMT_DESCRIPTION
+#define TMT_CAPTIONFONT 801
+#define TMT_SMALLCAPTIONFONT 802
+#define TMT_MENUFONT 803
+#define TMT_STATUSFONT 804
+#define TMT_MSGBOXFONT 805
+#define TMT_ICONTITLEFONT 806
+#define TMT_HEADING1FONT 807
+#define TMT_HEADING2FONT 808
+#define TMT_BODYFONT 809
+#define TMT_FIRSTFONT TMT_CAPTIONFONT
+#define TMT_LASTFONT TMT_BODYFONT
+#define TMT_FLATMENUS 1001
+#define TMT_FIRSTBOOL TMT_FLATMENUS
+#define TMT_LASTBOOL TMT_FLATMENUS
+#define TMT_SIZINGBORDERWIDTH 1201
+#define TMT_SCROLLBARWIDTH 1202
+#define TMT_SCROLLBARHEIGHT 1203
+#define TMT_CAPTIONBARWIDTH 1204
+#define TMT_CAPTIONBARHEIGHT 1205
+#define TMT_SMCAPTIONBARWIDTH 1206
+#define TMT_SMCAPTIONBARHEIGHT 1207
+#define TMT_MENUBARWIDTH 1208
+#define TMT_MENUBARHEIGHT 1209
+#define TMT_PADDEDBORDERWIDTH 1210
+#define TMT_FIRSTSIZE TMT_SIZINGBORDERWIDTH
+#define TMT_LASTSIZE TMT_PADDEDBORDERWIDTH
+#define TMT_MINCOLORDEPTH 1301
+#define TMT_FIRSTINT TMT_MINCOLORDEPTH
+#define TMT_LASTINT TMT_MINCOLORDEPTH
+#define TMT_CSSNAME 1401
+#define TMT_XMLNAME 1402
+#define TMT_LASTUPDATED 1403
+#define TMT_ALIAS 1404
+#define TMT_FIRSTSTRING TMT_CSSNAME
+#define TMT_LASTSTRING TMT_ALIAS
+#define TMT_SCROLLBAR 1601
+#define TMT_BACKGROUND 1602
+#define TMT_ACTIVECAPTION 1603
+#define TMT_INACTIVECAPTION 1604
+#define TMT_MENU 1605
+#define TMT_WINDOW 1606
+#define TMT_WINDOWFRAME 1607
+#define TMT_MENUTEXT 1608
+#define TMT_WINDOWTEXT 1609
+#define TMT_CAPTIONTEXT 1610
+#define TMT_ACTIVEBORDER 1611
+#define TMT_INACTIVEBORDER 1612
+#define TMT_APPWORKSPACE 1613
+#define TMT_HIGHLIGHT 1614
+#define TMT_HIGHLIGHTTEXT 1615
+#define TMT_BTNFACE 1616
+#define TMT_BTNSHADOW 1617
+#define TMT_GRAYTEXT 1618
+#define TMT_BTNTEXT 1619
+#define TMT_INACTIVECAPTIONTEXT 1620
+#define TMT_BTNHIGHLIGHT 1621
+#define TMT_DKSHADOW3D 1622
+#define TMT_LIGHT3D 1623
+#define TMT_INFOTEXT 1624
+#define TMT_INFOBK 1625
+#define TMT_BUTTONALTERNATEFACE 1626
+#define TMT_HOTTRACKING 1627
+#define TMT_GRADIENTACTIVECAPTION 1628
+#define TMT_GRADIENTINACTIVECAPTION 1629
+#define TMT_MENUHILIGHT 1630
+#define TMT_MENUBAR 1631
+#define TMT_FIRSTCOLOR TMT_SCROLLBAR
+#define TMT_LASTCOLOR TMT_MENUBAR
+#define TMT_FROMHUE1 1801
+#define TMT_FROMHUE2 1802
+#define TMT_FROMHUE3 1803
+#define TMT_FROMHUE4 1804
+#define TMT_FROMHUE5 1805
+#define TMT_TOHUE1 1806
+#define TMT_TOHUE2 1807
+#define TMT_TOHUE3 1808
+#define TMT_TOHUE4 1809
+#define TMT_TOHUE5 1810
+#define TMT_FROMCOLOR1 2001
+#define TMT_FROMCOLOR2 2002
+#define TMT_FROMCOLOR3 2003
+#define TMT_FROMCOLOR4 2004
+#define TMT_FROMCOLOR5 2005
+#define TMT_TOCOLOR1 2006
+#define TMT_TOCOLOR2 2007
+#define TMT_TOCOLOR3 2008
+#define TMT_TOCOLOR4 2009
+#define TMT_TOCOLOR5 2010
+#define TMT_TRANSPARENT 2201
+#define TMT_AUTOSIZE 2202
+#define TMT_BORDERONLY 2203
+#define TMT_COMPOSITED 2204
+#define TMT_BGFILL 2205
+#define TMT_GLYPHTRANSPARENT 2206
+#define TMT_GLYPHONLY 2207
+#define TMT_ALWAYSSHOWSIZINGBAR 2208
+#define TMT_MIRRORIMAGE 2209
+#define TMT_UNIFORMSIZING 2210
+#define TMT_INTEGRALSIZING 2211
+#define TMT_SOURCEGROW 2212
+#define TMT_SOURCESHRINK 2213
+#define TMT_DRAWBORDERS 2214
+#define TMT_NOETCHEDEFFECT 2215
+#define TMT_TEXTAPPLYOVERLAY 2216
+#define TMT_TEXTGLOW 2217
+#define TMT_TEXTITALIC 2218
+#define TMT_COMPOSITEDOPAQUE 2219
+#define TMT_LOCALIZEDMIRRORIMAGE 2220
+#define TMT_IMAGECOUNT 2401
+#define TMT_ALPHALEVEL 2402
+#define TMT_BORDERSIZE 2403
+#define TMT_ROUNDCORNERWIDTH 2404
+#define TMT_ROUNDCORNERHEIGHT 2405
+#define TMT_GRADIENTRATIO1 2406
+#define TMT_GRADIENTRATIO2 2407
+#define TMT_GRADIENTRATIO3 2408
+#define TMT_GRADIENTRATIO4 2409
+#define TMT_GRADIENTRATIO5 2410
+#define TMT_PROGRESSCHUNKSIZE 2411
+#define TMT_PROGRESSSPACESIZE 2412
+#define TMT_SATURATION 2413
+#define TMT_TEXTBORDERSIZE 2414
+#define TMT_ALPHATHRESHOLD 2415
+#define TMT_WIDTH 2416
+#define TMT_HEIGHT 2417
+#define TMT_GLYPHINDEX 2418
+#define TMT_TRUESIZESTRETCHMARK 2419
+#define TMT_MINDPI1 2420
+#define TMT_MINDPI2 2421
+#define TMT_MINDPI3 2422
+#define TMT_MINDPI4 2423
+#define TMT_MINDPI5 2424
+#define TMT_TEXTGLOWSIZE 2425
+#define TMT_FRAMESPERSECOND 2426
+#define TMT_PIXELSPERFRAME 2427
+#define TMT_ANIMATIONDELAY 2428
+#define TMT_GLOWINTENSITY 2429
+#define TMT_OPACITY 2430
+#define TMT_COLORIZATIONCOLOR 2431
+#define TMT_COLORIZATIONOPACITY 2432
+#define TMT_GLYPHFONT 2601
+#define TMT_IMAGEFILE 3001
+#define TMT_IMAGEFILE1 3002
+#define TMT_IMAGEFILE2 3003
+#define TMT_IMAGEFILE3 3004
+#define TMT_IMAGEFILE4 3005
+#define TMT_IMAGEFILE5 3006
+#define TMT_GLYPHIMAGEFILE 3008
+#define TMT_TEXT 3201
+#define TMT_CLASSICVALUE 3202
+#define TMT_OFFSET 3401
+#define TMT_TEXTSHADOWOFFSET 3402
+#define TMT_MINSIZE 3403
+#define TMT_MINSIZE1 3404
+#define TMT_MINSIZE2 3405
+#define TMT_MINSIZE3 3406
+#define TMT_MINSIZE4 3407
+#define TMT_MINSIZE5 3408
+#define TMT_NORMALSIZE 3409
+#define TMT_SIZINGMARGINS 3601
+#define TMT_CONTENTMARGINS 3602
+#define TMT_CAPTIONMARGINS 3603
+#define TMT_BORDERCOLOR 3801
+#define TMT_FILLCOLOR 3802
+#define TMT_TEXTCOLOR 3803
+#define TMT_EDGELIGHTCOLOR 3804
+#define TMT_EDGEHIGHLIGHTCOLOR 3805
+#define TMT_EDGESHADOWCOLOR 3806
+#define TMT_EDGEDKSHADOWCOLOR 3807
+#define TMT_EDGEFILLCOLOR 3808
+#define TMT_TRANSPARENTCOLOR 3809
+#define TMT_GRADIENTCOLOR1 3810
+#define TMT_GRADIENTCOLOR2 3811
+#define TMT_GRADIENTCOLOR3 3812
+#define TMT_GRADIENTCOLOR4 3813
+#define TMT_GRADIENTCOLOR5 3814
+#define TMT_SHADOWCOLOR 3815
+#define TMT_GLOWCOLOR 3816
+#define TMT_TEXTBORDERCOLOR 3817
+#define TMT_TEXTSHADOWCOLOR 3818
+#define TMT_GLYPHTEXTCOLOR 3819
+#define TMT_GLYPHTRANSPARENTCOLOR 3820
+#define TMT_FILLCOLORHINT 3821
+#define TMT_BORDERCOLORHINT 3822
+#define TMT_ACCENTCOLORHINT 3823
+#define TMT_TEXTCOLORHINT 3824
+#define TMT_HEADING1TEXTCOLOR 3825
+#define TMT_HEADING2TEXTCOLOR 3826
+#define TMT_BODYTEXTCOLOR 3827
+#define TMT_BGTYPE 4001
+#define TMT_BORDERTYPE 4002
+#define TMT_FILLTYPE 4003
+#define TMT_SIZINGTYPE 4004
+#define TMT_HALIGN 4005
+#define TMT_CONTENTALIGNMENT 4006
+#define TMT_VALIGN 4007
+#define TMT_OFFSETTYPE 4008
+#define TMT_ICONEFFECT 4009
+#define TMT_TEXTSHADOWTYPE 4010
+#define TMT_IMAGELAYOUT 4011
+#define TMT_GLYPHTYPE 4012
+#define TMT_IMAGESELECTTYPE 4013
+#define TMT_GLYPHFONTSIZINGTYPE 4014
+#define TMT_TRUESIZESCALINGTYPE 4015
+#define TMT_USERPICTURE 5001
+#define TMT_DEFAULTPANESIZE 5002
+#define TMT_BLENDCOLOR 5003
+#define TMT_CUSTOMSPLITRECT 5004
+#define TMT_ANIMATIONBUTTONRECT 5005
+#define TMT_ANIMATIONDURATION 5006
+#define TMT_TRANSITIONDURATIONS 6000
+#define TMT_SCALEDBACKGROUND 7001
+#define TMT_ATLASIMAGE 8000
+#define TMT_ATLASINPUTIMAGE 8001
+#define TMT_ATLASRECT 8002
+
+
+//
+// LINK class parts and states
+//
+#define VSCLASS_LINK L"LINK"
+
+enum LINKPARTS {
+ LP_HYPERLINK = 1,
+};
+
+enum HYPERLINKSTATES {
+ HLS_NORMALTEXT = 1,
+ HLS_LINKTEXT = 2,
+};
+
+
+//
+// EMPTYMARKUP class parts and states
+//
+#define VSCLASS_EMPTYMARKUP L"EMPTYMARKUP"
+
+enum EMPTYMARKUPPARTS {
+ EMP_MARKUPTEXT = 1,
+};
+
+enum MARKUPTEXTSTATES {
+ EMT_NORMALTEXT = 1,
+ EMT_LINKTEXT = 2,
+};
+
+
+//
+// STATIC class parts and states
+//
+#define VSCLASS_STATIC L"STATIC"
+
+enum STATICPARTS {
+ STAT_TEXT = 1,
+};
+
+
+//
+// PAGE class parts and states
+//
+#define VSCLASS_PAGE L"PAGE"
+
+enum PAGEPARTS {
+ PGRP_UP = 1,
+ PGRP_DOWN = 2,
+ PGRP_UPHORZ = 3,
+ PGRP_DOWNHORZ = 4,
+};
+
+
+//
+// MONTHCAL class parts and states
+//
+#define VSCLASS_MONTHCAL L"MONTHCAL"
+
+enum MONTHCALPARTS {
+ MC_BACKGROUND = 1,
+ MC_BORDERS = 2,
+ MC_GRIDBACKGROUND = 3,
+ MC_COLHEADERSPLITTER = 4,
+ MC_GRIDCELLBACKGROUND = 5,
+ MC_GRIDCELL = 6,
+ MC_GRIDCELLUPPER = 7,
+ MC_TRAILINGGRIDCELL = 8,
+ MC_TRAILINGGRIDCELLUPPER = 9,
+ MC_NAVNEXT = 10,
+ MC_NAVPREV = 11,
+};
+
+enum GRIDCELLBACKGROUNDSTATES {
+ MCGCB_SELECTED = 1,
+ MCGCB_HOT = 2,
+ MCGCB_SELECTEDHOT = 3,
+ MCGCB_SELECTEDNOTFOCUSED = 4,
+ MCGCB_TODAY = 5,
+};
+
+enum GRIDCELLSTATES {
+ MCGC_HOT = 1,
+ MCGC_HASSTATE = 2,
+ MCGC_HASSTATEHOT = 3,
+ MCGC_TODAY = 4,
+};
+
+enum GRIDCELLUPPERSTATES {
+ MCGCU_HOT = 1,
+ MCGCU_HASSTATE = 2,
+ MCGCU_HASSTATEHOT = 3,
+};
+
+enum TRAILINGGRIDCELLSTATES {
+ MCTGC_HOT = 1,
+ MCTGC_HASSTATE = 2,
+ MCTGC_HASSTATEHOT = 3,
+ MCTGC_TODAY = 4,
+};
+
+enum TRAILINGGRIDCELLUPPERSTATES {
+ MCTGCU_HOT = 1,
+ MCTGCU_HASSTATE = 2,
+ MCTGCU_HASSTATEHOT = 3,
+};
+
+enum NAVNEXTSTATES {
+ MCNN_NORMAL = 1,
+ MCNN_HOT = 2,
+ MCNN_PRESSED = 3,
+ MCNN_DISABLED = 4,
+};
+
+enum NAVPREVSTATES {
+ MCNP_NORMAL = 1,
+ MCNP_HOT = 2,
+ MCNP_PRESSED = 3,
+ MCNP_DISABLED = 4,
+};
+
+
+//
+// CLOCK class parts and states
+//
+#define VSCLASS_CLOCK L"CLOCK"
+
+enum CLOCKPARTS {
+ CLP_TIME = 1,
+};
+
+enum CLOCKSTATES {
+ CLS_NORMAL = 1,
+ CLS_HOT = 2,
+ CLS_PRESSED = 3,
+};
+
+
+//
+// TRAYNOTIFY class parts and states
+//
+#define VSCLASS_TRAYNOTIFY L"TRAYNOTIFY"
+
+enum TRAYNOTIFYPARTS {
+ TNP_BACKGROUND = 1,
+ TNP_ANIMBACKGROUND = 2,
+};
+
+
+//
+// TASKBAR class parts and states
+//
+#define VSCLASS_TASKBAR L"TASKBAR"
+
+enum TASKBARPARTS {
+ TBP_BACKGROUNDBOTTOM = 1,
+ TBP_BACKGROUNDRIGHT = 2,
+ TBP_BACKGROUNDTOP = 3,
+ TBP_BACKGROUNDLEFT = 4,
+ TBP_SIZINGBARBOTTOM = 5,
+ TBP_SIZINGBARRIGHT = 6,
+ TBP_SIZINGBARTOP = 7,
+ TBP_SIZINGBARLEFT = 8,
+};
+
+
+//
+// TASKBAND class parts and states
+//
+#define VSCLASS_TASKBAND L"TASKBAND"
+
+enum TASKBANDPARTS {
+ TDP_GROUPCOUNT = 1,
+ TDP_FLASHBUTTON = 2,
+ TDP_FLASHBUTTONGROUPMENU = 3,
+};
+
+
+//
+// STARTPANEL class parts and states
+//
+#define VSCLASS_STARTPANEL L"STARTPANEL"
+
+enum STARTPANELPARTS {
+ SPP_USERPANE = 1,
+ SPP_MOREPROGRAMS = 2,
+ SPP_MOREPROGRAMSARROW = 3,
+ SPP_PROGLIST = 4,
+ SPP_PROGLISTSEPARATOR = 5,
+ SPP_PLACESLIST = 6,
+ SPP_PLACESLISTSEPARATOR = 7,
+ SPP_LOGOFF = 8,
+ SPP_LOGOFFBUTTONS = 9,
+ SPP_USERPICTURE = 10,
+ SPP_PREVIEW = 11,
+ SPP_MOREPROGRAMSTAB = 12,
+ SPP_NSCHOST = 13,
+ SPP_SOFTWAREEXPLORER = 14,
+ SPP_OPENBOX = 15,
+ SPP_SEARCHVIEW = 16,
+ SPP_MOREPROGRAMSARROWBACK = 17,
+ SPP_TOPMATCH = 18,
+ SPP_LOGOFFSPLITBUTTONDROPDOWN = 19,
+};
+
+enum MOREPROGRAMSTABSTATES {
+ SPMPT_NORMAL = 1,
+ SPMPT_HOT = 2,
+ SPMPT_SELECTED = 3,
+ SPMPT_DISABLED = 4,
+ SPMPT_FOCUSED = 5,
+};
+
+enum SOFTWAREEXPLORERSTATES {
+ SPSE_NORMAL = 1,
+ SPSE_HOT = 2,
+ SPSE_SELECTED = 3,
+ SPSE_DISABLED = 4,
+ SPSE_FOCUSED = 5,
+};
+
+enum OPENBOXSTATES {
+ SPOB_NORMAL = 1,
+ SPOB_HOT = 2,
+ SPOB_SELECTED = 3,
+ SPOB_DISABLED = 4,
+ SPOB_FOCUSED = 5,
+};
+
+enum MOREPROGRAMSARROWSTATES {
+ SPS_NORMAL = 1,
+ SPS_HOT = 2,
+ SPS_PRESSED = 3,
+};
+
+enum MOREPROGRAMSARROWBACKSTATES {
+ SPSB_NORMAL = 1,
+ SPSB_HOT = 2,
+ SPSB_PRESSED = 3,
+};
+
+enum LOGOFFBUTTONSSTATES {
+ SPLS_NORMAL = 1,
+ SPLS_HOT = 2,
+ SPLS_PRESSED = 3,
+};
+
+
+//
+// MENUBAND class parts and states
+//
+#define VSCLASS_MENUBAND L"MENUBAND"
+
+enum MENUBANDPARTS {
+ MDP_NEWAPPBUTTON = 1,
+ MDP_SEPERATOR = 2,
+};
+
+enum MENUBANDSTATES {
+ MDS_NORMAL = 1,
+ MDS_HOT = 2,
+ MDS_PRESSED = 3,
+ MDS_DISABLED = 4,
+ MDS_CHECKED = 5,
+ MDS_HOTCHECKED = 6,
+};
+
+
+#endif //__VSSYM32_H__
+
diff --git a/include/msapi/winres.h b/include/msapi/winres.h new file mode 100644 index 0000000000..15e139c892 --- /dev/null +++ b/include/msapi/winres.h @@ -0,0 +1,71 @@ +/* winres.h Missing in MinGW. Adding missing constants */
+
+#ifdef __GNUC__
+#ifndef __WINRES_H
+#define __WINRES_H
+
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0501
+#endif
+#ifndef _WIN32_IE
+#define _WIN32_IE 0x0501
+#endif
+
+#define HOTKEY_CLASSA "msctls_hotkey32"
+
+#ifdef _COMMCTRL_H
+#error "Resource should include winres.h first!"
+#endif
+
+/* FIXME: It seems if we include richedit.h later we got a problem with MinGW + UNICODE */
+#ifdef UNICODE
+#undef UNICODE
+#endif
+
+#include <winresrc.h>
+
+#ifndef IDC_STATIC
+#define IDC_STATIC (-1)
+#endif
+
+#ifndef IDCLOSE
+#define IDCLOSE 8
+#endif
+
+#endif
+#else
+
+#ifdef _AFX_MINREBUILD
+#pragma component(minrebuild, off)
+#endif
+
+#define VS_VERSION_INFO 1
+
+#ifdef APSTUDIO_INVOKED
+#define APSTUDIO_HIDDEN_SYMBOLS // Ignore following symbols
+#endif
+
+#ifndef WINVER
+#define WINVER 0x0400 // default to Windows Version 4.0
+#endif
+
+#include <winresrc.h>
+
+// operation messages sent to DLGINIT
+#define LB_ADDSTRING (WM_USER+1)
+#define CB_ADDSTRING (WM_USER+3)
+
+#ifdef APSTUDIO_INVOKED
+#undef APSTUDIO_HIDDEN_SYMBOLS
+#endif
+
+#ifdef IDC_STATIC
+#undef IDC_STATIC
+#endif
+#define IDC_STATIC (-1)
+
+#ifdef _AFX_MINREBUILD
+#pragma component(minrebuild, on)
+#endif
+
+#endif
diff --git a/include/newpluginapi.h b/include/newpluginapi.h new file mode 100644 index 0000000000..0a51132119 --- /dev/null +++ b/include/newpluginapi.h @@ -0,0 +1,292 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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_NEWPLUGINAPI_H__
+#define M_NEWPLUGINAPI_H__
+
+#include "m_plugins.h"
+
+#define PLUGIN_MAKE_VERSION(a,b,c,d) (((((DWORD)(a))&0xFF)<<24)|((((DWORD)(b))&0xFF)<<16)|((((DWORD)(c))&0xFF)<<8)|(((DWORD)(d))&0xFF))
+#define MAXMODULELABELLENGTH 64
+
+#if defined( _UNICODE )
+ #define UNICODE_AWARE 1
+#else
+ #define UNICODE_AWARE 0
+#endif
+
+typedef struct {
+ int cbSize;
+ char *shortName;
+ DWORD version;
+ char *description; // [TRANSLATED-BY-CORE]
+ char *author;
+ char *authorEmail;
+ char *copyright;
+ char *homepage;
+ BYTE flags; // right now the only flag, UNICODE_AWARE, is recognized here
+ int replacesDefaultModule; //one of the DEFMOD_ constants in m_plugins.h or zero
+ //if non-zero, this will supress the loading of the specified built-in module
+ //with the implication that this plugin provides back-end-compatible features
+} PLUGININFO;
+
+/* 0.7+
+ New plugin loader implementation
+*/
+/* The UUID structure below is used to for plugin UUID's and module type definitions */
+typedef struct _MUUID {
+ unsigned long a;
+ unsigned short b;
+ unsigned short c;
+ unsigned char d[8];
+} MUUID;
+
+
+/* Used to define the end of the MirandaPluginInterface list */
+#define MIID_LAST {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}}
+
+/* Replaceable internal modules interface ids */
+#define MIID_HISTORY {0x5ca0cbc1, 0x999a, 0x4ea2, {0x8b, 0x44, 0xf8, 0xf6, 0x7d, 0x7f, 0x8e, 0xbe}}
+#define MIID_UIFINDADD {0xb22c528d, 0x6852, 0x48eb, {0xa2, 0x94, 0xe, 0x26, 0xa9, 0x16, 0x12, 0x13}}
+#define MIID_UIUSERINFO {0x570b931c, 0x9af8, 0x48f1, {0xad, 0x9f, 0xc4, 0x49, 0x8c, 0x61, 0x8a, 0x77}}
+#define MIID_SRURL {0x5192445c, 0xf5e8, 0x46c0, {0x8f, 0x9e, 0x2b, 0x6d, 0x43, 0xe5, 0xc7, 0x53}}
+#define MIID_SRAUTH {0x377780b9, 0x2b3b, 0x405b, {0x9f, 0x36, 0xb3, 0xc4, 0x87, 0x8e, 0x6f, 0x33}}
+#define MIID_SRAWAY {0x5ab54c76, 0x1b4c, 0x4a00, {0xb4, 0x4, 0x48, 0xcb, 0xea, 0x5f, 0xef, 0xe7}}
+#define MIID_SREMAIL {0xd005b5a6, 0x1b66, 0x445a, {0xb6, 0x3, 0x74, 0xd4, 0xd4, 0x55, 0x2d, 0xe2}}
+#define MIID_SRFILE {0x989d104d, 0xacb7, 0x4ee0, {0xb9, 0x6d, 0x67, 0xce, 0x46, 0x53, 0xb6, 0x95}}
+#define MIID_UIHELP {0xf2d35c3c, 0x861a, 0x4cc3, {0xa7, 0x8f, 0xd1, 0xf7, 0x85, 0x4, 0x41, 0xcb}}
+#define MIID_UIHISTORY {0x7f7e3d98, 0xce1f, 0x4962, {0x82, 0x84, 0x96, 0x85, 0x50, 0xf1, 0xd3, 0xd9}}
+#define MIID_AUTOAWAY {0x9c87f7dc, 0x3bd7, 0x4983, {0xb7, 0xfb, 0xb8, 0x48, 0xfd, 0xbc, 0x91, 0xf0}}
+#define MIID_USERONLINE {0x130829e0, 0x2463, 0x4ff8, {0xbb, 0xc8, 0xce, 0x73, 0xc0, 0x18, 0x84, 0x42}}
+#define MIID_IDLE {0x296f9f3b, 0x5b6f, 0x40e5, {0x8f, 0xb0, 0xa6, 0x49, 0x6c, 0x18, 0xbf, 0xa}}
+#define MIID_FONTSERVICE {0x56f39112, 0xe37f, 0x4234, {0xa9, 0xe6, 0x7a, 0x81, 0x17, 0x45, 0xc1, 0x75}}
+#define MIID_UPDATENOTIFY {0x4e68b12a, 0x6b54, 0x44de, {0x86, 0x37, 0xf1, 0x12, 0xd, 0xb6, 0x81, 0x40}}
+#define MIID_CRYPTO {0x415ca6e1, 0x895f, 0x40e6, {0x87, 0xbd, 0x9b, 0x39, 0x60, 0x16, 0xd0, 0xe5}}
+
+/* Common plugin interfaces (core plugins) */
+#define MIID_DATABASE {0xae77fd33, 0xe484, 0x4dc7, {0x8c, 0xbc, 0x9, 0x9f, 0xed, 0xcc, 0xcf, 0xdd}}
+#define MIID_CLIST {0x9d8da8bf, 0x665b, 0x4908, {0x9e, 0x61, 0x9f, 0x75, 0x98, 0xae, 0x33, 0xe}}
+#define MIID_CHAT {0x23576a43, 0x3a26, 0x4357, {0x9b, 0x1b, 0x4a, 0x71, 0x9e, 0x42, 0x5d, 0x48}}
+#define MIID_SRMM {0x58c7eea6, 0xf9db, 0x4dd9, {0x80, 0x36, 0xae, 0x80, 0x2b, 0xc0, 0x41, 0x4c}}
+#define MIID_IMPORT {0x5f3bcad4, 0x75f8, 0x476e, {0xb3, 0x6b, 0x2b, 0x30, 0x70, 0x32, 0x49, 0xc}}
+#define MIID_IMGSERVICES {0xf3974915, 0xc9d5, 0x4c87, {0x85, 0x64, 0xa0, 0xeb, 0xf9, 0xd2, 0x5a, 0xa0}}
+#define MIID_TESTPLUGIN {0x53b974f4, 0x3c74, 0x4dba, {0x8f, 0xc2, 0x6f, 0x92, 0xfe, 0x1, 0x3b, 0x8c}}
+
+/* Common plugin interfaces (non-core plugins) */
+#define MIID_VERSIONINFO {0xcfeb6325, 0x334e, 0x4052, {0xa6, 0x45, 0x56, 0x21, 0x93, 0xdf, 0xcc, 0x77}}
+#define MIID_FOLDERS {0xcfebec29, 0x39ef, 0x4b62, {0xad, 0x38, 0x9a, 0x65, 0x2c, 0xa3, 0x24, 0xed}}
+#define MIID_BIRTHDAYNOTIFY {0xcfba5784, 0x3701, 0x4d83, {0x81, 0x6a, 0x19, 0x9c, 0x00, 0xd4, 0xa6, 0x7a}}
+#define MIID_BONSAI {0xcfaae811, 0x30e1, 0x4a4f, {0x87, 0x84, 0x15, 0x3c, 0xcc, 0xb0, 0x03, 0x7a}}
+#define MIID_EXCHANGE {0xcfd79a89, 0x9959, 0x4e65, {0xb0, 0x76, 0x41, 0x3f, 0x98, 0xfe, 0x0d, 0x15}}
+#define MIID_MIRPY {0xcff91a5c, 0x1786, 0x41c1, {0x88, 0x86, 0x09, 0x4b, 0x14, 0x28, 0x1f, 0x15}}
+#define MIID_SERVICESLIST {0xcf4bdf02, 0x5d27, 0x4241, {0x99, 0xe5, 0x19, 0x51, 0xaa, 0xb0, 0xc4, 0x54}}
+#define MIID_TRANSLATOR {0xcfb637b0, 0x7217, 0x4c1e, {0xb2, 0x2a, 0xd9, 0x22, 0x32, 0x3a, 0x5d, 0x0b}}
+#define MIID_TOOLTIPS {0xbcbda043, 0x2716, 0x4404, {0xb0, 0xfa, 0x3d, 0x2d, 0x93, 0x81, 0x9e, 0x3}}
+#define MIID_POPUPS {0x33299069, 0x1919, 0x4ff8, {0xb1, 0x31, 0x1d, 0x7, 0x21, 0x78, 0xa7, 0x66}}
+#define MIID_LOGWINDOW {0xc53afb90, 0xfa44, 0x4304, {0xbc, 0x9d, 0x6a, 0x84, 0x1c, 0x39, 0x05, 0xf5}}
+#define MIID_EVENTNOTIFY {0xF3D7EC5A, 0xF7EF, 0x45DD, {0x8C, 0xA5, 0xB0, 0xF6, 0xBA, 0x18, 0x64, 0x7B}}
+#define MIID_SRCONTACTS {0x7CA6050E, 0xBAF7, 0x42D2, {0xB9, 0x36, 0x0D, 0xB9, 0xDF, 0x57, 0x2B, 0x95}}
+#define MIID_HISTORYEXPORT {0x18fa2ade, 0xe31b, 0x4b5d, {0x95, 0x3d, 0xa, 0xb2, 0x57, 0x81, 0xc6, 0x4}}
+
+/* Special exception interface for protocols.
+ This interface allows more than one plugin to implement it at the same time
+*/
+#define MIID_PROTOCOL {0x2a3c815e, 0xa7d9, 0x424b, {0xba, 0x30, 0x2, 0xd0, 0x83, 0x22, 0x90, 0x85}}
+
+#define MIID_SERVICEMODE {0x8a92c026, 0x953a, 0x4f5f, { 0x99, 0x21, 0xf2, 0xc2, 0xdc, 0x19, 0x5e, 0xc5}}
+
+/* Each service mode plugin must implement MS_SERVICEMODE_LAUNCH */
+#define MS_SERVICEMODE_LAUNCH "ServiceMode/Launch"
+
+typedef struct {
+ int cbSize;
+ char *shortName;
+ DWORD version;
+ char *description;
+ char *author;
+ char *authorEmail;
+ char *copyright;
+ char *homepage;
+ BYTE flags; // right now the only flag, UNICODE_AWARE, is recognized here
+ int replacesDefaultModule; //one of the DEFMOD_ constants in m_plugins.h or zero
+ //if non-zero, this will supress the loading of the specified built-in module
+ //with the implication that this plugin provides back-end-compatible features
+ /*********** WILL BE DEPRECATED in 0.8 * *************/
+ MUUID uuid; // Not required until 0.8.
+} PLUGININFOEX;
+
+#ifndef MODULES_H_
+ typedef int (*MIRANDAHOOK)(WPARAM,LPARAM);
+ typedef int (*MIRANDAHOOKPARAM)(WPARAM,LPARAM,LPARAM);
+ typedef int (*MIRANDAHOOKOBJ)(void*,WPARAM,LPARAM);
+ typedef int (*MIRANDAHOOKOBJPARAM)(void*,WPARAM,LPARAM,LPARAM);
+
+ typedef INT_PTR (*MIRANDASERVICE)(WPARAM,LPARAM);
+ typedef INT_PTR (*MIRANDASERVICEPARAM)(WPARAM,LPARAM,LPARAM);
+ typedef INT_PTR (*MIRANDASERVICEOBJ)(void*,WPARAM,LPARAM);
+ typedef INT_PTR (*MIRANDASERVICEOBJPARAM)(void*,WPARAM,LPARAM,LPARAM);
+
+#ifdef _WIN64
+ #define CALLSERVICE_NOTFOUND ((INT_PTR)0x8000000000000000)
+#else
+ #define CALLSERVICE_NOTFOUND ((int)0x80000000)
+#endif
+
+#endif
+
+//see modules.h for what all this stuff is
+typedef struct tagPLUGINLINK {
+ HANDLE (*CreateHookableEvent)(const char *);
+ int (*DestroyHookableEvent)(HANDLE);
+ int (*NotifyEventHooks)(HANDLE,WPARAM,LPARAM);
+ HANDLE (*HookEvent)(const char *,MIRANDAHOOK);
+ HANDLE (*HookEventMessage)(const char *,HWND,UINT);
+ int (*UnhookEvent)(HANDLE);
+ HANDLE (*CreateServiceFunction)(const char *,MIRANDASERVICE);
+ HANDLE (*CreateTransientServiceFunction)(const char *,MIRANDASERVICE);
+ int (*DestroyServiceFunction)(HANDLE);
+ INT_PTR (*CallService)(const char *,WPARAM,LPARAM);
+ int (*ServiceExists)(const char *); //v0.1.0.1+
+ INT_PTR (*CallServiceSync)(const char *,WPARAM,LPARAM); //v0.3.3+
+ int (*CallFunctionAsync) (void (__stdcall *)(void *), void *); //v0.3.4+
+ int (*SetHookDefaultForHookableEvent) (HANDLE, MIRANDAHOOK); // v0.3.4 (2004/09/15)
+ HANDLE (*CreateServiceFunctionParam)(const char *,MIRANDASERVICEPARAM,LPARAM); // v0.7+ (2007/04/24)
+ int (*NotifyEventHooksDirect)(HANDLE,WPARAM,LPARAM); // v0.7+
+ #if MIRANDA_VER >= 0x800
+ INT_PTR (*CallProtoService)(const char *, const char *, WPARAM, LPARAM );
+ INT_PTR (*CallContactService)( HANDLE, const char *, WPARAM, LPARAM );
+ HANDLE (*HookEventParam)(const char *,MIRANDAHOOKPARAM,LPARAM);
+ HANDLE (*HookEventObj)(const char *,MIRANDAHOOKOBJ, void* );
+ HANDLE (*HookEventObjParam)(const char *, MIRANDAHOOKOBJPARAM, void*, LPARAM);
+ HANDLE (*CreateServiceFunctionObj)(const char *,MIRANDASERVICEOBJ,void*);
+ HANDLE (*CreateServiceFunctionObjParam)(const char *,MIRANDASERVICEOBJPARAM,void*,LPARAM);
+ void (*KillObjectServices)(void *);
+ void (*KillObjectEventHooks)(void *);
+ #endif
+} PLUGINLINK;
+
+#ifndef MODULES_H_
+ #ifndef NODEFINEDLINKFUNCTIONS
+ //relies on a global variable 'pluginLink' in the plugins
+ extern PLUGINLINK *pluginLink;
+ #define CreateHookableEvent(a) pluginLink->CreateHookableEvent(a)
+ #define DestroyHookableEvent(a) pluginLink->DestroyHookableEvent(a)
+ #define NotifyEventHooks(a,b,c) pluginLink->NotifyEventHooks(a,b,c)
+ #define HookEventMessage(a,b,c) pluginLink->HookEventMessage(a,b,c)
+ #define HookEvent(a,b) pluginLink->HookEvent(a,b)
+ #define UnhookEvent(a) pluginLink->UnhookEvent(a)
+ #define CreateServiceFunction(a,b) pluginLink->CreateServiceFunction(a,b)
+ #define CreateTransientServiceFunction(a,b) pluginLink->CreateTransientServiceFunction(a,b)
+ #define DestroyServiceFunction(a) pluginLink->DestroyServiceFunction(a)
+ #define CallService(a,b,c) pluginLink->CallService(a,b,c)
+ #define ServiceExists(a) pluginLink->ServiceExists(a)
+ #define CallServiceSync(a,b,c) pluginLink->CallServiceSync(a,b,c)
+ #define CallFunctionAsync(a,b) pluginLink->CallFunctionAsync(a,b)
+ #define SetHookDefaultForHookableEvent(a,b) pluginLink->SetHookDefaultForHookableEvent(a,b)
+ #define CreateServiceFunctionParam(a,b,c) pluginLink->CreateServiceFunctionParam(a,b,c)
+ #define NotifyEventHooksDirect(a,b,c) pluginLink->NotifyEventHooksDirect(a,b,c)
+ #if MIRANDA_VER >= 0x800
+ #define CallProtoService(a,b,c,d) pluginLink->CallProtoService(a,b,c,d)
+ #define CallContactService(a,b,c,d) pluginLink->CallContactService(a,b,c,d)
+ #define HookEventParam(a,b,c) pluginLink->HookEventParam(a,b,c)
+ #define HookEventObj(a,b,c) pluginLink->HookEventObj(a,b,c)
+ #define HookEventObjParam(a,b,c,d) pluginLink->HookEventObjParam(a,b,c,d)
+ #define CreateServiceFunctionObj(a,b,c) pluginLink->CreateServiceFunctionObj(a,b,c)
+ #define CreateServiceFunctionObjParam(a,b,c,d) pluginLink->CreateServiceFunctionObjParam(a,b,c,d)
+ #define KillObjectServices(a) pluginLink->KillObjectServices(a)
+ #define KillObjectEventHooks(a) pluginLink->KillObjectEventHooks(a)
+ #endif
+ #endif
+#endif
+
+/*
+ Database plugin stuff
+*/
+
+// grokHeader() error codes
+#define EGROKPRF_NOERROR 0
+#define EGROKPRF_CANTREAD 1 // can't open the profile for reading
+#define EGROKPRF_UNKHEADER 2 // header not supported, not a supported profile
+#define EGROKPRF_VERNEWER 3 // header correct, version in profile newer than reader/writer
+#define EGROKPRF_DAMAGED 4 // header/version fine, other internal data missing, damaged.
+
+// makeDatabase() error codes
+#define EMKPRF_CREATEFAILED 1 // for some reason CreateFile() didnt like something
+
+typedef struct {
+ int cbSize;
+
+ /*
+ returns what the driver can do given the flag
+ */
+ int (*getCapability) ( int flag );
+
+ /*
+ buf: pointer to a string buffer
+ cch: length of buffer
+ shortName: if true, the driver should return a short but descriptive name, e.g. "3.xx profile"
+ Affect: The database plugin must return a "friendly name" into buf and not exceed cch bytes,
+ e.g. "Database driver for 3.xx profiles"
+ Returns: 0 on success, non zero on failure
+ */
+ int (*getFriendlyName) ( char * buf, size_t cch, int shortName );
+
+ /*
+ profile: pointer to a string which contains full path + name
+ Affect: The database plugin should create the profile, the filepath will not exist at
+ the time of this call, profile will be C:\..\<name>.dat
+ Note: Do not prompt the user in anyway about this operation.
+ Note: Do not initialise internal data structures at this point!
+ Returns: 0 on success, non zero on failure - error contains extended error information, see EMKPRF_*
+ */
+ int (*makeDatabase) ( char * profile, int * error );
+
+ /*
+ profile: [in] a null terminated string to file path of selected profile
+ error: [in/out] pointer to an int to set with error if any
+ Affect: Ask the database plugin if it supports the given profile, if it does it will
+ return 0, if it doesnt return 1, with the error set in error -- EGROKPRF_* can be valid error
+ condition, most common error would be [EGROKPRF_UNKHEADER]
+ Note: Just because 1 is returned, doesnt mean the profile is not supported, the profile might be damaged
+ etc.
+ Returns: 0 on success, non zero on failure
+ */
+ int (*grokHeader) ( char * profile, int * error );
+
+ /*
+ Affect: Tell the database to create all services/hooks that a 3.xx legecy database might support into link,
+ which is a PLUGINLINK structure
+ Returns: 0 on success, nonzero on failure
+ */
+ int (*Load) ( char * profile, void * link );
+
+ /*
+ Affect: The database plugin should shutdown, unloading things from the core and freeing internal structures
+ Returns: 0 on success, nonzero on failure
+ Note: Unload() might be called even if Load() was never called, wasLoaded is set to 1 if Load() was ever called.
+ */
+ int (*Unload) ( int wasLoaded );
+
+} DATABASELINK;
+
+#endif // M_NEWPLUGINAPI_H__
diff --git a/include/statusmodes.h b/include/statusmodes.h new file mode 100644 index 0000000000..da973ab79c --- /dev/null +++ b/include/statusmodes.h @@ -0,0 +1,52 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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 STATUSMODES_H__
+#define STATUSMODES_H__ 1
+
+//add 1 to ID_STATUS_CONNECTING to mark retries (v0.1.0.1+)
+//eg ID_STATUS_CONNECTING+2 is the third connection attempt, or the second retry
+#define ID_STATUS_CONNECTING 1
+
+//max retries is just a marker so that the clist knows what numbers represent
+//retries. It does not set any kind of limit on the number of retries you can
+//and/or should do.
+#define MAX_CONNECT_RETRIES 10000
+
+#define ID_STATUS_OFFLINE 40071
+#define ID_STATUS_ONLINE 40072
+#define ID_STATUS_AWAY 40073
+#define ID_STATUS_DND 40074
+#define ID_STATUS_NA 40075
+#define ID_STATUS_OCCUPIED 40076
+#define ID_STATUS_FREECHAT 40077
+#define ID_STATUS_INVISIBLE 40078
+#define ID_STATUS_ONTHEPHONE 40079
+#define ID_STATUS_OUTTOLUNCH 40080
+#define ID_STATUS_IDLE 40081 /* do not use as a status */
+
+#define MAX_STATUS_COUNT (ID_STATUS_OUTTOLUNCH-ID_STATUS_OFFLINE+1)
+
+#endif // STATUSMODES_H__
+
+
diff --git a/include/win2k.h b/include/win2k.h new file mode 100644 index 0000000000..d7b04565ba --- /dev/null +++ b/include/win2k.h @@ -0,0 +1,551 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM 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 WIN2K_H__
+#define WIN2K_H__ 1
+
+/*
+This file was made to define the new constants normally provided by the windows
+sdk you can get from http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
+To not need to install the whole sdk you can simply comment out the following lines.
+To make myself clear, you are supposed to use the sdk, this is just a work around.
+
+All constants are normally declared in winuser.h
+
+File created by Christian Kästner, and tweaked a bit by Richard Hughes*/
+
+//Windows versions in order of feature presence is:
+//95, NT4, 98, ME, 2000, XP
+//This is chronological order of release except for ME/2000. ME is barely an
+//improvement on 98.
+//These macros use the above order, not release order.
+#define WinVerMajor() LOBYTE(LOWORD(GetVersion()))
+#define WinVerMinor() HIBYTE(LOWORD(GetVersion()))
+#define IsWinVerNT() ((GetVersion()&0x80000000)==0)
+// IsWinVerNT4Plus() is buggy, Windows 98 is 4.10.1998
+#define IsWinVerNT4Plus() (WinVerMajor()>=5 || WinVerMinor()>0 || IsWinVerNT())
+#define IsWinVer98Plus() (LOWORD(GetVersion())!=4)
+#define IsWinVerMEPlus() (WinVerMajor()>=5 || WinVerMinor()>10)
+#define IsWinVer2000Plus() (WinVerMajor()>=5 && IsWinVerNT())
+#define IsWinVerXPPlus() (WinVerMajor()>=5 && LOWORD(GetVersion())!=5)
+#define IsWinVerVistaPlus() (WinVerMajor()>=6)
+#define IsWinVer7Plus() (WinVerMajor()>6 || (WinVerMajor()==6 && WinVerMinor()>=1))
+
+// put stuff that's not apart of any SDKs but is used nonetheless
+
+#define SIZEOF(X) (sizeof(X)/sizeof(X[0]))
+
+#ifdef _WIN64
+#define MENUITEMINFO_V4_SIZE sizeof(MENUITEMINFO)
+#else
+//mii was extended for NT5/Win98, so need the old length for some stuff
+#define MENUITEMINFO_V4_SIZE (offsetof(MENUITEMINFO,cch)+sizeof((*((MENUITEMINFO*)0)).cch))
+#endif
+
+#if _MSC_VER >= 1300
+#define NOWIN2K
+#endif
+
+#if WINVER >= 0x501
+#define NOWIN2K
+#endif
+
+#ifdef _MSC_VER
+#define BIGI(x) x##i64
+#else
+#define BIGI(x) x##LL
+#endif
+
+// collapsible groups for Vista
+#ifndef LVGS_COLLAPSIBLE
+ #define LVGS_COLLAPSIBLE 0x00000008
+#endif
+
+#ifndef SM_SERVERR2
+ #define SM_SERVERR2 89
+ #define VER_SUITE_STORAGE_SERVER 0x00002000
+ #define VER_SUITE_COMPUTE_SERVER 0x00004000
+ #define VER_SUITE_WH_SERVER 0x00008000
+#endif
+
+#if _MSC_VER
+ #if !defined(DTBG_CLIPRECT)
+ #define DTBG_CLIPRECT 0x00000001 // rcClip has been specified
+ #define DTBG_DRAWSOLID 0x00000002 // DEPRECATED: draw transparent/alpha images as solid
+ #define DTBG_OMITBORDER 0x00000004 // don't draw border of part
+ #define DTBG_OMITCONTENT 0x00000008 // don't draw content area of part
+ #define DTBG_COMPUTINGREGION 0x00000010 // TRUE if calling to compute region
+ #define DTBG_MIRRORDC 0x00000020 // assume the hdc is mirrorred and
+ // flip images as appropriate (currently
+ // only supported for bgtype=imagefile)
+ #define DTBG_NOMIRROR 0x00000040 // don't mirror the output, overrides everything else
+
+ typedef struct _DTBGOPTS
+ {
+ DWORD dwSize; // size of the struct
+ DWORD dwFlags; // which options have been specified
+ RECT rcClip; // clipping rectangle
+ } DTBGOPTS, *PDTBGOPTS;
+ #endif
+ #if !defined( DTT_COMPOSITED )
+ #define DTT_TEXTCOLOR (1UL << 0) // crText has been specified
+ #define DTT_BORDERCOLOR (1UL << 1) // crBorder has been specified
+ #define DTT_SHADOWCOLOR (1UL << 2) // crShadow has been specified
+ #define DTT_SHADOWTYPE (1UL << 3) // iTextShadowType has been specified
+ #define DTT_SHADOWOFFSET (1UL << 4) // ptShadowOffset has been specified
+ #define DTT_BORDERSIZE (1UL << 5) // iBorderSize has been specified
+ #define DTT_FONTPROP (1UL << 6) // iFontPropId has been specified
+ #define DTT_COLORPROP (1UL << 7) // iColorPropId has been specified
+ #define DTT_STATEID (1UL << 8) // IStateId has been specified
+ #define DTT_CALCRECT (1UL << 9) // Use pRect as and in/out parameter
+ #define DTT_APPLYOVERLAY (1UL << 10) // fApplyOverlay has been specified
+ #define DTT_GLOWSIZE (1UL << 11) // iGlowSize has been specified
+ #define DTT_CALLBACK (1UL << 12) // pfnDrawTextCallback has been specified
+ #define DTT_COMPOSITED (1UL << 13) // Draws text with antialiased alpha (needs a DIB section)
+
+ typedef
+ int
+ (WINAPI *DTT_CALLBACK_PROC)
+ (
+ HDC hdc,
+ LPWSTR pszText,
+ int cchText,
+ LPRECT prc,
+ UINT dwFlags,
+ LPARAM lParam);
+
+ typedef struct _DTTOPTS
+ {
+ DWORD dwSize; // size of the struct
+ DWORD dwFlags; // which options have been specified
+ COLORREF crText; // color to use for text fill
+ COLORREF crBorder; // color to use for text outline
+ COLORREF crShadow; // color to use for text shadow
+ int iTextShadowType; // TST_SINGLE or TST_CONTINUOUS
+ POINT ptShadowOffset; // where shadow is drawn (relative to text)
+ int iBorderSize; // Border radius around text
+ int iFontPropId; // Font property to use for the text instead of TMT_FONT
+ int iColorPropId; // Color property to use for the text instead of TMT_TEXTCOLOR
+ int iStateId; // Alternate state id
+ BOOL fApplyOverlay; // Overlay text on top of any text effect?
+ int iGlowSize; // Glow radious around text
+ DTT_CALLBACK_PROC pfnDrawTextCallback; // Callback for DrawText
+ LPARAM lParam; // Parameter for callback
+ } DTTOPTS, *PDTTOPTS;
+
+ #define WTNCA_NODRAWCAPTION 0x00000001 // don't draw the window caption
+ #define WTNCA_NODRAWICON 0x00000002 // don't draw the system icon
+ #define WTNCA_NOSYSMENU 0x00000004 // don't expose the system menu icon functionality
+ #define WTNCA_NOMIRRORHELP 0x00000008 // don't mirror the question mark, even in RTL layout
+
+ enum WINDOWTHEMEATTRIBUTETYPE
+ {
+ WTA_NONCLIENT = 1
+ };
+
+ typedef struct _WTA_OPTIONS
+ {
+ DWORD dwFlags; // values for each style option specified in the bitmask
+ DWORD dwMask; // bitmask for flags that are changing
+ // valid options are: WTNCA_NODRAWCAPTION, WTNCA_NODRAWICON, WTNCA_NOSYSMENU
+ } WTA_OPTIONS, *PWTA_OPTIONS;
+ #endif
+#endif
+
+#if defined (__GNUC__)
+ #define SECURITY_ENTRYPOINTA "InitSecurityInterfaceA"
+ #define SECURITY_ENTRYPOINT SECURITY_ENTRYPOINTA
+ #define FreeCredentialsHandle FreeCredentialsHandle
+ #define FAPPCOMMAND_MASK 0xF000
+ #define GET_APPCOMMAND_LPARAM(lParam) ((short)(HIWORD(lParam) & ~FAPPCOMMAND_MASK))
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+ WINGDIAPI BOOL WINAPI AlphaBlend(HDC,int,int,int,int,HDC,int,int,int,int,BLENDFUNCTION);
+ #ifdef __cplusplus
+ }
+ #endif
+ /* FIXME: MinGW doesn't provide _snscanf, we wrap unsafe sscanf here */
+ #define _snscanf(buf, size, fmt, ...) sscanf(buf, fmt, ## __VA_ARGS__)
+ #ifndef CDSIZEOF_STRUCT
+ #define CDSIZEOF_STRUCT(structname, member) \
+ (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)->member))
+ #endif
+ #ifndef OPENFILENAME_SIZE_VERSION_400
+ #define OPENFILENAME_SIZE_VERSION_400 CDSIZEOF_STRUCT(OPENFILENAME,lpTemplateName)
+ #endif
+ #ifndef NOTIFYICONDATAA_V1_SIZE
+ #define NOTIFYICONDATAA_V1_SIZE CDSIZEOF_STRUCT(NOTIFYICONDATAA, szTip[64])
+ #endif
+ #ifndef NOTIFYICONDATA_V1_SIZE
+ #define NOTIFYICONDATA_V1_SIZE CDSIZEOF_STRUCT(NOTIFYICONDATA, szTip[64])
+ #endif
+ #ifndef OPENFILENAMEW_SIZE_VERSION_400
+ #define OPENFILENAMEW_SIZE_VERSION_400 CDSIZEOF_STRUCT(OPENFILENAMEW,lpTemplateName)
+ #endif
+ #ifndef NOTIFYICONDATAW_V1_SIZE
+ #define NOTIFYICONDATAW_V1_SIZE CDSIZEOF_STRUCT(NOTIFYICONDATAW, szTip[64])
+ #endif
+ #ifndef TV_KEYDOWN
+ typedef struct tagNMKEY {
+ NMHDR hdr;
+ UINT nVKey;
+ UINT uFlags;
+ } NMKEY, *LPNMKEY;
+ typedef struct tagTVKEYDOWN
+ {
+ NMHDR hdr;
+ WORD wVKey;
+ UINT flags;
+ } NMTVKEYDOWN, *LPNMTVKEYDOWN;
+ #define TV_KEYDOWN NMTVKEYDOWN
+ #endif
+ #define ODS_HOTLIGHT 0x0040
+ #define ODS_INACTIVE 0x0080
+ #define OLERENDER_FORMAT 2
+ #define SES_EXTENDBACKCOLOR 4
+ #define SPI_GETFLATMENU 0x1022
+ #define COLOR_HOTLIGHT 26
+ #define COLOR_MENUBAR 30
+ #define COLOR_MENUHILIGHT 29
+ #define COLOR_HIGHLIGHT 13
+ #define BP_PUSHBUTTON 1 // Push Button Type
+ #define PBS_NORMAL 1
+ #define PBS_HOT 2
+ #define PBS_PRESSED 3
+ #define PBS_DISABLED 4
+ #define PBS_DEFAULTED 5
+ #define BP_CHECKBOX 3 // CheckBox Type
+ #define TP_BUTTON 1
+ #define TS_NORMAL 1
+ #define TS_HOT 2
+ #define TS_PRESSED 3
+ #define TS_DISABLED 4
+ #define TS_CHECKED 5
+ #define TS_HOTCHECKED 6
+ #ifndef TTM_SETTITLE
+ #ifndef UNICODE
+ #define TTM_SETTITLE TTM_SETTITLEA
+ #else
+ #define TTM_SETTITLE TTM_SETTITLEW
+ #endif
+ #endif
+ #define CBS_UNCHECKEDNORMAL 1
+ #define CBS_UNCHECKEDHOT 2
+ #define CBS_CHECKEDNORMAL 5
+ #define CBS_CHECKEDHOT 6
+ #define CFM_WEIGHT 0x00400000
+ #define CFM_UNDERLINETYPE 0x00800000
+ #define CFM_BACKCOLOR 0x04000000
+ #define CFU_UNDERLINE 1
+ #define CFU_UNDERLINEWORD 2
+ #define EP_EDITTEXT 1 // Edit
+ #define EP_CARET 2
+ #define ETS_NORMAL 1
+ #define ETS_HOT 2
+ #define ETS_SELECTED 3
+ #define ETS_DISABLED 4
+ #define ETS_FOCUSED 5
+ #define ETS_READONLY 6
+ #define ETS_ASSIST 7
+ #ifndef PBT_APMRESUMESUSPEND
+ #define PBT_APMSUSPEND 0x0004
+ #define PBT_APMRESUMESUSPEND 0x0007
+ #endif
+ #define AW_HOR_POSITIVE 0x00000001
+ #define AW_VER_NEGATIVE 0x00000008
+ #define AW_HIDE 0x00010000
+ #define AW_ACTIVATE 0x00020000
+ #define AW_SLIDE 0x00040000
+ #define AW_BLEND 0x00080000
+ #define WM_UNICHAR 0x0109
+ #define LVS_EX_DOUBLEBUFFER 0x00010000
+ #define RES_ICON 1
+ #ifndef DFCS_HOT
+ #define DFCS_HOT 0x1000
+ #endif
+ #define IP_TTL 7
+ #ifndef IP_MULTICAST_IF
+ #define IP_MULTICAST_IF 32
+ #endif
+ #define IMF_AUTOKEYBOARD 0x0001
+ #define IMF_AUTOFONTSIZEADJUST 0x0010
+ #define GRADIENT_FILL_RECT_H 0x00
+ #define GRADIENT_FILL_RECT_V 0x01
+ #define LANG_INVARIANT 0x7f
+ #define LOCALE_INVARIANT (MAKELCID(MAKELANGID(LANG_INVARIANT, SUBLANG_NEUTRAL), SORT_DEFAULT))
+ #define EN_ALIGN_RTL_EC 0x0701
+ #ifndef OBJID_MENU
+ #define OBJID_MENU ((LONG)0xFFFFFFFD)
+ #endif
+ #ifndef OBJID_VSCROLL
+ #define OBJID_VSCROLL ((LONG)0xFFFFFFFB)
+ #endif
+ #define TreeView_SetCheckState(hwndTV, hti, fCheck) \
+ TreeView_SetItemState(hwndTV, hti, INDEXTOSTATEIMAGEMASK((fCheck)?2:1), TVIS_STATEIMAGEMASK)
+ #define TreeView_GetCheckState(hwndTV, hti) \
+ ((((UINT)(SNDMSG((hwndTV), TVM_GETITEMSTATE, (WPARAM)(hti), TVIS_STATEIMAGEMASK))) >> 12) -1)
+ #define ERROR_INTERNET_SEC_CERT_NO_REV 12056
+ #define ERROR_INTERNET_SEC_CERT_REV_FAILED 12057
+ #define APPCOMMAND_BROWSER_BACKWARD 1
+ #define APPCOMMAND_BROWSER_FORWARD 2
+ #define NIN_BALLOONHIDE (WM_USER +3)
+ #define NIN_BALLOONTIMEOUT (WM_USER + 4)
+ #define NIN_BALLOONUSERCLICK (WM_USER + 5)
+// SDK isn't present or some older VC compiler was used, include missing things.
+#elif !defined(NOWIN2K) && (!defined WS_EX_LAYERED || !defined IDC_HAND)
+
+ #pragma message("win2k.h")
+
+ #define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
+
+ #define PSDK_WORKAROUND
+
+ #define MONITOR_DEFAULTTONEAREST 2
+
+ #ifndef EM_SETTEXTEX
+ #define EM_SETTEXTEX (WM_USER + 97)
+ #define ST_DEFAULT 0
+ #define ST_KEEPUNDO 1
+ #define ST_SELECTION 2
+ #define ST_NEWCHARS 4
+ typedef struct _settextex
+ {
+ DWORD flags;
+ UINT codepage;
+ } SETTEXTEX;
+ #endif
+
+ #if(_WIN32_WINNT >= 0x0500)
+ #define WS_EX_LAYERED 0x00080000
+ #define MIIM_STRING 0x00000040
+ #define MIIM_BITMAP 0x00000080
+ #define MIIM_FTYPE 0x00000100
+ #define HBMMENU_CALLBACK ((HBITMAP) -1)
+ #define ODS_HOTLIGHT 0x0040
+ #define ODS_INACTIVE 0x0080
+ #define IDC_HAND MAKEINTRESOURCE(32649)
+ #define COLOR_HOTLIGHT 26
+ #define COLOR_MENUBAR 30
+ #define COLOR_MENUHILIGHT 29
+ #define COLOR_HIGHLIGHT 13
+ #define SPI_GETFLATMENU 0x1022
+ #define TVS_NOHSCROLL 0x8000
+ #define SPI_GETLISTBOXSMOOTHSCROLLING 0x1006
+ #define SPI_GETHOTTRACKING 0x100E
+ #define BIF_NEWDIALOGSTYLE 0x0040
+ #define LVS_EX_LABELTIP 0x00004000
+ #define LVS_EX_DOUBLEBUFFER 0x00010000
+ #define DFCS_HOT 0x1000
+ #define FLASHW_TRAY 0x00000002;
+ typedef struct {
+ UINT cbSize;
+ HWND hwnd;
+ DWORD dwFlags;
+ UINT uCount;
+ DWORD dwTimeout;
+ } FLASHWINFO;
+ /* for the help plugin without the SDK */
+ #define SM_XVIRTUALSCREEN 76
+ #define SM_YVIRTUALSCREEN 77
+ #define SM_CXVIRTUALSCREEN 78
+ #define SM_CYVIRTUALSCREEN 79
+ #define COLOR_HOTLIGHT 26
+ #define VK_OEM_PLUS 0xBB
+ #define VK_OEM_MINUS 0xBD
+
+ /* the structure only needs to be defined for VC5 or lower */
+ #if _MSC_VER < 1200
+ typedef struct tagLASTINPUTINFO {
+ UINT cbSize;
+ DWORD dwTime;
+ } LASTINPUTINFO, *PLASTINPUTINFO;
+ #endif /* #if _MSC_VER < 1200 */
+
+ #ifndef OPENFILENAME_SIZE_VERSION_400
+ #define OPENFILENAME_SIZE_VERSION_400 sizeof(OPENFILENAME)
+ #endif
+
+ #ifndef CCM_SETVERSION
+ #define CCM_SETVERSION (CCM_FIRST + 0x7)
+ #endif
+
+ #define SYSRGN 4
+ WINGDIAPI int WINAPI GetRandomRgn(IN HDC, IN HRGN, IN INT);
+
+ #endif /* _WIN32_WINNT >= 0x0500 */
+
+ #define LWA_ALPHA 0x00000002
+ #define AW_HIDE 0x00010000
+ #define AW_BLEND 0x00080000
+ #define SPI_GETSCREENSAVERRUNNING 114
+ #define SM_CMONITORS 80
+
+ #ifndef AW_ACTIVATE
+ #define AW_ACTIVATE 0x00020000
+ #define AW_SLIDE 0x00040000
+ #define AW_VER_NEGATIVE 0x00000008
+ #define AW_HOR_POSITIVE 0x00000001
+ #endif
+
+ #ifndef DWORD_PTR
+ typedef DWORD DWORD_PTR;
+ #endif
+
+ #ifndef HMONITOR
+ DECLARE_HANDLE(HMONITOR);
+ typedef struct tagMONITORINFO
+ {
+ DWORD cbSize;
+ RECT rcMonitor;
+ RECT rcWork;
+ DWORD dwFlags;
+ } MONITORINFO, *LPMONITORINFO;
+ #endif
+
+
+ #ifndef IDropTargetHelper
+ DEFINE_GUID(CLSID_DragDropHelper, 0x4657278a, 0x411b, 0x11d2, 0x83, 0x9a, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0xd0);
+ #define INTERFACE IDropTargetHelper
+ DECLARE_INTERFACE_( IDropTargetHelper, IUnknown )
+ {
+ // IUnknown methods
+ STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
+ STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
+ STDMETHOD_(ULONG, Release) ( THIS ) PURE;
+
+ // IDropTargetHelper
+ STDMETHOD (DragEnter)(THIS_ HWND hwndTarget, IDataObject* pDataObject,
+ POINT* ppt, DWORD dwEffect) PURE;
+ STDMETHOD (DragLeave)(THIS) PURE;
+ STDMETHOD (DragOver)(THIS_ POINT* ppt, DWORD dwEffect) PURE;
+ STDMETHOD (Drop)(THIS_ IDataObject* pDataObject, POINT* ppt,
+ DWORD dwEffect) PURE;
+ STDMETHOD (Show)(THIS_ BOOL fShow) PURE;
+
+ };
+ #endif /* IDropTargetHelper */
+
+ #define WM_MENURBUTTONUP 0x0122
+
+// tabsrmm uses these
+
+#define SES_EXTENDBACKCOLOR 4
+#define EM_SETEDITSTYLE (WM_USER + 204)
+#define EM_SETSCROLLPOS (WM_USER + 222)
+#define SF_USECODEPAGE 0x00000020
+
+#define TreeView_SetItemState(hwndTV, hti, data, _mask) \
+{ TVITEM _TVi; \
+ _TVi.mask = TVIF_STATE; \
+ _TVi.hItem = hti; \
+ _TVi.stateMask = _mask; \
+ _TVi.state = data; \
+ SendMessage((hwndTV), TVM_SETITEM, 0, (LPARAM)(TV_ITEM *)&_TVi); \
+}
+
+#endif /* SDK check */
+
+#ifndef BPPF_ERASE
+ typedef enum _BP_BUFFERFORMAT
+ {
+ BPBF_COMPATIBLEBITMAP, // Compatible bitmap
+ BPBF_DIB, // Device-independent bitmap
+ BPBF_TOPDOWNDIB, // Top-down device-independent bitmap
+ BPBF_TOPDOWNMONODIB // Top-down monochrome device-independent bitmap
+ } BP_BUFFERFORMAT;
+
+
+ typedef struct _BP_PAINTPARAMS
+ {
+ DWORD cbSize;
+ DWORD dwFlags; // BPPF_ flags
+ const RECT * prcExclude;
+ const BLENDFUNCTION * pBlendFunction;
+ } BP_PAINTPARAMS, *PBP_PAINTPARAMS;
+
+ #define BPPF_ERASE 1
+ #define BPPF_NOCLIP 2
+ #define BPPF_NONCLIENT 4
+#endif
+
+
+ /* windows seven taskbar interface comes with sdk v7.0
+ if not existent define on our own */
+#ifdef _SHLOBJ_H_
+ #ifndef __ITaskbarList3_INTERFACE_DEFINED__
+ #define __ITaskbarList3_INTERFACE_DEFINED__
+ /* interface ITaskbarList3 */
+
+ typedef
+ enum TBPFLAG
+ {
+ TBPF_NOPROGRESS = 0,
+ TBPF_INDETERMINATE = 0x1,
+ TBPF_NORMAL = 0x2,
+ TBPF_ERROR = 0x4,
+ TBPF_PAUSED = 0x8
+ } TBPFLAG;
+
+ typedef struct THUMBBUTTON *LPTHUMBBUTTON;
+
+ static const GUID IID_ITaskbarList3 = { 0xea1afb91, 0x9e28, 0x4b86, { 0x90, 0xE9, 0x9e, 0x9f, 0x8a, 0x5e, 0xef, 0xaf } };
+
+ #ifdef INTERFACE
+ #undef INTERFACE
+ #endif
+ #define INTERFACE ITaskbarList3
+ DECLARE_INTERFACE_( ITaskbarList3, ITaskbarList2 )
+ {
+ // IUnknown methods
+ STDMETHOD (QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
+ STDMETHOD_(ULONG, AddRef) (THIS ) PURE;
+ STDMETHOD_(ULONG, Release) (THIS ) PURE;
+
+ // overloaded ITaskbarList2 members
+ STDMETHOD (HrInit) (THIS ) PURE;
+ STDMETHOD (AddTab) (THIS_ HWND hwnd) PURE;
+ STDMETHOD (DeleteTab) (THIS_ HWND hwnd) PURE;
+ STDMETHOD (ActivateTab) (THIS_ HWND hwnd) PURE;
+ STDMETHOD (SetActiveAlt) (THIS_ HWND hwnd) PURE;
+ STDMETHOD (MarkFullscreenWindow) (THIS_ HWND hwnd, int fFullscreen) PURE;
+
+ // ITaskbarList3 members
+ STDMETHOD (SetProgressValue) (THIS_ HWND hwnd, ULONGLONG ullCompleted, ULONGLONG ullTotal) PURE;
+ STDMETHOD (SetProgressState) (THIS_ HWND hwnd, TBPFLAG tbpFlags) PURE;
+ STDMETHOD (RegisterTab) (THIS_ HWND hwndTab,HWND hwndMDI) PURE;
+ STDMETHOD (UnregisterTab) (THIS_ HWND hwndTab) PURE;
+ STDMETHOD (SetTabOrder) (THIS_ HWND hwndTab, HWND hwndInsertBefore) PURE;
+ STDMETHOD (SetTabActive) (THIS_ HWND hwndTab, HWND hwndMDI, DWORD dwReserved) PURE;
+ STDMETHOD (ThumbBarAddButtons) (THIS_ HWND hwnd, UINT cButtons, LPTHUMBBUTTON pButton) PURE;
+ STDMETHOD (ThumbBarUpdateButtons)(THIS_ HWND hwnd, UINT cButtons, LPTHUMBBUTTON pButton) PURE;
+ STDMETHOD (ThumbBarSetImageList) (THIS_ HWND hwnd, HIMAGELIST himl) PURE;
+ STDMETHOD (SetOverlayIcon) (THIS_ HWND hwnd, HICON hIcon, LPCWSTR pszDescription) PURE;
+ STDMETHOD (SetThumbnailTooltip) (THIS_ HWND hwnd, LPCWSTR pszTip) PURE;
+ STDMETHOD (SetThumbnailClip) (THIS_ HWND hwnd, RECT *prcClip) PURE;
+ };
+
+ #endif /* __ITaskbarList3_INTERFACE_DEFINED__ */
+#endif /* _SHLOBJ_H_ */
+
+#endif // WIN2K_H__
|