From 4a586a34c99d32dd8e2f439a16e5e2a99355b72b Mon Sep 17 00:00:00 2001 From: mataes2007 Date: Sun, 15 May 2011 09:47:59 +0000 Subject: ExternalAPI: update git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@95 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb --- ExternalAPI/m_Quotes.h | 35 ++ ExternalAPI/m_actman.h | 2 +- ExternalAPI/m_buttonbar.h | 54 +++ ExternalAPI/m_cln_skinedit.h | 147 ++++++++ ExternalAPI/m_dbx_tree.h | 688 +++++++++++++++++++++++++++++++++++ ExternalAPI/m_flash.h | 15 +- ExternalAPI/m_historyevents.h | 424 +++++++++++++++++++++ ExternalAPI/m_ieview.h | 10 +- ExternalAPI/m_mydetails.h | 187 ++++++++++ ExternalAPI/m_nudge.h | 5 + ExternalAPI/m_radio.h | 94 +++++ ExternalAPI/m_skin_eng.h | 435 ++++++++++++++++++++++ ExternalAPI/m_skins.h | 142 ++++++++ ExternalAPI/m_skins_cpp.h | 210 +++++++++++ ExternalAPI/m_smileyadd_deprecated.h | 108 ++++++ ExternalAPI/m_weather.h | 161 ++++++++ ExternalAPI/m_wizard.h | 90 +++++ 17 files changed, 2793 insertions(+), 14 deletions(-) create mode 100644 ExternalAPI/m_Quotes.h create mode 100644 ExternalAPI/m_buttonbar.h create mode 100644 ExternalAPI/m_cln_skinedit.h create mode 100644 ExternalAPI/m_dbx_tree.h create mode 100644 ExternalAPI/m_historyevents.h create mode 100644 ExternalAPI/m_mydetails.h create mode 100644 ExternalAPI/m_nudge.h create mode 100644 ExternalAPI/m_radio.h create mode 100644 ExternalAPI/m_skin_eng.h create mode 100644 ExternalAPI/m_skins.h create mode 100644 ExternalAPI/m_skins_cpp.h create mode 100644 ExternalAPI/m_smileyadd_deprecated.h create mode 100644 ExternalAPI/m_weather.h create mode 100644 ExternalAPI/m_wizard.h (limited to 'ExternalAPI') diff --git a/ExternalAPI/m_Quotes.h b/ExternalAPI/m_Quotes.h new file mode 100644 index 0000000..f4bbb06 --- /dev/null +++ b/ExternalAPI/m_Quotes.h @@ -0,0 +1,35 @@ +#ifndef __7D8F07A4_72AF_4838_9C5C_6FDFF57D0DC6_m_Quotes_h__ +#define __7D8F07A4_72AF_4838_9C5C_6FDFF57D0DC6_m_Quotes_h__ + +/* + * Export the contact (or all contacts) to xml file + * wParam = (WPARAM)(HANDLE)hContact to export or 0 to export all contacts + * lParam = (LPARAM)(const char*)pszFileName - pointer to file name to export or + * 0 in this case the dialog to select a file to export would be shown + * returns 0 if export was successfull, + * -1 if user canceled export and + * value greater than zero if error occurred during exporting + */ +#define MS_QUOTES_EXPORT "Quotes/Export" + +/* + * Import the contact (or all contacts) from xml file + * wParam = flags + * lParam = (LPARAM)(const char*)pszFileName - pointer to file name to import or + * 0 in this case the dialog to select a file to import would be shown + * returns 0 if import was successfull, + * -1 if user canceled import and + * value greater than zero if error occurred during importing + */ + +// if contact(s) exists user would be asked to overwrite these contacts +// #define QUOTES_IMPORT_PROMPT_TO_OVERWRITE_EXISTING_CONTACTS 0x0000 +// if contact(s) exists it would be overwrite without any prompt +// #define QUOTES_IMPORT_SILENT_OVERWRITE_EXISTING_CONTACTS 0x0001 +// if contact(s) exists during importing it would be ignored +#define QUOTES_IMPORT_SKIP_EXISTING_CONTACTS 0x0002 + +#define MS_QUOTES_IMPORT "Quotes/Import" + + +#endif //__7D8F07A4_72AF_4838_9C5C_6FDFF57D0DC6_m_Quotes_h__ diff --git a/ExternalAPI/m_actman.h b/ExternalAPI/m_actman.h index 1a8efd8..c900ba9 100644 --- a/ExternalAPI/m_actman.h +++ b/ExternalAPI/m_actman.h @@ -49,7 +49,7 @@ typedef struct TAct_Param { DWORD flags; // 0 - ID, 1 - Name DWORD ID; // Id or name - WPARAM wParam; + WPARAM wParam; LPARAM lParam; } TAct_Param, *PAct_Param; diff --git a/ExternalAPI/m_buttonbar.h b/ExternalAPI/m_buttonbar.h new file mode 100644 index 0000000..9be67e9 --- /dev/null +++ b/ExternalAPI/m_buttonbar.h @@ -0,0 +1,54 @@ +#ifndef _BUTTONSBAR_H +#define _BUTTONSBAR_H + +#define MIN_CBUTTONID 4000 +#define MAX_CBUTTONID 5000 + +#define BBSF_IMBUTTON (1<<0) +#define BBSF_CHATBUTTON (1<<1) +#define BBSF_CANBEHIDDEN (1<<2) +#define BBSF_NTBSWAPED (1<<3) +#define BBSF_NTBDESTRUCT (1<<4) + +typedef struct _tagCustomButtonData + { + DWORD dwButtonOrigID; // id of button used while button creation and to store button info in DB + char * pszModuleName; //module name without spaces and underline symbols (e.g. "tabsrmm") + + DWORD dwButtonCID; + DWORD dwArrowCID; //only use with BBBF_ISARROWBUTTON flag + + TCHAR * ptszTooltip; //button's tooltip + + DWORD dwPosition; // default order pos of button, counted from window edge (left or right) + int iButtonWidth; //must be 22 for regular button and 33 for button with arrow + HANDLE hIcon; //Handle to icolib registred icon + BOOL bIMButton,bChatButton; + BOOL bCanBeHidden,bHidden,bAutoHidden,bDummy,bDisabled,bPushButton; + BOOL bLSided,bRSided; + BYTE opFlags; + }CustomButtonData; + +static INT_PTR CB_ModifyButton(WPARAM wParam, LPARAM lParam); +static INT_PTR CB_RemoveButton(WPARAM wParam, LPARAM lParam); +static INT_PTR CB_AddButton(WPARAM wParam, LPARAM lParam); +static INT_PTR CB_GetButtonState(WPARAM wParam, LPARAM lParam); +static INT_PTR CB_SetButtonState(WPARAM wParam, LPARAM lParam); +static void CB_GetButtonSettings(HANDLE hContact,CustomButtonData *cbd); + +void CB_WriteButtonSettings(HANDLE hContact,CustomButtonData *cbd); +int sstSortButtons(const void * vmtbi1, const void * vmtbi2); + +void CB_DeInitCustomButtons(); +void CB_InitCustomButtons(); +void CB_InitDefaultButtons(); +void CB_ReInitCustomButtons(); + +/* MinGW doesn't like this struct declatations below */ +void BB_UpdateIcons(HWND hdlg,struct TWindowData *dat); +void BB_RefreshTheme(const TWindowData *dat); +void CB_DestroyAllButtons(HWND hwndDlg,struct TWindowData *dat); +void CB_DestroyButton(HWND hwndDlg,struct TWindowData *dat,DWORD dwButtonCID,DWORD dwFlags); +void CB_ChangeButton(HWND hwndDlg,struct TWindowData *dat,CustomButtonData* cbd); + +#endif diff --git a/ExternalAPI/m_cln_skinedit.h b/ExternalAPI/m_cln_skinedit.h new file mode 100644 index 0000000..5ee6682 --- /dev/null +++ b/ExternalAPI/m_cln_skinedit.h @@ -0,0 +1,147 @@ + +/* + * services + */ + +#define MS_CLNSE_INVOKE "CLN_Skinedit/Invoke" +#define MS_CLNSE_FILLBYCURRENTSEL "CLN_Skinedit/FillByCurrentSel" + +/* + * data structs + */ + +struct TWindowData; +class CImageItem; + +struct ButtonItem { + TCHAR szName[40]; + HWND hWnd; + LONG xOff, yOff; + LONG width, height; + CImageItem *imgNormal, *imgPressed, *imgHover; + LONG_PTR normalGlyphMetrics[4]; + LONG_PTR hoverGlyphMetrics[4]; + LONG_PTR pressedGlyphMetrics[4]; + DWORD dwFlags, dwStockFlags; + DWORD uId; + TCHAR szTip[256]; + char szService[256]; + char szModule[256], szSetting[256]; + BYTE bValuePush[256], bValueRelease[256]; + DWORD type; + void (*pfnAction)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem); + void (*pfnCallback)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem); + TCHAR tszLabel[40]; + ButtonItem* nextItem; + HANDLE hContact; + TWindowData *dat; +}; + +typedef struct _tagButtonSet { + ButtonItem *items; + LONG left, top, right, bottom; // client area offsets, calculated from button layout +} ButtonSet; + +struct CSkinItem { + TCHAR szName[40]; + char szDBname[40]; + int statusID; + + BYTE GRADIENT; + BYTE CORNER; + + DWORD COLOR; + DWORD COLOR2; + + BYTE COLOR2_TRANSPARENT; + + DWORD TEXTCOLOR; + + int ALPHA; + + int MARGIN_LEFT; + int MARGIN_TOP; + int MARGIN_RIGHT; + int MARGIN_BOTTOM; + BYTE IGNORED; + DWORD BORDERSTYLE; + CImageItem *imageItem; +}; + +typedef struct _tagSkinDescription { + DWORD cbSize; + CSkinItem *StatusItems; + int lastItem; + int firstItem; + char szModule[100]; + HWND hWndParent, hWndTab; + HWND hwndCLUI; + HWND hwndSkinEdit; /* out param */ + HWND hwndImageEdit; /* out param */ + HMENU hMenuItems; + void (*pfnSaveCompleteStruct)(void); + void (*pfnClcOptionsChanged )(void); + void* (*pfnMalloc)(unsigned int); + void (*pfnFree)(void); + void* (*pfnRealloc)(void *, unsigned int); + void* reserved[20]; +} SKINDESCRIPTION; + +// defines + +// FLAGS +#define CORNER_NONE 0 +#define CORNER_ACTIVE 1 +#define CORNER_TL 2 +#define CORNER_TR 4 +#define CORNER_BR 8 +#define CORNER_BL 16 +#define CORNER_ALL (CORNER_TL | CORNER_TR | CORNER_BR | CORNER_BL | CORNER_ACTIVE) + +#define GRADIENT_NONE 0 +#define GRADIENT_ACTIVE 1 +#define GRADIENT_LR 2 +#define GRADIENT_RL 4 +#define GRADIENT_TB 8 +#define GRADIENT_BT 16 + +#define IMAGE_PERPIXEL_ALPHA 1 +#define IMAGE_FLAG_DIVIDED 2 +#define IMAGE_FILLSOLID 4 +#define IMAGE_GLYPH 8 + +#define IMAGE_STRETCH_V 1 +#define IMAGE_STRETCH_H 2 +#define IMAGE_STRETCH_B 4 + +#define BUTTON_ISINTERNAL 1 +#define BUTTON_ISTOGGLE 2 +#define BUTTON_ISSERVICE 4 +#define BUTTON_ISPROTOSERVICE 8 +#define BUTTON_PASSHCONTACTW 16 +#define BUTTON_PASSHCONTACTL 32 +#define BUTTON_ISDBACTION 64 +#define BUTTON_ISCONTACTDBACTION 128 +#define BUTTON_DBACTIONONCONTACT 256 +#define BUTTON_ISSIDEBAR 512 +#define BUTTON_NORMALGLYPHISICON 1024 +#define BUTTON_PRESSEDGLYPHISICON 2048 +#define BUTTON_HOVERGLYPHISICON 4096 +#define BUTTON_HASLABEL 8192 + +#define CLCDEFAULT_GRADIENT 0 +#define CLCDEFAULT_CORNER 0 + +#define CLCDEFAULT_COLOR 0xd0d0d0 +#define CLCDEFAULT_COLOR2 0xd0d0d0 + +#define CLCDEFAULT_TEXTCOLOR 0x000000 + +#define CLCDEFAULT_COLOR2_TRANSPARENT 1 + +#define CLCDEFAULT_ALPHA 100 +#define CLCDEFAULT_MRGN_LEFT 0 +#define CLCDEFAULT_MRGN_TOP 0 +#define CLCDEFAULT_MRGN_RIGHT 0 +#define CLCDEFAULT_MRGN_BOTTOM 0 +#define CLCDEFAULT_IGNORE 1 diff --git a/ExternalAPI/m_dbx_tree.h b/ExternalAPI/m_dbx_tree.h new file mode 100644 index 0000000..932b1bc --- /dev/null +++ b/ExternalAPI/m_dbx_tree.h @@ -0,0 +1,688 @@ +/* + +dbx_tree: tree database driver for Miranda IM + +Copyright 2007-2010 Michael "Protogenes" Kunz, + +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_DBX_TREE_H__ + +#define M_DBX_TREE_H__ 1 + +#ifndef _MSC_VER +#include +#else +#include "stdint.h" +#endif +#pragma pack(push, 8) + + +/** + \brief general return value if invalid param or invalid combination of params specified +**/ +static const unsigned int DBT_INVALIDPARAM = 0xFFFFFFFF; + + +/////////////////////////////////////////////////////////// +// Entities +/////////////////////////////////////////////////////////// + +/** + \brief A handle to a Entity +**/ +typedef uint32_t TDBTEntityHandle; + +static const uint32_t DBT_NF_IsRoot = 0x00000001; /// Entity is the Root +static const uint32_t DBT_NF_IsGroup = 0x00000002; /// Entity is a group +static const uint32_t DBT_NF_IsAccount = 0x00000004; /// Entity is an account + +static const uint32_t DBT_NF_HasChildren = 0x00010000; /// Entity has Children (for Groups and Metacontacts) +static const uint32_t DBT_NF_HasVirtuals = 0x00020000; /// Entity has at least one Virtual duplicate +static const uint32_t DBT_NF_IsVirtual = 0x00040000; /// Entity is a Virtual duplicate + +static const uint32_t DBT_NFM_SpecialEntity = DBT_NF_IsRoot | DBT_NF_IsGroup | DBT_NF_IsAccount | DBT_NF_IsVirtual; + +/////////////////////////////////////////////////////////// +// Entities +/////////////////////////////////////////////////////////// + +/** + \brief + \param wParam = 0 + \param lParam = 0 + + \return Handle to root Entity +**/ +#define MS_DBT_ENTITY_GETROOT "DBT/Entity/GetRoot" + + +/** + \brief + \param wParam = hEntity + \param lParam = 0 + + \return ChildCount of specified Entity +**/ +#define MS_DBT_ENTITY_CHILDCOUNT "DBT/Entity/ChildCount" + + +/** + \brief + \param wParam = hEntity + \param lParam = 0 + + \return Parent hEntity of specified Entity +**/ +#define MS_DBT_ENTITY_GETPARENT "DBT/Entity/GetParent" + + +/** + \brief + \param wParam = hEntity + \param lParam = hNewEntity + + \return 0 on success +**/ +#define MS_DBT_ENTITY_MOVE "DBT/Entity/Move" + +/** + \brief + \param wParam = hEntity + \param lParam = hNewParent +**/ +#define ME_DBT_ENTITY_MOVING "DBT/Entity/Moving" +/** + \brief + \param wParam = hEntity + \param lParam = hOldParent +**/ +#define ME_DBT_ENTITY_MOVED "DBT/Entity/Moved" + +/** + \brief Read the flags of an Entity + \param wParam = hEntity + \param lParam = 0 + + \return Flags +**/ +#define MS_DBT_ENTITY_GETFLAGS "DBT/Entity/GetFlags" + + + +static const uint32_t DBT_NIFO_OSC_AC = 0x00000001; /// onStartEntity - AddChildren +static const uint32_t DBT_NIFO_OSC_AP = 0x00000002; /// onStartEntity - AddParent +static const uint32_t DBT_NIFO_OSC_AO = 0x00000004; /// onStartEntity - AddOriginal (only if Entity is virtual) +static const uint32_t DBT_NIFO_OSC_AOC = 0x00000008 | DBT_NIFO_OSC_AO; /// onStartEntity - AddOriginalChildren (only if Entity is virtual) +static const uint32_t DBT_NIFO_OSC_AOP = 0x00000010 | DBT_NIFO_OSC_AO; /// onStartEntity - AddOriginalParent (only if Entity is virtual) +static const uint32_t DBT_NIFO_OSC_USEACCOUNT = 0x00000080; /// onStartEntity - use Account as fallback, only for settings + +static const uint32_t DBT_NIFO_OC_AC = 0x00000001 <<8; /// onChildEntity - AddChildren +//static const uint32_t DBT_LC_OC_AP = 0x00000002 <<8; /// invalid for children +static const uint32_t DBT_NIFO_OC_AO = 0x00000004 <<8; /// onChildEntity - AddOriginal (only if Entity is virtual) +static const uint32_t DBT_NIFO_OC_AOC = 0x00000008 <<8 | DBT_NIFO_OC_AO; /// onChildEntity - AddOriginalChildren (only if Entity is virtual) +static const uint32_t DBT_NIFO_OC_AOP = 0x00000010 <<8 | DBT_NIFO_OC_AO; /// onChildEntity - AddOriginalParent (only if Entity is virtual) +static const uint32_t DBT_NIFO_OC_USEACCOUNT = 0x00000080 <<8; /// onStartEntity - use Account as fallback, only for settings + +static const uint32_t DBT_NIFO_OP_AC = 0x00000001 <<16; /// onParentEntity - AddChildren +static const uint32_t DBT_NIFO_OP_AP = 0x00000002 <<16; /// onParentEntity - AddParent +static const uint32_t DBT_NIFO_OP_AO = 0x00000004 <<16; /// onParentEntity - AddOriginal (only if Entity is virtual) +static const uint32_t DBT_NIFO_OP_AOC = 0x00000008 <<16 | DBT_NIFO_OP_AO; /// onParentEntity - AddOriginalChildren (only if Entity is virtual) +static const uint32_t DBT_NIFO_OP_AOP = 0x00000010 <<16 | DBT_NIFO_OP_AO; /// onParentEntity - AddOriginalParent (only if Entity is virtual) +static const uint32_t DBT_NIFO_OP_USEACCOUNT = 0x00000080 <<16; /// onStartEntity - use Account as fallback, only for settings + +static const uint32_t DBT_NIFO_GF_DEPTHFIRST = 0x01000000; /// general flags - depth first iteration instead of breath first +static const uint32_t DBT_NIFO_GF_USEROOT = 0x02000000; /// general flags - use root as fallback, only for settings +static const uint32_t DBT_NIFO_GF_VL1 = 0x10000000; /// general flags - limit virtual lookup depth to 1 +static const uint32_t DBT_NIFO_GF_VL2 = 0x20000000; /// general flags - limit virtual lookup depth to 2 +static const uint32_t DBT_NIFO_GF_VL3 = 0x30000000; /// general flags - limit virtual lookup depth to 3 +static const uint32_t DBT_NIFO_GF_VL4 = 0x40000000; /// general flags - limit virtual lookup depth to 4 + +/** + \brief Entityfilter options for Entity iteration +**/ +typedef + struct TDBTEntityIterFilter + { + uint32_t cbSize; /// size of the structur in bytes + uint32_t Options; /// Options for iteration: DB_EIFO_* + uint32_t fHasFlags; /// flags an Entity must have to be iterated + uint32_t fDontHasFlags; /// flags an Entity have not to have to be iterated + } TDBTEntityIterFilter, *PDBTEntityIterFilter; + +/** + \brief Handle of an Entity-Iteration +**/ +typedef uintptr_t TDBTEntityIterationHandle; +/** + \brief initialize an iteration of Entities + \param wParam = PDBTEntityIterFilter, NULL to iterate all Entities (breadthfirst, all but root) + \param lParam = TDBTEntityHandle Entity, where iteration starts + + \return EnumID +**/ +#define MS_DBT_ENTITY_ITER_INIT "DBT/Entity/Iter/Init" + + +/** + \brief get the next Entity + \param wParam = EnumID returned by MS_DBT_ENTITY_ITER_INIT + \param lParam = 0 + + \return hEntity, 0 at the end +**/ +#define MS_DBT_ENTITY_ITER_NEXT "DBT/Entity/Iter/Next" + +/** + \brief closes an iteration and frees its ressourcs + \param wParam = IterationHandle returned by MS_DBT_ENTITY_ITER_INIT + \param lParam = 0 + + \return 0 on success +**/ +#define MS_DBT_ENTITY_ITER_CLOSE "DBT/Entity/Iter/Close" + +/** + \brief Deletes an Entity. + + All children will be moved to its parent. + If the Entity has virtual copies, history and settings will be transfered to the first duplicate. + + \param wParam = hEntity + \param lParam = 0 + + \return 0 on success +**/ +#define MS_DBT_ENTITY_DELETE "DBT/Entity/Delete" + + +typedef struct TDBTEntity +{ + uint32_t bcSize; + TDBTEntityHandle hParentEntity; + uint32_t fFlags; /// Flags DBT_NF_ + TDBTEntityHandle hAccountEntity; /// Needed for normal Entities, reference to AccountEntity for the created one +} TDBTEntity, *PDBTEntity; + +/** + \brief Creates a new Entity. + \param wParam = PDBTEntity + \param lParam = 0 + + \return hEntity on success, 0 otherwise +**/ +#define MS_DBT_ENTITY_CREATE "DBT/Entity/Create" + + +/** + \brief returns the account entity handle specified during creation + \param wParam = TDBTEntityHandle + \param lParam = 0 + + \return hEntity on success, 0 otherwise +**/ +#define MS_DBT_ENTITY_GETACCOUNT "DBT/Entity/GetAccount" + + +/////////////////////////////////////////////////////////// +// Virtual Entities +/////////////////////////////////////////////////////////// + +/** + \brief Creates a virtual duplicate of an Entity + \param wParam = hEntity to duplicate, couldn't be a group (DBT_NF_IsGroup set to 0) + \param lParam = hParentEntity to place duplicate + + \return hEntity of created duplicate +**/ +#define MS_DBT_VIRTUALENTITY_CREATE "DBT/VirtualEntity/Create" + +/** + \brief Retrieves the original Entity, which this is a duplicate of + \param wParam = hEntity of virtual Entity + \param lParam = 0 + + \return hEntity of original Entity +**/ +#define MS_DBT_VIRTUALENTITY_GETPARENT "DBT/VirtualEntity/GetParent" + +/** + \brief Retrieves the first virtual duplicate of an Entity (if any) + \param wParam = hEntity with virtual copies + \param lParam + + \return hEntity of first virtual duplicate +**/ +#define MS_DBT_VIRTUALENTITY_GETFIRST "DBT/VirtualEntity/GetFirst" + +/** + \brief Retrieves the following duplicate + \param wParam = hVirtualEntity of virtual Entity + \param lParam = 0 + + \return hEntity of next duplicate, 0 if hVirtualEntity was the last duplicate +**/ +#define MS_DBT_VIRTUALENTITY_GETNEXT "DBT/VirtualEntity/GetNext" + + +/////////////////////////////////////////////////////////// +// Settings +/////////////////////////////////////////////////////////// + +/** + \brief Handle of a Setting +**/ +typedef uint32_t TDBTSettingHandle; + + +static const uint16_t DBT_ST_BYTE = 0x01; +static const uint16_t DBT_ST_WORD = 0x02; +static const uint16_t DBT_ST_DWORD = 0x03; +static const uint16_t DBT_ST_QWORD = 0x04; + +static const uint16_t DBT_ST_CHAR = 0x11; +static const uint16_t DBT_ST_SHORT = 0x12; +static const uint16_t DBT_ST_INT = 0x13; +static const uint16_t DBT_ST_INT64 = 0x14; + +static const uint16_t DBT_ST_BOOL = 0x20; +static const uint16_t DBT_ST_FLOAT = 0x21; +static const uint16_t DBT_ST_DOUBLE = 0x22; + +static const uint16_t DBT_ST_ANSI = 0xff; +static const uint16_t DBT_ST_BLOB = 0xfe; +static const uint16_t DBT_ST_UTF8 = 0xfd; +static const uint16_t DBT_ST_WCHAR = 0xfc; + +#if (defined(_UNICODE) || defined(UNICODE)) + static const uint16_t DBT_ST_TCHAR = DBT_ST_WCHAR; +#else + static const uint16_t DBT_ST_TCHAR = DBT_ST_ANSI; +#endif + +static const uint16_t DBT_STF_Signed = 0x10; +static const uint16_t DBT_STF_VariableLength = 0x80; + + + +static const uint32_t DBT_SDF_FoundValid = 0x00000001; +static const uint32_t DBT_SDF_HashValid = 0x00000002; + +/** + \brief Describes a setting, its name and location +**/ +typedef + struct TDBTSettingDescriptor { + uint32_t cbSize; /// size of the structure in bytes + TDBTEntityHandle Entity; /// Entityhandle where the setting can be found, or where searching starts + char * pszSettingName; /// Setting name + uint32_t Options; /// options describing where the setting can be found DBT_NIFO_* + uint32_t Flags; /// Valid Flags. DBT_SDF_* describes which following values are valid (internal use) + + TDBTEntityHandle FoundInEntity; /// internal use to avoid to do the searching twice + uint32_t Hash; /// internal used HashValue for settingname + TDBTSettingHandle FoundHandle; /// internal used SettingHandle + } TDBTSettingDescriptor, * PDBTSettingDescriptor; + +/** + \brief Describes a settings value + + it is never used alone, without a type qualifier +**/ +typedef + union TDBTSettingValue { + bool Bool; + int8_t Char; uint8_t Byte; + int16_t Short; uint16_t Word; + uint32_t Int; uint32_t DWord; + int64_t Int64; uint64_t QWord; + float Float; + double Double; + + struct { + uint32_t Length; // length in bytes of pBlob, length in characters of char types including trailing null + union { + uint8_t * pBlob; + char * pAnsi; + char * pUTF8; + wchar_t * pWide; + TCHAR * pTChar; + }; + }; + } TDBTSettingValue; + +/** + \brief Describes a setting +**/ +typedef + struct TDBTSetting { + uint32_t cbSize; /// size of the structure in bytes + PDBTSettingDescriptor Descriptor; /// pointer to a Setting descriptor used to locate the setting + uint16_t Type; /// type of the setting, see DBT_ST_* + TDBTSettingValue Value; /// Value of the setting according to Type + } TDBTSetting, * PDBTSetting; + + + +/** + \brief retrieves the handle of the setting + \param wParam = PDBTSettingDescriptor + \param lParam = 0 + + \return hSetting when found, 0 otherwise +**/ +#define MS_DBT_SETTING_FIND "DBT/Setting/Find" + + +/** + \brief deletes the specified Setting + \param wParam = PDBTSettingDescriptor + \param lParam = 0 + + \return hSetting when found, 0 otherwise +**/ +#define MS_DBT_SETTING_DELETE "DBT/Setting/Delete" + +/** + \brief deletes the specified Setting + \param wParam = TDBTSettingHandle + \param lParam = 0 + + \return 0 on success +**/ +#define MS_DBT_SETTING_DELETEHANDLE "DBT/Setting/DeleteHandle" + + +/** + \brief Write a setting (and creates it if neccessary) + \param wParam = PDBTSetting + \param lParam = 0 + + \return TDBTSettingHandle on success, 0 otherwise +**/ +#define MS_DBT_SETTING_WRITE "DBT/Setting/Write" + +/** + \brief retrieves the handle of the setting + \param wParam = PDBTSetting + \param lParam = TDBTSettingHandle, could be 0 to create new setting, but needs wParam->Descriptor with valid data + + \return hSetting when found or created, 0 otherwise +**/ +#define MS_DBT_SETTING_WRITEHANDLE "DBT/Setting/WriteHandle" + +/** + \brief retrieves the value of the setting + \param wParam = PDBTSetting + \param lParam = 0 + + \return SettingHandle +**/ +#define MS_DBT_SETTING_READ "DBT/Setting/Read" + +/** + \brief retrieves the value of the setting + + Also retrieves the SettingDescriptor if it is set and prepared correctly (name buffers set etc) + \param wParam = PDBTSetting + \param lParam = TDBTSettingHandle + + \return original settings type +**/ +#define MS_DBT_SETTING_READHANDLE "DBT/Setting/ReadHandle" + + + +/** + \brief Settings Filter Options for setting iteration +**/ +typedef + struct TDBTSettingIterFilter { + uint32_t cbSize; /// size in bytes of this structure + uint32_t Options; /// DBT_NIFO_* flags + TDBTEntityHandle hEntity; /// hEntity which settings should be iterated (or where iteration begins) + char * NameStart; /// if set != NULL the iteration will only return settings which name starts with this string + uint32_t ExtraCount; /// count of additional Entities which settings are enumerated, size of the array pointed by ExtraEntities + TDBTEntityHandle * ExtraEntities; /// pointer to an array with additional Entity handles in prioritized order + + PDBTSettingDescriptor Descriptor; /// if set, the iteration will fill in the correct data, you may set SettingsNameLength and SettingName to a buffer to recieve the name of each setting + PDBTSetting Setting; /// if set, iteration loads every settings value, except variable length data (blob, strings) but returns their length + + } TDBTSettingIterFilter, *PDBTSettingIterFilter; + + +/** + \brief Handle of a Setting-Iteration +**/ +typedef uintptr_t TDBTSettingIterationHandle; +/** + \brief initialize an iteration of settings + \param wParam = PDBTSettingIterFilter + \param lParam = 0 + + \return EnumID +**/ +#define MS_DBT_SETTING_ITER_INIT "DBT/Setting/Iter/Init" + + +/** + \brief get the next setting + \param wParam = EnumID returned by MS_DBT_SETTING_ITER_INIT + \param lParam = 0 + + \return hSetting, 0 at the end +**/ +#define MS_DBT_SETTING_ITER_NEXT "DBT/Setting/Iter/Next" + +/** + \brief closes an iteration and frees its ressourcs + \param wParam = IterationHandle returned by MS_DBT_SETTING_ITER_INIT + \param lParam = 0 + + \return 0 on success +**/ +#define MS_DBT_SETTING_ITER_CLOSE "DBT/Setting/Iter/Close" + + +/////////////////////////////////////////////////////////// +// Events +/////////////////////////////////////////////////////////// + +typedef uint32_t TDBTEventHandle; + + +/** + \brief this event was sent by the user. If not set this event was received. +**/ +static const uint32_t DBT_EF_SENT = 0x00000002; + +/** + \brief event has been read by the user. It does not need to be processed any more except for history. +**/ +static const uint32_t DBT_EF_READ = 0x00000004; + +/** + \brief event contains the right-to-left aligned text +**/ +static const uint32_t DBT_EF_RTL = 0x00000008; + +/** + \brief event contains a text in utf-8 +**/ +static const uint32_t DBT_EF_UTF = 0x00000010; + +/** + \brief event is virtual. it is not stored to db file yet. +**/ +static const uint32_t DBT_EF_VIRTUAL = 0x00000020; + +/** + \brief describes an event +**/ +typedef struct TDBTEvent { + uint32_t cbSize; /// size of the structure in bytes + char * ModuleName; /// + uint32_t 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. + uint32_t Flags; /// the omnipresent flags + uint32_t EventType; /// module-unique event type ID + uint32_t cbBlob; /// size of pBlob in bytes + uint8_t * pBlob; /// pointer to buffer containing module-defined event data +} TDBTEvent, *PDBTEvent; + +static const uint32_t DBT_EventType_Message = 0; +static const uint32_t DBT_EventType_URL = 1; +static const uint32_t DBT_EventType_Contacts = 2; +static const uint32_t DBT_EventType_Added = 1000; +static const uint32_t DBT_EventType_AuthRequest = 1001; //specific codes, hence the module- +static const uint32_t DBT_EventType_File = 1002; //specific limit has been raised to 2000 + + +/** + \brief retrieves the blobsize of an event in bytes + \param wParam = hEvent + \param lParam = 0 + + \return blobsize +**/ +#define MS_DBT_EVENT_GETBLOBSIZE "DBT/Event/GetBlobSize" + + + +/** + \brief retrieves all information of an event + \param wParam = hEvent + \param lParam = PDBTEvent + + \return 0 on success +**/ +#define MS_DBT_EVENT_GET "DBT/Event/Get" + +/** + \brief retrieves all information of an event + \param wParam = hEntity + \param lParam = 0 + + \return Event count of specified Entity on success, DBT_INVALIDPARAM on error +**/ +#define MS_DBT_EVENT_GETCOUNT "DBT/Event/GetCount" + + +/** + \brief Deletes the specfied event + \param wParam = hEntity + \param lParam = hEvent + + \return 0 on success +**/ +#define MS_DBT_EVENT_DELETE "DBT/Event/Delete" + +/** + \brief Creates a new Event + \param wParam = hEntity + \param lParam = PDBTEvent + + \return hEvent on success, 0 otherwise +**/ + +#define MS_DBT_EVENT_ADD "DBT/Event/Add" + + +/** + \brief Changes the flags for an event to mark it as read. + \param wParam = hEntity + \param lParam = hEvent + + \return New flags +**/ +#define MS_DBT_EVENT_MARKREAD "DBT/Event/MarkRead" + +/** + \brief Saves a virtual event to file and changes the flags. + \param wParam = hEntity + \param lParam = hEvent + + \return 0 on success +**/ +#define MS_DBT_EVENT_WRITETODISK "DBT/Event/WriteToDisk" + +/** + \brief Retrieves a handle to a Entity that owns hEvent. + \param wParam = hEvent + \param lParam = 0 + + \return NULL is a valid return value, meaning, as usual, the user. + DBT_INVALIDPARAM if hDbEvent is invalid, or the handle to the Entity on + success +**/ +#define MS_DBT_EVENT_GETENTITY "DBT/Event/GetEntity" + +/** + \brief Event Filter Options for event iteration +**/ +typedef + struct TDBTEventIterFilter { + uint32_t cbSize; /// size in bytes of this structure + uint32_t Options; /// DBT_NIFO_* flags + TDBTEntityHandle hEntity; /// hEntity which events should be iterated (or where iteration begins) + uint32_t ExtraCount; /// count of additional Entities which settings are enumerated, size of the array pointed by ExtraEntities + TDBTEntityHandle * ExtraEntities; /// pointer to an array with additional Entity handles in prioritized order + + uint32_t tSince; /// timestamp when to start iteration, 0 for first item + uint32_t tTill; /// timestamp when to stop iteration, 0 for last item + + PDBTEvent Event; /// if set every events data gets stored there + + } TDBTEventIterFilter, *PDBTEventIterFilter; + + +/** + \brief Handle of a Event-Iteration +**/ +typedef uintptr_t TDBTEventIterationHandle; +/** + \brief initialize an iteration of events + \param wParam = PDBTEventIterFilter + \param lParam = 0 + + \return EnumID +**/ +#define MS_DBT_EVENT_ITER_INIT "DBT/Event/Iter/Init" + + +/** + \brief get the next event + \param wParam = EnumID returned by MS_DBT_EVENT_ITER_INIT + \param lParam = 0 + + \return hSetting, 0 at the end +**/ +#define MS_DBT_EVENT_ITER_NEXT "DBT/Event/Iter/Next" + +/** + \brief closes an iteration and frees its resourcs + \param wParam = IterationHandle returned by MS_DBT_EVENT_ITER_INIT + \param lParam = 0 + + \return 0 on success +**/ +#define MS_DBT_EVENT_ITER_CLOSE "DBT/Event/Iter/Close" + + + +#pragma pack(pop) + +#endif diff --git a/ExternalAPI/m_flash.h b/ExternalAPI/m_flash.h index 35184a3..bfc9e9f 100644 --- a/ExternalAPI/m_flash.h +++ b/ExternalAPI/m_flash.h @@ -38,12 +38,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define MS_FAVATAR_RESIZE "FlashAvatar/Resize" -/** - WPARAM FLASHAVATAR* (hContact, hParentWindow) - LPARAM LPRECT - */ -#define MS_FAVATAR_SETPOS "FlashAvatar/SetPos" - /** WPARAM FLASHAVATAR* (hContact, hParentWindow) LPARAM not used @@ -56,10 +50,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define MS_FAVATAR_SETEMOFACE "FlashAvatar/SetEmoFace" +#define MS_FAVATAR_SETPOS "FlashAvatar/SetPos" + /** WPARAM FLASHAVATAR* (hContact, hParentWindow) LPARAM COLORREF */ + #define MS_FAVATAR_SETBKCOLOR "FlashAvatar/SetBkColor" // tZers macros @@ -81,6 +78,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define AV_LOVE "love" #define AV_NORMAL "stam" +#define FAVATAR_WIDTH 52 +#define FAVATAR_HEIGHT 64 + // FLASHAVATAR structure typedef struct { HANDLE hContact; // contact who flash avatar belongs to @@ -88,5 +88,6 @@ typedef struct { HWND hParentWindow; // handle of flash avatar's parent object char* cUrl; // url of .swf file int id; // unique number of plugin which wants to use avatar service - char* cProto; // contact's protocol + char* cProto; // contacts protocol + char reserved[16]; // future usage } FLASHAVATAR; diff --git a/ExternalAPI/m_historyevents.h b/ExternalAPI/m_historyevents.h new file mode 100644 index 0000000..f73bf95 --- /dev/null +++ b/ExternalAPI/m_historyevents.h @@ -0,0 +1,424 @@ +/* +Copyright (C) 2006 Ricardo Pescuma Domenecci + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ + + +#ifndef __M_HISTORYEVENTS_H__ +# define __M_HISTORYEVENTS_H__ + + +#define MIID_HISTORYEVENTS { 0xc8be8543, 0x6618, 0x4030, { 0x85, 0xcf, 0x90, 0x82, 0xc7, 0xde, 0x7f, 0xf7 } } + + +#define HISTORYEVENTS_FORMAT_CHAR 1 +#define HISTORYEVENTS_FORMAT_WCHAR 2 +#define HISTORYEVENTS_FORMAT_RICH_TEXT 4 +#define HISTORYEVENTS_FORMAT_HTML 8 + +#define HISTORYEVENTS_FLAG_DEFAULT (1 << 0) // Is a miranda core event type +#define HISTORYEVENTS_FLAG_SHOW_IM_SRMM (1 << 1) // If this event has to be shown in srmm dialog +#define HISTORYEVENTS_FLAG_USE_SENT_FLAG (1 << 2) // Means that it can be a sent or received and uses DBEF_SENT to mark that +#define HISTORYEVENTS_FLAG_EXPECT_CONTACT_NAME_BEFORE (1 << 3) // Means that who is drawing this should draw the contact name before the text +#define HISTORYEVENTS_FLAG_ONLY_LOG_IF_SRMM_OPEN (1 << 4) // If this event will be logged only if the message window is open +#define HISTORYEVENTS_FLAG_FLASH_MSG_WINDOW (1 << 5) // If this event will trigger the openning/flashing of the message window +#define HISTORYEVENTS_REGISTERED_IN_ICOLIB (9 << 16) // If the icon is a name already registered in icolib +#define HISTORYEVENTS_FLAG_KEEP_ONE_YEAR (1 << 8) // By default store in db for 1 year +#define HISTORYEVENTS_FLAG_KEEP_SIX_MONTHS (2 << 8) // By default store in db for 6 months +#define HISTORYEVENTS_FLAG_KEEP_ONE_MONTH (3 << 8) // By default store in db for 1 month +#define HISTORYEVENTS_FLAG_KEEP_ONE_WEEK (4 << 8) // By default store in db for 1 week +#define HISTORYEVENTS_FLAG_KEEP_ONE_DAY (5 << 8) // By default store in db for 1 day +#define HISTORYEVENTS_FLAG_KEEP_FOR_SRMM (6 << 8) // By default store in db only enought for message log +#define HISTORYEVENTS_FLAG_KEEP_MAX_TEN (7 << 8) // By default store in db max 10 entries +#define HISTORYEVENTS_FLAG_KEEP_MAX_HUNDRED (8 << 8) // By default store in db for 100 entries +#define HISTORYEVENTS_FLAG_KEEP_DONT (9 << 8) // By default don't store in db (aka ignore it) + + +// This function must be implemented by subscribers. It must return a pointer or NULL +// to say it can't handle the text +typedef void * (*fGetHistoryEventText)(HANDLE hContact, HANDLE hDbEvent, DBEVENTINFO *dbe, int format); + +typedef struct { + int cbSize; + char *module; + char *name; // Internal event name + char *description; // Will be translated. When retrieving it is already translated + WORD eventType; // The event type it can handle + union { + HICON defaultIcon; + char * defaultIconName; // if HISTORYEVENTS_REGISTERED_IN_ICOLIB is set. Always use this one when retrieving + }; + int supports; // What kind of return is supported - or of HISTORYEVENTS_FORMAT_* + int flags; // or of HISTORYEVENTS_FLAG_* + fGetHistoryEventText pfGetHistoryEventText; // NULL to use default get text (similar to message, without extra format) + + // Aditional data if wants to use add to history services + char **templates; // Each entry is: "Name\nDefault\n%var%\tDescription\n%var%\tDescription\n%var%\tDescription" + int numTemplates; + +} HISTORY_EVENT_HANDLER; + + +/* +Get the number of registered events + +wParam: ignored +lParam: ignored +Return: The number of events registered with the plugin +*/ +#define MS_HISTORYEVENTS_GET_COUNT "HistoryEvents/GetCount" + + +/* +Get an event by number or by type. +To retrieve by number, pass -1 as type. To retrieve by type, pass -1 as number. + +wParam: (int) event number +lParam: (int) event type +Return: (const HISTORY_EVENT_HANDLER *) if the event exists, NULL otherwise. Don't change the + returned strunc: it is a pointer to the internall struct. +*/ +#define MS_HISTORYEVENTS_GET_EVENT "HistoryEvents/GetEvent" + + +/* +Register a plugin that can handle an event type. This must be called during the call to the +Load function of the plugin. In ModulesLoaded callback all plugins have to be already registered, +so srmm and history modules can query then. + +wParam: HISTORY_EVENT_HANDLER * +lParam: ignored +Return: 0 for success +*/ +#define MS_HISTORYEVENTS_REGISTER "HistoryEvents/Register" + + +typedef struct { + int cbSize; + HANDLE hDbEvent; + DBEVENTINFO *dbe; // Optional + int format; // one of HISTORYEVENTS_FORMAT_* + +} HISTORY_EVENT_PARAM; + +/* +Check if an event can be handled by any subscribers + +wParam: WORD - event type +lParam: ignored +Return: BOOL +*/ +#define MS_HISTORYEVENTS_CAN_HANDLE "HistoryEvents/CanHandle" + +/* +Get the icon for a history event type + +wParam: WORD - event type +lParam: ignored +Return: HICON - after use free with MS_HISTORYEVENTS_RELEASE_ICON +*/ +#define MS_HISTORYEVENTS_GET_ICON "HistoryEvents/GetIcon" + +/* +Get the flags for a history event type + +wParam: WORD - event type +lParam: ignored +Return: int - or of HISTORYEVENTS_FLAG_* or -1 if error +*/ +#define MS_HISTORYEVENTS_GET_FLAGS "HistoryEvents/GetFlags" + +/* +Release the icon for a history event type. This is really just a forward to icolib + +wParam: HICON +lParam: ignored +*/ +#define MS_HISTORYEVENTS_RELEASE_ICON "Skin2/Icons/ReleaseIcon" + +/* +Get the text for a history event type + +wParam: HISTORY_EVENT_PARAM * +lParam: ignored +Return: char * or wchar * depending on sent flags. Free with mir_free or MS_HISTORYEVENTS_RELEASE_TEXT +*/ +#define MS_HISTORYEVENTS_GET_TEXT "HistoryEvents/GetText" + +/* +Release the text for a history event type. Internally is just a call to mir_free + +wParam: char * or wchar * +lParam: ignored +*/ +#define MS_HISTORYEVENTS_RELEASE_TEXT "HistoryEvents/ReleaseText" + + + +typedef struct { + int cbSize; + HANDLE hContact; + WORD eventType; + int templateNum; + TCHAR **variables; + int numVariables; + PBYTE additionalData; + int additionalDataSize; + int flags; // Flags for the event type +} HISTORY_EVENT_ADD; + +/* +Add an registered event to the history. This is a helper service + +wParam: HISTORY_EVENT_ADD +lParam: ignored +Return: HANDLE to the db event +*/ +#define MS_HISTORYEVENTS_ADD_TO_HISTORY "HistoryEvents/AddToHistory" + +/* +Check if a template is enabled + +wParam: event type +lParam: template num +Return: TRUE or FALSE +*/ +#define MS_HISTORYEVENTS_IS_ENABLED_TEMPLATE "HistoryEvents/IsEnabledTemplate" + + + +// Helper functions ////////////////////////////////////////////////////////////////////////////// + + + + +static int HistoryEvents_Register(char *module, char *name, char *description, int eventType, HICON defaultIcon, + int supports, int flags, fGetHistoryEventText pfGetHistoryEventText) +{ + HISTORY_EVENT_HANDLER heh = {0}; + + if (!ServiceExists(MS_HISTORYEVENTS_REGISTER)) + return 1; + + heh.cbSize = sizeof(heh); + heh.module = module; + heh.name = name; + heh.description = description; + heh.eventType = eventType; + heh.defaultIcon = defaultIcon; + heh.supports = supports; + heh.flags = flags; + heh.pfGetHistoryEventText = pfGetHistoryEventText; + return CallService(MS_HISTORYEVENTS_REGISTER, (WPARAM) &heh, 0); +} + +static int HistoryEvents_RegisterWithTemplates(char *module, char *name, char *description, int eventType, HICON defaultIcon, + int supports, int flags, fGetHistoryEventText pfGetHistoryEventText, + char **templates, int numTemplates) +{ + HISTORY_EVENT_HANDLER heh = {0}; + + if (!ServiceExists(MS_HISTORYEVENTS_REGISTER)) + return 1; + + heh.cbSize = sizeof(heh); + heh.module = module; + heh.name = name; + heh.description = description; + heh.eventType = eventType; + heh.defaultIcon = defaultIcon; + heh.supports = supports; + heh.flags = flags; + heh.pfGetHistoryEventText = pfGetHistoryEventText; + heh.templates = templates; + heh.numTemplates = numTemplates; + return CallService(MS_HISTORYEVENTS_REGISTER, (WPARAM) &heh, 0); +} + +static int HistoryEvents_RegisterMessageStyle(char *module, char *name, char *description, int eventType, HICON defaultIcon, + int flags, char **templates, int numTemplates) +{ + HISTORY_EVENT_HANDLER heh = {0}; + + if (!ServiceExists(MS_HISTORYEVENTS_REGISTER)) + return 1; + + heh.cbSize = sizeof(heh); + heh.module = module; + heh.name = name; + heh.description = description; + heh.eventType = eventType; + heh.defaultIcon = defaultIcon; + heh.flags = flags; + heh.templates = templates; + heh.numTemplates = numTemplates; + return CallService(MS_HISTORYEVENTS_REGISTER, (WPARAM) &heh, 0); +} + +static BOOL HistoryEvents_CanHandle(WORD eventType) +{ + if (!ServiceExists(MS_HISTORYEVENTS_CAN_HANDLE)) + return FALSE; + + return (BOOL) CallService(MS_HISTORYEVENTS_CAN_HANDLE, (WPARAM) eventType, 0); +} + +static HICON HistoryEvents_GetIcon(WORD eventType) +{ + if (!ServiceExists(MS_HISTORYEVENTS_GET_ICON)) + return NULL; + + return (HICON) CallService(MS_HISTORYEVENTS_GET_ICON, (WPARAM) eventType, 0); +} + +static int HistoryEvents_GetFlags(WORD eventType) +{ + if (!ServiceExists(MS_HISTORYEVENTS_GET_FLAGS)) + return -1; + + return (int) CallService(MS_HISTORYEVENTS_GET_FLAGS, (WPARAM) eventType, 0); +} + +static void HistoryEvents_ReleaseIcon(HICON icon) +{ + CallService(MS_HISTORYEVENTS_RELEASE_ICON, (WPARAM) icon, 0); +} + +static char * HistoryEvents_GetTextA(HANDLE hDbEvent, DBEVENTINFO *dbe) +{ + HISTORY_EVENT_PARAM hep = {0}; + + if (!ServiceExists(MS_HISTORYEVENTS_GET_TEXT)) + return NULL; + + hep.cbSize = sizeof(hep); + hep.hDbEvent = hDbEvent; + hep.dbe = dbe; + hep.format = HISTORYEVENTS_FORMAT_CHAR; + return (char *) CallService(MS_HISTORYEVENTS_GET_TEXT, (WPARAM) &hep, 0); +} + +static wchar_t * HistoryEvents_GetTextW(HANDLE hDbEvent, DBEVENTINFO *dbe) +{ + HISTORY_EVENT_PARAM hep = {0}; + + if (!ServiceExists(MS_HISTORYEVENTS_GET_TEXT)) + return NULL; + + hep.cbSize = sizeof(hep); + hep.hDbEvent = hDbEvent; + hep.dbe = dbe; + hep.format = HISTORYEVENTS_FORMAT_WCHAR; + return (wchar_t *) CallService(MS_HISTORYEVENTS_GET_TEXT, (WPARAM) &hep, 0); +} + +static char * HistoryEvents_GetRichText(HANDLE hDbEvent, DBEVENTINFO *dbe) +{ + HISTORY_EVENT_PARAM hep = {0}; + + if (!ServiceExists(MS_HISTORYEVENTS_GET_TEXT)) + return NULL; + + hep.cbSize = sizeof(hep); + hep.hDbEvent = hDbEvent; + hep.dbe = dbe; + hep.format = HISTORYEVENTS_FORMAT_RICH_TEXT; + return (char *) CallService(MS_HISTORYEVENTS_GET_TEXT, (WPARAM) &hep, 0); +} + +#define HistoryEvents_ReleaseText mir_free +//static void HistoryEvents_ReleaseText(void *str) +//{ +// if (!ServiceExists(MS_HISTORYEVENTS_RELEASE_TEXT)) +// return; +// +// CallService(MS_HISTORYEVENTS_RELEASE_TEXT, (WPARAM) str, 0); +//} + +static HANDLE HistoryEvents_AddToHistoryEx(HANDLE hContact, WORD eventType, int templateNum, + TCHAR **variables, int numVariables, + PBYTE additionalData, int additionalDataSize, + int flags) +{ + HISTORY_EVENT_ADD hea = {0}; + + if (!ServiceExists(MS_HISTORYEVENTS_ADD_TO_HISTORY)) + return NULL; + + hea.cbSize = sizeof(hea); + hea.hContact = hContact; + hea.eventType = eventType; + hea.templateNum = templateNum; + hea.numVariables = numVariables; + hea.variables = variables; + hea.additionalData = additionalData; + hea.additionalDataSize = additionalDataSize; + hea.flags = flags; + + return (HANDLE) CallService(MS_HISTORYEVENTS_ADD_TO_HISTORY, (WPARAM) &hea, 0); +} + +static HANDLE HistoryEvents_AddToHistoryVars(HANDLE hContact, WORD eventType, int templateNum, + TCHAR **variables, int numVariables, + int flags) +{ + HISTORY_EVENT_ADD hea = {0}; + + if (!ServiceExists(MS_HISTORYEVENTS_ADD_TO_HISTORY)) + return NULL; + + hea.cbSize = sizeof(hea); + hea.hContact = hContact; + hea.eventType = eventType; + hea.templateNum = templateNum; + hea.numVariables = numVariables; + hea.variables = variables; + hea.flags = flags; + + return (HANDLE) CallService(MS_HISTORYEVENTS_ADD_TO_HISTORY, (WPARAM) &hea, 0); +} + +static HANDLE HistoryEvents_AddToHistorySimple(HANDLE hContact, WORD eventType, int templateNum, int flags) +{ + HISTORY_EVENT_ADD hea = {0}; + + if (!ServiceExists(MS_HISTORYEVENTS_ADD_TO_HISTORY)) + return NULL; + + hea.cbSize = sizeof(hea); + hea.hContact = hContact; + hea.eventType = eventType; + hea.templateNum = templateNum; + hea.flags = flags; + + return (HANDLE) CallService(MS_HISTORYEVENTS_ADD_TO_HISTORY, (WPARAM) &hea, 0); +} + +static BOOL HistoryEvents_IsEnabledTemplate(WORD eventType, int templateNum) +{ + return (BOOL) CallService(MS_HISTORYEVENTS_IS_ENABLED_TEMPLATE, eventType, templateNum); +} + +#ifdef UNICODE +# define HistoryEvents_GetTextT HistoryEvents_GetTextW +#else +# define HistoryEvents_GetTextT HistoryEvents_GetTextA +#endif + + + +#endif // __M_HISTORYEVENTS_H__ diff --git a/ExternalAPI/m_ieview.h b/ExternalAPI/m_ieview.h index dbc2037..e8fa237 100644 --- a/ExternalAPI/m_ieview.h +++ b/ExternalAPI/m_ieview.h @@ -1,7 +1,7 @@ /* IEView Plugin for Miranda IM -Copyright (C) 2005-2008 Piotr Piastucki +Copyright (C) 2005 Piotr Piastucki This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -18,16 +18,15 @@ 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_IEVIEW_INCLUDED #define M_IEVIEW_INCLUDED #define MS_IEVIEW_WINDOW "IEVIEW/NewWindow" #define MS_IEVIEW_EVENT "IEVIEW/Event" -#define MS_IEVIEW_UTILS "IEVIEW/Utils" #define MS_IEVIEW_NAVIGATE "IEVIEW/Navigate" -#define MS_IEVIEW_SHOWSMILEYSELECTION "IEVIEW/ShowSmileySelection" + #define ME_IEVIEW_OPTIONSCHANGED "IEVIEW/OptionsChanged" -#define ME_IEVIEW_NOTIFICATION "IEVIEW/Notification" /* IEView window commands */ #define IEW_CREATE 1 // create new window (control) @@ -36,9 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define IEW_SCROLLBOTTOM 4 // scroll text to bottom /* IEView window type/mode */ -#define IEWM_SRMM 0 // regular SRMM #define IEWM_TABSRMM 1 // TabSRMM-compatible HTML builder -#define IEWM_HTML 2 // HTML #define IEWM_SCRIVER 3 // Scriver-compatible HTML builder #define IEWM_MUCC 4 // MUCC group chats GUI #define IEWM_CHAT 5 // chat.dll group chats GUI @@ -56,6 +53,7 @@ typedef struct { int y; // IE control vertical position int cx; // IE control horizontal size int cy; // IE control vertical size + } IEVIEWWINDOW; #define IEEDF_UNICODE 0x00000001 // if set pszText is a pointer to wchar_t string instead of char string diff --git a/ExternalAPI/m_mydetails.h b/ExternalAPI/m_mydetails.h new file mode 100644 index 0000000..ad60433 --- /dev/null +++ b/ExternalAPI/m_mydetails.h @@ -0,0 +1,187 @@ +/* +Copyright (C) 2005 Ricardo Pescuma Domenecci + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ + + +#ifndef __M_MYDETAILS_H__ +# define __M_MYDETAILS_H__ + + +#define MIID_MDETAILS { 0xdba18dbc, 0x5be6, 0x4504, { 0xa7, 0x99, 0x29, 0xec, 0x6c, 0xca, 0x0, 0x65 } } + + + +/* +MyDetails/SetMyNickname service +Set the nickname for all possible protocols + +wparam = (const char *) protocol name or NULL for all protocols +lparam = (const char *) new nickname +returns: -2 if proto can't set this, -1 on protocol not found, else 0 +*/ +#define MS_MYDETAILS_SETMYNICKNAME "MyDetails/SetMyNickname" + + +/* +MyDetails/SetMyNicknameUI service +Shows a dialog to set the nickname for all possible protocols + +wparam = 0 +lparam = (const char *) protocol name or NULL for all protocols +returns: -2 if proto can't set this, -1 on protocol not found, else 0 +*/ +#define MS_MYDETAILS_SETMYNICKNAMEUI "MyDetails/SetMyNicknameUI" + + +/* +MyDetails/SetMyAvatar service +Set the avatar for all possible protocols + +wparam = (const char *) protocol name or NULL for all protocols +lparam = (const char *) new avatar file name +returns: -2 if proto can't set this, -1 on protocol not found, else 0 +*/ +#define MS_MYDETAILS_SETMYAVATAR "MyDetails/SetMyAvatar" + + +/* +MyDetails/SetMyAvatarUI service +Shows a dialog to set the avatar for all possible protocols + +wparam = 0 +lparam = (const char *) protocol name or NULL for all protocols +returns: -2 if proto can't set this, -1 on protocol not found, else 0 +*/ +#define MS_MYDETAILS_SETMYAVATARUI "MyDetails/SetMyAvatarUI" + + +/* +MyDetails/GetMyNickname service +Get the nickname + +wparam = (const char *) protocol name or NULL for default nick +lparam = (char *) the buffer to save the nickname. Has to have at least 1024 chars +returns: -1 on protocol not found, else 0 +*/ +#define MS_MYDETAILS_GETMYNICKNAME "MyDetails/GetMyNickname" +#define MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE 1024 + + +/* +MyDetails/GetMyAvatar service +Get the avatar file name + +wparam = (const char *) protocol name or NULL for default avatar +lparam = (char *) the buffer to save the file name. Has to have at least 1024 chars +returns: -2 if proto can't get this, -1 on protocol not found, else 0 +*/ +#define MS_MYDETAILS_GETMYAVATAR "MyDetails/GetMyAvatar" +#define MS_MYDETAILS_GETMYAVATAR_BUFFER_SIZE 1024 + + +/* +MyDetails/SetMyStatusMessageUI service +Shows a dialog to set the status message for all possible protocols +Today only works if NAS is installed. + +wparam = 0 +lparam = (const char *) protocol name or NULL for all protocols +returns: -2 if proto can't set this, -1 on protocol not found, else 0 +*/ +#define MS_MYDETAILS_SETMYSTATUSMESSAGEUI "MyDetails/SetMyStatusMessageUI" +#define MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE 1024 + + +/* +MyDetails/ShowNextProtocol service +Shows the next protocol in the frame + +wparam = 0 +lparam = 0 +returns: -1 on error, 0 on success +*/ +#define MS_MYDETAILS_SHOWNEXTPROTOCOL "MyDetails/ShowNextProtocol" + + +/* +MyDetails/ShowPreviousProtocol service +Shows the previous protocol in the frame + +wparam = 0 +lparam = 0 +returns: -1 on error, 0 on success +*/ +#define MS_MYDETAILS_SHOWPREVIOUSPROTOCOL "MyDetails/ShowPreviousProtocol" + + +/* +MyDetails/ShowProtocol service +Shows a protocol given its name in the frame + +wparam = 0 +lparam = protocol name +returns: -1 on error, 0 on success +*/ +#define MS_MYDETAILS_SHOWPROTOCOL "MyDetails/ShowProtocol" + + +/* +MyDetails/CicleThroughtProtocols service +Start/stops the cicling throught protocols + +wparam = FALSE to stop, TRUE to start +lparam = 0 +returns: -1 on error, 0 on success +*/ +#define MS_MYDETAILS_CYCLE_THROUGH_PROTOCOLS "MyDetails/CicleThroughtProtocols" + + +/* +MyDetails/ShowFrame service +Shows the MyDetails frame/window if it is hidden + +wparam = 0 +lparam = 0 +returns: 0 +*/ +#define MS_MYDETAILS_SHOWFRAME "MyDetails/ShowFrame" + + +/* +MyDetails/HideFrame service +Hides the MyDetails frame/window if it is shown + +wparam = 0 +lparam = 0 +returns: 0 +*/ +#define MS_MYDETAILS_HIDEFRAME "MyDetails/HideFrame" + + +/* +MyDetails/ShowHideMyDetails service +Shows the MyDetails frame/window if it is hidden or hides the MyDetails frame/window if it is shown + +wparam = 0 +lparam = 0 +returns: 0 +*/ +#define MS_MYDETAILS_SHOWHIDEFRAME "MyDetails/ShowHideMyDetails" + + +#endif diff --git a/ExternalAPI/m_nudge.h b/ExternalAPI/m_nudge.h new file mode 100644 index 0000000..e87e410 --- /dev/null +++ b/ExternalAPI/m_nudge.h @@ -0,0 +1,5 @@ +#define MS_SHAKE_CLIST "SHAKE/Service/ShakeClist" +#define MS_SHAKE_CHAT "SHAKE/Service/ShakeChat" +#define MS_SHAKE_CLIST_TRIGGER "SHAKE/Service/TriggerShakeClist" +#define MS_SHAKE_CHAT_TRIGGER "SHAKE/Service/TirggerShakeChat" +#define MS_NUDGE_SEND "NUDGE/Send" diff --git a/ExternalAPI/m_radio.h b/ExternalAPI/m_radio.h new file mode 100644 index 0000000..0adc12a --- /dev/null +++ b/ExternalAPI/m_radio.h @@ -0,0 +1,94 @@ +#ifndef M_RADIO +#define M_RADIO + +#ifndef MIID_MRADIO +#define MIID_MRADIO {0xeebc474c, 0xb0ad, 0x470f, {0x99, 0xa8, 0x9d, 0xd9, 0x21, 0x0c, 0xe2, 0x33}} +#endif + +// command codes +#define MRC_STOP 0 +#define MRC_PLAY 1 // lParam is radio contact handle +#define MRC_PAUSE 2 +#define MRC_PREV 3 +#define MRC_NEXT 4 +#define MRC_STATUS 5 // lParam is RD_STATUS_* value (RD_STATUS_GET only now) +#define MRC_SEEK 6 // lParam is value in sec; -1 mean obtain current position +#define MRC_RECORD 7 // lParam is 0 - switch; 1 - on; 2 - off + +// please, do not use these commands, internal using only +#define RD_STATUS_NOSTATION 0 // no active station found +#define RD_STATUS_PLAYING 1 // media is playing +#define RD_STATUS_PAUSED 2 // media is paused +#define RD_STATUS_STOPPED 3 // media is stopped (only for playlists) +#define RD_STATUS_CONNECT 4 // plugin try to connect to the station +#define RD_STATUS_ABORT 5 // plugin want to abort while try to connect +// next command is for users +#define RD_STATUS_GET 6 // to get current status + +/* + Open radio Options, if Main Options window not opened + wParam: 0 + lParam: 0 +*/ +#define MS_RADIO_SETTINGS "mRadio/Settings" +/* + Switch 'record' mode + wParam: 0 - switch mode; else - get record status + lParam: 0 + Return: Current status: 1 - record is ON +*/ +#define MS_RADIO_RECORD "mRadio/REC" + +/* + Set current radio volume + wParam: volume (0-100) + lParam: must be 0 +*/ +#define MS_RADIO_SETVOL "mRadio/SetVol" + +/* + Send command to mRadio + wParam: command (see MRC_* constant) + lParam: value (usually 0) + Return: return value (now for status only) +*/ +#define MS_RADIO_COMMAND "mRadio/Command" + +/* + Starting or stopping radio station + wParam: Radio contact handle (lParam=0) or Station name + lParam: 0 - wParam is handle, 1 - ANSI, else - unicode +*/ +#define MS_RADIO_PLAYSTOP "mRadio/PlayStop" + +/* + wParam: station handle (0 - all) + lParam: nil (through dialog, radio.ini by default) or ansi string with filename + Return: exported stations amount +*/ +#define MS_RADIO_EXPORT "mRadio/Export" + +/* + wParam: group to import radio or 0 + lParam: nil (through dialog, radio.ini by default) or ansi string with filename + Return: imported stations amount +*/ +#define MS_RADIO_IMPORT "mRadio/Import" + +/* + MRC_STOP , LParam - 0 + MRC_PLAY , LParam - url + MRC_PAUSE , LParam - 0 (pause) / 1 (play) + MRC_SEEK , LParam - lParam is value in sec + MRC_RECORD , LParam - 0 (stop) / 1 (record) +*/ +#define ME_RADIO_STATUS "mRadio/Status" + +/* + wParam: 0 - switch; 1 - switch on; -1 - switch off + lParam: 0 + Return: last state (0 - was off, 1 - was on) +*/ +#define MS_RADIO_EQONOFF "mRadio/EqOnOff" + +#endif diff --git a/ExternalAPI/m_skin_eng.h b/ExternalAPI/m_skin_eng.h new file mode 100644 index 0000000..c099a28 --- /dev/null +++ b/ExternalAPI/m_skin_eng.h @@ -0,0 +1,435 @@ +/* + +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 + + + +/*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) +{ + SKINDRAWREQUEST rq; + POINT pt={0}; + RECT rc,r1; + + HWND hwnd=(HWND)CallService(MS_CLUI_GETHWND,0,0); + if (!objectID) return 0; + GetWindowRect(hwndIn,&r1); + pt.x=r1.left; + pt.y=r1.top; + //ClientToScreen(hwndIn,&pt); + GetWindowRect(hwnd,&rc); + OffsetRect(&rc,-pt.x ,-pt.y); + rq.hDC=hdc; + rq.rcDestRect=rc; + rq.rcClipRect=*rcClip; + strncpy(rq.szObjectID,objectID,sizeof(rq.szObjectID)); + ///ske_Service_DrawGlyph((WPARAM)&rq,0); //$$$ + return CallService(MS_SKIN_DRAWGLYPH,(WPARAM)&rq,0); +} + + +//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); +//} +static 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 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 + + +inline BOOL isSkinEngineEnabled() +{ + return ServiceExists(MS_SKINENG_REGISTERPAINTSUB) && !DBGetContactSettingByte(NULL, "ModernData", "DisableEngine", FALSE); +} + + +inline BOOL isLayeredEnabled() +{ + return isSkinEngineEnabled() && DBGetContactSettingByte(NULL, "ModernData", "EnableLayering", TRUE); +} + +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 && !isLayeredEnabled()) 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,BOOL bErase) +{ + 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); +} + +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); +} + + + + +// Register of plugin's user +// +// wParam = (WPARAM)szSetting - string that describes a user +// format: Category/ModuleName, +// eg: "Contact list background/CLUI", +// "Status bar background/StatusBar" +// lParam = (LPARAM)dwFlags +// +#define MS_BACKGROUNDCONFIG_REGISTER "ModernBkgrCfg/Register" + +// +// Notification about changed background +// wParam = ModuleName +// lParam = 0 +#define ME_BACKGROUNDCONFIG_CHANGED "ModernBkgrCfg/Changed" + + + +#endif diff --git a/ExternalAPI/m_skins.h b/ExternalAPI/m_skins.h new file mode 100644 index 0000000..da01064 --- /dev/null +++ b/ExternalAPI/m_skins.h @@ -0,0 +1,142 @@ +/* +Copyright (C) 2008 Ricardo Pescuma Domenecci + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ + + +#ifndef __M_SKINS_H__ +# define __M_SKINS_H__ + +#include + +#define MIID_SKINS { 0x917db7a4, 0xd0fe, 0x4b1c, { 0x8c, 0xa3, 0x6d, 0xc1, 0x44, 0x80, 0xf5, 0xcc } } + + +typedef void * SKINNED_DIALOG; +typedef void * SKINNED_FIELD; +typedef void * SKINNED_DIALOG_STATE; +typedef void * SKINNED_FIELD_STATE; + +typedef void (*SkinOptionsChangedCallback)(void *param, SKINNED_DIALOG dlg); + + +#define SKN_HALIGN_LEFT 1 +#define SKN_HALIGN_CENTER 2 +#define SKN_HALIGN_RIGHT 3 + +#define SKN_VALIGN_TOP 1 +#define SKN_VALIGN_CENTER 2 +#define SKN_VALIGN_BOTTOM 3 + + +/// Some common parameters: +/// - name : internal name and name used inside skin file +/// - description : name shown to the user +/// - module : the module name where the settings will be stored +/// Do not translate any parameters. +struct SKIN_INTERFACE +{ + int cbSize; + + // Global methods + SKINNED_DIALOG (*RegisterDialog)(const char *name, const char *description, const char *module); + void (*DeleteDialog)(SKINNED_DIALOG dlg); + void (*SetSkinChangedCallback)(SKINNED_DIALOG dlg, SkinOptionsChangedCallback cb, void *param); + void (*FinishedConfiguring)(SKINNED_DIALOG dlg); + + // Dialog methods + SKINNED_FIELD (*AddTextField)(SKINNED_DIALOG dlg, const char *name, const char *description); + SKINNED_FIELD (*AddIconField)(SKINNED_DIALOG dlg, const char *name, const char *description); + SKINNED_FIELD (*AddImageField)(SKINNED_DIALOG dlg, const char *name, const char *description); + SKINNED_FIELD (*GetField)(SKINNED_DIALOG dlg, const char *name); + void (*SetDialogSize)(SKINNED_DIALOG dlg, int width, int height); + void (*SetInfoInt)(SKINNED_DIALOG dlg, const char *name, int value); + void (*SetInfoDouble)(SKINNED_DIALOG dlg, const char *name, double value); + void (*SetInfoBool)(SKINNED_DIALOG dlg, const char *name, BOOL value); + void (*SetInfoString)(SKINNED_DIALOG dlg, const char *name, const TCHAR *value); + void (*RemoveInfo)(SKINNED_DIALOG dlg, const char *name); + + // Field methods + void (*SetEnabled)(SKINNED_FIELD field, BOOL enabled); + void (*SetToolTipA)(SKINNED_FIELD field, const char *tooltip); + void (*SetToolTipW)(SKINNED_FIELD field, const WCHAR *tooltip); + + // TextField methods + void (*SetTextA)(SKINNED_FIELD field, const char *text); + void (*SetTextW)(SKINNED_FIELD field, const WCHAR *text); + + // IconField methods + void (*SetIcon)(SKINNED_FIELD field, HICON hIcon); + + // ImageField methods + void (*SetImage)(SKINNED_FIELD field, HBITMAP hBmp); + + // Run the skin and get an state from it + SKINNED_DIALOG_STATE (*Run)(SKINNED_DIALOG dialog); + + // Dialog State methods + SKINNED_FIELD_STATE (*GetFieldState)(SKINNED_DIALOG_STATE dlg, const char *name); + RECT (*GetDialogBorders)(SKINNED_DIALOG_STATE dlg); + + // Field State methods + RECT (*GetRect)(SKINNED_FIELD_STATE field); // With borders + RECT (*GetInsideRect)(SKINNED_FIELD_STATE field); // Without borders + RECT (*GetRawRect)(SKINNED_FIELD_STATE field); // With borders, without processing to assert inside window + RECT (*GetRawInsideRect)(SKINNED_FIELD_STATE field); // Without borders, without processing to assert inside window + RECT (*GetBorders)(SKINNED_FIELD_STATE field); + BOOL (*IsVisible)(SKINNED_FIELD_STATE field); + char * (*GetToolTipA)(SKINNED_FIELD field); // You have to free the result + WCHAR * (*GetToolTipW)(SKINNED_FIELD field); // You have to free the result + int (*GetHorizontalAlign)(SKINNED_FIELD_STATE field); // one of SKN_HALIGN_* + int (*GetVerticalAlign)(SKINNED_FIELD_STATE field); // one of SKN_VALIGN_* + + // TextField State methods + char * (*GetTextA)(SKINNED_FIELD_STATE field); // You have to free the result + WCHAR * (*GetTextW)(SKINNED_FIELD_STATE field); // You have to free the result + HFONT (*GetFont)(SKINNED_FIELD_STATE field); + COLORREF (*GetFontColor)(SKINNED_FIELD_STATE field); + + // IconField State methods + HICON (*GetIcon)(SKINNED_FIELD_STATE field); + + // ImageField State methods + HBITMAP (*GetImage)(SKINNED_FIELD_STATE field); +}; + + + +/* +Skins/GetInterface service +Fill the function pointers for a SKIN_INTERFACE struct + +wparam = 0 +lparam = (SKIN_INTERFACE *) struct to be filled +returns: 0 on success +*/ +#define MS_SKINS_GETINTERFACE "Skins/GetInterface" + + + + +static int mir_skins_getInterface(struct SKIN_INTERFACE *dest) +{ + dest->cbSize = sizeof(SKIN_INTERFACE); + return CallService(MS_SKINS_GETINTERFACE, 0, (LPARAM) dest); +} + + +#endif // __M_SKINS_H__ diff --git a/ExternalAPI/m_skins_cpp.h b/ExternalAPI/m_skins_cpp.h new file mode 100644 index 0000000..bdc7337 --- /dev/null +++ b/ExternalAPI/m_skins_cpp.h @@ -0,0 +1,210 @@ +/* +Copyright (C) 2008 Ricardo Pescuma Domenecci + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ + + +#ifndef __M_SKINS_CPP_H__ +# define __M_SKINS_CPP_H__ + +#include "m_skins.h" + +extern struct SKIN_INTERFACE mski; + + +class SkinFieldState +{ +public: + SkinFieldState(SKINNED_FIELD_STATE field) : tooltip(NULL) { this->field = field; } + virtual ~SkinFieldState() { if (tooltip != NULL) mir_free(tooltip); } + + bool isValid() { return field != NULL; } + + RECT getRect(bool raw = false) { return raw ? mski.GetRawRect(field) : mski.GetRect(field); } + RECT getInsideRect(bool raw = false) { return raw ? mski.GetRawInsideRect(field) : mski.GetInsideRect(field); } + RECT getBorders() { return mski.GetBorders(field); } + bool isVisible() { return mski.IsVisible(field) != FALSE; } + int getHorizontalAlign() { return mski.GetHorizontalAlign(field); } // one of SKN_HALIGN_* + int getVerticalAlign() { return mski.GetVerticalAlign(field); } // one of SKN_VALIGN_* + + const TCHAR * getToolTip() { + if (tooltip != NULL) + mir_free(tooltip); + +#ifdef UNICODE + tooltip = mski.GetToolTipW(field); +#else + tooltip = mski.GetToolTipA(field); +#endif + return tooltip; + } + +protected: + SKINNED_FIELD_STATE field; + TCHAR *tooltip; +}; + +class SkinTextFieldState : public SkinFieldState +{ +public: + SkinTextFieldState(SKINNED_FIELD_STATE field) : SkinFieldState(field), text(NULL) {} + virtual ~SkinTextFieldState() { if (text != NULL) mir_free(text); } + + const TCHAR * getText() { + if (text != NULL) + mir_free(text); + +#ifdef UNICODE + text = mski.GetTextW(field); +#else + text = mski.GetTextA(field); +#endif + return text; + } + + HFONT getFont() { return mski.GetFont(field); } + COLORREF getFontColor() { return mski.GetFontColor(field); } + +private: + TCHAR *text; +}; + +class SkinIconFieldState : public SkinFieldState +{ +public: + SkinIconFieldState(SKINNED_FIELD_STATE field) : SkinFieldState(field) {} + + HICON getIcon() { return mski.GetIcon(field); } +}; + +class SkinImageFieldState : public SkinFieldState +{ +public: + SkinImageFieldState(SKINNED_FIELD_STATE field) : SkinFieldState(field) {} + + HBITMAP getImage() { return mski.GetImage(field); } +}; + + +class SkinDialogState +{ +public: + SkinDialogState(SKINNED_DIALOG_STATE dlg) { this->dlg = dlg; } + + bool isValid() { return dlg != NULL; } + + RECT getBorders() { return mski.GetDialogBorders(dlg); } + + SkinFieldState getField(const char *name) { return SkinFieldState( mski.GetFieldState(dlg, name) ); } + SkinTextFieldState getTextField(const char *name) { return SkinTextFieldState( mski.GetFieldState(dlg, name) ); } + SkinIconFieldState getIconField(const char *name) { return SkinIconFieldState( mski.GetFieldState(dlg, name) ); } + SkinImageFieldState getImageField(const char *name) { return SkinImageFieldState( mski.GetFieldState(dlg, name) ); } + +private: + SKINNED_DIALOG_STATE dlg; +}; + + +class SkinField +{ +public: + SkinField(SKINNED_FIELD field) { this->field = field; } + + bool isValid() { return field != NULL; } + + void setEnabled(bool enabled) { mski.SetEnabled(field, enabled); } + + void setToolTip(const TCHAR *tooltip) { +#ifdef UNICODE + mski.SetToolTipW(field, tooltip); +#else + mski.SetToolTipA(field, tooltip); +#endif + } + +protected: + SKINNED_FIELD field; +}; + +class SkinTextField : public SkinField +{ +public: + SkinTextField(SKINNED_FIELD field) : SkinField(field) {} + + void setText(const TCHAR *text) { +#ifdef UNICODE + mski.SetTextW(field, text); +#else + mski.SetTextA(field, text); +#endif + } +}; + +class SkinIconField : public SkinField +{ +public: + SkinIconField(SKINNED_FIELD field) : SkinField(field) {} + + void setIcon(HICON hIcon) { mski.SetIcon(field, hIcon); } +}; + +class SkinImageField : public SkinField +{ +public: + SkinImageField(SKINNED_FIELD field) : SkinField(field) {} + + void setImage(HBITMAP hBmp) { mski.SetImage(field, hBmp); } +}; + + +class SkinDialog +{ +public: + SkinDialog(const char *name, const char *description, const char *module) { dlg = mski.RegisterDialog(name, description, module); } + ~SkinDialog() { mski.DeleteDialog(dlg); dlg = NULL; } + + bool isValid() { return dlg != NULL; } + + void setSkinChangedCallback(SkinOptionsChangedCallback cb, void *param) { mski.SetSkinChangedCallback(dlg, cb, param); } + + void finishedConfiguring() { mski.FinishedConfiguring(dlg); } + + void setSize(int width, int height) { mski.SetDialogSize(dlg, width, height); } + + SkinTextField addTextField(const char *name, const char *description) { return SkinTextField( mski.AddTextField(dlg, name, description) ); } + SkinIconField addIconField(const char *name, const char *description) { return SkinIconField( mski.AddIconField(dlg, name, description) ); } + SkinImageField addImageField(const char *name, const char *description) { return SkinImageField( mski.AddImageField(dlg, name, description) ); } + + SkinField getField(const char *name) { return SkinField( mski.GetField(dlg, name) ); } + SkinTextField getTextField(const char *name) { return SkinTextField( mski.GetField(dlg, name) ); } + SkinIconField getIconField(const char *name) { return SkinIconField( mski.GetField(dlg, name) ); } + SkinImageField getImageField(const char *name) { return SkinImageField( mski.GetField(dlg, name) ); } + + void setInfoInt(const char *name, int value) { mski.SetInfoInt(dlg, name, value); } + void setInfoDouble(const char *name, double value) { mski.SetInfoDouble(dlg, name, value); } + void setInfoBool(const char *name, bool value) { mski.SetInfoBool(dlg, name, value); } + void setInfoString(const char *name, const TCHAR *value) { mski.SetInfoString(dlg, name, value); } + void removeInfo(const char *name) { mski.RemoveInfo(dlg, name); } + + SkinDialogState run() { return SkinDialogState( mski.Run(dlg) ); } + +private: + SKINNED_DIALOG dlg; +}; + + +#endif // __M_SKINS_CPP_H__ \ No newline at end of file diff --git a/ExternalAPI/m_smileyadd_deprecated.h b/ExternalAPI/m_smileyadd_deprecated.h new file mode 100644 index 0000000..ff9feb9 --- /dev/null +++ b/ExternalAPI/m_smileyadd_deprecated.h @@ -0,0 +1,108 @@ +/* +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 . +*/ + + + + +//find smileys in unicode text +//wParam = (WPARAM) 0; not used +//lParam = (LPARAM) (SMADD_PARSEW*) &smgp; //pointer to SMADD_PARSEW +typedef struct +{ + int 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 + wchar_t* str; //String to parse + HICON SmileyIcon; //RETURN VALUE: the Icon handle is responsibility of the reciever + //it must be destroyed with DestroyIcon when not needed. + 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 +} SMADD_PARSEW; + +#define MS_SMILEYADD_PARSEW "SmileyAdd/ParseW" + + +//find smiley in text, API could be called iterativly, on each iteration the remainder +//of the string after last smiley processed +//wParam = (WPARAM) 0; not used +//lParam = (LPARAM) (SMADD_PARSE*) &smgp; //pointer to SMADD_PARSE +//return: TRUE if API succeeded (all parameters were valid) , FALSE if not. +typedef struct +{ + int 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 + char* str; //String to parse + HICON SmileyIcon; //RETURN VALUE: the Icon handle is responsibility of the reciever + //it must be destroyed with DestroyIcon when not needed. + 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 +} SMADD_PARSE; + +#define MS_SMILEYADD_PARSE "SmileyAdd/Parse" + + +//get button smiley icon +//wParam = (WPARAM) 0; not used +//lParam = (LPARAM) (SMADD_INFO*) &smgi; //pointer to SMADD_INFO +//return: TRUE if API succeeded (all parameters were valid) , FALSE if not. +#define MS_SMILEYADD_GETINFO "SmileyAdd/GetInfo" + + +//find smiley, this API have been supreceeded with MS_SMILEYADD_PARSE[W] +//wParam = (WPARAM) 0; not used +//lParam = (LPARAM) (SMADD_GETICON*) &smgi; //pointer to SMADD_GETICON +//return: TRUE if SmileySequence starts with a smiley, FALSE if not +typedef struct +{ + int cbSize; //size of the structure + char* Protocolname; // " " + char* SmileySequence; //character string containing the smiley + HICON SmileyIcon; //RETURN VALUE: this is filled with the icon handle... + //do not destroy! + int Smileylength; //length of the smiley that is found. +} SMADD_GETICON; + +#define MS_SMILEYADD_GETSMILEYICON "SmileyAdd/GetSmileyIcon" + +#define SMADD_SHOWSEL_SIZE_V1 32 +#define SMADD_SHOWSEL_SIZE_V2 36 + +#define SMADD_RICHEDIT_SIZE_V1 16 +#define SMADD_RICHEDIT_SIZE_V2 24 + +#define SMADD_INFO_SIZE_V1 20 + +#define SMADD_BATCHPARSE_SIZE_V1 24 diff --git a/ExternalAPI/m_weather.h b/ExternalAPI/m_weather.h new file mode 100644 index 0000000..dbdd1de --- /dev/null +++ b/ExternalAPI/m_weather.h @@ -0,0 +1,161 @@ +/* +Weather Protocol plugin for Miranda IM +Copyright (C) 2005-2009 Boris Krasnovskiy All Rights Reserved +Copyright (C) 2002-2005 Calvin Che + +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 . +*/ + +#ifndef M_WEATHER_H__ +#define M_WEATHER_H__ 1 + +// {6B612A34-DCF2-4e32-85CF-B6FD006B745E} +#define MIID_WEATHER { 0x6b612a34, 0xdcf2, 0x4e32, { 0x85, 0xcf, 0xb6, 0xfd, 0x0, 0x6b, 0x74, 0x5e } } + +//============ CONSTANTS ============ + +// name +#define WEATHERPROTONAME "Weather" +#define WEATHERPROTOTEXT "Weather" +#define DEFCURRENTWEATHER "WeatherCondition" +#define WEATHERCONDITION "Current" + +// weather conditions +#define SUNNY ID_STATUS_ONLINE +#define NA ID_STATUS_OFFLINE +#define PCLOUDY ID_STATUS_AWAY +#define CLOUDY ID_STATUS_NA +#define RAIN ID_STATUS_OCCUPIED +#define RSHOWER ID_STATUS_DND +#define SNOW ID_STATUS_FREECHAT +#define LIGHT ID_STATUS_INVISIBLE +#define THUNDER ID_STATUS_INVISIBLE +#define SSHOWER ID_STATUS_ONTHEPHONE +#define FOG ID_STATUS_OUTTOLUNCH +#define UNAVAIL 40081 + + +//============ WEATHER CONDITION STRUCT ============ + +// weather conditions (added in v0.1.2.0) +typedef struct { + HANDLE hContact; + char id[128]; + char city[128]; + char update[64]; + char cond[128]; + char temp[16]; + char low[16]; + char high[16]; + char feel[16]; + char wind[16]; + char winddir[64]; + char dewpoint[16]; + char pressure[16]; + char humid[16]; + char vis[16]; + char sunrise[32]; + char sunset[32]; +// are the other ones that important!? + WORD status; +} WEATHERINFO; + + + +// =============== WEATHER SERVICES ================ + +// Enable or disable weather protocol. +// WPARAM = FALSE to toggle, TRUE to use the LPARAM +// LPARAM = TRUE to enable, FALSE to disable +#define MS_WEATHER_ENABLED "Weather/EnableDisable" + +// Update all weather info +// WPARAM = LPARAM = NULL +#define MS_WEATHER_UPDATEALL "Weather/UpdateAll" + +// Update all weather info + erase the old ones +// WPARAM = LPARAM = NULL +#define MS_WEATHER_REFRESHALL "Weather/RefreshAll" + +// Below are the service functions for weather contacts +// The plugin does NOT verify that they are used in weather contact, +// so bad call on these function may cause crashes. + +// Update a single station +// WPARAM = (HANDLE)hContact +// LPARAM = NULL +#define MS_WEATHER_UPDATE "Weather/Update" + +// Update a single station + delete old settings +// WPARAM = (HANDLE)hContact +// LPARAM = NULL +#define MS_WEATHER_REFRESH "Weather/Refresh" + +// View the brief info of a contact +// WPARAM = (HANDLE)hContact +// LPARAM = NULL +#define MS_WEATHER_BRIEF "Weather/Brief" + +// Use default browser to open the complete forecast on web +// WPARAM = (HANDLE)hContact +// LPARAM = NULL +#define MS_WEATHER_COMPLETE "Weather/CompleteForecast" + +// Use default browser to open the weather map defined for the contact +// WPARAM = (HANDLE)hContact +// LPARAM = NULL +#define MS_WEATHER_MAP "Weather/Map" + +// Open the external log of the weather contact +// WPARAM = (HANDLE)hContact +// LPARAM = NULL +#define MS_WEATHER_LOG "Weather/Log" + +// Edit weather contact setting +// WPARAM = (HANDLE)hContact +// LPARAM = NULL +#define MS_WEATHER_EDIT "Weather/Edit" + +// parse the string to turn it to weather display +// WPARAM = (WEATHERINFO*)hContact +// LPARAM = (char*)display_str +#define MS_WEATHER_GETDISPLAY "Weather/GetDisplay" + +// =============== WEATHER EVENTS ================ + +/* +HANDLE hContact = (HANDLE)wParam; +BOOL Condition_Changed = (BOOL)lParam; + +hContact is the handle of updated contact +If the weather condition is differ from the last update (either temperature/condition, +or the last update time, depend what the user choose in the options), then +Condition_Changed is true; otherwise is false. +*/ +#define ME_WEATHER_UPDATED "Miranda/Weather/Updated" + +/* +Shows a warning message for Weather PopUp. +wParam = (char*) lpzMessage +lParam = Type +Type can either be SM_WARNING, SM_NOTIFY, or SM_WEATHERALERT + +This event is used to avoid the error popup to occurs within a thread, so the "Use +multiply thread" fuction don't have to be enabled for weather popups to work. +*/ +#define SM_WEATHERALERT 16 +#define ME_WEATHER_ERROR "Miranda/Weather/Error" + + +#endif //M_WEATHER_H__ diff --git a/ExternalAPI/m_wizard.h b/ExternalAPI/m_wizard.h new file mode 100644 index 0000000..4b37c3a --- /dev/null +++ b/ExternalAPI/m_wizard.h @@ -0,0 +1,90 @@ +/* + +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_WIZARD_H__ +#define M_WIZARD_H__ 1 + +#include "m_options.h" + +#define MWF_UNICODE 0x01 +#define MWF_ICOLIB 0x02 +#ifdef _UNICODE + #define MWF_TCHAR MWF_UNICODE +#else + #define MWF_TCHAR 0 +#endif + +typedef struct +{ + DWORD dwFlags; + HANDLE hContact; + char *pszWizardName; + union + { + HICON hIcon; + HANDLE hIcolibItem; + }; + union + { + char *pszTitle; + WCHAR *pwszTitle; + TCHAR *ptszTitle; + }; +} WIZARDINFO; + +//show the User Details dialog box +//wParam=0 +//lParam=(WPARAM)(WIZARDINFO *)wizardInfo +#define MS_WIZARD_SHOW "Wizard/Show" + +// Predefined wizards +#define MW_MIRANDA_STARTUP "Miranda/Startup" +#define MW_MIRANDA_CONFIG "Miranda/Config" + +/* Wizard/Initialise +The user opened a details dialog. Modules should do whatever initialisation +they need and call wizard/addpage one or more times if they want pages +displayed in the options dialog +wParam=addInfo +lParam=(WIZARDINFO *)wizardInfo +addInfo should be passed straight to the wParam of wizard/addpage +*/ +#define ME_WIZARD_INITIALISE "Wizard/Initialise" + +/* Wizard/AddPage +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)(WIZARDINFO *)wizardInfo +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 +*/ +#define MS_WIZARD_ADDPAGE "Wizard/AddPage" + +#endif // M_WIZARD_H__ + -- cgit v1.2.3