summaryrefslogtreecommitdiff
path: root/plugins/modernb/m_api
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-05-15 10:38:20 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-05-15 10:38:20 +0000
commit48540940b6c28bb4378abfeb500ec45a625b37b6 (patch)
tree2ef294c0763e802f91d868bdef4229b6868527de /plugins/modernb/m_api
parent5c350913f011e119127baeb32a6aedeb4f0d33bc (diff)
initial commit
git-svn-id: http://svn.miranda-ng.org/main/trunk@2 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/modernb/m_api')
-rw-r--r--plugins/modernb/m_api/m_metacontacts.h162
-rw-r--r--plugins/modernb/m_api/m_skin_eng.h434
-rw-r--r--plugins/modernb/m_api/m_skinbutton.h30
-rw-r--r--plugins/modernb/m_api/m_skinned_profile.h44
-rw-r--r--plugins/modernb/m_api/m_smileyadd.h252
-rw-r--r--plugins/modernb/m_api/m_toolbar.h88
-rw-r--r--plugins/modernb/m_api/m_variables.h256
-rw-r--r--plugins/modernb/m_api/m_xpTheme.h35
8 files changed, 1301 insertions, 0 deletions
diff --git a/plugins/modernb/m_api/m_metacontacts.h b/plugins/modernb/m_api/m_metacontacts.h
new file mode 100644
index 0000000000..1da12b97fa
--- /dev/null
+++ b/plugins/modernb/m_api/m_metacontacts.h
@@ -0,0 +1,162 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright © 2004 Universite Louis PASTEUR, STRASBOURG.
+Copyright © 2004 Scott Ellis (www.scottellis.com.au mail@scottellis.com.au)
+
+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_METACONTACTS_H__
+#define M_METACONTACTS_H__ 1
+
+//get the handle for a contact's parent metacontact
+//wParam=(HANDLE)hSubContact
+//lParam=0
+//returns a handle to the parent metacontact, or null if this contact is not a subcontact
+#define MS_MC_GETMETACONTACT "MetaContacts/GetMeta"
+
+//gets the handle for the default contact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a handle to the default contact, or null on failure
+#define MS_MC_GETDEFAULTCONTACT "MetaContacts/GetDefault"
+
+//gets the contact number for the default contact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a DWORD contact number, or -1 on failure
+#define MS_MC_GETDEFAULTCONTACTNUM "MetaContacts/GetDefaultNum"
+
+//gets the handle for the 'most online' contact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a handle to the 'most online' contact
+#define MS_MC_GETMOSTONLINECONTACT "MetaContacts/GetMostOnline"
+
+//gets the number of subcontacts for a metacontact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a DWORD representing the number of subcontacts for the given metacontact
+#define MS_MC_GETNUMCONTACTS "MetaContacts/GetNumContacts"
+
+//gets the handle of a subcontact, using the subcontact's number
+//wParam=(HANDLE)hMetaContact
+//lParam=(DWORD)contact number
+//returns a handle to the specified subcontact
+#define MS_MC_GETSUBCONTACT "MetaContacts/GetSubContact"
+
+//sets the default contact, using the subcontact's contact number
+//wParam=(HANDLE)hMetaContact
+//lParam=(DWORD)contact number
+//returns 0 on success
+#define MS_MC_SETDEFAULTCONTACTNUM "MetaContacts/SetDefault"
+
+//sets the default contact, using the subcontact's handle
+//wParam=(HANDLE)hMetaContact
+//lParam=(HANDLE)hSubcontact
+//returns 0 on success
+#define MS_MC_SETDEFAULTCONTACT "MetaContacts/SetDefaultByHandle"
+
+//forces the metacontact to send using a specific subcontact, using the subcontact's contact number
+//wParam=(HANDLE)hMetaContact
+//lParam=(DWORD)contact number
+//returns 0 on success
+#define MS_MC_FORCESENDCONTACTNUM "MetaContacts/ForceSendContact"
+
+//forces the metacontact to send using a specific subcontact, using the subcontact's handle
+//wParam=(HANDLE)hMetaContact
+//lParam=(HANDLE)hSubcontact
+//returns 0 on success (will fail if 'force default' is in effect)
+#define MS_MC_FORCESENDCONTACT "MetaContacts/ForceSendContactByHandle"
+
+//'unforces' the metacontact to send using a specific subcontact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns 0 on success (will fail if 'force default' is in effect)
+#define MS_MC_UNFORCESENDCONTACT "MetaContacts/UnforceSendContact"
+
+//'forces' or 'unforces' (i.e. toggles) the metacontact to send using it's default contact
+// overrides (and clears) 'force send' above, and will even force use of offline contacts
+// will send ME_MC_FORCESEND or ME_MC_UNFORCESEND event
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns 1(true) or 0(false) representing new state of 'force default'
+#define MS_MC_FORCEDEFAULT "MetaContacts/ForceSendDefault"
+
+// method to get state of 'force' for a metacontact
+// wParam=(HANDLE)hMetaContact
+// lParam= (DWORD)&contact_number or NULL
+//
+// if lparam supplied, the contact_number of the contatct 'in force' will be copied to the address it points to,
+// or if none is in force, the value (DWORD)-1 will be copied
+// (v0.8.0.8+ returns 1 if 'force default' is true with *lParam == default contact number, else returns 0 with *lParam as above)
+#define MS_MC_GETFORCESTATE "MetaContacts/GetForceState"
+
+// fired when a metacontact's default contact changes (fired upon creation of metacontact also, when default is initially set)
+// wParam=(HANDLE)hMetaContact
+// lParam=(HANDLE)hDefaultContact
+#define ME_MC_DEFAULTTCHANGED "MetaContacts/DefaultChanged"
+
+// fired when a metacontact's subcontacts change (fired upon creation of metacontact, when contacts are added or removed, and when
+// contacts are reordered) - a signal to re-read metacontact data
+// wParam=(HANDLE)hMetaContact
+// lParam=0
+#define ME_MC_SUBCONTACTSCHANGED "MetaContacts/SubcontactsChanged"
+
+// fired when a metacontact is forced to send using a specific subcontact
+// wParam=(HANDLE)hMetaContact
+// lParam=(HANDLE)hForceContact
+#define ME_MC_FORCESEND "MetaContacts/ForceSend"
+
+// fired when a metacontact is 'unforced' to send using a specific subcontact
+// wParam=(HANDLE)hMetaContact
+// lParam=0
+#define ME_MC_UNFORCESEND "MetaContacts/UnforceSend"
+
+// method to get protocol name - used to be sure you're dealing with a "real" metacontacts plugin :)
+// wParam=lParam=0
+#define MS_MC_GETPROTOCOLNAME "MetaContacts/GetProtoName"
+
+
+// added 0.9.5.0 (22/3/05)
+// wParam=(HANDLE)hContact
+// lParam=0
+// convert a given contact into a metacontact
+#define MS_MC_CONVERTTOMETA "MetaContacts/ConvertToMetacontact"
+
+// added 0.9.5.0 (22/3/05)
+// wParam=(HANDLE)hContact
+// lParam=(HANDLE)hMeta
+// add an existing contact to a metacontact
+#define MS_MC_ADDTOMETA "MetaContacts/AddToMetacontact"
+
+// added 0.9.5.0 (22/3/05)
+// wParam=0
+// lParam=(HANDLE)hContact
+// remove a contact from a metacontact
+#define MS_MC_REMOVEFROMMETA "MetaContacts/RemoveFromMetacontact"
+
+
+// added 0.9.13.2 (6/10/05)
+// wParam=(BOOL)disable
+// lParam=0
+// enable/disable the 'hidden group hack' - for clists that support subcontact hiding using 'IsSubcontact' setting
+// should be called once in the clist 'onmodulesloaded' event handler (which, since it's loaded after the db, will be called
+// before the metacontact onmodulesloaded handler where the subcontact hiding is usually done)
+#define MS_MC_DISABLEHIDDENGROUP "MetaContacts/DisableHiddenGroup"
+
+#endif
diff --git a/plugins/modernb/m_api/m_skin_eng.h b/plugins/modernb/m_api/m_skin_eng.h
new file mode 100644
index 0000000000..78de34e2bb
--- /dev/null
+++ b/plugins/modernb/m_api/m_skin_eng.h
@@ -0,0 +1,434 @@
+/*
+
+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_ske_H_INC
+#define M_ske_H_INC
+
+#include "newpluginapi.h"
+#include "m_clui.h"
+#include "../hdr/modern_commonheaders.h"
+
+
+/*defaults*/
+#define DEFAULT_FIT_MODE FM_STRETCH
+#define DEFAULT_STYLE ST_BRUSH
+#define DEFAULT_BKCOLOUR GetSysColor(COLOR_3DFACE)
+#define DEFAULT_SELBKCOLOUR GetSysColor(COLOR_HIGHLIGHT)
+#define SIZING_MARGIN 3
+
+/* Fit mode */
+#define FM_STRETCH 0
+#define FM_TILE_HORZ 1
+#define FM_TILE_VERT 2
+#define FM_TILE_BOTH 3
+
+/*Object types*/
+#define OT_ANY 0
+#define OT_GLYPHOBJECT 1
+#define OT_FONTOBJECT 2
+
+/*STYLE INDEXEX*/
+#define ST_SKIP 0
+#define ST_PARENT 1
+#define ST_BRUSH 2
+#define ST_IMAGE 3
+#define ST_SOLARIZE 4 //Not used yet.
+#define ST_FRAGMENT 5
+#define ST_GRADIENT 6
+
+//formats:
+#define ADT_TOP 0x00000000
+#define ADT_LEFT 0x00000000
+#define ADT_HCENTER 0x00000001
+#define ADT_RIGHT 0x00000002
+#define ADT_VCENTER 0x00000004
+#define ADT_BOTTOM 0x00000008
+//#define ADT_ECLIPSE 64
+
+
+/*SERVICES*/
+
+//toggle the 'hide offline contacts' flag and call CLUI
+//wParam=0
+//lParam=0
+#define MS_CLIST_TOGGLEHIDEOFFLINE "CList/ToggleHideOffline"
+
+#define MS_CLIST_TOGGLEGROUPS "CList/ToggleGroups"
+
+#define MS_CLIST_TOGGLESOUNDS "CList/ToggleSounds"
+
+// Add new object to skin object list.
+// wParam = pointer to SKINOBJECTDESCRIPTOR structure
+// lParam = 0 ( used for internal purposes: pointer to skin object list)
+#define MS_SKIN_REGISTEROBJECT "ModernList/RegisterObject"
+
+// Add new object to skin object list.
+// wParam = pointer to DEF_SKIN_OBJECT_PARAMS structure
+// lParam = 0 ( used for internal purposes: pointer to skin object list)
+#define MS_SKIN_REGISTERDEFOBJECT "ModernList/RegisterDefObject"
+
+typedef struct s_DEF_SKIN_OBJECT_PARAMS
+{
+ char * szObjectID;
+ BYTE defStyle;
+ DWORD defColor;
+ // SKINOBJECTSLIST * Skin;
+} DEF_SKIN_OBJECT_PARAMS;
+
+
+// Request painting glyph object
+// wParam = pointer to SKINDRAWREQUEST structure
+// lParam = 0
+#define MS_SKIN_DRAWGLYPH "ModernList/DrawGlyph"
+
+
+
+/* EVENTS */
+#define ME_SKIN_SERVICESCREATED "ModernList/ServicesCreated"
+
+/* DRAWGLYPH Request structure */
+typedef struct s_SKINDRAWREQUEST
+{
+ char szObjectID[255]; // Unic Object ID (path) to paint
+ RECT rcDestRect; // Rectangle to fit
+ RECT rcClipRect; // Rectangle to paint in.
+ HDC hDC; // Handler to device context to paint in.
+} SKINDRAWREQUEST,*LPSKINDRAWREQUEST;
+
+/* SKINOBJECTDESCRIPTOR opbject descriptor structure */
+typedef struct tagSKINOBJECTDESCRIPTOR
+{
+ BYTE bType; // One of OT_* values.
+ char* szObjectID; // Unic Object ID (path) [255] max
+ LPVOID Data; // Pointer to GLYPHOBJECT strycture if bType==OT_GLYPHOBJECT
+} SKINOBJECTDESCRIPTOR, *LPSKINOBJECTDESCRIPTOR;
+
+/* SKINOBJECTDESCRIPTOR opbject descriptor structure */
+typedef struct s_GLYPHOBJECT
+{
+ BYTE Style; // One of ST_* values
+ HBITMAP hGlyph; // Bitmap handler (for internal use only)
+ DWORD dwTop, dwLeft, dwBottom, dwRight; // Margins
+ char* szFileName; // FileName of image
+ DWORD dwColor; // Fill color
+ BYTE dwAlpha; // Constant alpha-transparency level
+ BYTE FitMode; // One of FM_* values
+ POINT clipArea; // Object image rect on full image
+ SIZE szclipArea; // Object image rect on full image
+ SortedList * plTextList; // List of GLYPHTEXT
+ LONG bmWidth;
+ LONG bmHeight;
+ BYTE bmBitsPixel;
+} GLYPHOBJECT,*LPGLYPHOBJECT;
+
+/* SKINTEXTDESCRIPTOR opbject descriptor structure */
+typedef struct s_GLYPHTEXT
+{
+ char * szGlyphTextID;
+ TCHAR * stText;
+ TCHAR * stValueText;
+ DWORD dwFlags;
+ DWORD dwColor; // Color (InvAA)(RR)(GG)(BB)
+ DWORD dwShadow; //ToDo: Color2/Shaddow
+ int iLeft,iTop,iRight,iBottom;
+ BYTE RelativeFlags;
+ char * szFontID;
+ HFONT hFont;
+ char * szObjectName;
+}GLYPHTEXT,*LPGLYPHTEXT;
+
+/* SKINTEXTDESCRIPTOR opbject descriptor structure */
+typedef struct s_SKINFONT
+{
+ char * szFontID;
+ HFONT hFont;
+}SKINFONT, *LPSKINFONT;
+
+/* HELPER FUNCTIONS */
+
+//Paint ObjectID as parent background for frame hwndIn
+int __inline SkinDrawWindowBack(HWND hwndIn, HDC hdc, RECT * rcClip, char * objectID);
+//Paint ObjectID
+int __inline SkinDrawGlyph(HDC hdc, RECT * rcSize, RECT * rcClip, char * objectID);
+//Register object with predefined style
+int __inline CreateGlyphedObjectDefStyle(char * ObjID,BYTE defStyle);
+int __inline CreateGlyphedObjectDefColor(char * ObjID,DWORD defColor);
+//Register default object
+int __inline CreateGlyphedObject(char * ObjID);
+
+
+
+//// Creating and registering objects
+//int __inline CreateGlyphedObject(char * ObjID)
+//{
+// DEF_SKIN_OBJECT_PARAMS prm={0};
+// prm.defColor=DEFAULT_BKCOLOUR;
+// prm.defStyle=DEFAULT_STYLE;
+// prm.szObjectID=ObjID;
+// return CallService(MS_SKIN_REGISTERDEFOBJECT,(WPARAM)&prm,0);
+//}
+static BOOL __inline ScreenToClientRect(HWND hWnd, LPRECT lpRect)
+{
+ BOOL ret;
+
+ POINT pt;
+
+ pt.x = lpRect->left;
+ pt.y = lpRect->top;
+
+ ret = ScreenToClient(hWnd, &pt);
+
+ if (!ret) return ret;
+
+ lpRect->left = pt.x;
+ lpRect->top = pt.y;
+
+
+ pt.x = lpRect->right;
+ pt.y = lpRect->bottom;
+
+ ret = ScreenToClient(hWnd, &pt);
+
+ lpRect->right = pt.x;
+ lpRect->bottom = pt.y;
+
+ return ret;
+}
+
+//int __inline CreateGlyphedObjectDefStyle(char * ObjID,BYTE defStyle)
+//{
+// DEF_SKIN_OBJECT_PARAMS prm={0};
+// prm.defColor=DEFAULT_BKCOLOUR;
+// prm.defStyle=defStyle;
+// prm.szObjectID=ObjID;
+// return CallService(MS_SKIN_REGISTERDEFOBJECT,(WPARAM)&prm,0);
+//}
+//int __inline CreateGlyphedObjectDefColor(char * ObjID,DWORD defColor)
+//{
+// DEF_SKIN_OBJECT_PARAMS prm={0};
+// prm.defColor=defColor;
+// prm.defStyle=ST_BRUSH;
+// prm.szObjectID=ObjID;
+// return CallService(MS_SKIN_REGISTERDEFOBJECT,(WPARAM)&prm,0);
+//}
+INT_PTR ske_Service_DrawGlyph(WPARAM wParam,LPARAM lParam);
+int __inline SkinDrawGlyph(HDC hdc, RECT * rcSize, RECT * rcClip, char * objectID)
+{
+ SKINDRAWREQUEST rq;
+ if (!objectID) return 0;
+ rq.hDC=hdc;
+ rq.rcDestRect=*rcSize;
+ rq.rcClipRect=*rcClip;
+ strncpy(rq.szObjectID,objectID,SIZEOF(rq.szObjectID));
+ return ske_Service_DrawGlyph((WPARAM)&rq,0);
+ //return CallService(MS_SKIN_DRAWGLYPH,(WPARAM)&rq,0);
+}
+//#include "../hdr/modern_skin_selector.h"
+
+//////////////////////////////////////////////
+// //
+// New Painting sequence servises //
+// //
+//////////////////////////////////////////////
+
+typedef struct sPAINT_REQUEST
+{
+ DWORD dStructSize; //size of structure
+ HWND hWnd; //called by window
+ HDC hDC; //context to draw on
+ RECT rcUpdate; //rectangle to be painted in (relative to Top-Left corner of Main window)
+ DWORD dwFlags; //drawing flags
+ void * CallbackData; //Data for passing to callback procedure
+ char Reserved[16]; //reserved for farther usage;
+} sPaintRequest;
+
+// Request to register sub for callback painting frame area
+// wParam = hWnd of called frame
+// lParam = pointer to tPaintCallBackProc (or NULL to remove)
+// return 1 - succes, 0 - failure
+#define MS_SKINENG_REGISTERPAINTSUB "SkinEngine/ske_Service_RegisterFramePaintCallbackProcedure"
+
+// Request to repaint frame or change/drop callback data immeadeately
+// wParam = hWnd of called frame
+// lParam = pointer to sPaintRequest (or NULL to redraw all)
+#define MS_SKINENG_UPTATEFRAMEIMAGE "SkinEngine/ske_Service_UpdateFrameImage"
+
+// Request to repaint frame or change/drop callback data
+// wParam = hWnd of called frame
+// lParam = pointer to sPaintRequest (or NULL to redraw all)
+// return 2 - already queued, data updated, 1-have been queued, 0 - failure
+#define MS_SKINENG_INVALIDATEFRAMEIMAGE "SkinEngine/ske_Service_InvalidateFrameImage"
+
+// Callback proc type
+typedef int (/*__stdcall*/ *tPaintCallbackProc)(HWND hWnd, HDC hDC, RECT * rcPaint, HRGN rgnUpdate, DWORD dFlags, void * CallBackData);
+//tPaintCallbackProc PaintCallbackProc;
+
+// HELPER TO UPDATEIMAGEFRAME
+
+int __inline SkinEngUpdateImageFrame(HWND hwnd, RECT * rcUpdate, DWORD dwFlags, void * CallBackData)
+{
+ sPaintRequest sr={0};
+ sr.dStructSize=sizeof(sPaintRequest);
+ sr.hWnd=hwnd;
+ if (rcUpdate)
+ sr.rcUpdate=*rcUpdate;
+ sr.dwFlags=dwFlags;
+ sr.CallbackData=CallBackData;
+ return CallService(MS_SKINENG_UPTATEFRAMEIMAGE,(WPARAM)hwnd,(LPARAM)&sr);
+}
+
+int __inline SkinEngInvalidateImageFrame(HWND hwnd, CONST RECT * rcUpdate, DWORD dwFlags, void * CallBackData)
+{
+ sPaintRequest sr={0};
+ if (hwnd && (!g_CluiData.fLayered)) return InvalidateRect(hwnd,rcUpdate,dwFlags);
+ sr.dStructSize=sizeof(sPaintRequest);
+ sr.hWnd=hwnd;
+ if (rcUpdate)
+ sr.rcUpdate=*rcUpdate;
+ sr.dwFlags=dwFlags;
+ sr.CallbackData=CallBackData;
+ return CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE,(WPARAM)hwnd,(LPARAM)&sr);
+}
+
+
+int __inline SkinInvalidateFrame(HWND hWnd, CONST RECT* lpRect)
+{
+ return SkinEngInvalidateImageFrame(hWnd,lpRect,0,0);
+}
+// Alpha channel GDI replacements/helpers
+
+//
+// Paints text with correct alpha channel
+// wParam - pointer to AlphaTextOutParams
+#define MS_SKINENG_ALPHATEXTOUT "SkinEngine/ske_AlphaTextOut"
+typedef struct _AlphaTextOutParams
+{
+ HDC hDC;
+ LPCTSTR lpString;
+ int nCount;
+ RECT * lpRect;
+ UINT format;
+ DWORD ARGBcolor;
+ char reserv[16];
+}AlphaTextOutParams;
+
+int __inline AlphaText(HDC hDC, LPCTSTR lpString, int nCount, RECT * lpRect, UINT format, DWORD ARGBcolor)
+{
+ AlphaTextOutParams ap={0};
+ ap.hDC=hDC;
+ ap.lpString=lpString;
+ ap.nCount=nCount;
+ ap.lpRect=lpRect;
+ ap.format=format;
+ ap.ARGBcolor=ARGBcolor;
+ return CallService(MS_SKINENG_ALPHATEXTOUT,(WPARAM)&ap,0);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Paints text with correct alpha channel and effect, alternative to DrawText
+// wParam - pointer to DrawTextWithEffectParam
+
+typedef struct MODERNFONTEFFECT_tag
+{
+ BYTE effectIndex;
+ DWORD baseColour; // ARGB
+ DWORD secondaryColour; // ARGB
+}
+MODERNFONTEFFECT;
+
+typedef struct DrawTextWithEffectParam_tag
+{
+ int cbSize;
+ HDC hdc; // handle to DC
+ LPCTSTR lpchText; // text to draw
+ int cchText; // length of text to draw
+ LPRECT lprc; // rectangle coordinates
+ UINT dwDTFormat; // formatting options
+ MODERNFONTEFFECT * pEffect; // effect to be drawn on
+} DrawTextWithEffectParam;
+
+#define MS_DRAW_TEXT_WITH_EFFECTA "Modern/SkinEngine/DrawTextWithEffectA"
+#define MS_DRAW_TEXT_WITH_EFFECTW "Modern/SkinEngine/DrawTextWithEffectW"
+
+#ifdef UNICODE
+ #define MS_DRAW_TEXT_WITH_EFFECT MS_DRAW_TEXT_WITH_EFFECTW
+#else
+ #define MS_DRAW_TEXT_WITH_EFFECT MS_DRAW_TEXT_WITH_EFFECTA
+#endif
+
+// Helper
+int __inline DrawTextWithEffect( HDC hdc, LPCTSTR lpchText, int cchText, RECT * lprc, UINT dwDTFormat, MODERNFONTEFFECT * pEffect )
+{
+ DrawTextWithEffectParam params;
+ static BYTE bIfServiceExists = ServiceExists( MS_DRAW_TEXT_WITH_EFFECT ) ? 1 : 0;
+ if ( bIfServiceExists == 0 ) return DrawText ( hdc, lpchText, cchText, lprc, dwDTFormat );
+
+ // else
+ params.cbSize = sizeof( DrawTextWithEffectParam );
+ params.hdc = hdc;
+ params.lpchText = lpchText;
+ params.cchText = cchText;
+ params.lprc = lprc;
+ params.dwDTFormat = dwDTFormat;
+ params.pEffect = pEffect;
+ return CallService( MS_DRAW_TEXT_WITH_EFFECT, (WPARAM)&params, 0 );
+}
+
+
+typedef struct _ImageListFixParam
+{
+ HIMAGELIST himl;
+ int index;
+ HICON hicon;
+}ImageListFixParam;
+
+typedef struct _DrawIconFixParam
+{
+ HDC hdc;
+ int xLeft;
+ int yTop;
+ HICON hIcon;
+ int cxWidth;
+ int cyWidth;
+ UINT istepIfAniCur;
+ HBRUSH hbrFlickerFreeDraw;
+ UINT diFlags;
+} DrawIconFixParam;
+//wParam - pointer to DrawIconFixParam
+#define MS_SKINENG_DRAWICONEXFIX "SkinEngine/DrawIconEx_Fix"
+
+int __inline mod_DrawIconEx_helper(HDC hdc,int xLeft,int yTop,HICON hIcon,int cxWidth,int cyWidth, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags)
+{
+ DrawIconFixParam p={0};
+ p.hdc=hdc;
+ p.xLeft=xLeft;
+ p.yTop=yTop;
+ p.hIcon=hIcon;
+ p.cxWidth=cxWidth;
+ p.cyWidth=cyWidth;
+ p.istepIfAniCur=istepIfAniCur;
+ p.hbrFlickerFreeDraw=hbrFlickerFreeDraw;
+ p.diFlags=diFlags;
+ return CallService(MS_SKINENG_DRAWICONEXFIX,(WPARAM)&p,0);
+}
+#endif
diff --git a/plugins/modernb/m_api/m_skinbutton.h b/plugins/modernb/m_api/m_skinbutton.h
new file mode 100644
index 0000000000..86634cb566
--- /dev/null
+++ b/plugins/modernb/m_api/m_skinbutton.h
@@ -0,0 +1,30 @@
+#include "m_button.h"
+
+#define BUTTONSETID WM_USER+55
+#define BUTTONDRAWINPARENT WM_USER+56
+#define BUTTONSETMARGINS WM_USER+57
+#define BUTTONSETSENDONDOWN WM_USER+58
+
+#define MBM_UPDATETRANSPARENTFLAG WM_USER+52
+#define MBM_SETICOLIBHANDLE WM_USER+53
+#define MBM_REFRESHICOLIBICON WM_USER+54
+
+#define SBF_ALIGN_TL_RIGHT 1
+#define SBF_ALIGN_TL_HCENTER 2
+#define SBF_ALIGN_TL_BOTTOM 4
+#define SBF_ALIGN_TL_VCENTER 8
+
+#define SBF_ALIGN_BR_RIGHT 16
+#define SBF_ALIGN_BR_HCENTER 32
+#define SBF_ALIGN_BR_BOTTOM 64
+#define SBF_ALIGN_BR_VCENTER 128
+
+#define SBF_CALL_ON_PRESS 256
+
+// Params for draw flag at Repos function
+#define SBRF_DO_NOT_DRAW 0
+#define SBRF_DO_REDRAW_ALL 1
+#define SBRF_DO_ALT_DRAW 2
+#define SBRF_REDRAW ( SBRF_DO_REDRAW_ALL|SBRF_DO_ALT_DRAW )
+
+#define BUTTONNEEDREDRAW 1256 \ No newline at end of file
diff --git a/plugins/modernb/m_api/m_skinned_profile.h b/plugins/modernb/m_api/m_skinned_profile.h
new file mode 100644
index 0000000000..0b0932bac6
--- /dev/null
+++ b/plugins/modernb/m_api/m_skinned_profile.h
@@ -0,0 +1,44 @@
+#ifdef m_skinned_profile_h__
+#define m_skinned_profile_h__
+
+#define MS_SKINPROFILE_GET_INTERFACE
+
+#ifdef _cplusplus
+extern "C" {
+#endif //_cplusplus
+
+struct SKIN_PROFILE_INTERFACE
+{
+ DWORD cbSize;
+
+ int (*pfnGetByte) ( HANDLE, const char *, const char *, int, const char *szFile, const int nLine);
+ int (*pfnGetWord) ( HANDLE, const char *, const char *, int, const char *szFile, const int nLine);
+ int (*pfnGetDword)( HANDLE, const char *, const char *, int, const char *szFile, const int nLine);
+
+};
+
+#ifdef SPI_DECLARE_INTERFACE_INIT
+#include <m_database.h>
+__forceinline int mir_getSPI( struct SKIN_PROFILE_INTERFACE * pspi)
+{
+ if ( !ServiceExists( MS_SKINPROFILE_GET_INTERFACE ) )
+ {
+ pspi->pfnGetByte = DBGetContactSettingByte_Helper;
+ pspi->pfnGetWord = DBGetContactSettingWord_Helper;
+ pspi->pfnGetDword = DBGetContactSettingDword_Helper;
+ return 0;
+ }
+ else
+ {
+ pspi->cbSize = sizeof( struct SKIN_PROFILE_INTERFACE );
+ return CallService( MS_SKINPROFILE_GET_INTERFACE, 0, (LPARAM) pspi );
+ }
+}
+#endif
+
+#ifdef _cplusplus
+};
+#endif //_cplusplus
+
+
+#endif // m_skinned_profile_h__ \ No newline at end of file
diff --git a/plugins/modernb/m_api/m_smileyadd.h b/plugins/modernb/m_api/m_smileyadd.h
new file mode 100644
index 0000000000..bae3890c7b
--- /dev/null
+++ b/plugins/modernb/m_api/m_smileyadd.h
@@ -0,0 +1,252 @@
+/*
+Miranda SmileyAdd Plugin
+Copyright (C) 2005 - 2009 Boris Krasnovskiy
+Copyright (C) 2003 - 2004 Rein-Peter de Boer
+
+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 version 2
+of the License.
+
+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, see <http://www.gnu.org/licenses/>.
+*/
+#include <richedit.h>
+
+#define SAFLRE_INSERTEMF 2 // insert smiley as EMF into RichEdit, otherwise bitmap inserted
+ // this flag allows "true" transparency
+#define SAFLRE_OUTGOING 4 // Parsing outgoing message
+#define SAFLRE_NOCUSTOM 8 // Do not use custom smileys
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ HWND hwndRichEditControl; //handle to the rich edit control
+ CHARRANGE* rangeToReplace; //same meaning as for normal Richedit use (NULL = replaceall)
+ const char* Protocolname; //protocol to use... if you have defined a protocol, u can
+ //use your own protocol name. SmileyAdd will automatically
+ //select the smileypack that is defined for your protocol.
+ //Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ //if you prefer those icons.
+ //If not found or NULL, "Standard" will be used
+ unsigned flags; //Flags (SAFLRE_*) that define the behaivior
+ BOOL disableRedraw; //Parameter have been depricated, have no effect on operation
+ HANDLE hContact; //Contact handle
+} SMADD_RICHEDIT3;
+
+//Replace smileys in a rich edit control...
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_RICHEDIT3*) &smre; //pointer to SMADD_RICHEDIT3
+//return: TRUE if API succeeded (all parameters were valid) , FALSE if not.
+#define MS_SMILEYADD_REPLACESMILEYS "SmileyAdd/ReplaceSmileys"
+
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ char* Protocolname; //protocol to use... if you have defined a protocol, you can
+ //use your own protocol name. Smiley add will automatically
+ //select the smileypack that is defined for your protocol.
+ //Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ //if you prefer those icons.
+ //If not found or NULL: "Standard" will be used
+ int xPosition; //Postition to place the selectwindow
+ int yPosition; // "
+ int Direction; //Direction (i.e. size upwards/downwards/etc) of the window 0, 1, 2, 3
+
+ HWND hwndTarget; //Window, where to send the message when smiley is selected.
+ UINT targetMessage; //Target message, to be sent.
+ LPARAM targetWParam; //Target WParam to be sent (LParam will be char* to select smiley)
+ //see the example file.
+ HWND hwndParent; //Parent window for smiley dialog
+ HANDLE hContact; //Contact handle
+} SMADD_SHOWSEL3;
+
+//Show smiley selection window
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_SHOWSEL3*) &smre; //pointer to SMADD_SHOWSEL3
+//return: TRUE if API succeeded (all parameters were valid) , FALSE if not.
+#define MS_SMILEYADD_SHOWSELECTION "SmileyAdd/ShowSmileySelection"
+
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ char* Protocolname; // " "
+ HICON ButtonIcon; //RETURN VALUE: this is filled with the icon handle
+ //of the smiley that can be used on the button
+ //if used with GETINFO2 handle must be destroyed by user!
+ //NULL if the buttonicon is not defined...
+ int NumberOfVisibleSmileys; //Number of visible smileys defined.
+ int NumberOfSmileys; //Number of total smileys defined
+ HANDLE hContact; //Contact handle
+} SMADD_INFO2;
+
+//get button smiley icon
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_INFO2*) &smgi; //pointer to SMADD_INFO2
+//return: TRUE if API succeeded (all parameters were valid) , FALSE if not.
+#define MS_SMILEYADD_GETINFO2 "SmileyAdd/GetInfo2"
+
+// Event notifies that SmileyAdd options have changed
+// Message dialogs usually need to redraw it's content on reception of this event
+//wParam = Contact handle which options have changed, NULL if global options changed
+//lParam = (LPARAM) 0; not used
+#define ME_SMILEYADD_OPTIONSCHANGED "SmileyAdd/OptionsChanged"
+
+#define SAFL_PATH 1 // provide smiley file path, icon otherwise
+#define SAFL_UNICODE 2 // string fields in OPTIONSDIALOGPAGE are WCHAR*
+#define SAFL_OUTGOING 4 // Parsing outgoing message
+#define SAFL_NOCUSTOM 8 // Do not use custom smileys
+
+#if defined _UNICODE || defined UNICODE
+ #define SAFL_TCHAR SAFL_UNICODE
+#else
+ #define SAFL_TCHAR 0
+#endif
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ const char* Protocolname; //protocol to use... if you have defined a protocol, u can
+ //use your own protocol name. Smiley add wil automatically
+ //select the smileypack that is defined for your protocol.
+ //Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ //if you prefer those icons.
+ //If not found or NULL: "Standard" will be used
+ union {
+ TCHAR* str; //String to parse
+ char* astr;
+ wchar_t* wstr;
+ };
+ unsigned flag; //One of the SAFL_ flags specifies parsing requirements
+ //This parameter should be filled by the user
+
+ unsigned numSmileys; //Number of Smileys found, this parameter filled by SmileyAdd
+ unsigned oflag; //One of the SAFL_ flags specifies content of the parse results
+ //this parameter filled by SmileyAdd
+ HANDLE hContact; //Contact handle
+} SMADD_BATCHPARSE2;
+
+typedef struct
+{
+ unsigned startChar; //Starting smiley character
+ //Because of iterative nature of the API caller should set this
+ //parameter to correct value
+ unsigned size; //Number of characters in smiley (0 if not found)
+ //Because of iterative nature of the API caller should set this
+ //parameter to correct value
+ union {
+ const TCHAR* filepath;
+ const char* afilepath;
+ const wchar_t* wfilepath;
+ HICON hIcon; //User responsible for destroying icon handle
+ };
+} SMADD_BATCHPARSERES;
+
+//find all smileys in text, API parses the provided text and returns all smileys found
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_BATCHPARSE2*) &smgp; //pointer to SMADD_BATCHPARSE2
+//function returns pointer to array SMADD_BATCHPARSERES records for each smiley found
+//if no smileys found NULL is returned
+//if non NULL value returned pointer must be freed with MS_SMILEYADD_BATCHFREE API
+#define MS_SMILEYADD_BATCHPARSE "SmileyAdd/BatchParse"
+
+//Free memory allocated by MS_SMILEYADD_BATCHPARSE
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_BATCHPARSERES*) &smgp; //pointer to SMADD_BATCHPARSERES
+#define MS_SMILEYADD_BATCHFREE "SmileyAdd/BatchFree"
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ char* name; //smiley category name for reference
+ char* dispname; //smiley category name for display
+} SMADD_REGCAT;
+
+//Register smiley category
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_REGCAT*) &smgp; pointer to SMADD_REGCAT
+#define MS_SMILEYADD_REGISTERCATEGORY "SmileyAdd/RegisterCategory"
+
+//Register smiley category
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) Pointer to protocol name or NULL for all;
+#define MS_SMILEYADD_RELOAD "SmileyAdd/Reload"
+
+#ifndef MIID_SMILEY
+// {E03C71B2-6DEE-467e-A4F0-DD516745876A}
+#define MIID_SMILEY { 0xe03c71b2, 0x6dee, 0x467e, { 0xa4, 0xf0, 0xdd, 0x51, 0x67, 0x45, 0x87, 0x6a } }
+#endif
+
+/**
+ NM_FIREVIEWCHANGE is WM_NOTIFY Message for notify parent of host window about smiley are going to be repaint
+
+ The proposed action is next: Owner of RichEdit windows received NM_FIREVIEWCHANGE through WM_NOTIFY
+ twice first time before painting|invalidating (FVCN_PREFIRE) and second time - after (FVCN_POSTFIRE).
+ The Owner window may change any values of received FVCNDATA_NMHDR structure in order to raise needed action.
+ For example it may substitute FVCA_INVALIDATE to FVCA_CUSTOMDRAW event to force painting on self offscreen context.
+
+ It can be:
+ FVCA_CUSTOMDRAW - in this case you need to provide valid HDC to draw on and valid RECT of smiley
+ FVCA_INVALIDATE - to invalidate specified rect of window
+ FVCA_NONE - skip any action. But be aware - animation will be stopped till next repainting of smiley.
+ FVCA_SENDVIEWCHANGE - to notify richedit ole about object changed. Be aware Richedit will fully reconstruct itself
+
+ Another point is moment of received smiley rect - it is only valid if FVCA_DRAW is initially set,
+ and it is PROBABLY valid if FVCA_INVALIDATE is set. And it most probably invalid in case of FVCA_SENDVIEWCHANGE.
+ The smiley position is relative last full paint HDC. Usually it is relative to top-left corner of host
+ richedit (NOT it client area) in windows coordinates.
+
+*/
+
+// Type of Event one of
+#define FVCN_PREFIRE 1
+#define FVCN_POSTFIRE 2
+
+// Action of event are going to be done
+#define FVCA_NONE 0
+#define FVCA_DRAW 1 // do not modify hdc in case of _DRAW, Use _CUSTOMDRAW
+#define FVCA_CUSTOMDRAW 2
+//#define FVCA_INVALIDATE 3 (not supported)
+//#define FVCA_SENDVIEWCHANGE 4 (not supported)
+#define FVCA_SKIPDRAW 5
+
+// Extended NMHDR structure for WM_NOTIFY
+typedef struct
+{
+ //NMHDR structure
+ HWND hwndFrom; // Window of smiley host
+ UINT idFrom; // ignored
+ UINT code; // NM_FIREVIEWCHANGE
+
+ size_t cbSize;
+ BYTE bEvent; // FVCN_ value - pre- or post- painting
+ BYTE bAction; // FVCA_ keys
+ HDC hDC; // Canvas to draw on
+ RECT rcRect; // Valid/should be in case of FVCA_DRAW
+ COLORREF clrBackground; // color to fill background if fTransparent is not set
+ BOOL fTransparent; // if need to fill back color (not supported)
+ LPARAM lParam; // used by host window PreFire and PostFire event
+} FVCNDATA_NMHDR;
+
+// Code of WM_NOTIFY message (code)
+#define NM_FIREVIEWCHANGE NM_FIRST+1;
+
+typedef struct
+{
+ unsigned cbSize; // size of the structure
+ HANDLE hContact;
+ int type; // 0 - directory, 1 - file;
+ TCHAR* path; // smiley category name for reference
+} SMADD_CONT;
+
+//Loads all smileys for the contact
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_CONT*) &dir; // pointer to directory to load smiley from
+#define MS_SMILEYADD_LOADCONTACTSMILEYS "SmileyAdd/LoadContactSmileys"
diff --git a/plugins/modernb/m_api/m_toolbar.h b/plugins/modernb/m_api/m_toolbar.h
new file mode 100644
index 0000000000..fc417cf873
--- /dev/null
+++ b/plugins/modernb/m_api/m_toolbar.h
@@ -0,0 +1,88 @@
+#ifndef M_TOOLBAR_H
+#define M_TOOLBAR_H
+
+#define TOOLBARBUTTON_ICONIDPREFIX "MTB_"
+#define TOOLBARBUTTON_ICONIDPRIMARYSUFFIX "_Primary"
+#define TOOLBARBUTTON_ICONIDSECONDARYSUFFIX "_Secondary"
+#define TOOLBARBUTTON_ICONNAMEPRESSEDSUFFIX "Pressed"
+
+//button flags
+#define TBBF_DISABLED (1<<0)
+#define TBBF_VISIBLE (1<<1)
+#define TBBF_PUSHED (1<<2)
+#define TBBF_SHOWTOOLTIP (1<<3)
+#define TBBF_ISSEPARATOR (1<<5)
+#define TBBF_ISLBUTTON (1<<6)
+#define TBBF_FLEXSIZESEPARATOR (TBBF_ISSEPARATOR|TBBF_PUSHED)
+typedef struct _tagTBButton
+{
+ int cbSize; // size of structure
+ char * pszButtonID; // char id of button used to store button info in DB and know about icon
+ char * pszButtonName; // name of button (not translated)
+ char * pszServiceName; // service name to be executed
+ LPARAM lParam; // param of service to be called
+ char * pszTooltipUp, *pszTooltipDn;
+ DWORD defPos; // default order pos of button (less values are nearer to edge).. please use values greater that 100. the default buttons has pos: 10,20..90
+ DWORD tbbFlags; // combine of TBBF_ flags above
+ void (*ParamDestructor)(void *); //will be called on parameters deletion
+ HANDLE hPrimaryIconHandle;
+ HANDLE hSecondaryIconHandle;
+}TBButton;
+
+//////////////////////////////////////////////////////////////////////////
+// Events
+// Only after this event module subscribers should register their buttons
+// wparam=lparam=0
+// don't forget to return 0 to continue processing
+#define ME_TB_MODULELOADED "ToolBar/ModuleLoaded"
+
+//////////////////////////////////////////////////////////////////////////
+// Services
+//
+//////////////////////////////////////////////////////////////////////////
+// Adding a button
+// WPARAM = 0
+// LPARAM = (TBButton *) &description
+// LRESULT = (HANDLE) hButton
+// in order to correctly process default icons via iconlib it should be
+// registered icolib icon with id named:
+// 'TBButton_'+pszButtonID+ 'Up' or +'Down' for Push (2-state) buttons
+#define MS_TB_ADDBUTTON "ToolBar/AddButton"
+
+//////////////////////////////////////////////////////////////////////////
+// Remove button
+// WPARAM = (HANDLE) hButton;
+// LPARAM = 0;
+#define MS_TB_REMOVEBUTTON "ToolBar/RemoveButton"
+
+//////////////////////////////////////////////////////////////////////////
+// SetState
+// WPARAM = (HANDLE) hButton;
+// LPARAM = one of below TBST_ states
+// LRESULT= old state
+#define TBST_PUSHED 1
+#define TBST_RELEASED 0
+#define MS_TB_SETBUTTONSTATE "ToolBar/SetButtonState"
+
+//////////////////////////////////////////////////////////////////////////
+// SetStatebyId
+// WPARAM = (char *) szButtonID;
+// LPARAM = one of below TBST_ states
+// LRESULT= old state
+#define MS_TB_SETBUTTONSTATEBYID "ToolBar/SetButtonStateId"
+//////////////////////////////////////////////////////////////////////////
+// GetState
+// WPARAM = (HANLDE) hButton;
+// LPARAM = 0
+// LRESULT= current state
+#define MS_TB_GETBUTTONSTATE "ToolBar/GetButtonState"
+
+//////////////////////////////////////////////////////////////////////////
+// GetState
+// WPARAM = (char *) szButtonID;;
+// LPARAM = 0
+// LRESULT= current state
+#define MS_TB_GETBUTTONSTATEBYID "ToolBar/GetButtonStateId"
+
+
+#endif \ No newline at end of file
diff --git a/plugins/modernb/m_api/m_variables.h b/plugins/modernb/m_api/m_variables.h
new file mode 100644
index 0000000000..73ab9a4f17
--- /dev/null
+++ b/plugins/modernb/m_api/m_variables.h
@@ -0,0 +1,256 @@
+/*
+ Variables Plugin for Miranda-IM (www.miranda-im.org)
+ Copyright 2003-2005 P. Boon
+
+ 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_VARS
+#define __M_VARS
+
+#define FIF_TCHAR 0x01 // expects and returns TCHAR*
+
+typedef struct {
+ int cbSize;
+ int flags;
+ union {
+ char *szFormat;
+ TCHAR *tszFormat;
+ };
+ union {
+ char *szSource;
+ TCHAR *tszSource;
+ };
+ HANDLE hContact;
+ int pCount; // number of succesful parses
+ int eCount; // number of failures
+} FORMATINFO;
+#define MS_VARS_FORMATSTRING "Vars/FormatString"
+
+#define CI_PROTOID 0x00000001
+#define CI_NICK 0x00000002
+#define CI_LISTNAME 0x00000004
+#define CI_FIRSTNAME 0x00000008
+#define CI_LASTNAME 0x00000010
+#define CI_EMAIL 0x00000020
+#define CI_UNIQUEID 0x00000040
+#define CI_TCHAR 0x80000000 // tszContact is of type TCHAR
+typedef struct {
+ int cbSize;
+ union {
+ char *szContact;
+ TCHAR *tszContact;
+ };
+ HANDLE *hContacts;
+ DWORD flags;
+} CONTACTSINFO;
+
+// wparam = (CONTACTSINFO *)
+// lparam = 0
+// returns number of contacts found, hContacts array contains these hContacts
+#define MS_VARS_GETCONTACTFROMSTRING "Vars/GetContactFromString"
+
+#define AIF_DONTPARSE 0x01 // don't parse the result of this function
+#define AIF_FALSE 0x02 // (logical) false
+//#define AIF_ERR_ARGS 0x04 // invalid arguments
+
+typedef struct {
+ int cbSize; // in
+ FORMATINFO *fi; // in
+ unsigned int argc; // in
+ union {
+ char **argv; // in (argv[0] will be the tokenstring)
+ TCHAR **targv;
+ };
+ int flags; // out (AIF_*)
+} ARGUMENTSINFO;
+
+#define TR_MEM_VARIABLES 1 // the memory will be allocated in Variable's memory space (not implemented)
+#define TR_MEM_MIRANDA 2 // the memory will be allocated in Miranda's memory space,
+ // if TRF_FREEMEM is set, the memory will be freed by Variables.
+#define TR_MEM_OWNER 3 // the memory is in the caller's memory space, Variables won't touch it,
+ // even if TRF_FREEMEM is set
+
+#define TRF_FREEMEM 0x01 // free the memory if possible
+#define TRF_CALLSVC 0x02 // cal szCleanupService when Variables doesn't need the result anymore
+#define TRF_UNPARSEDARGS 0x04 // give the arguments unparsed (if available)
+#define TRF_FIELD 0x08 // the token can be used as a %field%
+#define TRF_FUNCTION 0x10 // the token can be used as a ?function()
+#define TRF_TCHAR 0x20 // the token is given as TCHAR* and the service returns TCHAR*
+
+typedef struct {
+ int cbSize;
+ union {
+ char *szTokenString; // non-built-in variable WITHOUT '%' or '?' or '!'
+ TCHAR *tszTokenString;
+ };
+ char *szService; // service to call, must return a 0 terminating string or NULL on error, will be called
+ // with wparam = 0 and lparam = ARGUMENTSINFO *ai
+ char *szCleanupService; // only if flag VRF_CALLSVC is set, will be called when variable copied the result
+ // in it's own memory. wParam = 0, lParam = result from szService call.
+ char *szHelpText; // shown in help dialog, maybe NULL or in format
+ // "subject\targuments\tdescription" ("math\t(x, y ,...)\tx + y + ...") or
+ // "subject\tdescription" ("miranda\tpath to the Miranda-IM executable")
+ // subject and description are translated automatically
+ int memType; // set to TR_MEM_* if you use the flag VRF_FREEMEM
+ int flags; // one of TRF_*
+} TOKENREGISTER;
+
+// wparam = 0
+// lparam = (LPARAM)&TOKENREGISTER
+// returns 0 on success
+#define MS_VARS_REGISTERTOKEN "Vars/RegisterToken"
+
+// wparam = (void *)pnt
+// lparam = 0
+// free the memory from variables' memory space pointed by pnt
+#define MS_VARS_FREEMEMORY "Vars/FreeMemory"
+
+// Returns Variable's RTL/CRT function poiners to malloc() free() realloc()
+// wParam=0, lParam = (LPARAM) &MM_INTERFACE (see m_system.h)
+// copied from Miranda's core (miranda.c)
+#define MS_VARS_GET_MMI "Vars/GetMMI"
+
+__inline static void variables_free(void *ptr) {
+
+ if (ptr) {
+ struct MM_INTERFACE mm;
+ mm.cbSize=sizeof(struct MM_INTERFACE);
+ CallService(MS_VARS_GET_MMI,0,(LPARAM)&mm);
+ mm.mmi_free(ptr);
+ }
+}
+
+// wparam = (HWND)hwnd (may be NULL)
+// lparam = (char *)string (may be NULL)
+// when [ok] is pressed in the help box, hwnd's text will be set to the text in the help box.
+// the text of hwnd is set as initial text if string is NULL
+// string is set as initial value of the text box and EN_CHANGE will be send
+// returns the handle to the help dialog. Only one can be opened at a time.
+// WARNING: This service has not yet been converted to UNICODE, it will certainly change in the near future
+#define MS_VARS_SHOWHELP "Vars/ShowHelp"
+
+
+// don't use these yet, WIP
+#define VARM_PARSE WM_USER+1
+#define VARM_SETSUBJECT WM_USER+2
+#define VARM_GETSUBJECT WM_USER+3
+#define VARM_SETEXTRATEXT WM_USER+4
+#define VARM_GETEXTRATEXT WM_USER+5
+
+/*** HELPERS ***/
+
+__inline static char *variables_parseA(char *src, char *extra, HANDLE hContact) {
+
+ FORMATINFO fi;
+
+ ZeroMemory(&fi, sizeof(fi));
+ fi.cbSize = sizeof(fi);
+ fi.szFormat = src;
+ fi.szSource = extra;
+ fi.hContact = hContact;
+ return (char *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+}
+
+__inline static char *variables_parseT(TCHAR *src, TCHAR *extra, HANDLE hContact) {
+
+ FORMATINFO fi;
+
+ ZeroMemory(&fi, sizeof(fi));
+ fi.cbSize = sizeof(fi);
+ fi.tszFormat = src;
+ fi.tszSource = extra;
+ fi.hContact = hContact;
+ fi.flags = FIF_TCHAR;
+ return (char *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+}
+
+#ifdef UNICODE
+#define variables_parse(x,y,z) variables_parseT(x,y,z)
+#else
+#define variables_parse(x,y,z) variables_parseA(x,y,z)
+#endif
+
+/*
+Returns copy of src if Variables is not installed, or a copy of the parsed string if it is installed.
+If the returned value is not NULL, it must be free using your own free().
+*/
+__inline static char *variables_parsedupA(char *src, char *extra, HANDLE hContact) {
+
+ FORMATINFO fi;
+ char *parsed, *res;
+
+ if (src == NULL) {
+ return NULL;
+ }
+ if (!ServiceExists(MS_VARS_FORMATSTRING)) {
+ return _strdup(src);
+ }
+ res = NULL;
+ ZeroMemory(&fi, sizeof(fi));
+ fi.cbSize = sizeof(fi);
+ fi.szFormat = src;
+ fi.szSource = extra;
+ fi.hContact = hContact;
+ parsed = (char *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+ if (parsed != NULL) {
+ res = _strdup(parsed);
+ CallService(MS_VARS_FREEMEMORY, (WPARAM)parsed, 0);
+ }
+ else {
+ return _strdup(src);
+ }
+ return res;
+}
+
+/*
+Returns copy of src if Variables is not installed, or a copy of the parsed string if it is installed.
+If the returned value is not NULL, it must be free using your own free().
+*/
+__inline static TCHAR *variables_parsedupT(TCHAR *src, TCHAR *extra, HANDLE hContact) {
+
+ FORMATINFO fi;
+ TCHAR *parsed, *res;
+
+ if (src == NULL) {
+ return NULL;
+ }
+ if (!ServiceExists(MS_VARS_FORMATSTRING)) {
+ return _tcsdup(src);
+ }
+ res = NULL;
+ ZeroMemory(&fi, sizeof(fi));
+ fi.cbSize = sizeof(fi);
+ fi.tszFormat = src;
+ fi.tszSource = extra;
+ fi.hContact = hContact;
+ fi.flags |= FIF_TCHAR;
+ parsed = (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+ if (parsed != NULL) {
+ res = _tcsdup(parsed);
+ CallService(MS_VARS_FREEMEMORY, (WPARAM)parsed, 0);
+ }
+ else {
+ return _tcsdup(src);
+ }
+ return res;
+}
+
+#ifdef UNICODE
+#define variables_parsedup(x,y,z) variables_parsedupT(x,y,z)
+#else
+#define variables_parsedup(x,y,z) variables_parsedupA(x,y,z)
+#endif
+
+#endif
diff --git a/plugins/modernb/m_api/m_xpTheme.h b/plugins/modernb/m_api/m_xpTheme.h
new file mode 100644
index 0000000000..63f1b0a5d3
--- /dev/null
+++ b/plugins/modernb/m_api/m_xpTheme.h
@@ -0,0 +1,35 @@
+/* Wrapper for XP theme */
+typedef void * XPTHANDLE;
+typedef HANDLE HTHEME;
+
+XPTHANDLE xpt_AddThemeHandle(HWND hwnd, LPCWSTR className);
+void xpt_FreeThemeHandle(XPTHANDLE xptHandle);
+void xpt_FreeThemeForWindow(HWND hwnd);
+BOOL xpt_IsValidHandle(XPTHANDLE xptHandle);
+HRESULT xpt_DrawThemeBackground(XPTHANDLE xptHandle, HDC hdc, int type, int state, const RECT * sizeRect, const RECT * clipRect);
+HRESULT xpt_DrawThemeParentBackground(HWND hWnd, HDC hdc, const RECT * sizeRect);
+HRESULT xpt_DrawThemeText(XPTHANDLE xptHandle, HDC hdc, int type, int state, LPCTSTR lpStr, int len, DWORD flag1, DWORD flag2, const RECT * textRect);
+BOOL xpt_IsThemeBackgroundPartiallyTransparent(XPTHANDLE xptHandle, int type, int state);
+HRESULT xpt_DrawTheme(XPTHANDLE xptHandle, HWND hwnd, HDC hdc, int type, int state, const RECT *sizeRect, const RECT * clipRect);
+BOOL xpt_IsThemed(XPTHANDLE xptHandle);
+BOOL xpt_EnableThemeDialogTexture(HWND hwnd, DWORD flags);
+
+// next will be called only from one place
+HRESULT XPThemesLoadModule();
+void XPThemesUnloadModule();
+void xpt_OnWM_THEMECHANGED();
+
+
+//definitions
+
+
+//#include <tmschema.h>
+//TODO: ADD HERE other definitions of part and states from <tmschema.h>
+//WINDOW
+#define WP_CAPTION 1
+#define WP_SMALLCAPTION 2
+#define WP_SMALLMINCAPTION 4
+#define WP_SMALLMAXCAPTION 6
+
+#define CS_ACTIVE 1
+#define CS_INACTIVE 2 \ No newline at end of file