From 50feaa0ffc1b2e120eb6b22b2970f5bc2f7dc7a4 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sun, 14 Oct 2012 13:35:25 +0000 Subject: TabSRMM: folders restructurization git-svn-id: http://svn.miranda-ng.org/main/trunk@1923 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/include/ImageDataObject.h | 136 +++ plugins/TabSRMM/src/include/buttonbar.h | 54 ++ plugins/TabSRMM/src/include/contactcache.h | 167 ++++ plugins/TabSRMM/src/include/controls.h | 136 +++ plugins/TabSRMM/src/include/functions.h | 199 ++++ plugins/TabSRMM/src/include/generic_msghandlers.h | 67 ++ plugins/TabSRMM/src/include/globals.h | 245 +++++ plugins/TabSRMM/src/include/infopanel.h | 220 +++++ plugins/TabSRMM/src/include/m_cln_skinedit.h | 147 +++ plugins/TabSRMM/src/include/mim.h | 301 ++++++ plugins/TabSRMM/src/include/msgdlgutils.h | 103 ++ plugins/TabSRMM/src/include/msgs.h | 1062 +++++++++++++++++++++ plugins/TabSRMM/src/include/nen.h | 169 ++++ plugins/TabSRMM/src/include/resource.h | 796 +++++++++++++++ plugins/TabSRMM/src/include/sendlater.h | 155 +++ plugins/TabSRMM/src/include/sendqueue.h | 123 +++ plugins/TabSRMM/src/include/sidebar.h | 239 +++++ plugins/TabSRMM/src/include/taskbar.h | 197 ++++ plugins/TabSRMM/src/include/templates.h | 50 + plugins/TabSRMM/src/include/themes.h | 415 ++++++++ plugins/TabSRMM/src/include/translator.h | 63 ++ plugins/TabSRMM/src/include/typingnotify.h | 76 ++ plugins/TabSRMM/src/include/utils.h | 268 ++++++ plugins/TabSRMM/src/include/version.h | 15 + 24 files changed, 5403 insertions(+) create mode 100644 plugins/TabSRMM/src/include/ImageDataObject.h create mode 100644 plugins/TabSRMM/src/include/buttonbar.h create mode 100644 plugins/TabSRMM/src/include/contactcache.h create mode 100644 plugins/TabSRMM/src/include/controls.h create mode 100644 plugins/TabSRMM/src/include/functions.h create mode 100644 plugins/TabSRMM/src/include/generic_msghandlers.h create mode 100644 plugins/TabSRMM/src/include/globals.h create mode 100644 plugins/TabSRMM/src/include/infopanel.h create mode 100644 plugins/TabSRMM/src/include/m_cln_skinedit.h create mode 100644 plugins/TabSRMM/src/include/mim.h create mode 100644 plugins/TabSRMM/src/include/msgdlgutils.h create mode 100644 plugins/TabSRMM/src/include/msgs.h create mode 100644 plugins/TabSRMM/src/include/nen.h create mode 100644 plugins/TabSRMM/src/include/resource.h create mode 100644 plugins/TabSRMM/src/include/sendlater.h create mode 100644 plugins/TabSRMM/src/include/sendqueue.h create mode 100644 plugins/TabSRMM/src/include/sidebar.h create mode 100644 plugins/TabSRMM/src/include/taskbar.h create mode 100644 plugins/TabSRMM/src/include/templates.h create mode 100644 plugins/TabSRMM/src/include/themes.h create mode 100644 plugins/TabSRMM/src/include/translator.h create mode 100644 plugins/TabSRMM/src/include/typingnotify.h create mode 100644 plugins/TabSRMM/src/include/utils.h create mode 100644 plugins/TabSRMM/src/include/version.h (limited to 'plugins/TabSRMM/src/include') diff --git a/plugins/TabSRMM/src/include/ImageDataObject.h b/plugins/TabSRMM/src/include/ImageDataObject.h new file mode 100644 index 0000000000..0e2c112827 --- /dev/null +++ b/plugins/TabSRMM/src/include/ImageDataObject.h @@ -0,0 +1,136 @@ +/* +Miranda SmileyAdd Plugin +Copyright (C) 2004 Rein-Peter de Boer (peacow) + +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. +*/ + +//code taken partly from public example on the internet, source unknown. + +//make sure is include before this file +#include +#include +#include + +class CImageDataObject : IDataObject +{ +public: + // returns true on success, false on failure + static bool InsertBitmap(IRichEditOle* pRichEditOle, HBITMAP hBitmap); + // returns true on success, false on failure + //static bool InsertIcon(IRichEditOle* pRichEditOle, HICON hIcon, + //COLORREF backgroundColor, int sizeX = 0, int sizeY = 0); + +private: + ULONG m_ulRefCnt; + BOOL m_bRelease; + + STGMEDIUM m_stgmed; + FORMATETC m_format; + +public: + CImageDataObject() : m_ulRefCnt(0) + { + m_bRelease = FALSE; + } + + ~CImageDataObject() + { + if (m_bRelease) + ::ReleaseStgMedium(&m_stgmed); + } + + // IUnknown interface + STDMETHOD(QueryInterface)(REFIID iid, void ** ppvObject) + { + if (iid == IID_IUnknown || iid == IID_IDataObject) + { + *ppvObject = this; + AddRef(); + return S_OK; + } + else + return E_NOINTERFACE; + } + + STDMETHOD_(ULONG, AddRef)(void) + { + m_ulRefCnt++; + return m_ulRefCnt; + } + + STDMETHOD_(ULONG, Release)(void) + { + m_ulRefCnt--; + if (m_ulRefCnt == 0) + delete this; + return m_ulRefCnt; + } + + // IDataObject Interface + STDMETHOD(GetData)(FORMATETC *pformatetcIn, STGMEDIUM *pmedium) { + HANDLE hDst; + hDst = ::OleDuplicateData(m_stgmed.hBitmap, CF_BITMAP, 0); + if (hDst == NULL) + return E_HANDLE; + + pmedium->tymed = TYMED_GDI; + pmedium->hBitmap = (HBITMAP)hDst; + pmedium->pUnkForRelease = NULL; + + return S_OK; + } + + STDMETHOD(GetDataHere)(FORMATETC* pformatetc, STGMEDIUM* pmedium ) { + return E_NOTIMPL; + } + + STDMETHOD(QueryGetData)(FORMATETC* pformatetc ) { + return E_NOTIMPL; + } + + STDMETHOD(GetCanonicalFormatEtc)(FORMATETC* pformatectIn ,FORMATETC* pformatetcOut ) { + return E_NOTIMPL; + } + + STDMETHOD(SetData)(FORMATETC* pformatetc , STGMEDIUM* pmedium , BOOL fRelease ) { + m_format = *pformatetc; + m_stgmed = *pmedium; + + return S_OK; + } + + STDMETHOD(EnumFormatEtc)(DWORD dwDirection , IEnumFORMATETC** ppenumFormatEtc ) { + return E_NOTIMPL; + } + + STDMETHOD(DAdvise)(FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, + DWORD *pdwConnection) { + return E_NOTIMPL; + } + + STDMETHOD(DUnadvise)(DWORD dwConnection) { + return E_NOTIMPL; + } + + STDMETHOD(EnumDAdvise)(IEnumSTATDATA **ppenumAdvise) { + return E_NOTIMPL; + } + + // Other + void SetBitmap(HBITMAP hBitmap); + IOleObject *GetOleObject(IOleClientSite *pOleClientSite, IStorage *pStorage); +}; + diff --git a/plugins/TabSRMM/src/include/buttonbar.h b/plugins/TabSRMM/src/include/buttonbar.h new file mode 100644 index 0000000000..9be67e965b --- /dev/null +++ b/plugins/TabSRMM/src/include/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/plugins/TabSRMM/src/include/contactcache.h b/plugins/TabSRMM/src/include/contactcache.h new file mode 100644 index 0000000000..309e95131d --- /dev/null +++ b/plugins/TabSRMM/src/include/contactcache.h @@ -0,0 +1,167 @@ +/* + * astyle --force-indent=tab=4 --brackets=linux --indent-switches + * --pad=oper --one-line=keep-blocks --unpad=paren + * + * Miranda NG: the free IM client for Microsoft* Windows* + * + * Copyright 2000-2009 Miranda ICQ/IM project, + * all portions of this codebase are copyrighted to the people + * listed in contributors.txt. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * you should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * part of tabSRMM messaging plugin for Miranda. + * + * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors + * + * $Id: contactcache.h 12846 2010-10-01 03:26:02Z silvercircle $ + * + * the contact cache + * + */ + +#ifndef __CONTACTCACHE_H +#define __CONTACTCACHE_H + +#define C_INVALID_PROTO "" +#define C_INVALID_ACCOUNT _T("") +#define C_INVALID_PROTO_T _T("") +#define HISTORY_INITIAL_ALLOCSIZE 300 + + +struct TInputHistory { + TCHAR* szText; + size_t lLen; +}; + +struct TSessionStats { + enum { + BYTES_RECEIVED = 1, + BYTES_SENT = 2, + FAILURE = 3, + UPDATE_WITH_LAST_RCV= 4, + SET_LAST_RCV = 5, + INIT_TIMER = 6, + }; + + time_t started; + unsigned int iSent, iReceived, iSentBytes, iReceivedBytes; + unsigned int messageCount; + unsigned int iFailures; + unsigned int lastReceivedChars; + BOOL bWritten; +}; + +class CContactCache { +public: + + CContactCache () {} + CContactCache (const HANDLE hContact); + ~CContactCache () + { + releaseAlloced(); + } + void inc () { m_accessCount++; } + const bool isValid () const { return(m_Valid); } + const WORD getStatus () const { return(m_wStatus); } + const WORD getMetaStatus () const { return(m_wMetaStatus); } + const WORD getActiveStatus () const { return(m_isMeta ? m_wMetaStatus : m_wStatus); } + const WORD getOldStatus () const { return(m_wOldStatus); } + const TCHAR* getNick () const { return(m_szNick); } + const HANDLE getContact () const { return(m_hContact); } + const HANDLE getActiveContact () const { return(m_isMeta ? (m_hSubContact ? m_hSubContact : m_hContact) : m_hContact); } + const DWORD getIdleTS () const { return(m_idleTS); } + const char* getProto () const { return(m_szProto); } + const TCHAR* getProtoT () const { return(m_tszProto); } + const char* getMetaProto () const { return(m_szMetaProto ? m_szMetaProto : C_INVALID_PROTO); } + const TCHAR* getMetaProtoT () const { return(m_szMetaProto ? m_tszMetaProto : C_INVALID_PROTO_T); } + const char* getActiveProto () const { return(m_isMeta ? (m_szMetaProto ? m_szMetaProto : m_szProto) : m_szProto); } + const TCHAR* getActiveProtoT () const { return(m_isMeta ? (m_szMetaProto ? m_tszMetaProto : m_tszProto) : m_tszProto); } + bool isMeta () const { return(m_isMeta); } + bool isSubContact () const { return(m_isSubcontact); } + bool isFavorite () const { return(m_isFavorite); } + bool isRecent () const { return(m_isRecent); } + const TCHAR* getRealAccount () const { return(m_szAccount ? m_szAccount : C_INVALID_ACCOUNT); } + const TCHAR* getUIN () const { return(m_szUIN); } + const TCHAR* getStatusMsg () const { return(m_szStatusMsg); } + const TCHAR* getXStatusMsg () const { return(m_xStatusMsg); } + const TCHAR* getListeningInfo () const { return(m_ListeningInfo); } + BYTE getXStatusId () const { return(m_xStatus); } + const HWND getWindowData (TWindowData*& dat) const { dat = m_dat; return(m_hwnd); } + const HWND getHwnd () const { return(m_hwnd); } + int getMaxMessageLength (); + + TWindowData* getDat () const { return(m_dat); } + + void updateStats (int iType, size_t value = 0); + const DWORD getSessionStart () const { return(m_stats->started); } + const int getSessionMsgCount () const { return((int)m_stats->messageCount) ; } + void updateState (); + bool updateStatus (); + bool updateNick (); + void updateMeta (bool fForce = false); + bool updateUIN (); + void updateStatusMsg (const char *szKey = 0); + void setWindowData (const HWND hwnd = 0, TWindowData *dat = 0); + void resetMeta (); + void closeWindow (); + void deletedHandler (); + void updateFavorite (); + TCHAR* getNormalizedStatusMsg (const TCHAR *src, bool fStripAll = false); + HICON getIcon (int& iSize) const; + + /* + * input history + */ + void saveHistory (WPARAM wParam, LPARAM lParam); + void inputHistoryEvent (WPARAM wParam); + + HANDLE m_hContact; + CContactCache* m_next; + + static CContactCache* m_cCache; + static CContactCache* getContactCache(const HANDLE hContact); + +private: + void allocStats (); + void initPhaseTwo (); + void allocHistory (); + void releaseAlloced (); + +private: + size_t m_accessCount; + HANDLE m_hSubContact; + WORD m_wStatus, m_wMetaStatus; + WORD m_wOldStatus; + char* m_szProto, *m_szMetaProto; + TCHAR* m_tszProto, m_tszMetaProto[40]; + TCHAR* m_szAccount; + TCHAR m_szNick[80], m_szUIN[80]; + TCHAR* m_szStatusMsg, *m_xStatusMsg, *m_ListeningInfo; + BYTE m_xStatus; + DWORD m_idleTS; + bool m_isMeta, m_isSubcontact; + bool m_Valid; + bool m_isFavorite; + bool m_isRecent; + HWND m_hwnd; + int m_nMax; + int m_iHistoryCurrent, m_iHistoryTop, m_iHistorySize; + TWindowData* m_dat; + TSessionStats* m_stats; + TInputHistory* m_history; +}; + +#endif /* __CONTACTCACHE_H */ diff --git a/plugins/TabSRMM/src/include/controls.h b/plugins/TabSRMM/src/include/controls.h new file mode 100644 index 0000000000..2f6e236ca3 --- /dev/null +++ b/plugins/TabSRMM/src/include/controls.h @@ -0,0 +1,136 @@ +/* + * astyle --force-indent=tab=4 --brackets=linux --indent-switches + * --pad=oper --one-line=keep-blocks --unpad=paren + * + * Miranda NG: the free IM client for Microsoft* Windows* + * + * Copyright 2000-2009 Miranda ICQ/IM project, + * all portions of this codebase are copyrighted to the people + * listed in contributors.txt. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * you should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * part of tabSRMM messaging plugin for Miranda. + * + * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors + * + * $Id: controls.h 11635 2010-04-26 07:17:39Z silvercircle $ + * + * menu bar and status bar classes for the container window. + * + */ + +#ifndef __CONTROLS_H +#define __CONTROLS_H + +extern LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + +class CMenuBar +{ +public: + enum { + NR_BUTTONS = 8 + }; + + CMenuBar(HWND hwndParent, const TContainerData *pContainer); + ~CMenuBar(); + + const RECT& TSAPI getClientRect(); + void TSAPI Resize(WORD wWidth, WORD wHeight, BOOL redraw) const + { + ::SetWindowPos(m_hwndToolbar, 0, 4, 0, wWidth, m_size_y, SWP_NOZORDER | SWP_NOACTIVATE | + SWP_NOCOPYBITS|SWP_NOREDRAW); + + } + LONG TSAPI getHeight() const; + void TSAPI Show(int showCmd) const + { + ::ShowWindow(m_hwndToolbar, showCmd); + } + LONG_PTR TSAPI Handle(const NMTOOLBAR *nmtb); + void TSAPI Cancel(); + LONG_PTR TSAPI processMsg(const UINT msg, const WPARAM wParam, const LPARAM lParam); + bool TSAPI isContactMenu() const { return(m_isContactMenu); } + bool TSAPI isMainMenu() const { return(m_isMainMenu); } + void TSAPI configureMenu(void) const; + void TSAPI setActive(HMENU hMenu) + { + m_activeSubMenu = hMenu; + } + void setAero(bool fState) { m_isAero = fState; } + const bool getAero(void) const { return(m_isAero); } + + const LRESULT processAccelerator(TCHAR a, UINT& ctlId) const + { + UINT _ctlId; + + const LRESULT result = ::SendMessage(m_hwndToolbar, TB_MAPACCELERATOR, (WPARAM)a, (LPARAM)&_ctlId); + ctlId = _ctlId; + + return(result); + } + void TSAPI autoShow(const int showcmd = 1); + + const int idToIndex(const int id) const + { + for (int i = 0; i < NR_BUTTONS; i++) { + if (m_TbButtons[i].idCommand == id ) + return(i); + } + return(-1); + } +public: + static HHOOK m_hHook; + static HBITMAP m_MimIcon; + +private: + HWND m_hwndToolbar; + RECT m_rcClient; + TContainerData *m_pContainer; + HMENU m_activeMenu, m_activeSubMenu;; + int m_activeID; + bool m_fTracking; + bool m_isContactMenu; + bool m_isMainMenu; + bool m_isAero; + bool m_mustAutoHide; + LONG m_size_y; + WNDPROC m_oldWndProc; + /* + * for custom drawing + */ + RECT m_rcItem; + HDC m_hdcDraw; + HBITMAP m_hbmDraw, m_hbmOld; + HANDLE m_hTheme; + HFONT m_hOldFont; + + static TBBUTTON m_TbButtons[8]; + static bool m_buttonsInit; + static CMenuBar *m_Owner; + static int m_MimIconRefCount; +private: + LONG_PTR TSAPI customDrawWorker(NMCUSTOMDRAW *nm); + void TSAPI updateState(const HMENU hMenu) const; + void TSAPI invoke(const int id); + void TSAPI cancel(const int id); + void TSAPI obtainHook(); + void TSAPI releaseHook(); + + static LRESULT CALLBACK wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); // subclassing for the toolbar control + static LRESULT CALLBACK MessageHook(int nCode, WPARAM wParam, LPARAM lParam); // message hook (only active when modal menus are active) +}; + +#endif /* __CONTROLS_H */ diff --git a/plugins/TabSRMM/src/include/functions.h b/plugins/TabSRMM/src/include/functions.h new file mode 100644 index 0000000000..49ae0f79ab --- /dev/null +++ b/plugins/TabSRMM/src/include/functions.h @@ -0,0 +1,199 @@ +/* + * astyle --force-indent=tab=4 --brackets=linux --indent-switches + * --pad=oper --one-line=keep-blocks --unpad=paren + * + * Miranda NG: the free IM client for Microsoft* Windows* + * + * Copyright 2000-2009 Miranda ICQ/IM project, + * all portions of this codebase are copyrighted to the people + * listed in contributors.txt. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * you should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * part of tabSRMM messaging plugin for Miranda. + * + * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors + * + * $Id: functions.h 11636 2010-04-27 22:08:16Z silvercircle $ + * + * Global function prototypes + * + */ + +#ifndef _TABSRMM_FUNCTIONS_H +#define _TABSRMM_FUNCTIONS_H + +int Chat_PreShutdown (); +int Chat_ModulesLoaded (WPARAM wp, LPARAM lp); +int AvatarChanged (WPARAM wParam, LPARAM lParam); +int MyAvatarChanged (WPARAM wParam, LPARAM lParam); +int IcoLibIconsChanged (WPARAM wParam, LPARAM lParam); +int FontServiceFontsChanged (WPARAM wParam, LPARAM lParam); +int SmileyAddOptionsChanged (WPARAM wParam, LPARAM lParam); +int IEViewOptionsChanged (WPARAM wParam, LPARAM lParam); +void RegisterFontServiceFonts (); +int ModPlus_PreShutdown (WPARAM wparam, LPARAM lparam); +int ModPlus_Init (WPARAM wparam, LPARAM lparam); +LONG_PTR CALLBACK HotkeyHandlerDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); + + +/* + * nen / event popup stuff + */ + +int TSAPI NEN_ReadOptions (NEN_OPTIONS *options); +int TSAPI NEN_WriteOptions (NEN_OPTIONS *options); +int TSAPI UpdateTrayMenu (const TWindowData *dat, WORD wStatus, const char *szProto, + const TCHAR *szStatus, HANDLE hContact, DWORD fromEvent); +static int TSAPI PopupPreview (NEN_OPTIONS *pluginOptions); +void TSAPI DeletePopupsForContact (HANDLE hContact, DWORD dwMask); + +/* + * tray stuff + */ + +void TSAPI CreateSystrayIcon (int create); +void TSAPI FlashTrayIcon (HICON hIcon); +void TSAPI UpdateTrayMenuState (TWindowData *dat, BOOL bForced); +void TSAPI LoadFavoritesAndRecent (); +void TSAPI AddContactToFavorites (HANDLE hContact, const TCHAR *szNickname, const char *szProto, TCHAR *szStatus, + WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu); +void TSAPI CreateTrayMenus (int mode); +void TSAPI HandleMenuEntryFromhContact (int iSelection); + +/* + * gneric msgwindow functions (creation, container management etc.) + */ + +BOOL TSAPI IsUtfSendAvailable (HANDLE hContact); +HWND TSAPI CreateNewTabForContact (TContainerData *pContainer, HANDLE hContact, int isSend, + const char *pszInitialText, BOOL bActivateTAb, BOOL bPopupContainer, BOOL bWantPopup, HANDLE hdbEvent); +int TSAPI ActivateTabFromHWND (HWND hwndTab, HWND hwnd); +void TSAPI FlashContainer (TContainerData *pContainer, int iMode, int iNum); +void TSAPI CreateImageList (BOOL bInitial); +TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName, HANDLE hContact); +TContainerData* TSAPI CreateContainer (const TCHAR *name, int iTemp, HANDLE hContactFrom); +TContainerData* TSAPI FindContainerByName (const TCHAR *name); +int TSAPI GetTabIndexFromHWND (HWND hwndTab, HWND hwnd); +int TSAPI GetTabItemFromMouse (HWND hwndTab, POINT *pt); +int TSAPI ActivateTabFromHWND (HWND hwndTab, HWND hwnd); +void TSAPI AdjustTabClientRect (TContainerData *pContainer, RECT *rc); +void TSAPI ReflashContainer (TContainerData *pContainer); +HMENU TSAPI BuildMCProtocolMenu (HWND hwndDlg); + +TContainerData* TSAPI AppendToContainerList(TContainerData *pContainer); +TContainerData* TSAPI RemoveContainerFromList(TContainerData *pContainer); + +void TSAPI DeleteContainer (int iIndex); +void TSAPI RenameContainer (int iIndex, const TCHAR *newName); +int TSAPI GetContainerNameForContact (HANDLE hContact, TCHAR *szName, int iNameLen); +HMENU TSAPI BuildContainerMenu (); +void TSAPI BuildCodePageList (); +void TSAPI PreTranslateDates (); +void TSAPI ApplyContainerSetting (TContainerData *pContainer, DWORD flags, UINT mode, bool fForceResize); +void TSAPI BroadCastContainer (const TContainerData *pContainer, UINT message, WPARAM wParam, LPARAM lParam, BYTE iType = 0); +void TSAPI GetDefaultContainerTitleFormat(); +INT_PTR MessageWindowOpened(WPARAM wParam, LPARAM lParam); +void TSAPI SetAeroMargins (TContainerData *pContainer); +int TABSRMM_FireEvent (HANDLE hContact, HWND hwnd, unsigned int type, unsigned int subType); + +LRESULT CALLBACK IEViewSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); +LRESULT CALLBACK HPPKFSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + +/* + * skinning engine + */ +void TSAPI DrawAlpha (HDC hdcwnd, PRECT rc, DWORD basecolor, int alpha, DWORD basecolor2, + BYTE transparent, BYTE FLG_GRADIENT, BYTE FLG_CORNER, DWORD BORDERSTYLE, CImageItem *imageItem); +// the cached message log icons + +void TSAPI CacheMsgLogIcons (); +void TSAPI CacheLogFonts (); +void TSAPI InitAPI (); +void TSAPI LoadIconTheme (); +int TSAPI LoadFromIconLib (); +int TSAPI SetupIconLibConfig (); +void TSAPI RTF_CTableInit (); + +INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); + +int TSAPI InitOptions (void); +INT_PTR CALLBACK DlgProcContainer (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int TSAPI DbEventIsShown (TWindowData *dat, DBEVENTINFO *dbei); +void TSAPI StreamInEvents (HWND hwndDlg,HANDLE hDbEventFirst,int count,int fAppend, DBEVENTINFO *dbei_s); +void TSAPI LoadLogfont (int i,LOGFONTA *lf,COLORREF *colour, char *szModule); + + +// custom tab control + +void TSAPI ReloadTabConfig (); +void TSAPI FreeTabConfig (); +int TSAPI RegisterTabCtrlClass (void); + +// buttons + +int TSAPI LoadTSButtonModule (void); +int TSAPI UnloadTSButtonModule (); + + +/* + * debugging support + */ + +int _DebugTraceW(const wchar_t *fmt, ...); +int _DebugTraceA(const char *fmt, ...); +int _DebugPopup(HANDLE hContact, const TCHAR *fmt, ...); +int _DebugMessage(HWND hwndDlg, struct TWindowData *dat, const char *fmt, ...); + +// themes + +const TCHAR* TSAPI GetThemeFileName (int iMode); +void TSAPI LoadLogfontFromINI (int i, char *szKey, LOGFONTA *lf, COLORREF *colour, const char *szIniFilename); +int TSAPI CheckThemeVersion (const TCHAR *szIniFilename); +void TSAPI WriteThemeToINI (const TCHAR *szIniFilename, TWindowData *dat); +void TSAPI ReadThemeFromINI (const TCHAR *szIniFilename, TContainerData *dat, int noAdvanced, DWORD dwFlags); + +// compatibility + +// user prefs + +int TSAPI LoadLocalFlags (HWND hwnd, TWindowData *dat); + +//TypingNotify +int TN_ModuleInit (); +int TN_OptionsInitialize (WPARAM wParam, LPARAM lParam); +int TN_ModuleDeInit (); +int TN_TypingMessage (WPARAM wParam, LPARAM lParam); + +// mod plus + +int ChangeClientIconInStatusBar (const TWindowData *dat); + +// hotkeys + +LRESULT ProcessHotkeysByMsgFilter (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, UINT_PTR ctrlId); + +void TSAPI DrawMenuItem (DRAWITEMSTRUCT *dis, HICON hIcon, DWORD dwIdle); + +/* + * dialog procedures + */ + +INT_PTR CALLBACK SelectContainerDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK DlgProcContainerOptions (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK DlgProcAbout (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); + + +#endif /* _TABSRMM_FUNCTIONS_H */ diff --git a/plugins/TabSRMM/src/include/generic_msghandlers.h b/plugins/TabSRMM/src/include/generic_msghandlers.h new file mode 100644 index 0000000000..4f756b24f0 --- /dev/null +++ b/plugins/TabSRMM/src/include/generic_msghandlers.h @@ -0,0 +1,67 @@ +/* + * astyle --force-indent=tab=4 --brackets=linux --indent-switches + * --pad=oper --one-line=keep-blocks --unpad=paren + * + * Miranda NG: the free IM client for Microsoft* Windows* + * + * Copyright 2000-2009 Miranda ICQ/IM project, + * all portions of this codebase are copyrighted to the people + * listed in contributors.txt. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * you should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * part of tabSRMM messaging plugin for Miranda. + * + * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors + * + * $Id: generic_msghandlers.h 12058 2010-06-24 15:26:10Z silvercircle $ + * + * prototypes from generic_msghandlers.c + * + */ + +void TSAPI DM_SetDBButtonStates (HWND hwndChild, struct TWindowData *dat); +int TSAPI BTN_GetStockItem (ButtonItem *item, const TCHAR *szName); +HWND TSAPI DM_CreateClist (TWindowData *dat); + +void TSAPI DM_OptionsApplied (TWindowData *dat, WPARAM wParam, LPARAM lParam); +void TSAPI DM_UpdateTitle (TWindowData *dat, WPARAM wParam, LPARAM lParam); +LRESULT TSAPI DM_ScrollToBottom (TWindowData *dat, WPARAM wParam, LPARAM lParam); +LRESULT TSAPI DM_LoadLocale (TWindowData *dat); +LRESULT TSAPI DM_SaveLocale (TWindowData *dat, WPARAM wParam, LPARAM lParam); +LRESULT TSAPI DM_UpdateLastMessage (const TWindowData *dat); +LRESULT __stdcall DM_RecalcPictureSize (TWindowData *dat); +LRESULT TSAPI DM_WMCopyHandler (HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam); +LRESULT TSAPI DM_MouseWheelHandler (HWND hwnd, HWND hwndParent, struct TWindowData *mwdat, WPARAM wParam, LPARAM lParam); +LRESULT TSAPI DM_ThemeChanged (TWindowData *dat); +void TSAPI DM_Typing (TWindowData *dat, bool fForceOff = false); +void TSAPI DM_FreeTheme (TWindowData *dat); +void TSAPI DM_NotifyTyping (TWindowData *dat, int mode); +int TSAPI DM_SplitterGlobalEvent (TWindowData *dat, WPARAM wParam, LPARAM lParam); +void TSAPI BB_InitDlgButtons (TWindowData *dat); + +BOOL TSAPI BB_SetButtonsPos (TWindowData *dat); +void TSAPI BB_RedrawButtons (TWindowData *dat); +void TSAPI BB_CustomButtonClick (TWindowData *dat,DWORD idFrom ,HWND hwndFrom, BOOL code) ; +void TSAPI DM_EventAdded (TWindowData *dat, WPARAM wParam, LPARAM lParam); +void TSAPI DM_InitRichEdit (TWindowData *dat); +LRESULT TSAPI DM_ContainerCmdHandler (TContainerData *pContainer, UINT cmd, WPARAM wParam, LPARAM lParam); +LRESULT TSAPI DM_MsgWindowCmdHandler (HWND hwndDlg, TContainerData *pContainer, TWindowData *dat, UINT cmd, WPARAM wParam, LPARAM lParam); +LRESULT TSAPI DM_GenericHotkeysCheck (MSG *message, TWindowData *dat); +void TSAPI DM_DismissTip (TWindowData *dat, const POINT& pt); +void TSAPI DM_InitTip (TWindowData *dat); +void TSAPI DM_HandleAutoSizeRequest(TWindowData *dat, REQRESIZE* rr); +void TSAPI DM_SaveLogAsRTF (const TWindowData* dat); +void TSAPI DM_CheckAutoHide (const TWindowData* dat, WPARAM wParam, LPARAM lParam); diff --git a/plugins/TabSRMM/src/include/globals.h b/plugins/TabSRMM/src/include/globals.h new file mode 100644 index 0000000000..69d62f66f7 --- /dev/null +++ b/plugins/TabSRMM/src/include/globals.h @@ -0,0 +1,245 @@ +/* + * astyle --force-indent=tab=4 --brackets=linux --indent-switches + * --pad=oper --one-line=keep-blocks --unpad=paren + * + * Miranda NG: the free IM client for Microsoft* Windows* + * + * Copyright 2000-2009 Miranda ICQ/IM project, + * all portions of this codebase are copyrighted to the people + * listed in contributors.txt. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * you should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * part of tabSRMM messaging plugin for Miranda. + * + * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors + * + * $Id: globals.h 13046 2010-10-28 10:02:50Z silvercircle $ + * + * Plugin configuration variables and functions. Implemented as a class + * though there will always be only a single instance. + * + */ + +#ifndef __GLOBALS_H +#define __GLOBALS_H + +struct TSplitterBroadCast { + TContainerData *pSrcContainer; + TWindowData *pSrcDat; + LONG pos, pos_chat; + LONG off_chat, off_im; + LPARAM lParam; + BYTE bSync; +}; + +typedef BOOL (WINAPI *pfnSetMenuInfo )( HMENU hmenu, LPCMENUINFO lpcmi ); + +class CRTException : public std::runtime_error +{ +public: + CRTException(const char *szMsg, const TCHAR *szParam); + ~CRTException() {} + + void display() const; + +private: + TCHAR m_szParam[MAX_PATH]; +}; + + +class CGlobals +{ +public: + enum { + H_MS_MSG_SENDMESSAGE = 0, + H_MS_MSG_SENDMESSAGEW = 1, + H_MS_MSG_FORWARDMESSAGE = 2, + H_MS_MSG_GETWINDOWAPI = 3, + H_MS_MSG_GETWINDOWCLASS = 4, + H_MS_MSG_GETWINDOWDATA = 5, + H_MS_MSG_READMESSAGE = 6, + H_MS_MSG_TYPINGMESSAGE = 7, + H_MS_MSG_MOD_MESSAGEDIALOGOPENED = 8, + H_MS_TABMSG_SETUSERPREFS = 9, + H_MS_TABMSG_TRAYSUPPORT = 10, + H_MSG_MOD_GETWINDOWFLAGS = 11, + H_MS_TABMSG_SLQMGR = 12, + SERVICE_LAST = 13 + }; + + CGlobals() + { + ::ZeroMemory(this, sizeof(CGlobals)); + m_TypingSoundAdded = false; + } + + ~CGlobals() + { + if (m_MenuBar) + ::DestroyMenu(m_MenuBar); + + CContactCache* c = CContactCache::m_cCache, *cTemp; + while(c) { + cTemp = c->m_next; + delete c; + c = cTemp; + } + } + void reloadAdv(); + void reloadSystemStartup(); + void reloadSystemModulesChanged(); + void reloadSettings(bool fReloadSkins = true); + + void hookSystemEvents(); + bool haveAutoSwitch(); + + const HMENU getMenuBar(); + + HWND g_hwndHotkeyHandler; + HICON g_iconIn, g_iconOut, g_iconErr, g_iconContainer, g_iconStatus; + HICON g_iconOverlayDisabled, g_iconOverlayEnabled, g_iconClock; + HCURSOR hCurSplitNS, hCurSplitWE, hCurHyperlinkHand; + HBITMAP g_hbmUnknown; + int g_MetaContactsAvail, g_SmileyAddAvail, g_WantIEView, g_PopupAvail, g_PopupWAvail, g_WantHPP; + int g_FlashAvatarAvail; + HIMAGELIST g_hImageList; + HICON g_IconMsgEvent, g_IconTypingEvent, g_IconFileEvent, g_IconSend; + HICON g_IconMsgEventBig, g_IconTypingEventBig; + HICON g_IconFolder, g_IconChecked, g_IconUnchecked; + HMENU g_hMenuContext, g_hMenuContainer, g_hMenuEncoding, g_hMenuTrayUnread; + HMENU g_hMenuFavorites, g_hMenuRecent, g_hMenuTrayContext; + HICON g_buttonBarIcons[NR_BUTTONBARICONS]; + HICON g_sideBarIcons[NR_SIDEBARICONS]; + HANDLE g_buttonBarIconHandles[23]; + // dynamic options, need reload when options change + int m_SendOnShiftEnter; + int m_SendOnEnter; + int m_SendOnDblEnter; + int m_AutoLocaleSupport; + int m_AutoSwitchTabs; + int m_CutContactNameOnTabs; + int m_CutContactNameTo; + int m_StatusOnTabs; + int m_LogStatusChanges; + int m_UseDividers; + int m_DividersUsePopupConfig; + int m_MsgTimeout; + int m_EscapeCloses; + int m_FlashOnClist; + int m_AlwaysFullToolbarWidth; + int m_LimitStaticAvatarHeight; + int m_SendFormat; + int m_FormatWholeWordsOnly; + int m_RTLDefault; + int m_MathModAvail; + TCHAR m_MathModStartDelimiter[40]; + int m_UnreadInTray; + int m_TrayFlashes; + int m_TrayFlashState; + BOOL m_SuperQuiet; + HANDLE m_UserMenuItem; + double g_DPIscaleX; + double g_DPIscaleY; + BOOL m_HideOnClose; + BOOL g_bSoundOnTyping; + BOOL m_AllowTab; + BYTE m_AllowOfflineMultisend; + BOOL g_bDisableAniAvatars; + HBITMAP m_hbmMsgArea; + BYTE g_iButtonsBarGap; + BYTE m_WinVerMajor; + BYTE m_WinVerMinor; + bool m_bIsXP, m_bIsVista, m_bIsWin7; + HWND m_hwndClist; + int m_TabAppearance; + struct myTabCtrl tabConfig; + int m_panelHeight, m_MUCpanelHeight; + WINDOWPLACEMENT m_GlobalContainerWpos; + int m_IdleDetect; + int m_smcxicon, m_smcyicon; + int m_PasteAndSend; + TCHAR *m_szNoStatus; + COLORREF crIncoming, crOutgoing, crOldIncoming, crOldOutgoing, crStatus; + BOOL bUnicodeBuild; + HFONT hFontCaption; + DWORD m_LangPackCP; + BYTE m_SmileyButtonOverride; + NONCLIENTMETRICS m_ncm; + HICON m_AnimTrayIcons[4]; + BOOL m_visualMessageSizeIndicator; + BOOL m_autoSplit; + BOOL m_FlashOnMTN; + DWORD dwThreadID; + char szMetaName[256]; + BYTE bMetaEnabled; + HANDLE m_hMessageWindowList, hUserPrefsWindowList; + bool m_chat_enabled; + HMENU m_MenuBar; + COLORREF m_ipBackgroundGradient; + COLORREF m_ipBackgroundGradientHigh; + COLORREF m_tbBackgroundHigh, m_tbBackgroundLow, m_fillColor, m_cRichBorders, m_genericTxtColor; + BYTE g_bClientInStatusBar; + BYTE m_dontUseDefaultKbd; + HANDLE hSvc[SERVICE_LAST]; + HANDLE m_event_MsgWin, m_event_MsgPopup; + HANDLE m_hMenuItem; + BYTE m_useAeroPeek; + + TSplitterBroadCast lastSPlitterPos; + TContainerSettings globalContainerSettings; + + static HANDLE m_event_FoldersChanged; + static TCHAR* m_default_container_name; + static void cacheUpdateMetaChanged(); + static void logStatusChange(WPARAM wParam, const CContactCache *c); + + static void Ex_CopyEditToClipboard(HWND hWnd); + static void Ex_Handler(); + static int Ex_ShowDialog(EXCEPTION_POINTERS *ep, const char *szFile, int line, wchar_t* szReason, bool fAllowContinue); + static INT_PTR CALLBACK Ex_DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +private: + bool m_TypingSoundAdded; + static HANDLE m_event_ModulesLoaded, m_event_PrebuildMenu, m_event_SettingChanged; + static HANDLE m_event_ContactDeleted, m_event_Dispatch, m_event_EventAdded; + static HANDLE m_event_IconsChanged, m_event_TypingEvent, m_event_ProtoAck, m_event_PreShutdown, m_event_OkToExit; + static HANDLE m_event_IcoLibChanged, m_event_AvatarChanged, m_event_MyAvatarChanged, m_event_FontsChanged; + static HANDLE m_event_SmileyAdd, m_event_IEView; + static HANDLE m_event_ME_MC_SUBCONTACTSCHANGED, m_event_ME_MC_FORCESEND, m_event_ME_MC_UNFORCESEND; + + static EXCEPTION_RECORD m_exRecord; + static CONTEXT m_exCtx; + static LRESULT m_exLastResult; + static char m_exSzFile[MAX_PATH]; + static wchar_t m_exReason[256]; + static int m_exLine; + static bool m_exAllowContinue; +private: + static int ModulesLoaded(WPARAM wParam, LPARAM lParam); + static int DBSettingChanged(WPARAM wParam, LPARAM lParam); + static int DBContactDeleted(WPARAM wParam, LPARAM lParam); + static int PreshutdownSendRecv(WPARAM wParam, LPARAM lParam); + static int MetaContactEvent(WPARAM wParam, LPARAM lParam); + static int OkToExit(WPARAM wParam, LPARAM lParam); + static void RestoreUnreadMessageAlerts(void); +}; + +extern CGlobals PluginConfig; +extern CGlobals *pConfig; + +#define DPISCALEY_S(argY) ((int) ((double)(argY) * PluginConfig.g_DPIscaleY)) +#define DPISCALEX_S(argX) ((int) ((double)(argX) * PluginConfig.g_DPIscaleX)) + +#endif /* __GLOBALS_H */ diff --git a/plugins/TabSRMM/src/include/infopanel.h b/plugins/TabSRMM/src/include/infopanel.h new file mode 100644 index 0000000000..3a2812444e --- /dev/null +++ b/plugins/TabSRMM/src/include/infopanel.h @@ -0,0 +1,220 @@ +/* + * astyle --force-indent=tab=4 --brackets=linux --indent-switches + * --pad=oper --one-line=keep-blocks --unpad=paren + * + * Miranda NG: the free IM client for Microsoft* Windows* + * + * Copyright 2000-2009 Miranda ICQ/IM project, + * all portions of this codebase are copyrighted to the people + * listed in contributors.txt. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * you should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * part of tabSRMM messaging plugin for Miranda. + * + * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors + * + * $Id: infopanel.h 12396 2010-08-22 17:17:05Z silvercircle $ + * + * the info area for both im and chat sessions + */ + +#ifndef __INFOPANEL_H +#define __INFOPANEL_H + +/* + * configuration data for the info panel (fonts, colors) + * this is global for all panels + */ + +#define IPFONTCOUNT 6 // # of fonts needed for the info panel + +/* + * command ids for the info panel contextual menus + */ + +#define CMD_IP_USERDETAILS 20000 +#define CMD_IP_USERPREFS 20001 +#define CMD_IP_ROOMPREFS 20002 +#define CMD_IP_HISTORY 20003 +#define CMD_IP_COPY 21000 + +struct TInfoPanelConfig { + HFONT hFonts[IPFONTCOUNT]; + COLORREF clrs[IPFONTCOUNT]; + UINT height1, height2; +}; + +extern TCHAR *xStatusDescr[]; + +/** + * a simple tooltip class using a richedit control to display its content. Allows + * for formatted text and clickable hyperlinks + * + * Used by: Info panel to display status messages, topics etc. + */ +class CTip +{ +public: + enum { + TOP_BORDER = 25, + LEFT_BORDER = 2, + RIGHT_BORDER = 2, + BOTTOM_BORDER = 1, + LEFT_BAR_WIDTH = 20 + }; + + CTip (const HWND hwndParent, const HANDLE hContact, const TCHAR *pszText = 0, const CInfoPanel *panel = 0); + ~CTip() + { + if (m_pszText) + mir_free(m_pszText); + } + void show (const RECT& rc, POINT& pt, const HICON hIcon = 0, const TCHAR *szTitle = 0); + const HWND getHwnd () const { return(m_hwnd); } + + static void registerClass (); +private: + + INT_PTR CALLBACK WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + static INT_PTR CALLBACK WndProcStub (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + static INT_PTR CALLBACK RichEditProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + + HWND m_hwnd; // our window handle + HWND m_hRich; // handle of the rich edit child + HWND m_hwndParent; // parent window (used for position calculations and to send notifications) + HANDLE m_hContact; // contact handle + char* m_pszText; // the richedit text + SIZE m_szRich; // size of the richedit control (height auto-calculated to make it fit the text) + RECT m_rcRich; // adjusted rectangle for the richedit control (client coordinates) + const CInfoPanel* m_panel; // the info panel parent (if any) + HICON m_hIcon; // optional icon to show in the title line + const TCHAR* m_szTitle; // optional text to show in the title + int m_leftWidth; + +private: + static WNDPROC m_OldMessageEditProc; // stores original richedit wnd proc + +}; + +/** + * the info panel class definition. The panel itself is not a real window class - it + * is implemented as a drawing canvas on the message window background. + * + * Each message session has its own info panel object + */ +class CInfoPanel +{ +public: + enum { + DEGRADE_THRESHOLD = 37, // defines the height at which the infopanel will do the transition from 1 to 2 lines + LEFT_OFFSET_LOGO = 3 + }; + enum { + HOVER_NICK = 1, + HOVER_STATUS = 2, + HOVER_UIN = 4 + }; + enum { + HTNICK = 1, + HTUIN = 2, + HTSTATUS = 3, + HTNIRVANA = 0 + }; + CInfoPanel(TWindowData *dat) + { + if (dat) { + m_dat = dat; + m_isChat = dat->bType == SESSIONTYPE_CHAT ? true : false; + } + m_defaultHeight = PluginConfig.m_panelHeight; + m_defaultMUCHeight = PluginConfig.m_MUCpanelHeight; + m_hwndConfig = 0; + m_hoverFlags = 0; + m_tip = 0; + } + + ~CInfoPanel() + { + if (m_hwndConfig) + ::DestroyWindow(m_hwndConfig); + saveHeight(true); + } + + const LONG getHeight () const { return(m_height); } + void setHeight (LONG newHeight, bool fBroadcast = false); + bool isActive () const { return(m_active); } + bool isPrivateHeight () const { return(m_fPrivateHeight); } + DWORD isHovered () const { return(m_active ? m_hoverFlags : 0); } + const TWindowData* getDat () const { return(m_dat); } + void setActive (const int newActive); + void loadHeight (); + void saveHeight (bool fFlush = false); + + void Configure () const; + void showHide () const; + bool getVisibility (); + void renderBG (const HDC hdc, RECT& rc, CSkinItem *item, bool fAero, bool fAutoCalc = true) const; + void renderContent (const HDC hdcMem); + void Invalidate (BOOL fErase = FALSE) const; + void trackMouse (POINT& pt); + int hitTest (POINT pt); + void handleClick (const POINT& pt); + void showTip (UINT ctrlId, const LPARAM lParam); + void hideTip (const HWND hWndNew); + int invokeConfigDialog (const POINT& pt); + void dismissConfig (bool fForced = false); + +public: + static TInfoPanelConfig m_ipConfig; + static int setPanelHandler (TWindowData *dat, WPARAM wParam, LPARAM lParam); + static INT_PTR CALLBACK avatarParentSubclass (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + +private: + void mapRealRect (const RECT& rcSrc, RECT& rcDest, const SIZE& sz); + HFONT setUnderlinedFont (const HDC hdc, HFONT hFontOrig); + void RenderIPNickname (const HDC hdc, RECT& rc); + void RenderIPUIN (const HDC hdc, RECT& rcItem); + void RenderIPStatus (const HDC hdc, RECT& rcItem); + void Chat_RenderIPNickname (const HDC hdc, RECT& rcItem); + void Chat_RenderIPSecondLine (const HDC hdc, RECT& rcItem); + LRESULT cmdHandler (UINT cmd); + HMENU constructContextualMenu () const; + INT_PTR CALLBACK ConfigDlgProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + static INT_PTR CALLBACK ConfigDlgProcStub (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + +private: + bool m_isChat; // is MUC session + bool m_active; // panel active and visible + bool m_fPrivateHeight; + bool m_fDialogCreated; + TWindowData* m_dat; // this one OWNS us... + LONG m_height; // height (determined by position of IDC_PANELSPLITTER) + LONG m_defaultHeight, m_defaultMUCHeight; // global values for the info bar height + HWND m_hwndConfig; // window handle of the config dialog window + HFONT m_configDlgFont, m_configDlgBoldFont; + SIZE m_szNick; // rectangle where the nick has been rendered, + /* + * these are used to store rectangles important to mouse tracking. + */ + RECT m_rcNick; + RECT m_rcUIN; + RECT m_rcStatus; + DWORD m_hoverFlags; + CTip* m_tip; +}; + +#endif /* __INFOPANEL_H */ + diff --git a/plugins/TabSRMM/src/include/m_cln_skinedit.h b/plugins/TabSRMM/src/include/m_cln_skinedit.h new file mode 100644 index 0000000000..5ee66829c5 --- /dev/null +++ b/plugins/TabSRMM/src/include/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/plugins/TabSRMM/src/include/mim.h b/plugins/TabSRMM/src/include/mim.h new file mode 100644 index 0000000000..c971cb7fdf --- /dev/null +++ b/plugins/TabSRMM/src/include/mim.h @@ -0,0 +1,301 @@ +/* + * astyle --force-indent=tab=4 --brackets=linux --indent-switches + * --pad=oper --one-line=keep-blocks --unpad=paren + * + * Miranda NG: the free IM client for Microsoft* Windows* + * + * Copyright 2000-2009 Miranda ICQ/IM project, + * all portions of this codebase are copyrighted to the people + * listed in contributors.txt. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * you should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * part of tabSRMM messaging plugin for Miranda. + * + * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors + * + * $Id: mim.h 12272 2010-08-04 08:24:08Z silvercircle $ + * + * wraps some parts of Miranda API + * Also, OS dependent stuff (visual styles api etc.) + * + */ + +#ifndef __MIM_H +#define __MIM_H + + +extern FI_INTERFACE *FIF; + +/* + * Win32 API definitions of functions dynamically obtained via GetProcAddress() + * - uxtheme + * - dwmapi + * - some GDI functions (AlphaBlend()..) + */ +typedef BOOL (WINAPI *SMI)( HMENU hmenu, LPCMENUINFO lpcmi ); +typedef HRESULT (WINAPI *DEFICA)(HWND hwnd, const MARGINS *margins); +typedef HRESULT (WINAPI *DICE)(BOOL *); +typedef DWORD (WINAPI *PSLWA)(HWND, DWORD, BYTE, DWORD); +typedef BOOL (WINAPI *PULW)(HWND, HDC, POINT *, SIZE *, HDC, POINT *, COLORREF, BLENDFUNCTION *, DWORD); +typedef BOOL (WINAPI *PFWEX)(FLASHWINFO *); +typedef BOOL (WINAPI *PAB)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION); +typedef BOOL (WINAPI *PGF)(HDC, PTRIVERTEX, ULONG, PVOID, ULONG, ULONG); + +typedef BOOL (WINAPI *PITA)(); +typedef HANDLE (WINAPI *POTD)(HWND, LPCWSTR); +typedef UINT (WINAPI *PDTB)(HANDLE, HDC, int, int, RECT *, RECT *); +typedef UINT (WINAPI *PCTD)(HANDLE); +typedef UINT (WINAPI *PDTT)(HANDLE, HDC, int, int, LPCWSTR, int, DWORD, DWORD, RECT *); +typedef UINT (WINAPI *PDTTE)(HANDLE, HDC, int, int, LPCWSTR, int, DWORD, RECT *, const DTTOPTS *); +typedef BOOL (WINAPI *PITBPT)(HANDLE, int, int); +typedef HRESULT (WINAPI *PDTPB)(HWND, HDC, RECT *); +typedef HRESULT (WINAPI *PGTBCR)(HANDLE, HDC, int, int, const RECT *, const RECT *); + +typedef HMONITOR(WINAPI *MMFW)(HWND, DWORD); +typedef BOOL (WINAPI *GMIA)(HMONITOR, LPMONITORINFO); +typedef HRESULT (WINAPI *DRT)(HWND, HWND, PHTHUMBNAIL); +typedef BOOL (WINAPI *ETDT)(HANDLE, DWORD); +typedef HANDLE (WINAPI *BBP)(HDC, RECT *, BP_BUFFERFORMAT, BP_PAINTPARAMS *, HDC *); +typedef HRESULT (WINAPI *EBP)(HANDLE, BOOL); +typedef HRESULT (WINAPI *BPI)(void); +typedef HRESULT (WINAPI *BPU)(void); +typedef HRESULT (WINAPI *BBW)(HWND, DWM_BLURBEHIND *); +typedef HRESULT (WINAPI *DGC)(DWORD *, BOOL *); +typedef HRESULT (WINAPI *BPSA)(HANDLE, const RECT *, BYTE); +typedef int (WINAPI *GLIX)(LPCWSTR, LCTYPE, LPCWSTR, int); +typedef HRESULT (WINAPI *DWMSWA)(HWND, DWORD, LPCVOID, DWORD); +typedef HRESULT (WINAPI *DWMIIB)(HWND); +typedef HRESULT (WINAPI *DWMUT)(HTHUMBNAIL, DWM_THUMBNAIL_PROPERTIES *); +typedef HRESULT (WINAPI *DURT)(HTHUMBNAIL); +typedef HRESULT (WINAPI *DSIT)(HWND, HBITMAP, DWORD); +typedef HRESULT (WINAPI *DSILP)(HWND, HBITMAP, POINT *, DWORD); + +/* + * used to encapsulate some parts of the Miranda API + * constructor does early time initialization - do NOT put anything + * here, except thngs that deal with the core and database API. + * + * it is UNSAFE to assume that any plugin provided services are available + * when the object is instantiated. + */ + +class CMimAPI +{ +public: + CMimAPI() + { + InitPaths(); + InitAPI(); + getAeroState(); + + LRESULT fi_version = CallService(MS_IMG_GETIFVERSION, 0, 0); + CallService(MS_IMG_GETINTERFACE, fi_version, (LPARAM)&FIF); + + ::QueryPerformanceFrequency((LARGE_INTEGER *)&m_tFreq); + m_dFreq = (double)(1.0f / m_tFreq); + m_hChatLogLock = INVALID_HANDLE_VALUE; + } + + ~CMimAPI() { + if (m_haveBufferedPaint) + m_pfnBufferedPaintUninit(); + if (m_hUxTheme != 0) + FreeLibrary(m_hUxTheme); + if (m_hDwmApi != 0) + FreeLibrary(m_hDwmApi); + + if (m_hChatLogLock != INVALID_HANDLE_VALUE) + CloseHandle(m_hChatLogLock); + } + + /* + * database functions + */ + + DWORD FASTCALL GetDword (const HANDLE hContact, const char *szModule, const char *szSetting, DWORD uDefault) const; + + DWORD FASTCALL GetDword (const char *szModule, const char *szSetting, DWORD uDefault) const; + DWORD FASTCALL GetDword (const char *szSetting, DWORD uDefault) const; + DWORD FASTCALL GetDword (const HANDLE hContact, const char *szSetting, DWORD uDefault) const; + + int FASTCALL GetByte (const HANDLE hContact, const char *szModule, const char *szSetting, int uDefault) const; + int FASTCALL GetByte (const char *szModule, const char *szSetting, int uDefault) const; + int FASTCALL GetByte (const char *szSetting, int uDefault) const; + int FASTCALL GetByte (const HANDLE hContact, const char *szSetting, int uDefault) const; + + INT_PTR FASTCALL GetTString (const HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) const; + INT_PTR FASTCALL GetString (const HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) const; + + INT_PTR FASTCALL WriteDword (const HANDLE hContact, const char *szModule, const char *szSetting, DWORD value) const; + INT_PTR FASTCALL WriteDword (const char *szModule, const char *szSetting, DWORD value) const; + + INT_PTR FASTCALL WriteByte (const HANDLE hContact, const char *szModule, const char *szSetting, BYTE value) const; + INT_PTR FASTCALL WriteByte (const char *szModule, const char *szSetting, BYTE value) const; + + INT_PTR FASTCALL WriteTString (const HANDLE hContact, const char *szModule, const char *szSetting, const TCHAR *st) const; + + /* + * path utilities + */ + + int pathIsAbsolute (const TCHAR *path) const; + size_t pathToAbsolute (const TCHAR *pSrc, TCHAR *pOut, const TCHAR *szBase = 0) const; + size_t pathToRelative (const TCHAR *pSrc, TCHAR *pOut, const TCHAR *szBase = 0) const; + + const TCHAR* getDataPath() const { return(m_szProfilePath); } + const TCHAR* getSkinPath() const { return(m_szSkinsPath); } + const TCHAR* getSavedAvatarPath() const { return(m_szSavedAvatarsPath); } + const TCHAR* getChatLogPath() const { return(m_szChatLogsPath); } + const bool haveFoldersPlugin() const { return(m_haveFolders); } + + const TCHAR* getUserDir(); + void configureCustomFolders(); + INT_PTR foldersPathChanged(); + + void startTimer(); + void stopTimer (const char *szMsg = 0); + void timerMsg (const char *szMsg); + __int64 getTimerStart() const { return(m_tStart); } + __int64 getTimerStop() const { return(m_tStop); } + __int64 getTicks() const { return(m_tStop - m_tStart); } + double getFreq() const { return(m_dFreq); } + double getMsec() const { return(1000 * ((double)(m_tStop - m_tStart) * m_dFreq)); } + + /* + * os dependant stuff (aero, visual styles etc.) + */ + + const bool isVSAPIState() const { return m_VsAPI; } + /** + * return status of Vista Aero + * + * @return bool: true if aero active, false otherwise + */ + const bool isAero() const { return(m_isAero); } + const bool isDwmActive() const { return(m_DwmActive); } + + /** + * Refresh Aero status. + * Called on: + * * plugin init + * * WM_DWMCOMPOSITIONCHANGED message received + * + * @return + */ + bool getAeroState(); + /** + * return status of visual styles theming engine (Windows XP+) + * + * @return bool: themes are enabled + */ + bool isVSThemed() + { + return(m_isVsThemed); + } + /* + * window lists + */ + + void BroadcastMessage (UINT msg, WPARAM wParam, LPARAM lParam); + void BroadcastMessageAsync (UINT msg, WPARAM wParam, LPARAM lParam); + INT_PTR AddWindow (HWND hWnd, HANDLE h); + INT_PTR RemoveWindow (HWND hWnd); + HWND FindWindow (HANDLE h) const; + + static int FoldersPathChanged(WPARAM wParam, LPARAM lParam); // hook subscriber for folders plugin + static const TCHAR* TSAPI StriStr(const TCHAR *szString, const TCHAR *szSearchFor); + static int TypingMessage(WPARAM wParam, LPARAM lParam); + static int ProtoAck(WPARAM wParam, LPARAM lParam); + static int PrebuildContactMenu(WPARAM wParam, LPARAM lParam); + static int DispatchNewEvent(WPARAM wParam, LPARAM lParam); + static int MessageEventAdded(WPARAM wParam, LPARAM lParam); +public: + HANDLE m_hMessageWindowList; + /* + various function pointers + */ + static PITA m_pfnIsThemeActive; + static POTD m_pfnOpenThemeData; + static PDTB m_pfnDrawThemeBackground; + static PCTD m_pfnCloseThemeData; + static PDTT m_pfnDrawThemeText; + static PDTTE m_pfnDrawThemeTextEx; + static PITBPT m_pfnIsThemeBackgroundPartiallyTransparent; + static PDTPB m_pfnDrawThemeParentBackground; + static PGTBCR m_pfnGetThemeBackgroundContentRect; + static ETDT m_pfnEnableThemeDialogTexture; + static PSLWA m_pSetLayeredWindowAttributes; + static PFWEX m_MyFlashWindowEx; + static PAB m_MyAlphaBlend; + static PGF m_MyGradientFill; + static DEFICA m_pfnDwmExtendFrameIntoClientArea; + static DICE m_pfnDwmIsCompositionEnabled; + static MMFW m_pfnMonitorFromWindow; + static GMIA m_pfnGetMonitorInfoA; + static DRT m_pfnDwmRegisterThumbnail; + static BPI m_pfnBufferedPaintInit; + static BPU m_pfnBufferedPaintUninit; + static BBP m_pfnBeginBufferedPaint; + static EBP m_pfnEndBufferedPaint; + static BBW m_pfnDwmBlurBehindWindow; + static DGC m_pfnDwmGetColorizationColor; + static BPSA m_pfnBufferedPaintSetAlpha; + static GLIX m_pfnGetLocaleInfoEx; + static DWMSWA m_pfnDwmSetWindowAttribute; + static DWMIIB m_pfnDwmInvalidateIconicBitmaps; + static DWMUT m_pfnDwmUpdateThumbnailProperties; + static DURT m_pfnDwmUnregisterThumbnail; + static DSIT m_pfnDwmSetIconicThumbnail; + static DSILP m_pfnDwmSetIconicLivePreviewBitmap; + static bool m_shutDown, m_haveBufferedPaint; + +private: + TCHAR m_szProfilePath[MAX_PATH + 2], m_szSkinsPath[MAX_PATH + 2], m_szSavedAvatarsPath[MAX_PATH + 2], m_szChatLogsPath[MAX_PATH + 2]; + HMODULE m_hUxTheme, m_hDwmApi; + bool m_VsAPI; + bool m_isAero; + bool m_DwmActive; + bool m_isVsThemed; + HANDLE m_hDataPath, m_hSkinsPath, m_hAvatarsPath, m_hChatLogsPath; + __int64 m_tStart, m_tStop, m_tFreq; + double m_dFreq; + char m_timerMsg[256]; + bool m_haveFolders; + HANDLE m_hChatLogLock; + + void InitAPI(); + void InitPaths(); + +private: + static TCHAR m_userDir[MAX_PATH + 2]; +}; + +inline void CMimAPI::startTimer() +{ + ::QueryPerformanceCounter((LARGE_INTEGER *)&m_tStart); +} + +inline void CMimAPI::stopTimer(const char *szMsg) +{ + ::QueryPerformanceCounter((LARGE_INTEGER *)&m_tStop); + + if (szMsg) + timerMsg(szMsg); +} + +extern CMimAPI *M; + +#endif /* __MIM_H */ diff --git a/plugins/TabSRMM/src/include/msgdlgutils.h b/plugins/TabSRMM/src/include/msgdlgutils.h new file mode 100644 index 0000000000..59e349f07c --- /dev/null +++ b/plugins/TabSRMM/src/include/msgdlgutils.h @@ -0,0 +1,103 @@ +/* + * astyle --force-indent=tab=4 --brackets=linux --indent-switches + * --pad=oper --one-line=keep-blocks --unpad=paren + * + * Miranda NG: the free IM client for Microsoft* Windows* + * + * Copyright 2000-2009 Miranda ICQ/IM project, + * all portions of this codebase are copyrighted to the people + * listed in contributors.txt. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * you should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * part of tabSRMM messaging plugin for Miranda. + * + * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors + * + * $Id: msgdlgutils.h 12833 2010-09-27 23:45:55Z silvercircle $ + * + * + */ + +#ifndef _MSGDLGUTILS_H +#define _MSGDLGUTILS_H + +#define WANT_IEVIEW_LOG 1 +#define WANT_HPP_LOG 2 + +void TSAPI CalcDynamicAvatarSize (TWindowData *dat, BITMAP *bminfo); +char* TSAPI GetCurrentMetaContactProto (TWindowData *dat); +void TSAPI WriteStatsOnClose (TWindowData *dat); +int TSAPI MsgWindowUpdateMenu (TWindowData *dat, HMENU submenu, int menuID); +int TSAPI MsgWindowMenuHandler (TWindowData *dat, int selection, int menuId); +int TSAPI GetAvatarVisibility (HWND hwndDlg, TWindowData *dat); +void TSAPI UpdateStatusBar (const TWindowData *dat); +int TSAPI CheckValidSmileyPack (const char *szProto, HANDLE hContact); +TCHAR* TSAPI QuoteText (const TCHAR *text, int charsPerLine, int removeExistingQuotes); +void TSAPI UpdateReadChars (const TWindowData *dat); +void TSAPI ShowPicture (TWindowData *dat, BOOL showNewPic); +void TSAPI AdjustBottomAvatarDisplay (TWindowData *dat); +void TSAPI SetDialogToType (HWND hwndDlg); +void TSAPI FlashOnClist (HWND hwndDlg, TWindowData *dat, HANDLE hEvent, DBEVENTINFO *dbei); +char* TSAPI Message_GetFromStream (HWND hwndDlg, const TWindowData* dat, DWORD dwPassedFlags); +BOOL TSAPI DoRtfToTags (TCHAR * pszText, const TWindowData *dat); +void TSAPI DoTrimMessage (TCHAR *msg); +void TSAPI GetMYUIN (TWindowData *dat); +void TSAPI SetMessageLog (TWindowData *dat); +void TSAPI SwitchMessageLog (TWindowData *dat, int iMode); +UINT TSAPI GetIEViewMode (HWND hwndDlg, HANDLE hContact); +void TSAPI FindFirstEvent (TWindowData *dat); +void TSAPI SaveSplitter (TWindowData *dat); +void TSAPI LoadSplitter (TWindowData *dat); +void TSAPI PlayIncomingSound (const TWindowData *dat); +void TSAPI GetSendFormat (TWindowData *dat, int mode); +void TSAPI GetLocaleID (TWindowData *dat, const TCHAR *szKLName); +void TSAPI LoadOwnAvatar (TWindowData *dat); +void TSAPI LoadContactAvatar (TWindowData *dat); +void TSAPI LoadTimeZone (TWindowData *dat); +void TSAPI HandlePasteAndSend (const TWindowData *dat); +int TSAPI MsgWindowDrawHandler (WPARAM wParam, LPARAM lParam, TWindowData *dat); +void TSAPI LoadOverrideTheme (TContainerData *pContainer); +void TSAPI LoadThemeDefaults (TContainerData *pContainer); +void TSAPI ConfigureSmileyButton (TWindowData *dat); +int TSAPI CutContactName (const TCHAR *szold, TCHAR *sznew, unsigned int size); +void TSAPI SendNudge (const TWindowData *dat); +void TSAPI EnableSendButton (const TWindowData *dat, int iMode); +LRESULT TSAPI GetSendButtonState (HWND hwnd); +HICON TSAPI GetXStatusIcon (const TWindowData *dat); +void TSAPI FlashTab (TWindowData *dat, HWND hwndTab, int iTabindex, BOOL *bState, BOOL mode, HICON origImage); +void TSAPI GetClientIcon (TWindowData *dat); +void TSAPI RearrangeTab (HWND hwndDlg, const TWindowData *dat, int iMode, BOOL fSavePos); +void TSAPI GetCachedStatusMsg (TWindowData *dat); +BOOL TSAPI IsStatusEvent (int eventType); +void TSAPI GetMyNick (TWindowData *dat); +HICON TSAPI MY_GetContactIcon (const TWindowData *dat); +void TSAPI CheckAndDestroyIEView (TWindowData *dat); +void TSAPI KbdState (TWindowData *dat, BOOL& isShift, BOOL& isControl, BOOL& isAlt); +void TSAPI ClearLog (TWindowData *dat); +bool TSAPI IsAutoSplitEnabled (const TWindowData* dat); +LONG TSAPI GetDefaultMinimumInputHeight (const TWindowData* dat); +void TSAPI DetermineMinHeight (TWindowData* dat); +// mathmod + +void TSAPI MTH_updateMathWindow (const TWindowData *dat); + +void TSAPI CleanTempFiles (); +void TSAPI SendHBitmapAsFile (const TWindowData* dat, HBITMAP hbmp); + +extern INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); + +#endif diff --git a/plugins/TabSRMM/src/include/msgs.h b/plugins/TabSRMM/src/include/msgs.h new file mode 100644 index 0000000000..5f4adef350 --- /dev/null +++ b/plugins/TabSRMM/src/include/msgs.h @@ -0,0 +1,1062 @@ +/* + * astyle --force-indent=tab=4 --brackets=linux --indent-switches + * --pad=oper --one-line=keep-blocks --unpad=paren + * + * Miranda NG: the free IM client for Microsoft* Windows* + * + * Copyright 2000-2009 Miranda ICQ/IM project, + * all portions of this codebase are copyrighted to the people + * listed in contributors.txt. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * you should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * part of tabSRMM messaging plugin for Miranda. + * + * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors + * + * $Id: msgs.h 13587 2011-04-12 13:54:26Z george.hazan $ + * + * + */ + +#ifndef _MSGS_H +#define _MSGS_H + +#ifdef _MSC_VER +#if _MSC_VER < 1400 +#define uintptr_t UINT_PTR +#define _localtime32 localtime +#define __time32_t time_t +#endif +#endif +/* + * required for MingW32 compatibility + */ + +#define CF_TEXTT CF_UNICODETEXT + +#include +#include +#include "m_avatars.h" +#include "m_message.h" + +#define MSGERROR_CANCEL 0 +#define MSGERROR_RETRY 1 +#define MSGERROR_SENDLATER 2 + +#define CONTAINER_NAMELEN 25 +#define TITLE_FORMATLEN 30 + +#define MWF_SAVEBTN_SAV 2 + +#define MWF_DEFERREDSCROLL 4 +#define MWF_NEEDHISTORYSAVE 8 +#define MWF_WASBACKGROUNDCREATE 16 +//#define MWF_MOUSEDOWN 32 +#define MWF_ERRORSTATE 128 +#define MWF_DEFERREDREMAKELOG 256 + +#define MWF_LOG_NORMALTEMPLATES 512 +#define MWF_LOG_SHOWTIME 1024 +#define MWF_LOG_SHOWSECONDS 2048 +#define MWF_LOG_SHOWDATES 4096 + +#define MWF_LOG_INDENT 16384 +#define MWF_LOG_RTL 32768 + +//MAD: ieview still mistakenly uses these... +#define MWF_LOG_NEWLINE 8192 +#define MWF_LOG_UNDERLINE 65536 +#define MWF_LOG_SWAPNICK 131072 +// +//#define MWF_LOG_BBCODE 65536 +//#define MWF_LOG_STATUSCHANGES 131072 +//#define MWF_LOG_LOCALTIME 8192 +#define MWF_LOG_BBCODE 1 +#define MWF_LOG_STATUSCHANGES 32 +#define MWF_LOG_LOCALTIME 64 + +#define MWF_LOG_SHOWICONS 262144 +#define MWF_LOG_SYMBOLS 0x200000 +#define MWF_INITMODE 0x400000 +#define MWF_NEEDCHECKSIZE 0x800000 +#define MWF_DIVIDERSET 0x1000000 +#define MWF_LOG_TEXTFORMAT 0x2000000 +#define MWF_LOG_GRID 0x4000000 +// #define MWF_LOG_INDIVIDUALBKG 0x8000000 * FREE * +#define MWF_LOG_INOUTICONS 0x10000000 +#define MWF_SMBUTTONSELECTED 0x20000000 +#define MWF_DIVIDERWANTED 0x40000000 +#define MWF_LOG_GROUPMODE 0x80000000 + +#define MWF_SHOW_URLEVENTS 1 +#define MWF_SHOW_FILEEVENTS 2 +//#define MWF_SHOW_PRIVATETHEME 4 +//#define MWF_SHOW_EMPTYLINEFIX 8 +//#define MWF_SHOW_MICROLF 16 +//#define MWF_SHOW_MARKFOLLOWUPTS 32 +#define MWF_SHOW_FLASHCLIST 64 +#define MWF_SHOW_SPLITTEROVERRIDE 128 +#define MWF_SHOW_SCROLLINGDISABLED 256 +//#define MWF_SHOW_INFONOTES ** FREE ** +#define MWF_SHOW_ISIDLE 4096 +#define MWF_SHOW_AWAYMSGTIMER 8192 +#define MWF_EX_DELAYEDSPLITTER 32768 +#define MWF_EX_AVATARCHANGED 65536 +#define MWF_EX_WARNCLOSE 0x20000 + +#define SMODE_DEFAULT 0 +#define SMODE_MULTIPLE 1 +#define SMODE_CONTAINER 2 +#define SMODE_FORCEANSI 4 +#define SMODE_SENDLATER 8 +#define SMODE_NOACK 16 + +#define SENDFORMAT_BBCODE 1 +#define SENDFORMAT_NONE 0 + +#define AVATARMODE_DYNAMIC 0 + +#define MSGDLGFONTCOUNT 22 +#define CHATFONTCOUNT 19 + +#define TMPL_MSGIN 0 +#define TMPL_MSGOUT 1 +#define TMPL_GRPSTARTIN 2 +#define TMPL_GRPSTARTOUT 3 +#define TMPL_GRPINNERIN 4 +#define TMPL_GRPINNEROUT 5 +#define TMPL_STATUSCHG 6 +#define TMPL_ERRMSG 7 + +#define TEMPLATE_LENGTH 150 +#define CUSTOM_COLORS 5 + +struct TTemplateSet { + BOOL valid; // all templates populated (may still contain crap.. so it's only half-assed safety :) + TCHAR szTemplates[TMPL_ERRMSG + 1][TEMPLATE_LENGTH]; // the template strings + char szSetName[20]; // everything in this world needs a name. so does this poor template set. +}; + +struct TitleBtn { + BOOL isHot; + BOOL isPressed; +}; + +#define BTN_MIN 0 +#define BTN_MAX 1 +#define BTN_CLOSE 2 + +#define NR_LOGICONS 8 +#define NR_BUTTONBARICONS 37//MaD: 29 +#define NR_SIDEBARICONS 2 + +class CTaskbarInteract; +class CMenuBar; +class CInfoPanel; +class CSideBar; +class CContactCache; +class CProxyWindow; + +#define STICK_ICON_MSG 10 +struct TLogTheme { + COLORREF inbg, outbg, bg, oldinbg, oldoutbg, statbg, inputbg; + COLORREF hgrid; + COLORREF custom_colors[5]; + DWORD dwFlags; + DWORD left_indent, right_indent; + LOGFONTA* logFonts; + COLORREF* fontColors; + char* rtfFonts; + bool isPrivate; +}; + +struct TContainerSettings { + bool fPrivate; + DWORD dwFlags; + DWORD dwFlagsEx; + DWORD dwTransparency; + DWORD panelheight; + DWORD splitterPos; + TCHAR szTitleFormat[TITLE_FORMATLEN + 2]; + WORD avatarMode; + WORD ownAvatarMode; + WORD autoCloseSeconds; + BYTE reserved[10]; +}; + +struct TContainerData { + TContainerData *pNextContainer; + TCHAR szName[CONTAINER_NAMELEN + 4]; // container name + HWND hwndActive; // active message window + HWND hwnd; // the container handle + int iTabIndex; // next tab id + int iChilds; + int iContainerIndex; + bool fHidden; + HMENU hMenuContext; + HWND hwndTip; // tab - tooltips... + BOOL bDontSmartClose; // if set, do not search and select the next possible tab after closing one. + DWORD dwFlags; + DWORD dwFlagsEx; + LONG uChildMinHeight; + int tBorder; + int tBorder_outer_left, tBorder_outer_right, tBorder_outer_top, tBorder_outer_bottom; + HANDLE hContactFrom; + BOOL isCloned; + HWND hwndStatus; + int statusBarHeight; + DWORD dwLastActivity; + int hIcon; // current window icon stick indicator + HICON hIconTaskbarOverlay; // contains a "sticky" taskbar overlay (e.g. new message icon) + DWORD dwFlashingStarted; + HWND hWndOptions; + BOOL bSizingLoop; + TCHAR szRelThemeFile[MAX_PATH], szAbsThemeFile[MAX_PATH]; + TTemplateSet *ltr_templates, *rtl_templates; + HDC cachedDC; + HBITMAP cachedHBM, oldHBM; + SIZE oldDCSize; + RECT rcClose, rcMin, rcMax; + struct TitleBtn buttons[3]; + struct TitleBtn oldbuttons[3]; + int ncActive; + HWND hwndSaved; + ButtonItem *buttonItems; + RECT rcSaved, rcLogSaved; + POINT ptLogSaved; + DWORD exFlags; + BOOL fPrivateThemeChanged; + MARGINS mOld; + HDC cachedToolbarDC; + HBITMAP hbmToolbarBG, oldhbmToolbarBG; + SIZE szOldToolbarSize; + SIZE oldSize, preSIZE; + WORD avatarMode, ownAvatarMode; + BYTE bTBRenderingMode; + TLogTheme theme; + TContainerSettings* settings; + CTaskbarInteract* TaskBar; + CMenuBar* MenuBar; + CSideBar* SideBar; +}; + +struct SESSIONINFO_TYPE; + +struct TWindowData { + UINT cbSize; + BYTE bType; + struct TContainerData *pContainer; // parent container description structure + HWND hwnd; + DWORD dwFlags; + DWORD dwFlagsEx; + HANDLE hContact; + char *szProto; + TCHAR szMyNickname[130]; + TCHAR szStatusBar[100]; + TCHAR newtitle[130]; // tab title... + TCHAR szStatus[50]; + WORD wStatus; + char *sendBuffer; + int iSendBufferSize; + int iSendLength; // message length in utf-8 octets + HICON hTabIcon, hTabStatusIcon, hXStatusIcon, hClientIcon, hTaskbarIcon; + HICON iFlashIcon; + BOOL mayFlashTab; + BOOL bTabFlash; + HWND hwndIEView, hwndFlash, hwndIWebBrowserControl, hwndHPP; + HWND hwndContactPic, hwndPanelPic, hwndPanelPicParent; + UINT bbLSideWidth; //MAD + UINT bbRSideWidth; //MAD + BYTE kstate[256]; + struct TStatusBarIconNode *pSINod; + SESSIONINFO_TYPE* si; + + RECT rcNick, rcUIN, rcStatus, rcPic; + HANDLE hDbEventFirst, hDbEventLast; + int sendMode; + int splitterY, originalSplitterY, dynaSplitter, savedSplitter, savedSplitY, savedDynaSplit; + int multiSplitterX; + SIZE minEditBoxSize; + int showUIElements; + int nTypeSecs; + int nTypeMode; + DWORD nLastTyping; + int showTyping; + DWORD lastMessage; + int iTabID; + HKL hkl; // keyboard layout identifier + DWORD dwTickLastEvent, dwUnread; + HBITMAP hOwnPic; + SIZE pic; + int showPic, showInfoPic; + BOOL fMustOffset; + BOOL isHistory; + int doSmileys; + UINT codePage; + HICON hSmileyIcon; + int iLastEventType; + time_t lastEventTime; + int iRealAvatarHeight; + int iButtonBarReallyNeeds; + DWORD dwLastActivity; + int iOpenJobs; + int iCurrentQueueError; + BOOL bIsMeta; + HANDLE hFlashingEvent; + TCHAR myUin[80]; + BOOL bNotOnList; + int SendFormat; + HANDLE *hQueuedEvents; + int iNextQueuedEvent; +#define EVENT_QUEUE_SIZE 10 + int iEventQueueSize; + LCID lcid; + TCHAR lcID[10]; + int panelWidth; + DWORD idle; + HWND hwndTip; + TOOLINFO ti; + HANDLE hTimeZone; + DWORD panelStatusCX; + COLORREF inputbg; + struct avatarCacheEntry *ace, *ownAce; + HANDLE *hHistoryEvents; + int maxHistory, curHistory; + HANDLE hTheme, hThemeIP, hThemeToolbar; + char szMicroLf[128]; + DWORD isAutoRTL; + int nMax; // max message size + int textLen; // current text len + LONG ipFieldHeight; + WNDPROC oldIEViewProc; + BOOL clr_added; + BOOL fIsReattach; + WPARAM wParam; // used for "delayed" actions like moved splitters in minimized windows + LPARAM lParam; + int iHaveRTLLang; + BOOL fInsertMode; + bool fkeyProcessed; + bool fEditNotesActive; + CInfoPanel *Panel; + CContactCache *cache; + CProxyWindow *pWnd; // proxy window object (win7+, for taskbar support). + // ALWAYS check this pointer before using it, it is not guaranteed to exist. + DWORD iSplitterSaved; + BYTE bWasDeleted; + BOOL bActualHistory; + POINT ptTipActivation; + LONG iInputAreaHeight; + bool fIsAutosizingInput; + bool fLimitedUpdate; +}; + +#define MESSAGE_WINDOW_DATA_SIZE offsetof(_MessageWindowData, hdbEventFirst); + +typedef struct _recentinfo { + DWORD dwFirst, dwMostRecent; // timestamps + int iFirstIndex, iMostRecent; // tab indices + HWND hwndFirst, hwndMostRecent; // client window handles +} RECENTINFO; + +/* + * configuration data for custom tab ctrl + */ + +struct myTabCtrl { + HPEN m_hPenShadow, m_hPenItemShadow, m_hPenLight; + HFONT m_hMenuFont; + COLORREF colors[10]; + HBRUSH m_brushes[4]; + DWORD m_fixedwidth; + int m_bottomAdjust; +}; + +struct TIconDesc { + char *szName; + char *szDesc; + HICON *phIcon; // where the handle is saved... + INT_PTR uId; // icon ID + BOOL bForceSmall; // true: force 16x16 +}; + +struct TIconDescW { + TCHAR *szName; + TCHAR *szDesc; + HICON *phIcon; // where the handle is saved... + INT_PTR uId; // icon ID + BOOL bForceSmall; // true: force 16x16 +}; + +// menu IDS + +#define MENU_LOGMENU 1 +#define MENU_PICMENU 2 +#define MENU_TABCONTEXT 3 +#define MENU_PANELPICMENU 4 + +#define TABSRMM_SMILEYADD_BKGCOLORMODE 0x10000000 +#define ADDEDEVENTSQUEUESIZE 100 + +/* + * tab config flags + */ + +#define TCF_FLAT 1 +//#define TCF_STYLED 2 +#define TCF_CLOSEBUTTON 4 +#define TCF_FLASHICON 8 +#define TCF_FLASHLABEL 16 +#define TCF_SINGLEROWTABCONTROL 32 +//#define TCF_LABELUSEWINCOLORS 64 +//#define TCF_BKGUSEWINCOLORS 128 +#define TCF_SBARLEFT 256 +#define TCF_SBARRIGHT 512 + +#define TCF_DEFAULT (TCF_FLASHICON) + +#define MIN_PANELHEIGHT 20 + +struct TNewWindowData { + HANDLE hContact; + int isWchar; + const char* szInitialText; + int iTabID; + int iTabImage; + int iActivate; + TCITEM item; + TContainerData* pContainer; + BOOL bWantPopup; + HANDLE hdbEvent; + HKL hkl; +}; + +// flags for the container dwFlags +#define CNT_MOUSEDOWN 1 +#define CNT_NOTITLE 2 +#define CNT_HIDETABS 4 +#define CNT_SIDEBAR 8 +#define CNT_NOFLASH 0x10 +#define CNT_STICKY 0x20 +#define CNT_DONTREPORT 0x40 +#define CNT_FLASHALWAYS 0x80 +#define CNT_TRANSPARENCY 0x100 +#define CNT_AUTOHIDE 0x200 +#define CNT_DONTREPORTFOCUSED 0x400 +//#define CNT_GLOBALSETTINGS 0x400 +#define CNT_GLOBALSIZE 0x800 +#define CNT_INFOPANEL 0x1000 +#define CNT_NOSOUND 0x2000 +#define CNT_AUTOSPLITTER 0x4000 +#define CNT_DEFERREDCONFIGURE 0x8000 +#define CNT_CREATE_MINIMIZED 0x10000 +#define CNT_NEED_UPDATETITLE 0x20000 +#define CNT_DEFERREDSIZEREQUEST 0x40000 +#define CNT_DONTREPORTUNFOCUSED 0x80000 +#define CNT_DONTREPORTFOCUSED 0x400 +#define CNT_ALWAYSREPORTINACTIVE 0x100000 +#define CNT_NEWCONTAINERFLAGS 0x200000 +#define CNT_DEFERREDTABSELECT 0x400000 +#define CNT_CREATE_CLONED 0x800000 +#define CNT_NOSTATUSBAR 0x1000000 +#define CNT_NOMENUBAR 0x2000000 +#define CNT_TABSBOTTOM 0x4000000 +#define CNT_AVATARSONTASKBAR 0x200 +#define CNT_BOTTOMTOOLBAR 0x10000000 +#define CNT_HIDETOOLBAR 0x20000000 +#define CNT_UINSTATUSBAR 0x40000000 +#define CNT_VERTICALMAX 0x80000000 + +#define CNT_EX_SOUNDS_MINIMIZED 1024 +#define CNT_EX_SOUNDS_UNFOCUSED 2048 +#define CNT_EX_SOUNDS_INACTIVETABS 4096 +#define CNT_EX_SOUNDS_FOCUSED 8192 + +#define CNT_FLAGS_DEFAULT (CNT_DONTREPORT | CNT_DONTREPORTUNFOCUSED | CNT_ALWAYSREPORTINACTIVE | CNT_HIDETABS | CNT_NEWCONTAINERFLAGS | CNT_NOMENUBAR | CNT_INFOPANEL) +#define CNT_TRANS_DEFAULT 0x00ff00ff + +#define CNT_FLAGSEX_DEFAULT (TCF_FLASHICON | CNT_EX_SOUNDS_MINIMIZED | CNT_EX_SOUNDS_UNFOCUSED | CNT_EX_SOUNDS_INACTIVETABS | CNT_EX_SOUNDS_FOCUSED) + +#define CNT_CREATEFLAG_CLONED 1 +#define CNT_CREATEFLAG_MINIMIZED 2 + +#define CNT_EX_CLOSEWARN 1 + +#define MWF_LOG_ALL (MWF_LOG_NORMALTEMPLATES | MWF_LOG_SHOWTIME | MWF_LOG_SHOWSECONDS | \ + MWF_LOG_SHOWDATES | MWF_LOG_INDENT | MWF_LOG_TEXTFORMAT | MWF_LOG_SYMBOLS | MWF_LOG_INOUTICONS | \ + MWF_LOG_SHOWICONS | MWF_LOG_GRID | MWF_LOG_GROUPMODE | \ + MWF_LOG_RTL | MWF_LOG_BBCODE | MWF_LOG_LOCALTIME/*MAD:*/ | \ + MWF_LOG_STATUSCHANGES|MWF_LOG_NEWLINE|MWF_LOG_UNDERLINE|MWF_LOG_SWAPNICK /*_MAD*/) + +#define MWF_LOG_DEFAULT (MWF_LOG_SHOWTIME | MWF_LOG_NORMALTEMPLATES | MWF_LOG_SHOWDATES | MWF_LOG_SYMBOLS | MWF_LOG_GRID | MWF_LOG_STATUSCHANGES | MWF_LOG_INOUTICONS) + +/* + * custom dialog window messages + */ +#define EM_SUBCLASSED (WM_USER+0x101) +#define EM_SEARCHSCROLLER (WM_USER+0x103) +#define EM_VALIDATEBOTTOM (WM_USER+0x104) +#define EM_THEMECHANGED (WM_USER+0x105) +#define EM_UNSUBCLASSED (WM_USER+0x106) +#define EM_REFRESHWITHOUTCLIP (WM_USER+0x107) + +#define HM_EVENTSENT (WM_USER+10) +#define DM_REMAKELOG (WM_USER+11) +#define HM_DBEVENTADDED (WM_USER+12) +#define DM_SETINFOPANEL (WM_USER+13) +#define DM_OPTIONSAPPLIED (WM_USER+14) +#define DM_SPLITTERMOVED (WM_USER+15) +#define DM_UPDATETITLE (WM_USER+16) +#define DM_APPENDTOLOG (WM_USER+17) +#define DM_ERRORDECIDED (WM_USER+18) +#define DM_SPLITSENDACK (WM_USER+19) +#define DM_TYPING (WM_USER+20) +#define DM_UPDATEWINICON (WM_USER+21) +#define DM_UPDATELASTMESSAGE (WM_USER+22) + +#define DM_SELECTTAB (WM_USER+23) +#define DM_CLOSETABATMOUSE (WM_USER+24) +#define DM_STATUSICONCHANGE (WM_USER+25) +#define DM_SETLOCALE (WM_USER+26) +#define DM_SESSIONLIST (WM_USER+27) +#define DM_QUERYLASTUNREAD (WM_USER+28) +#define DM_QUERYPENDING (WM_USER+29) +#define DM_UPDATEPICLAYOUT (WM_USER+30) +#define DM_QUERYCONTAINER (WM_USER+31) +#define DM_MUCFLASHWORKER (WM_USER+32) +#define DM_INVALIDATEPANEL (WM_USER+33) +//#define DM_REPORTMINHEIGHT (WM_USER+34) // msg dialog reports its minimum height to the container +#define DM_CHECKINFOTIP (WM_USER+35) +#define DM_SAVESIZE (WM_USER+36) +#define DM_CHECKSIZE (WM_USER+37) +#define DM_FORCEREDRAW (WM_USER+38) +#define DM_CONTAINERSELECTED (WM_USER+39) +#define DM_CONFIGURECONTAINER (WM_USER+40) +#define DM_QUERYHCONTACT (WM_USER+41) +#define DM_DEFERREDREMAKELOG (WM_USER+42) +#define DM_RESTOREWINDOWPOS (WM_USER+43) +#define DM_FORCESCROLL (WM_USER+44) +#define DM_QUERYCLIENTAREA (WM_USER+45) +#define DM_QUERYRECENT (WM_USER+47) +#define DM_ACTIVATEME (WM_USER+46) +// #define DM_REMOVEFROMSENDLATER (WM_USER+48) +#define DM_SENDLATER_RESEND (WM_USER+49) +#define DM_ADDDIVIDER (WM_USER+50) +#define DM_STATUSMASKSET (WM_USER+51) +#define DM_CONTACTSETTINGCHANGED (WM_USER+52) +#define DM_UPDATESTATUSMSG (WM_USER+53) +#define DM_PROTOACK (WM_USER+54) +#define DM_OWNNICKCHANGED (WM_USER+55) +#define DM_CONFIGURETOOLBAR (WM_USER+56) +#define DM_LOADBUTTONBARICONS (WM_USER+57) +#define DM_ACTIVATETOOLTIP (WM_USER+58) +#define DM_UINTOCLIPBOARD (WM_USER+59) +//#define DM_SPLITTEREMERGENCY (WM_USER+60) +#define DM_SENDMESSAGECOMMAND (WM_USER+61) +#define DM_FORCEDREMAKELOG (WM_USER+62) +//#define DM_QUERYFLAGS (WM_USER+63) +#define DM_STATUSBARCHANGED (WM_USER+64) +#define DM_SAVEMESSAGELOG (WM_USER+65) +#define DM_CHECKAUTOCLOSE (WM_USER+66) +#define DM_UPDATEMETACONTACTINFO (WM_USER+67) +#define DM_SETICON (WM_USER+68) +#define DM_CLOSEIFMETA (WM_USER+69) +#define DM_CHECKQUEUEFORCLOSE (WM_USER+70) +#define DM_CHECKAUTOHIDE (WM_USER+71) +#define DM_SETPARENTDIALOG (WM_USER+72) +#define DM_HANDLECLISTEVENT (WM_USER+73) +#define DM_TRAYICONNOTIFY (WM_USER+74) +#define DM_REMOVECLISTEVENT (WM_USER+75) +#define DM_GETWINDOWSTATE (WM_USER+76) +#define DM_DOCREATETAB (WM_USER+77) +#define DM_DELAYEDSCROLL (WM_USER+78) +#define DM_REPLAYQUEUE (WM_USER+79) +#define DM_REFRESHTABINDEX (WM_USER+83) +#define DM_PROTOAVATARCHANGED (WM_USER+84) +#define DM_SMILEYOPTIONSCHANGED (WM_USER+85) +#define DM_MYAVATARCHANGED (WM_USER+86) +#define DM_PRINTCLIENT (WM_USER+87) +#define DM_IEVIEWOPTIONSCHANGED (WM_USER+88) +#define DM_SPLITTERGLOBALEVENT (WM_USER + 89) +#define DM_DOCREATETAB_CHAT (WM_USER+90) +#define DM_CLIENTCHANGED (WM_USER+91) +#define DM_PLAYINCOMINGSOUND (WM_USER+92) +#define DM_SENDMESSAGECOMMANDW (WM_USER+93) +#define DM_REMOVEPOPUPS (WM_USER+94) +#define DM_BBNEEDUPDATE (WM_USER+96) +#define DM_CBDESTROY (WM_USER+97) +#define DM_LOGSTATUSCHANGE (WM_USER+98) +//#define DM_SPLITTERMOVEDGLOBAL_NOSYNC_IM (WM_USER+99) +#define DM_SC_BUILDLIST (WM_USER+100) +#define DM_SC_INITDIALOG (WM_USER+101) +#define DM_SC_CONFIG (WM_USER+104) +#define DM_SCROLLIEVIEW (WM_USER+102) +#define DM_UPDATEUIN (WM_USER+103) + +#define MINSPLITTERY 42 +#define MINLOGHEIGHT 30 +#define ERRORPANEL_HEIGHT 51 + +// wParam values for DM_SELECTTAB + +#define DM_SELECT_NEXT 1 +#define DM_SELECT_PREV 2 + +#define DM_SELECT_BY_HWND 3 // lParam specifies hwnd +#define DM_SELECT_BY_INDEX 4 // lParam specifies tab index + +#define DM_QUERY_NEXT 1 +#define DM_QUERY_MOSTRECENT 2 + +/* + * implement a callback for the rich edit. Without it, no bitmaps + * can be added to the richedit control. + * this class has to implement the GetNewStorage() method + */ + +class REOLECallback : IRichEditOleCallback +{ + +public: + + REOLECallback() + { + mRefCounter = 0; + } + + ~REOLECallback() + {} + + STDMETHOD_(ULONG, AddRef)(void) + { + mRefCounter++; + return (mRefCounter); + } + + STDMETHOD_(ULONG, Release)(void) + { + --mRefCounter; + //if (--mRefCounter == 0) + // delete this; + return (mRefCounter); + } + + STDMETHOD(QueryInterface)(REFIID iid, void** ppvObject) + { + if ( iid == IID_IUnknown || iid == IID_IRichEditOleCallback ) { + *ppvObject = this; AddRef(); return (S_OK); + } + else + return (E_NOINTERFACE); + } + + STDMETHOD(ContextSensitiveHelp) (BOOL fEnterMode) { return (E_NOTIMPL);} + STDMETHOD(DeleteObject) (LPOLEOBJECT lpoleobj) { return (E_NOTIMPL);} + STDMETHOD(GetClipboardData) (CHARRANGE FAR *lpchrg, DWORD reco, LPDATAOBJECT FAR *lplpdataobj) { return (E_NOTIMPL);} + STDMETHOD(GetContextMenu) (WORD seltype, LPOLEOBJECT lpoleobj, CHARRANGE FAR *lpchrg, HMENU FAR *lphmenu) { return (E_NOTIMPL);} + STDMETHOD(GetDragDropEffect) (BOOL fDrag, DWORD grfKeyState, LPDWORD pdwEffect) { return (E_NOTIMPL);} + STDMETHOD(GetInPlaceContext) (LPOLEINPLACEFRAME FAR *lplpFrame, LPOLEINPLACEUIWINDOW FAR *lplpDoc, LPOLEINPLACEFRAMEINFO lpFrameInfo) { return (E_NOTIMPL);} + STDMETHOD(GetNewStorage) (LPSTORAGE FAR *lplpstg); + STDMETHOD(QueryAcceptData) (LPDATAOBJECT lpdataobj, CLIPFORMAT FAR *lpcfFormat, DWORD reco, BOOL fReally, HGLOBAL hMetaPict) { return (E_NOTIMPL);} + STDMETHOD(QueryInsertObject) (LPCLSID lpclsid, LPSTORAGE lpstg, LONG cp) { return (S_OK);} + STDMETHOD(ShowContainerUI) (BOOL fShow) { return (E_NOTIMPL);} +private: + UINT mRefCounter; +}; + +#define MSGFONTID_MYMSG 0 +#define MSGFONTID_MYMISC 1 +#define MSGFONTID_YOURMSG 2 +#define MSGFONTID_YOURMISC 3 +#define MSGFONTID_MYNAME 4 +#define MSGFONTID_MYTIME 5 +#define MSGFONTID_YOURNAME 6 +#define MSGFONTID_YOURTIME 7 +#define H_MSGFONTID_MYMSG 8 +#define H_MSGFONTID_MYMISC 9 +#define H_MSGFONTID_YOURMSG 10 +#define H_MSGFONTID_YOURMISC 11 +#define H_MSGFONTID_MYNAME 12 +#define H_MSGFONTID_MYTIME 13 +#define H_MSGFONTID_YOURNAME 14 +#define H_MSGFONTID_YOURTIME 15 +#define MSGFONTID_MESSAGEAREA 16 +#define H_MSGFONTID_STATUSCHANGES 17 +#define H_MSGFONTID_DIVIDERS 18 +#define MSGFONTID_ERROR 19 +#define MSGFONTID_SYMBOLS_IN 20 +#define MSGFONTID_SYMBOLS_OUT 21 + +#define IPFONTID_NICK 0 +#define IPFONTID_UIN 1 +#define IPFONTID_STATUS 2 +#define IPFONTID_PROTO 3 +#define IPFONTID_TIME 4 + +extern const int msgDlgFontCount; + +#define LOADHISTORY_UNREAD 0 +#define LOADHISTORY_COUNT 1 +#define LOADHISTORY_TIME 2 + +#define SRMSGSET_AUTOPOPUP "AutoPopup" +#define SRMSGDEFSET_AUTOPOPUP 0 +#define SRMSGSET_AUTOMIN "AutoMin" +#define SRMSGDEFSET_AUTOMIN 0 +#define SRMSGSET_SENDONENTER "SendOnEnter" +#define SRMSGDEFSET_SENDONENTER 0 +#define SRMSGSET_MSGTIMEOUT "MessageTimeout" +#define SRMSGDEFSET_MSGTIMEOUT 60000 +#define SRMSGSET_MSGTIMEOUT_MIN 30000 // minimum value (30 seconds) + +#define SRMSGSET_LOADHISTORY "LoadHistory" +#define SRMSGDEFSET_LOADHISTORY LOADHISTORY_COUNT +#define SRMSGSET_LOADCOUNT "LoadCount" +#define SRMSGDEFSET_LOADCOUNT 10 +#define SRMSGSET_LOADTIME "LoadTime" +#define SRMSGDEFSET_LOADTIME 10 + +#define SRMSGSET_SHOWURLS "ShowURLs" +#define SRMSGDEFSET_SHOWURLS 1 +#define SRMSGSET_SHOWFILES "ShowFiles" +#define SRMSGDEFSET_SHOWFILES 1 +#define SRMSGSET_BKGCOLOUR "BkgColour" +#define SRMSGSET_BKGCOLOUR_MUC "BkgColourMUC" + +#define SRMSGDEFSET_BKGCOLOUR RGB(250,250,250) +//#define SRMSGDEFSET_BKGCOLOUR GetSysColor(COLOR_WINDOW) +#define SRMSGDEFSET_BKGINCOLOUR RGB(245,255,245) +#define SRMSGDEFSET_BKGOUTCOLOUR RGB(245,245,255) + +#define SRMSGSET_TYPING "SupportTyping" +#define SRMSGSET_TYPINGNEW "DefaultTyping" +#define SRMSGDEFSET_TYPINGNEW 1 + +#define SRMSGSET_TYPINGUNKNOWN "UnknownTyping" +#define SRMSGDEFSET_TYPINGUNKNOWN 0 + +#define SRMSGSET_SHOWTYPING "ShowTyping" +#define SRMSGDEFSET_SHOWTYPING 1 + +#define SRMSGSET_SHOWTYPINGWINFLASH "ShowTypingWinFlash" +#define SRMSGDEFSET_SHOWTYPINGWINFLASH 1 + +#define SRMSGSET_SHOWTYPINGNOWINOPEN "ShowTypingNoWinOpen" + +#define SRMSGSET_SHOWTYPINGWINOPEN "ShowTypingWinOpen" + +#define SRMSGSET_SHOWTYPINGCLIST "ShowTypingClist" +#define SRMSGDEFSET_SHOWTYPINGCLIST 1 + +// rtl support +#define SRMSGDEFSET_MOD_RTL 0 + +#define TIMERID_FLASHWND 1 +#define TIMEOUT_FLASHWND 900 +#define TIMERID_HEARTBEAT 2 +#define TIMEOUT_HEARTBEAT 20000 +#define TIMERID_HOVER 10 +#define TIMERID_HOVER_T 11 + +#define SRMSGMOD "SRMsg" +#define SRMSGMOD_T "Tab_SRMsg" +#define FONTMODULE "TabSRMM_Fonts" +#define CHAT_FONTMODULE "TabSRMM_chat_Fonts" + +#define IDM_STAYONTOP (WM_USER + 1) +#define IDM_NOTITLE (WM_USER + 2) +#define IDM_MOREOPTIONS (WM_USER +4) + +// constants for the container management functions + +#define CNT_ENUM_DELETE 1 // delete the target container... +#define CNT_ENUM_RENAME 2 +#define CNT_ENUM_WRITEFLAGS 4 + +#define IDM_CONTAINERMENU 50500 + +#define EVENTTYPE_STATUSCHANGE 25368 +#define EVENTTYPE_DIVIDER 25367 +#define EVENTTYPE_ERRMSG 25366 + +// hotkey modifiers... + +#define HOTKEY_MODIFIERS_CTRLSHIFT 0 +#define HOTKEY_MODIFIERS_CTRLALT 1 +#define HOTKEY_MODIFIERS_ALTSHIFT 2 + +struct TLogIcon { + HBITMAP hBmp, hoBmp; + HDC hdc, hdcMem; + HBRUSH hBkgBrush; +}; + +#include "..\TabSRMM_icons\resource.h" // icon pack values + +struct TCpTable { + UINT cpId; + TCHAR *cpName; +}; + +#define LOI_TYPE_FLAG 1 +#define LOI_TYPE_SETTING 2 + +struct TOptionListGroup { + LRESULT handle; + TCHAR *szName; +}; + +struct TOptionListItem { + LRESULT handle; + TCHAR *szName; + UINT id; + UINT uType; + UINT_PTR lParam; + UINT uGroup; +}; + +// sidebar button flags + +#define SBI_TOP 1 +#define SBI_BOTTOM 2 +#define SBI_HIDDEN 4 +#define SBI_DISABLED 8 +#define SBI_TOGGLE 16 +#define SBI_HANDLEBYCLIENT 32 + +// fixed stock button identifiers + +#define IDC_SBAR_SLIST 1111 +#define IDC_SBAR_FAVORITES 1112 +#define IDC_SBAR_RECENT 1113 +#define IDC_SBAR_SETUP 1114 +#define IDC_SBAR_USERPREFS 1115 +#define IDC_SBAR_TOGGLEFORMAT 1117 +#define IDC_SBAR_CANCEL 1118 + +struct SIDEBARITEM { + UINT uId; + DWORD dwFlags; + HICON *hIcon, *hIconPressed, *hIconHover; + TCHAR *szName; + void (*pfnAction)(ButtonItem *item, HWND hwndDlg, struct TWindowData *dat, HWND hwndItem); + void (*pfnCallback)(ButtonItem *item, HWND hwndDlg, struct TWindowData *dat, HWND hwndItem); + TCHAR *tszTip; +}; + +#define FONTF_BOLD 1 +#define FONTF_ITALIC 2 +#define FONTF_UNDERLINE 4 +#define FONTF_STRIKEOUT 8 + +#define RTFCACHELINESIZE 128 + +#define ID_EXTBKCONTAINER 0 +#define ID_EXTBKBUTTONBAR 1 +#define ID_EXTBKBUTTONSPRESSED 2 +#define ID_EXTBKBUTTONSNPRESSED 3 +#define ID_EXTBKBUTTONSMOUSEOVER 4 +#define ID_EXTBKINFOPANEL 5 +#define ID_EXTBKTITLEBUTTON 6 +#define ID_EXTBKTITLEBUTTONMOUSEOVER 7 +#define ID_EXTBKTITLEBUTTONPRESSED 8 +#define ID_EXTBKTABPAGE 9 +#define ID_EXTBKTABITEM 10 +#define ID_EXTBKTABITEMACTIVE 11 +#define ID_EXTBKTABITEMBOTTOM 12 +#define ID_EXTBKTABITEMACTIVEBOTTOM 13 +#define ID_EXTBKFRAME 14 +#define ID_EXTBKHISTORY 15 +#define ID_EXTBKINPUTAREA 16 +#define ID_EXTBKFRAMEINACTIVE 17 +#define ID_EXTBKTABITEMHOTTRACK 18 +#define ID_EXTBKTABITEMHOTTRACKBOTTOM 19 +#define ID_EXTBKSTATUSBARPANEL 20 +#define ID_EXTBKSTATUSBAR 21 +#define ID_EXTBKUSERLIST 22 +#define ID_EXTBKINFOPANELBG 23 +#define ID_EXTBKSIDEBARBG 24 +#define ID_EXTBK_LAST 24 + +#define SESSIONTYPE_ANY 0 +#define SESSIONTYPE_IM 1 +#define SESSIONTYPE_CHAT 2 + +#define DEFAULT_SIDEBARWIDTH 30 + +#define THEME_READ_FONTS 1 +#define THEME_READ_TEMPLATES 2 +#define THEME_READ_ALL (THEME_READ_FONTS | THEME_READ_TEMPLATES) + +#define IDC_TBFIRSTUID 10000 // first uId for custom buttons + +#include "templates.h" + +struct TStatusBarIconNode { + TStatusBarIconNode* next; + StatusIconData sid; +}; + +struct TABSRMM_SessionInfo { + unsigned int cbSize; + unsigned short evtCode; + HWND hwnd; // handle of the message dialog (tab) + HWND hwndContainer; // handle of the parent container + HWND hwndInput; // handle of the input area (rich edit) + UINT extraFlags; + UINT extraFlagsEX; + void *local; +}; + +typedef struct { + int cbSize; + HANDLE hContact; + int uFlags; // should be same as input data unless 0, then it will be the actual type + HWND hwndWindow; //top level window for the contact or NULL if no window exists + int uState; // see window states + void *local; // used to store pointer to custom data +} MessageWindowOutputData; + +#define MS_MSG_GETWINDOWDATA "MessageAPI/GetWindowData" +//wparam=(MessageWindowInputData*) +//lparam=(MessageWindowData*) +//returns 0 on success and returns non-zero (1) on error or if no window data exists for that hcontact + +// callback for the user menu entry + +#define MS_TABMSG_SETUSERPREFS "SRMsg_MOD/SetUserPrefs" +#define MS_TABMSG_SLQMGR "SRMsg_MOD/InvokeQmgr" + +// show one of the tray menus +// wParam = 0 -> session list +// wParam = 1 -> tray menu +// lParam must be 0 +#define MS_TABMSG_TRAYSUPPORT "SRMsg_MOD/Show_TrayMenu" + +/* + * the service which processes globally registered hotkeys + */ +#define MS_TABMSG_HOTKEYPROCESS "SRMsg_MOD/ProcessHotkey" + +#define MBF_DISABLED 0x01 + +#define TEMPLATES_MODULE "tabSRMM_Templates" +#define RTLTEMPLATES_MODULE "tabSRMM_RTLTemplates" + +//Checks if there is a message window opened +//wParam=(LPARAM)(HANDLE)hContact - handle of the contact for which the window is searched. ignored if lParam +//is not zero. +//lParam=(LPARAM)(HWND)hwnd - a window handle - SET THIS TO 0 if you want to obtain the window handle +//from the hContact. +#define MS_MSG_MOD_MESSAGEDIALOGOPENED "SRMsg_MOD/MessageDialogOpened" + +//obtain the message window flags +//wParam = hContact - ignored if lParam is given. +//lParam = hwnd +//returns struct MessageWindowData *dat, 0 if no window is found +#define MS_MSG_MOD_GETWINDOWFLAGS "SRMsg_MOD/GetWindowFlags" + +// custom tabSRMM events + +#define tabMSG_WINDOW_EVT_CUSTOM_BEFORESEND 1 + + +/* temporary HPP API for emulating message log */ + +#define MS_HPP_EG_WINDOW "History++/ExtGrid/NewWindow" +#define MS_HPP_EG_EVENT "History++/ExtGrid/Event" +#define MS_HPP_EG_UTILS "History++/ExtGrid/Utils" +#define MS_HPP_EG_OPTIONSCHANGED "History++/ExtGrid/OptionsChanged" +#define MS_HPP_EG_NOTIFICATION "History++/ExtGrid/Notification" + +#define SB_CHAR_WIDTH 45 // default width for status bar panel #2 +#define DEFAULT_CONTAINER_POS 0x00400040 // default container position and size +#define DEFAULT_CONTAINER_SIZE 0x019001f4 + +/* + * core hotkey service ids + */ + +#define TABSRMM_HK_LASTUNREAD 2 +#define TABSRMM_HK_LASTRECENT 4 +#define TABSRMM_HK_PASTEANDSEND 8 +#define TABSRMM_HK_SETUSERPREFS 9 +#define TABSRMM_HK_CONTAINEROPTIONS 10 +#define TABSRMM_HK_NUDGE 11 +#define TABSRMM_HK_SENDFILE 12 +#define TABSRMM_HK_QUOTEMSG 13 +#define TABSRMM_HK_SEND 14 +#define TABSRMM_HK_EMOTICONS 15 +#define TABARMM_HK_TOGGLEINFOPANEL 16 +#define TABSRMM_HK_HISTORY 17 +#define TABSRMM_HK_TOGGLETOOLBAR 18 +#define TABSRMM_HK_TOGGLEMULTISEND 19 +#define TABSRMM_HK_TOGGLERTL 20 +#define TABSRMM_HK_USERMENU 21 +#define TABSRMM_HK_USERDETAILS 22 +#define TABSRMM_HK_TOGGLEINFOPANEL 23 +#define TABSRMM_HK_CLEARLOG 24 +#define TABSRMM_HK_EDITNOTES 25 +#define TABSRMM_HK_TOGGLESENDLATER 26 +#define TABSRMM_HK_TOGGLESIDEBAR 27 +#define TABSRMM_HK_CHANNELMGR 28 +#define TABSRMM_HK_FILTERTOGGLE 29 +#define TABSRMM_HK_LISTTOGGLE 30 +#define TABSRMM_HK_MUC_SHOWSERVER 31 + +#define TABSRMM_HK_SECTION_IM "Message windows - IM" +#define TABSRMM_HK_SECTION_GENERIC "Message windows - all" +#define TABSRMM_HK_SECTION_GC "Message windows - groupchats" + +/* + * encryption status bar indicator + */ + +// extern HANDLE hHookIconPressedEvt; +extern int status_icon_list_size; + +int SI_InitStatusIcons(); +int SI_DeinitStatusIcons(); + +int GetStatusIconsCount(); +void DrawStatusIcons(struct TWindowData *dat, HDC hdc, RECT r, int gap); +void SI_CheckStatusIconClick(struct TWindowData *dat, HWND hwndFrom, POINT pt, RECT rc, int gap, int code); + +typedef struct _tagSKINDesc { + ULONG ulID; // resource id + TCHAR tszName[30]; +} SKINDESC; + +#define SKIN_NR_ELEMENTS 6 +#define SKIN_VERSION 2 + +/* + * icon defintions (index into g_buttonBarIcons) + */ + +#define ICON_DEFAULT_SOUNDS 22 +#define ICON_DEFAULT_PULLDOWN 16 +#define ICON_DEFAULT_LEFT 25 +#define ICON_DEFAULT_RIGHT 28 +#define ICON_DEFAULT_UP 26 +#define ICON_DEFAULT_TYPING 5 + +#define ICON_BUTTON_ADD 0 +#define ICON_BUTTON_CANCEL 6 +#define ICON_BUTTON_SAVE 7 + +#endif /* _MSGS_H */ + + diff --git a/plugins/TabSRMM/src/include/nen.h b/plugins/TabSRMM/src/include/nen.h new file mode 100644 index 0000000000..106238b320 --- /dev/null +++ b/plugins/TabSRMM/src/include/nen.h @@ -0,0 +1,169 @@ +/* + * astyle --force-indent=tab=4 --brackets=linux --indent-switches + * --pad=oper --one-line=keep-blocks --unpad=paren + * + * Miranda NG: the free IM client for Microsoft* Windows* + * + * Copyright 2000-2009 Miranda ICQ/IM project, + * all portions of this codebase are copyrighted to the people + * listed in contributors.txt. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * you should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * part of tabSRMM messaging plugin for Miranda. + * + * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors + * + * $Id: nen.h 13750 2011-08-03 20:10:43Z george.hazan $ + * + * This implements the event notification module for tabSRMM. The code + * is largely based on the NewEventNotify plugin for Miranda NG. See + * notices below for original copyright + * + * Name: NewEventNotify - Plugin for Miranda ICQ + * Description: Notifies you when you receive a message + * Author: icebreaker, + * Date: 18.07.02 13:59 / Update: 16.09.02 17:45 + * Copyright: (C) 2002 Starzinger Michael + * + */ + +#ifndef _NEN_H_ +#define _NEN_H_ + +//#include "m_popup.h" +//#include "m_popupw.h" + +#define MODULE "tabSRMM_NEN" + +int tabSRMM_ShowPopup(WPARAM wParam, LPARAM lParam, WORD eventType, int windowOpen, struct TContainerData *pContainer, HWND hwndChild, const char *szProto, struct TWindowData *dat); + + +#define DEFAULT_COLBACK RGB(255,255,128) +#define DEFAULT_COLTEXT RGB(0,0,0) +#define DEFAULT_MASKNOTIFY (MASK_MESSAGE|MASK_URL|MASK_FILE|MASK_OTHER) +#define DEFAULT_MASKACTL (MASK_OPEN|MASK_DISMISS) +#define DEFAULT_MASKACTR (MASK_DISMISS) +#define DEFAULT_DELAY -1 + +#define MASK_MESSAGE 0x0001 +#define MASK_URL 0x0002 +#define MASK_FILE 0x0004 +#define MASK_OTHER 0x0008 + +#define MASK_DISMISS 0x0001 +#define MASK_OPEN 0x0002 +#define MASK_REMOVE 0x0004 + +#define PU_REMOVE_ON_FOCUS 1 +#define PU_REMOVE_ON_TYPE 2 +#define PU_REMOVE_ON_SEND 4 + +#define SETTING_LIFETIME_MIN 1 +#define SETTING_LIFETIME_MAX 60 +#define SETTING_LIFETIME_DEFAULT 4 + +//Entrys in the database, don't translate +#define OPT_PREVIEW "Preview" +#define OPT_COLDEFAULT_MESSAGE "DefaultColorMsg" +#define OPT_COLBACK_MESSAGE "ColorBackMsg" +#define OPT_COLTEXT_MESSAGE "ColorTextMsg" +#define OPT_COLDEFAULT_OTHERS "DefaultColorOthers" +#define OPT_COLDEFAULT_ERR "DefaultColorErr" +#define OPT_COLBACK_OTHERS "ColorBackOthers" +#define OPT_COLTEXT_OTHERS "ColorTextOthers" +#define OPT_COLBACK_ERR "ColorBackErr" +#define OPT_COLTEXT_ERR "ColorTextErr" +#define OPT_MASKNOTIFY "Notify" +#define OPT_MASKACTL "ActionLeft" +#define OPT_MASKACTR "ActionRight" +#define OPT_MASKACTTE "ActionTimeExpires" +#define OPT_MERGEPOPUP "MergePopup" +#define OPT_DELAY_MESSAGE "DelayMessage" +#define OPT_DELAY_OTHERS "DelayOthers" +#define OPT_DELAY_ERR "DelayErr" +#define OPT_SHOW_HEADERS "ShowHeaders" +#define OPT_NORSS "NoRSSAnnounces" +#define OPT_DISABLE "Disabled" +#define OPT_MUCDISABLE "MUCDisabled" +#define OPT_WINDOWCHECK "WindowCheck" +#define OPT_LIMITPREVIEW "LimitPreview" +#define OPT_REMOVEMASK "removemask" + +struct NEN_OPTIONS { + BOOL bPreview; + BOOL bDefaultColorMsg; + BOOL bDefaultColorOthers; + BOOL bDefaultColorErr; + BOOL bDisableNonMessage; + COLORREF colBackMsg; + COLORREF colTextMsg; + COLORREF colBackOthers; + COLORREF colTextOthers; + COLORREF colBackErr; + COLORREF colTextErr; + UINT maskActL; + UINT maskActR; + UINT maskActTE; + int iDelayMsg; + int iDelayOthers; + int iDelayErr; + int iDelayDefault; + BOOL bMergePopup; + BOOL bShowHeaders; + BOOL bNoRSS; + int iDisable; + int iMUCDisable; + int dwStatusMask; + BOOL bTraySupport; + BOOL bTrayExist; + BOOL iNoSounds; + BOOL iNoAutoPopup; + BOOL bWindowCheck; + int iLimitPreview; + WORD wMaxRecent; + WORD wMaxFavorites; + DWORD dwRemoveMask; +}; + +typedef struct { + HANDLE hEvent; + TCHAR szText[MAX_SECONDLINE + 2]; + DWORD timestamp; +} EVENT_DATAT; + +typedef struct { + UINT eventType; + HANDLE hContact; + NEN_OPTIONS *pluginOptions; + POPUPDATAT_V2* pud; + HWND hWnd; + long iSeconds; + TCHAR szHeader[256]; + int nrMerged; + EVENT_DATAT *eventData; + int nrEventsAlloced; + int iActionTaken; + HWND hContainer; +} PLUGIN_DATAT; + +#define NR_MERGED 5 + +#define TIMER_TO_ACTION 50685 + +#define MAX_DATASIZE 50 +#define MAX_POPUPS 20 + +#endif diff --git a/plugins/TabSRMM/src/include/resource.h b/plugins/TabSRMM/src/include/resource.h new file mode 100644 index 0000000000..25f9547d0f --- /dev/null +++ b/plugins/TabSRMM/src/include/resource.h @@ -0,0 +1,796 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by C:\tabsrmm\trunk\miranda\plugins\tabsrmm\resource.rc +// +#define IDD_TEMPLATEEDIT 1 +#define IDD_USERPREFS 2 +#define IDOK2 2 +#define IDD_USERPREFS1 3 +#define IDD_TABCONFIG 4 +#define IDD_ABOUT 7 +#define IDD_INFOPANEL 8 +#define IDC_TESTVALUE 10 +#define IDB_BITMAP1 10 +#define IDB_LOGO 10 +#define IDD_USERPREFS_FRAME 11 +#define IDR_SKIN1 13 +#define IDR_SKIN_AERO 14 +#define IDR_SKIN_AERO_GLOW 15 +#define IDD_SENDLATER_QMGR 15 +#define IDR_SKIN_AERO_SWITCHBAR 16 +#define IDD_WARNING 16 +#define IDR_SKIN_LOGO 20 +#define IDI_IMGOPEN 102 +#define IDI_IMGCLOSE 103 +#define IDI_FEATURE_DISABLED 104 +#define IDI_FEATURE_ENABLED 105 +#define IDR_CONTEXT 180 +#define IDM_PASTEFORMATTED 181 +#define IDM_CUT 182 +#define IDM_PASTE 183 +#define IDD_MSGSPLITNEW 184 +#define IDM_QUOTE 185 +#define IDM_COPY 186 +#define IDM_COPYALL 187 +#define IDM_SELECTALL 188 +#define IDM_CLEAR 189 +#define IDM_OPENNEW 190 +#define IDM_OPENEXISTING 191 +#define IDM_COPYLINK 192 +#define IDM_STICKY 193 +#define IDM_REPORTALWAY 194 +#define IDM_REPORTNEVER 195 +#define IDM_DONTREPORTMINIMIZED 196 +#define IDD_OPT_MSGDLG 243 +#define IDD_OPT_MSGLOG 245 +#define IDD_OPT_MSGTYPE 275 +#define IDD_MSGCONTAINER 276 +#define IDD_OPT_TABBEDMSG 277 +#define IDD_POPUP_OPT 278 +#define IDR_ACCEL 283 +#define IDR_TABCONTEXT 286 +#define IDD_MODERNOPTS 288 +#define IDD_SELECTCONTAINER 299 +#define IDD_CONTAINEROPTIONS 300 +#define IDD_OPT_CONTAINERS 301 +#define IDD_OPT_TOOLBAR 304 +#define IDR_MENUBAR 308 +#define IDD_CHOOSESTATUSMODES 310 +#define IDD_SKINTABDIALOG 312 +#define IDD_OPT_SKIN 313 +#define IDD_OPTIONS_PLUS 333 +#define IDD_EXCEPTION 400 +#define IDC_QMGR_REMOVE 1000 +#define IDC_EXCEPTION_DETAILS 1000 +#define IDC_UNLOAD 1000 +#define IDC_READNEXT 1000 +#define IDC_MINIMIZE 1000 +#define IDC_COPY_EXCEPTION 1001 +#define IDC_RELOADSKIN 1001 +#define IDC_APPLY 1001 +#define IDC_MAXIMIZE 1001 +#define IDC_SKINFILE 1002 +#define IDC_MESSAGE 1002 +#define IDC_THEMEEXPORT 1002 +#define IDC_HYPERLINKHAND 1003 +#define IDC_THEMEEXPORT2 1003 +#define IDC_THEMEIMPORT 1003 +#define IDC_EXPORT 1005 +#define IDC_IMPORT 1006 +#define IDC_PREVIEW 1006 +#define IDC_LOG 1006 +#define IDC_CHKNOTIFY_MESSAGE 1007 +#define IDC_FASTGRADIENT 1008 +#define IDC_CHKNOTIFY_URL 1009 +#define IDC_USESKIN 1011 +#define IDC_AUTOCLOSE 1012 +#define IDC_CHKNOTIFY_OTHER 1013 +#define IDC_AUTOMIN 1014 +#define IDC_CHKMENUITEM 1015 +#define IDC_TIME 1016 +#define IDC_CHKDISABLE 1017 +#define IDC_SENDMENU 1018 +#define IDC_CHKACTL_DISMISS 1019 +#define IDC_QUOTE 1020 +#define IDC_CHKACTL_OPEN 1021 +#define IDC_NAME 1022 +#define IDC_CHKACTL_REMOVE 1023 +#define IDC_INFOPANELMENU 1023 +#define IDC_CLOSE 1024 +#define IDC_SAVE 1025 +#define IDC_CHKACTR_DISMISS 1026 +#define IDC_CHKACTR_OPEN 1028 +#define IDC_CONTACTPIC 1029 +#define IDC_ST_ENTERMSG 1031 +#define IDC_PANELNICK 1032 +#define IDC_CHKWINDOWCHECK 1032 +#define IDC_PANELUIN 1033 +#define IDC_CHKPREVIEW 1034 +#define IDC_CHKINFINITE 1035 +#define IDC_PANELSTATUS 1036 +#define IDC_SPLITTER 1037 +#define IDC_CHKDEFAULTCOL_MESSAGE 1038 +#define IDC_CHKDEFAULTCOL_MUC 1039 +#define IDC_CHKDEFAULTCOL_ERR 1040 +#define IDC_COLBACK_MESSAGE 1041 +#define IDC_COLTEXT_MESSAGE 1042 +#define IDC_COLTEXT_MUC 1043 +#define IDC_COLBACK_MUC 1044 +#define IDC_COLTEXT_ERR 1045 +#define IDC_COLBACK_ERR 1046 +#define IDC_SHOWNAMES 1047 +#define IDC_CHKDEFAULTCOL_OTHERS 1050 +#define IDC_COLBACK_OTHERS 1051 +#define IDC_CLOSEONREPLY 1052 +#define IDC_COLTEXT_OTHERS 1053 +#define IDC_SHOWFILES 1054 +#define IDC_MERGEPOPUP 1056 +#define IDC_CHKINFINITE_MESSAGE 1057 +#define IDC_CHKMERGEPOPUP 1058 +#define IDC_IMGTAG 1058 +#define IDC_SHOWURLS 1059 +#define IDC_ANIAVATAR 1059 +#define IDC_DELAY_MESSAGE 1060 +#define IDC_SCROLLFIX 1060 +#define IDC_CLIENTINSTATBAR 1061 +#define IDC_TYPINGSOUNDS 1062 +#define IDC_OFFLINEMULTI 1063 +#define IDC_CLIENTINSTATBAR2 1063 +#define IDC_ICONWARNINGS 1063 +#define IDC_AUTOCLOSEV2 1064 +#define IDC_RESTART 1065 +#define IDC_DELAY_OTHERS 1066 +#define IDC_CLIST 1067 +#define IDC_DELAY_MUC 1067 +#define IDC_NUMBERMSG 1068 +#define IDC_MULTISPLITTER 1069 +#define IDC_CHKSHOWDATE 1070 +#define IDC_SAVEPERCONTACT 1071 +#define IDC_CHKSHOWTIME 1072 +#define IDC_CHKSHOWHEADERS 1073 +#define IDC_LOADCOUNTN 1074 +#define IDC_RDNEW 1075 +#define IDC_LOADCOUNTSPIN 1076 +#define IDC_RDOLD 1077 +#define IDC_SHOWINFOLINE 1078 +#define IDC_LBNUMBERMSG 1079 +#define IDC_SHOWBUTTONLINE 1080 +#define IDC_CHKINFINITE_URL 1081 +#define IDC_LOADUNREAD 1082 +#define IDC_SENDONENTER 1083 +#define IDC_CHKINFINITE_FILE 1084 +#define IDC_LOADCOUNT 1085 +#define IDC_SENDONDBLENTER 1086 +#define IDC_CHKINFINITE_OTHERS 1087 +#define IDC_LOADTIMEN 1088 +#define IDC_LOADTIMESPIN 1089 +#define IDC_LOADTIME 1090 +#define IDC_CMDEDITHEADERS 1091 +#define IDC_TRIM 1091 +#define IDC_FONTLIST 1092 +#define IDC_TRIMSPIN 1092 +#define IDC_USEOSD 1093 +#define IDC_CHOOSEFONT 1094 +#define IDC_CHKACTTE_DISMISS 1095 +#define IDC_CHKACTTE_OPEN 1096 +#define IDC_STMINSOLD 1097 +#define IDC_CHKACTTE_REMOVE 1098 +#define IDC_NORSS 1099 +#define IDC_DETAILS 1100 +#define IDC_ADD 1101 +#define IDC_DELAY_ERR 1102 +#define IDC_RTL 1103 +#define IDC_PIC 1104 +#define IDC_SMILEYBTN 1105 +#define IDC_FONTBOLD 1106 +#define IDC_FONTITALIC 1107 +#define IDC_FONTUNDERLINE 1108 +#define IDC_FONTFACE 1110 +#define IDC_HISTORY 1111 +#define IDC_CANCELADD 1112 +#define IDC_FONTSTRIKEOUT 1113 +#define IDC_MATH_BKGCOLOUR 1124 +#define IDC_FONTCOLOR 1127 +#define IDC_LOGFROZENTEXT 1128 +#define IDC_FONTCOLOUR 1128 +#define IDC_STSIZETEXT 1135 +#define IDC_STCOLOURTEXT 1136 +#define IDC_PRESETSPLIT 1137 +#define IDC_PRESETSINGLE 1138 +#define IDC_STMSGLOGGROUP 1139 +#define IDC_PROTOCOL 1140 +#define IDC_STMSGLOGGROUP2 1140 +#define IDC_STMSGLOGGROUP3 1141 +#define IDC_PROTOMENU 1141 +#define IDC_TYPING 1143 +#define IDC_TOGGLETOOLBAR 1144 +#define IDC_ERRORTEXT 1145 +#define IDC_SHOWNOTIFY 1146 +#define IDC_STATUSWIN 1147 +#define IDC_TYPEFLASHWIN 1148 +#define IDC_CHARCOUNT 1149 +#define IDC_TYPENOWIN 1150 +#define IDC_TYPEWIN 1151 +#define IDC_CASCADE 1151 +#define IDC_SECONDS 1152 +#define IDC_NOTIFYTRAY 1153 +#define IDC_NOTIFYBALLOON 1154 +#define IDC_NOTIFYBALLOON2 1155 +#define IDC_NOTIFYPOPUP 1155 +#define IDC_MathSubst 1156 +#define IDC_INDENT 1157 +#define IDC_INDENTAMOUNT 1158 +#define IDC_MSGTABS 1159 +#define IDC_SIDEBARUP 1160 +#define IDC_SIDEBARDOWN 1161 +#define IDC_WARNONCLOSE 1162 +#define IDC_CUT_TABTITLE 1163 +#define IDC_CUT_TITLEMAX 1164 +#define IDC_SHOWTABTIP 1165 +#define IDC_SHOWSTATUSONTAB 1166 +#define IDC_SWAPTIMESTAMP 1167 +#define IDC_AUTOCREATETABS 1168 +#define IDC_LOCALTIME 1169 +#define IDC_O_HIDETITLE 1170 +#define IDC_STICKY 1171 +#define IDC_LOGSTATUS 1172 +#define IDC_DEBUGPOPUPS 1173 +#define IDC_CONTAINERGROUPMODE 1174 +#define IDC_SELFTYPING 1175 +#define IDC_LOGHOTKEYS 1176 +#define IDC_NOTITLE 1177 +#define IDC_TABPADDING 1178 +#define IDC_PADSPIN 1179 +#define IDC_HTABPADDING 1179 +#define IDC_BOTTOMTABADJUST 1180 +#define IDC_POPUPCONTAINER 1181 +#define IDC_TABWIDTH 1181 +#define IDC_PRIVATESPLITTER 1182 +#define IDC_CNTPRIVATE 1182 +#define IDC_NEWSPLITLAYOUT 1183 +#define IDC_O_NOTABS 1184 +#define IDC_DONTREPORTUNFOCUSED 1185 +#define IDC_ESC_MINIMIZE 1186 +#define IDC_USEDIVIDERS 1187 +#define IDC_DRAWGRID 1188 +#define IDC_LIMITTABS 1189 +#define IDC_WANTVERTICALGRID 1190 +#define IDC_LIMITPREVIEW 1191 +#define IDC_AUTOLOCALE 1192 +#define IDC_MUC_LOGCOLORS 1192 +#define IDC_DONTREPORTUNFOCUSED2 1193 +#define IDC_GCHECK 1194 +#define IDC_HIDETAB 1195 +#define IDC_O_DONTREPORT 1196 +#define IDC_USEDEFERRED 1197 +#define IDC_AUTOSWITCHTABS 1198 +#define IDC_USEINDIVIDUALBKG 1199 +#define IDC_SINGLEWINDOWMODE 1200 +#define IDC_FLATBUTTONS 1201 +#define IDC_O_STICKY 1202 +#define IDC_DIVIDERSUSEPOPUPCONFIG 1203 +#define IDC_FLASHFOREVER 1205 +#define IDC_DONTFLASH 1206 +#define IDC_O_FLASHDEFAULT 1208 +#define IDC_FLASHDEFAULT 1209 +#define IDC_DEFAULTCONTAINERMODE 1210 +#define IDC_ALWAYS 1211 +#define IDC_DONTREPORTFOCUSED2 1212 +#define IDC_TRANSPARENCY 1215 +#define IDC_PANELSPLITTER 1216 +#define IDC_AUTOCREATECONTAINER 1216 +#define IDC_LIMITAVATARS 1217 +#define IDC_DONTREPORT 1219 +#define IDC_SPIN1 1220 +#define IDC_CNTLIST 1221 +#define IDC_SPIN3 1221 +#define IDC_NEWCONTAINER 1222 +#define IDC_TABWIDTHSPIN 1222 +#define IDC_UPDATEPREVIEW 1223 +#define IDC_MODIFY 1223 +#define IDC_SAVESIZEASGLOBAL 1223 +#define IDC_REVERTGLOBAL 1223 +#define IDC_CREATENEW 1224 +#define IDC_RTLMODIFY 1224 +#define IDC_RESETALLTEMPLATES 1224 +#define IDC_SENDLATER 1226 +#define IDC_RETRY 1227 +#define IDC_SETUPAUTOCREATEMODES 1228 +#define IDC_POPUPSTATUSMODES 1229 +#define IDC_DELETECONTAINER 1230 +#define IDC_CANCELSEND 1231 +#define IDC_O_FLASHALWAYS 1232 +#define IDC_RENAMECONTAINER 1233 +#define IDC_RETRY2 1234 +#define IDC_MSGSENDLATER 1235 +#define IDC_O_FLASHNEVER 1236 +#define IDC_NEWCONTAINERNAME 1237 +#define IDC_O_TITLENEVER 1238 +#define IDC_O_TITLEFRONT 1239 +#define IDC_O_TITLESUFFIX 1240 +#define IDC_TRANSPARENCY_ACTIVE 1241 +#define IDC_TRANSPARENCY_INACTIVE 1242 +#define IDC_INDENTSPIN 1250 +#define IDC_TABBORDER 1251 +#define IDC_SPIN2 1252 +#define IDC_TABBORDERSPIN 1253 +#define IDC_FLASHINTERVALSPIN 1254 +#define IDC_HIDESBAR 1255 +#define IDC_TABBORDEROUTER 1256 +#define IDC_TABBORDEROUTERRIGHT 1257 +#define IDC_TABBORDERSPINOUTER 1258 +#define IDC_ALWAYSPOPUPSINACTIVE 1259 +#define IDC_TABBORDERSPINOUTER2 1259 +#define IDC_BOTTOMTABADJUSTSPIN 1259 +#define IDC_HISTORYSIZE 1260 +#define IDC_TABBORDERSPINOUTERRIGHT 1260 +#define IDC_HISTORYSIZESPIN 1261 +#define IDC_TABBORDEROUTERTOP 1261 +#define IDC_HOTKEYSAREGLOBAL 1262 +#define IDC_TABBORDERSPINOUTERTOP 1262 +#define IDC_SINGLEROWTAB 1263 +#define IDC_STREAMTHREADING 1264 +#define IDC_TABBORDEROUTERBOTTOM 1264 +#define IDC_IEVIEWMODE 1265 +#define IDC_TABBORDERSPINOUTERBOTTOM 1265 +#define IDC_TEXTFORMATTING 1266 +#define IDC_AVATARMODE 1267 +#define IDC_CODEPAGES 1268 +#define IDC_OWNAVATARMODE 1268 +#define IDC_EMPTYLINEFIX 1272 +#define IDC_SPLITTERSTATICEDGES 1273 +#define IDC_MAXAVATARHEIGHT 1275 +#define IDC_TABLIMIT 1276 +#define IDC_RIGHTINDENT 1277 +#define IDC_AVATARSPIN 1278 +#define IDC_TABLIMITSPIN 1279 +#define IDC_SHOWFORMATTING 1280 +#define IDC_AGGRESSIVEUPDATE 1283 +#define IDC_THINSEPARATORS 1284 +#define IDC_RINDENTSPIN 1285 +#define IDC_STATICERRORICON 1286 +#define IDC_STATICTEXT 1287 +#define IDC_GROUPMODE 1288 +#define IDC_ANIMATED 1289 +#define IDC_ISFAVORITE 1289 +#define IDC_ALWAYSTRIM 1289 +#define IDC_SKIN_LOADFONTS 1289 +#define IDC_PRESERVEAVATARSIZE 1289 +#define IDC_UPREFS_SHOWICONS 1289 +#define IDC_ALWAYSTRIM2 1290 +#define IDC_SKIN_LOADTEMPLATES 1290 +#define IDC_UPREFS_SHOWSYMBOLS 1290 +#define IDC_SKIN_LOADTEMPLATES2 1291 +#define IDC_UPREFS_INOUTICONS 1291 +#define IDC_AVADYNAMIC 1292 +#define IDC_UPREFS_SHOWTIMESTAMP 1292 +#define IDC_USESNAPPING 1293 +#define IDC_UPREFS_SHOWSECONDS 1293 +#define IDC_UPREFS_SHOWICONS3 1294 +#define IDC_UPREFS_SHOWDATES 1294 +#define IDC_SENDFORMAT 1295 +#define IDC_UPREFS_LOCALTIME 1295 +#define IDC_FLATMSGLOG 1296 +#define IDC_UPREFS_INDENT 1296 +#define IDC_UPREFS_GRID 1297 +#define IDC_UPREFS_GROUPING 1298 +#define IDC_TOGGLESIDEBAR 1299 +#define IDC_CNTNOSTATUSBAR 1299 +#define IDC_UPREFS_BBCODE 1299 +#define IDC_SECTIONTREE 1300 +#define IDC_UPREFS_RTL 1301 +#define IDC_CHECKICONDLL 1302 +#define IDC_UPREFS_LOGSTATUS 1302 +#define IDC_ENABLETRAYSUPPORT 1303 +#define IDC_UPREFS_LOGSTATUS2 1303 +#define IDC_UPREFS_NORMALTEMPLATES 1303 +#define IDC_HEADERSHADING 1304 +#define IDC_HIDEMENUBAR 1305 +#define IDC_STATICCONTROL 1307 +#define IDC_AUTOCLOSETABTIME 1308 +#define IDC_AUTOCLOSETABSPIN 1309 +#define IDC_SENDONSHIFTENTER 1310 +#define IDC_USEGLOBALSIZE 1311 +#define IDC_LOADONLYACTUAL 1311 +#define IDC_MICROLF 1312 +#define IDC_EVENTAPI 1313 +#define IDC_MINIMIZETOTRAY 1316 +#define IDC_DELETETEMP 1318 +#define IDC_FORMATTING 1319 +#define IDC_AUTOSELECTCOPY 1319 +#define IDC_HIDETOOLBAR 1320 +#define IDC_FLASHCLIST 1322 +#define IDC_MSGLOGPLUGIN 1323 +#define IDC_UIDSTATUSBAR 1324 +#define IDC_NRFLASH 1325 +#define IDC_NRFLASHSPIN 1326 +#define IDC_FLASHINTERVAL 1327 +#define IDC_USEKBDHOOK 1328 +#define IDC_STATIC111 1329 +#define IDC_TAB1 1330 +#define IDC_ALWAYSFULLWIDTHTOOLBAR 1335 +#define IDC_FORMATWHOLEWORDSONLY 1337 +#define IDC_STATUSGROUP 1338 +#define IDC_ALLOWSENDBUTTONHIDE 1340 +#define IDC_VERTICALMAX 1341 +#define IDC_AUTOSPLITTER 1342 +#define IDC_ICONDLLNAME 1343 +#define IDC_SAVETEMPLATE 1344 +#define IDC_SELECTICONDLL 1345 +#define IDC_RTLDEFAULT 1346 +#define IDC_MATHMODSUPPORT 1348 +#define IDC_MESSAGEPREVIEWLIMIT 1349 +#define IDC_MESSAGEPREVIEWLIMITSPIN 1350 +#define IDC_DELAY_MESSAGE_SPIN 1351 +#define IDC_DELAY_MESSAGE_MUC_SPIN 1352 +#define IDC_DELAY_ERR_SPIN 1353 +#define IDC_MESSAGEPREVIEWLIMITSPIN2 1354 +#define IDC_DELAY_OTHERS_SPIN 1354 +#define IDC_TEMPLATELIST 1361 +#define IDC_EDITTEMPLATE 1362 +#define IDC_REVERT 1363 +#define IDC_FORGET 1364 +#define IDC_COLOR1 1366 +#define IDC_COLOR2 1367 +#define IDC_COLOR3 1368 +#define IDC_COLOR4 1369 +#define IDC_COLOR5 1370 +#define IDC_FORCEANSI 1371 +#define IDC_TEMPLOVERRIDE 1372 +#define IDC_IGNORETIMEOUTS 1372 +#define IDC_RTLTEMPLOVERRIDE 1373 +#define IDC_SELECTTHEME 1376 +#define IDC_RELOAD 1376 +#define IDC_LOGOPTIONS 1377 +#define IDC_WINDOWOPTIONS 1378 +#define IDC_TRAYCONTAINER 1379 +#define IDC_EVENTOPTIONS 1380 +#define IDC_VARIABLESHELP 1381 +#define IDC_TABMSGOPTIONS 1384 +#define IDC_HELPTEXT 1392 +#define IDC_TITLEFORMAT 1393 +#define IDC_THEME 1394 +#define IDC_INFOPANEL 1395 +#define IDC_SUPPORT 1396 +#define IDC_SHOWAVATAR 1396 +#define IDC_NOPOPUPAVAIL 1398 +#define IDC_QHTM 1399 +#define IDC_TSLABEL_ACTIVE 1400 +#define IDC_TSLABEL_INACTIVE 1401 +#define IDC_TITLEBOX 1402 +#define IDC_DESC 1404 +#define IDC_LABEL_PRIVATETHEME 1405 +#define IDC_MSGLOGDIDSPLAY 1407 +#define IDC_IMCHECK 1410 +#define IDC_CHATCHECK 1411 +#define IDC_CANBEHIDDEN 1412 +#define IDC_BBRESET 1413 +#define IDC_BOTTOMTOOLBAR 1414 +#define IDC_BUTTON1 1415 +#define IDC_SEPARATOR 1415 +#define IDC_PLUS_REVERT 1415 +#define IDC_SIZECOMPACT 1415 +#define IDC_RESCANSKIN 1415 +#define IDC_RESETWARNINGS 1415 +#define IDC_TIMEOUTSPIN 1416 +#define IDC_SIZENORMAL 1416 +#define IDC_SIZELARGE 1417 +#define IDC_MTN_POPUPMODE 1418 +#define IDC_MTN_HELP 1419 +#define IDC_CUT_TITLEMAXSPIN 1420 +#define IDC_HELP_CONTAINERS 1421 +#define IDC_HELP_GENERAL 1422 +#define IDC_CLOSEONESC 1423 +#define IDC_ALWAYSPOPUP 1424 +#define IDC_AEROEFFECT 1424 +#define IDC_CREATEMIN 1425 +#define IDC_ESCMODE 1425 +#define IDC_CHECK5 1426 +#define IDC_TABMODE 1426 +#define IDC_SENDSHIFTENTER 1427 +#define IDC_O_TABMODE 1427 +#define IDC_SENDENTER 1428 +#define IDC_O_SBARLAYOUT 1428 +#define IDC_PANELVISIBILITY 1428 +#define IDC_SENDDBLENTER 1429 +#define IDC_SBARLAYOUT 1429 +#define IDC_PANELSIZE 1429 +#define IDC_MINSEND 1430 +#define IDC_IPCONFIG_TITLE 1430 +#define IDC_SENDCTRLENTER 1431 +#define IDC_NOSYNC 1431 +#define IDC_USETABS 1432 +#define IDC_IPCONFIG_FOOTER 1432 +#define IDC_NOOPENPOPUP 1433 +#define IDC_NOOPENNOTIFY 1433 +#define IDC_GROUP_SCOPE 1433 +#define IDC_CREATENOACTIVATE 1434 +#define IDC_GROUP_SIZE 1434 +#define IDC_NOTIFYMSG 1435 +#define IDC_GROUP_OTHER 1435 +#define IDC_POPUPONCREATE 1436 +#define IDC_SIZE_TIP 1436 +#define IDC_IPCONFIG_PRIVATECONTAINER 1437 +#define IDC_EXPLAINMSGLOGSETTINGS 1437 +#define IDC_NOTIFYFILE 1438 +#define IDC_PANELPICTUREVIS 1438 +#define IDC_SKINNAME 1438 +#define IDC_NOTIFYURL 1439 +#define IDC_SKINROOTFOLDER 1439 +#define IDC_NOTIFYOTHER 1440 +#define IDC_SKIN_WARN 1440 +#define IDC_QMGR_LIST 1441 +#define IDC_QMGR_FILTER 1442 +#define IDC_TOOLBARTREE 1444 +#define IDC_QMGR_HELP 1444 +#define IDC_QMGR_ERRORPOPUPS 1445 +#define IDC_QMGR_ERRORPOPUPS2 1446 +#define IDC_QMGR_SUCCESSPOPUPS 1446 +#define IDC_BUTTON2 1446 +#define IDC_SKIN_CLOSENOW 1446 +#define IDC_CHECK1 1447 +#define IDC_DONTSHOWAGAIN 1447 +#define IDC_CAPTION 1448 +#define IDC_WARNTEXT 1449 +#define IDC_WARNICON 1450 +#define IDC_WARNGROUP 1451 +#define IDC_EX_REASON 1452 +#define IDC_FLASHICON 1489 +#define IDC_FLASHLABEL 1490 +#define IDC_STATIC_VISIBILTY 1491 +#define IDC_BUTTONTABS 1492 +#define IDC_CLOSEBUTTONONTABS 1493 +#define IDC_O_STATIC_AVATAR 1501 +#define IDC_O_STATIC_OWNAVATAR 1502 +#define IDC_USEAERO 1531 +#define IDC_USEAEROPEEK 1532 +#define IDC_TXT_TITLE1 1617 +#define IDC_TXT_TITLE2 1618 +#define IDC_TXT_TITLE4 1620 +#define IDC_TXT_TITLE5 1622 +#define IDC_TXT_TITLE3 1623 +#define IDC_O_EXPLAINGLOBALNOTIFY 1624 +#define IDC_O_AUTOHIDE 1625 +#define IDC_O_AUTOHIDESECONDS 1626 +#define IDC_O_ENABLESOUNDS 1701 +#define IDC_O_SOUNDSMINIMIZED 1702 +#define IDC_O_SOUNDSUNFOCUSED 1703 +#define IDC_O_SOUNDSINACTIVE 1704 +#define IDC_O_SOUNDSFOCUSED 1705 +#define IDC_O_TITLEBARFORMAT 1706 +#define IDC_EDIT1 1720 +#define IDC_O_CNTPRIVATE 1901 +#define IDC_PLUS_CHECKTREE 2000 +#define IDC_COPYRIGHT 2002 +#define IDC_PLUS_HELP 2004 +#define IDC_O_HELP_TITLEFORMAT 2064 +#define IDC_OPTIONSTAB 2111 +#define IDC_HEADERBAR 2397 +#define IDC_AVATARSONTASKBAR 2735 +#define IDC_TSLABEL_EXPLAINTHEME 3123 +#define IDC_TSLABEL_REOPENWARN 3124 +#define IDD_OPT_TYPINGNOTIFYPOPUP 30159 +#define IDI_START1 30160 +#define IDI_STOP1 30161 +#define IDI_START2 30162 +#define IDI_STOP2 30163 +#define IDI_ENABLED 30164 +#define IDI_DISABLED 30165 +#define IDD_OPT 30166 +#define IDC_START 30167 +#define IDC_STOP 30168 +#define IDI_START3 30169 +#define IDI_STOP3 30170 +#define IDI_START4 30171 +#define IDI_STOP4 30172 +#define IDI_START5 30173 +#define IDI_STOP5 30174 +#define IDI_START6 30175 +#define IDI_STOP6 30176 +#define IDI_START7 30177 +#define IDI_STOP7 30178 +#define IDI_START8 30179 +#define IDI_STOP8 30180 +#define IDI_START9 30181 +#define IDI_STOP9 30182 +#define IDC_ICON1 31600 +#define IDC_ICON2 31601 +#define IDC_TIMEOUT_POPUP2 31602 +#define IDC_TIMEOUT_CUSTOM2 31603 +#define IDC_TIMEOUT_POPUP 31604 +#define IDC_TIMEOUT_PROTO 31605 +#define IDC_TIMEOUT_CUSTOM 31606 +#define IDC_TIMEOUT_VALUE 31607 +#define IDC_TIMEOUT_POPUP3 31608 +#define IDC_TIMEOUT_PERMANENT2 31608 +#define IDC_USEWINCOLORS 31609 +#define IDC_USEPOPUPCOLORS 31610 +#define IDC_TYPEON_BG 31611 +#define IDC_TYPEON_TX 31612 +#define IDC_TYPEOFF_BG 31613 +#define IDC_TYPEOFF_TX 31614 +#define IDC_INFO 31615 +#define IDC_INFO2 31616 +#define IDC_WO 31617 +#define IDC_TIMEOUT_PERMANENT1 31618 +#define IDC_TIMEOUT_PERMANENT 31618 +#define IDC_SHOWMENU 31619 +#define IDC_DISABLED 31620 +#define IDC_ONEPOPUP 31621 +#define IDC_WOCL 31622 +#define IDC_ICONS 31623 +#define IDC_TIMEOUT_VALUE2 31624 +#define IDC_PREVIEW_ALL 31625 +#define ID_CLOSETAB_DETACHTAB 40025 +#define ID_TABCONTEXT_NEXTTAB 40026 +#define ID_TABCONTEXT_ATTACH 40027 +#define ID_TABCONTEXT_CLOSECONTAINER 40028 +#define ID_TABCONTEXT_PREVTAB 40029 +#define ID_CLOSETAB 40030 +#define ID_TABMENU_CLOSETAB 40031 +#define ID_TABMENU_SAVELOCALESETTINGFORTHISCONTACT 40034 +#define ID_TABMENU_OPENWINDOWSERVICE 40035 +#define ID_TABMENU_ATTACHTOCONTAINER 40036 +#define ID_Menu 40037 +#define ID_PICMENU_TOGGLEAVATARDISPLAY 40041 +#define ID_PICMENU_SETTINGS 40042 +#define ID_LOG_CONTAINEROPTIONS 40045 +#define ID_TABMENU_CONTAINEROPTIONS 40046 +#define ID_LOGMENU_SHOWMESSAGEICONS 40056 +#define ID_LOGMENU_LOADDEFAULTS 40057 +#define ID_LOGMENU_ALWAYSUSEGLOBALSPLITTERPOSITION 40060 +#define ID_LOGMENU_TIMESTAMPSETTINGS 40061 +#define ID_LOGMENU_MESSAGELOGFORMATTING 40062 +#define ID_TABMENU_CLOSECONTAINER 40063 +#define ID_STATUSBARSETTINGS_USEGLOBALDEFAULT 40065 +#define ID_STATUSBARSETTINGS_SHOWTHESTATUSBAR 40066 +#define ID_STATUSBARSETTINGS_HIDETHESTATUSBAR 40067 +#define ID_VIEW_SHOWMENUBAR 40076 +#define ID_VIEW_SHOWSTATUSBAR 40077 +#define ID_VIEW_SHOWTOOLBAR 40078 +#define ID_TOOLBAR_SENDBUTTON 40079 +#define ID_TOOLBAR_USERINFORMATION 40080 +#define ID_TOOLBAR_EXTRABUTTONS 40081 +#define ID_VIEW_SHOWAVATAR 40082 +#define ID_VIEW_SHOWTITLEBAR 40083 +#define ID_FILE 40084 +#define ID_FILE_CLOSE 40085 +#define ID_FILE_CLOSEMESSAGESESSION 40086 +#define ID_VIEW_SHOWMULTISENDCONTACTLIST 40087 +#define ID_VIEW_TITLEBAR 40088 +#define ID_VIEW_TABSATBOTTOM 40093 +#define ID_VIEW_STAYONTOP 40095 +#define ID_HELP 40096 +#define ID_OPTIONS_EVENTPOPUPS 40097 +#define ID_EVENTPOPUPS_DISABLEALLEVENTPOPUPS 40098 +#define ID_OPTIONS_SOUNDS 40101 +#define ID_SOUNDS_DISABLEALLMESSAGESOUNDS 40102 +#define ID_SOUNDS_SYNCSOUNDSWITHEVENTPOPUPS 40103 +#define ID_SOUNDS_ENABLEALLMESSAGESOUNDS 40104 +#define ID_VIEW_FLASHING 40105 +#define ID_WINDOWFLASHING_USEDEFAULTVALUES 40106 +#define ID_WINDOWFLASHING_FLASHUNTILFOCUSED 40107 +#define ID_WINDOWFLASHING_DISABLEFLASHING 40108 +#define ID_FILE_SAVEMESSAGELOGAS 40109 +#define ID_EVENTPOPUPS_SHOWPOPUPSIFWINDOWISMINIMIZED 40110 +#define ID_EVENTPOPUPS_SHOWPOPUPSIFWINDOWISUNFOCUSED 40111 +#define ID_EVENTPOPUPS_SHOWPOPUPSFORALLINACTIVESESSIONS 40112 +#define ID_OPTIONS_SAVECURRENTWINDOWPOSITIONASDEFAULT 40113 +#define ID_CONTAINER_CONTAINEROPTIONS 40114 +#define ID_MESSAGELOG 40115 +#define ID_MESSAGELOG_LOGITEMSTOSHOW 40116 +#define ID_LOGITEMSTOSHOW_USETHINGRIDLINES 40117 +#define ID_MESSAGELOG_TIMESTAMPSETTINGS 40118 +#define ID_MESSAGELOG_MESSAGELOGFORMATTING 40119 +#define ID_EVENTPOPUPS_SHOWPOPUPSIFWINDOWISFOCUSED 40120 +#define ID_LOGMENU_MESSAGELOGSETTINGSAREGLOBAL 40124 +#define ID_USER 40125 +#define ID_TITLEBAR_USESTATICCONTAINERICON 40126 +#define ID_PICMENU_ALWAYSKEEPTHEBUTTONBARATFULLWIDTH 40134 +#define ID_SENDMENU_SENDDEFAULT 40135 +#define ID_SENDMENU_SENDTOMULTIPLEUSERS 40136 +#define ID_SENDMENU_SENDTOCONTAINER 40137 +#define ID_SENDMENU_FORCEANSISEND 40138 +#define ID_VIEW_VERTICALMAXIMIZE 40143 +#define ID_SENDMENU_SENDLATER 40144 +#define ID_PROTOMENU_SPLITTER 40145 +#define ID_MODE_GLOBAL 40148 +#define ID_MODE_PRIVATE 40150 +#define ID_UNREADMENU_TEST 40151 +#define ID_UNREADMENU_FOOBAR 40152 +#define ID_UNREADMENU_ 40153 +#define ID_TRAYCONTEXT_RECENTSESSIONS 40154 +#define ID_RECENTSESSIONS_1 40155 +#define ID_TRAYCONTEXT_FAVORITES 40156 +#define ID_FAVORITES_1 40157 +#define ID_TRAYCONTEXT_DISABLEALLPOPUPS 40158 +#define ID_TRAYCONTEXT_DON 40159 +#define ID_TRAYCONTEXT_HIDEALLMESSAGECONTAINERS 40160 +#define ID_TRAYCONTEXT_RESTOREALLMESSAGECONTAINERS 40161 +#define ID_TRAYCONTEXT_DON40223 40164 +#define ID_TRAYCONTEXT_BE 40165 +#define ID_RECENTSESSIONS_2 40166 +#define ID_PROTOMENU_SENDTEXTFORMATTING 40167 +#define ID_SENDTEXTFORMATTING_GLOBAL 40169 +#define ID_Menu40228 40170 +#define ID_VIEW_BOTTOMTOOLBAR 40171 +#define ID_GLOBAL_OFF 40172 +#define ID_SENDTEXTFORMATTING_THISCONTACT 40173 +#define ID_THISCONTACT_GLOBALSETTING 40174 +#define ID_THISCONTACT_BBCODE 40175 +#define ID_THISCONTACT_OFF 40177 +#define ID_GLOBAL_BBCODE 40178 +#define ID_PROTOMENU_FAVORITES 40179 +#define ID_FAVORITES_ADDCONTACTTOFAVORITES 40180 +#define ID_FAVORITES_REMOVECONTACTFROMFAVORITES 40181 +#define ID_FILE_HTTP 40182 +#define ID_LOG_FREEZELOG 40183 +#define ID_FONT_SIZE 40186 +#define ID_SIZE_LARGE 40187 +#define ID_SIZE_BIGGER 40188 +#define ID_SIZE_NORMAL 40189 +#define ID_SIZE_SMALLER 40190 +#define ID_SIZE_TINY 40191 +#define ID_FONT_RED 40192 +#define ID_FONT_GREEN 40193 +#define ID_FONT_BLUE 40194 +#define ID_FONT_MAGENTA 40195 +#define ID_FONT_YELLOW 40196 +#define ID_FONT_BLACK 40197 +#define ID_FONT_WHITE 40198 +#define ID_FONT_CLEARALLFORMATTING 40199 +#define ID_FONT_DEFAULTCOLOR 40200 +#define ID_FONT_CYAN 40201 +#define ID_SENDMENU_SENDWITHOUTTIMEOUTS 40201 +#define ID_DUMMY_NOMESSAGESESSIONSOPENED 40202 +#define ID_TRAYCONTEXT_SHOWTHETRAYICON 40204 +#define ID_INFOPANEL_QUICKTOGGLE 40206 +#define ID_INFOPANEL_GLOBAL 40207 +#define ID_VIEW_INFOPANEL 40208 +#define ID_GLOBAL_ENABLED 40208 +#define ID_GLOBAL_DISABLED 40209 +#define ID_INFOPANEL_THISCONTACT 40210 +#define ID_THISCONTACT_USEGLOBALSETTING 40211 +#define ID_THISCONTACT_ALWAYSON 40212 +#define ID_THISCONTACT_ALWAYSOFF 40213 +#define ID_PANELPICMENU_RESETTHEAVATAR 40218 +#define ID_EDITOR_PASTEANDSENDIMMEDIATELY 40221 +#define ID_HELP_ABOUTTABSRMM 40223 +#define ID_SENDMENU_SENDNUDGE 40228 +#define ID_SPLITTERCONTEXT_SAVEGLOBALFORALLSESSIONS 40229 +#define ID_SPLITTERCONTEXT_SAVEFORTHISCONTACTONLY 40230 +#define ID_SPLITTERCONTEXT_FORGETTHECHANGES 40231 +#define ID_SPLITTERCONTEXT_SETPOSITIONFORTHISSESSION 40232 +#define ID_FONT_CYAN40233 40233 +#define ID_TABMENU_LEAVECHATROOM 40234 +#define ID_PANELPICMENU_SAVETHISPICTUREAS 40235 +#define ID_PICMENU_SAVETHISPICTUREAS 40236 +#define ID_TABMENU_SAVETABPOSITION 40239 +#define ID_TABMENU_CLEARSAVEDTABPOSITION 40240 +#define ID_VISIBILITY_DEFAULT 40241 +#define ID_VISIBILITY_HIDDENFORTHISCONTACT 40242 +#define ID_VISIBILITY_VISIBLEFORTHISCONTACT 40243 +#define ID_LOGMENU_USEADVANCEDTEMPLATE 40244 +#define ID_MESSAGELOG_USESIMPLETEMPLATES 40246 +#define ID_EDITOR_SHOWMESSAGELENGTHINDICATOR 40248 +#define ID_LOGMENU_MESSAGELOGSETTINGS 40250 +#define ID_MESSAGELOGSETTINGS_GLOBAL 40251 +#define ID_MESSAGELOGSETTINGS_FORTHISCONTACT 40252 +#define ID_MESSAGELOG_MESSAGELOGSETTINGS 40253 +#define ID_QUEUEMANAGER_MARKSELECTEDFORREMOVAL 40256 +#define ID_QUEUEMANAGER_RESETSELECTED 40257 +#define ID_QUEUEMANAGER_HOLDSELECTED 40258 +#define ID_QUEUEMANAGER_RESUMESELECTED 40259 +#define ID_QUEUEMANAGER_CANCELALLMULTISENDJOBS 40260 +#define ID_QUEUEMANAGER_COPYMESSAGETOCLIPBOARD 40261 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 17 +#define _APS_NEXT_COMMAND_VALUE 40263 +#define _APS_NEXT_CONTROL_VALUE 1453 +#define _APS_NEXT_SYMED_VALUE 40283 +#endif +#endif diff --git a/plugins/TabSRMM/src/include/sendlater.h b/plugins/TabSRMM/src/include/sendlater.h new file mode 100644 index 0000000000..a81c08f4ae --- /dev/null +++ b/plugins/TabSRMM/src/include/sendlater.h @@ -0,0 +1,155 @@ +/* + * astyle --force-indent=tab=4 --brackets=linux --indent-switches + * --pad=oper --one-line=keep-blocks --unpad=paren + * + * Miranda NG: the free IM client for Microsoft* Windows* + * + * Copyright 2000-2009 Miranda ICQ/IM project, + * all portions of this codebase are copyrighted to the people + * listed in contributors.txt. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * you should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * part of tabSRMM messaging plugin for Miranda. + * + * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors + * + * $Id: sendlater.h 11707 2010-05-05 13:53:11Z silvercircle $ + * + * the sendlater class + */ + +#ifndef __SENDLATER_H +#define __SENDLATER_H + +#define TIMERID_SENDLATER 12000 +#define TIMERID_SENDLATER_TICK 13000 + +#define TIMEOUT_SENDLATER 10000 +#define TIMEOUT_SENDLATER_TICK 200 + +class CSendLaterJob { + +public: + /* + * job status/error codes + */ + enum { + INVALID_CONTACT = 'I', + JOB_DEFERRED = 'D', + JOB_AGE = 'O', + JOB_MYSTATUS = 'M', + JOB_STATUS = 'S', + JOB_WAITACK = 'A', + JOB_REMOVABLE = 'R', + JOB_HOLD = 'H', + }; + /* + * internal flags + */ + enum { + SLF_SUSPEND = 1, + SLF_INVALID = 2 + }; + void readFlags(); + void writeFlags(); + void cleanDB(); + bool isPersistentJob(); + bool mustDelete(); + CSendLaterJob(); + ~CSendLaterJob(); + char szId[20]; // database key name (time stamp of original send) + HANDLE hContact; // original contact where the message has been assigned + HANDLE hTargetContact; // *real* contact (can be different for metacontacts, e.g). + HANDLE hProcess; // returned from the protocols sending service. needed to find it in the ACK handler + time_t created; // job was created at this time (important to kill jobs, that are too old) + time_t lastSent; // time at which the delivery was initiated. used to handle timeouts + char *sendBuffer; // utf-8 send buffer + PBYTE pBuf; // conventional send buffer (for non-utf8 protocols) + DWORD dwFlags; + int iSendCount; // # of times we tried to send it... + bool fSuccess, fFailed; + BYTE bCode; // error/progress code (for the UI) +}; + +typedef std::vector::iterator SendLaterJobIterator; + +class CSendLater { + +public: + enum { + SENDLATER_AGE_THRESHOLD = (86400 * 3), // 3 days, older messages will be removed from the db. + SENDLATER_RESEND_THRESHOLD = 180, // timeouted messages should be resent after that many seconds + SENDLATER_PROCESS_INTERVAL = 50 // process the list of waiting job every this many seconds + }; + + CSendLater(); + ~CSendLater(); + bool isAvail() const { return(m_fAvail); } + bool isInteractive() const { return(m_fIsInteractive); } + bool isJobListEmpty() const { return(m_sendLaterJobList.empty() ? true : false); } + bool haveErrorPopups() const { return(m_fErrorPopups); } + bool haveSuccessPopups() const { return(m_fSuccessPopups); } + void startJobListProcess(); + time_t lastProcessed() const { return(m_last_sendlater_processed); } + void setLastProcessed(const time_t _t) { m_last_sendlater_processed = _t; } + void flushQueue() { m_last_sendlater_processed = 0; } + bool haveJobs() const + { + if (m_sendLaterJobList.empty() || m_jobIterator == m_sendLaterJobList.end()) + return(false); + else + return(true); + } + bool processCurrentJob(); + void processContacts(); + int addJob(const char *szSetting, LPARAM lParam); + void addContact(const HANDLE hContact); + static int _cdecl addStub(const char *szSetting, LPARAM lParam); + HANDLE processAck(const ACKDATA *ack); + + void invokeQueueMgrDlg(); + void qMgrUpdate(bool fReEnable = false); + static INT_PTR svcQMgr(WPARAM wParam, LPARAM lParam); + +private: + void processSingleContact(const HANDLE hContact); + int sendIt(CSendLaterJob *job); + + INT_PTR CALLBACK DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + static INT_PTR CALLBACK DlgProcStub(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + void qMgrFillList(bool fClear = true); + void qMgrSetupColumns(); + void qMgrSaveColumns(); + LRESULT qMgrAddFilter(const HANDLE hContact, const TCHAR* tszNick); + + std::vector m_sendLaterContactList; + std::vector m_sendLaterJobList; + bool m_fAvail; + bool m_fIsInteractive; + bool m_fErrorPopups; + bool m_fSuccessPopups; + time_t m_last_sendlater_processed; + SendLaterJobIterator m_jobIterator; + + HWND m_hwndDlg; + HWND m_hwndList, m_hwndFilter; + HANDLE m_hFilter; // contact handle to filter the qmgr list (0 = no filter, show all) + LRESULT m_sel; // index of the combo box entry corresponding to the contact filter; +}; + +extern CSendLater* sendLater; + +#endif /* __SENDLATER_H */ diff --git a/plugins/TabSRMM/src/include/sendqueue.h b/plugins/TabSRMM/src/include/sendqueue.h new file mode 100644 index 0000000000..8fdb8205d7 --- /dev/null +++ b/plugins/TabSRMM/src/include/sendqueue.h @@ -0,0 +1,123 @@ +/* + +Miranda NG: the free IM client for Microsoft* Windows* + +Copyright 2000-2009 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +$Id: sendqueue.h 12065 2010-06-25 17:30:24Z silvercircle $ + +*/ + +#ifndef __SENDQUEUE_H +#define __SENDQUEUE_H + +#define TIMERID_MSGSEND 100 +#define TIMERID_TYPE 3 +#define TIMERID_AWAYMSG 4 +//#define TIMERID_TOOLTIP 5 +#define TIMEOUT_TYPEOFF 10000 // send type off after 10 seconds of inactivity +#define SB_CHAR_WIDTH 45 +#define SEND_FLAGS PREF_UNICODE + +/* + * send flags + */ + +#define SENDJOBS_MAX_SENDS 100 + +struct SendJob { + HANDLE hSendId; + char *sendBuffer; + int dwLen; // actual buffer length (checked for reallocs() + int iSendLength; // length of message in utf-8 octets (used to check maxlen) + int sendCount; + HANDLE hOwner; + HWND hwndOwner; + unsigned int iStatus; + TCHAR szErrorMsg[128]; + DWORD dwFlags; + int iAcksNeeded; + HANDLE hEventSplit; + int chunkSize; + DWORD dwTime; +}; + +class SendQueue { +public: + enum { + NR_SENDJOBS = 30, + SQ_ERROR = 2, + SQ_INPROGRESS = 1, + SQ_UNDEFINED = 0 + }; + + SendQueue() + { + ZeroMemory(m_jobs, (sizeof(SendJob) * NR_SENDJOBS)); + m_currentIndex = 0; + } + + void inc() { m_currentIndex++; } + void dec() { m_currentIndex--; } + + ~SendQueue() + { + for (int i = 0; i < NR_SENDJOBS; i++) { + if (m_jobs[i].sendBuffer) + free(m_jobs[i].sendBuffer); + } + } + + SendJob *getJobByIndex(const int index) { return(&m_jobs[index]); } + + void clearJob (const int index); + int findNextFailed (const TWindowData *dat) const; + void handleError (TWindowData *dat, const int iEntry) const; + int addTo (TWindowData *dat, const int iLen, int dwFlags); + int sendQueued (TWindowData *dat, const int iEntry); + int getSendLength (const int iEntry, const int sendMode); + void checkQueue (const TWindowData *dat) const; + void logError (const TWindowData *dat, int iSendJobIndex, + const TCHAR *szErrMsg) const; + void recallFailed (const TWindowData *dat, int iEntry) const; + void showErrorControls (TWindowData *dat, const int showCmd) const; + int ackMessage (TWindowData *dat, WPARAM wParam, LPARAM lParam); + int doSendLater (int iIndex, TWindowData *dat, HANDLE hContact = 0, bool fIsSendLater = true); + /* + * static members + */ + static int TSAPI RTL_Detect (const wchar_t *pszwText); + static char* TSAPI MsgServiceName (const HANDLE hContact, const TWindowData *dat, int isUnicode); + static int TSAPI GetProtoIconFromList (const char *szProto, int iStatus); + static LRESULT TSAPI WarnPendingJobs (unsigned int uNrMessages); + static void TSAPI NotifyDeliveryFailure (const TWindowData *dat); + static void TSAPI UpdateSaveAndSendButton (TWindowData *dat); + static void TSAPI EnableSending (const TWindowData *dat, const int iMode); +private: + SendJob m_jobs[NR_SENDJOBS]; + int m_currentIndex; +}; + +extern SendQueue *sendQueue; + +int TSAPI ActivateExistingTab (TContainerData *pContainer, HWND hwndChild); +void TSAPI ShowMultipleControls (const HWND hwndDlg, const UINT * controls, int cControls, int state); +void TSAPI HandleIconFeedback (TWindowData *dat, HICON iIcon); + +#endif /* __SENDQUEUE_H */ diff --git a/plugins/TabSRMM/src/include/sidebar.h b/plugins/TabSRMM/src/include/sidebar.h new file mode 100644 index 0000000000..415b96c5ac --- /dev/null +++ b/plugins/TabSRMM/src/include/sidebar.h @@ -0,0 +1,239 @@ +/* + * astyle --force-indent=tab=4 --brackets=linux --indent-switches + * --pad=oper --one-line=keep-blocks --unpad=paren + * + * Miranda NG: the free IM client for Microsoft* Windows* + * + * Copyright 2000-2009 Miranda ICQ/IM project, + * all portions of this codebase are copyrighted to the people + * listed in contributors.txt. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * you should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * part of tabSRMM messaging plugin for Miranda. + * + * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors + * + * $Id: sidebar.h 11744 2010-05-13 20:34:30Z silvercircle $ + * + * the contact switch bar on the left (or right) side + * + */ + +#ifndef __SIDEBAR_H +#define __SIDEBAR_H + +struct TSideBarNotify { + NMHDR nmHdr; + const TWindowData* dat; +}; +/* layout descrtiption structure */ + +struct TSideBarLayout { + TCHAR szName[50]; // everything wants a name... + LONG width; // width of the switchbar element (a single button) + LONG height; // height of a single switchbar element + DWORD dwFlags; // flags, obviously :) + + /* + * the following 4 items define pointers to the actual renderer functions for that sidebar layout + * a default is always provided, however, it has been designed to be easily extendible without + * rewriting lots of code just in order to change how the switchbar items look like. + */ + void (__fastcall *pfnContentRenderer)(const HDC hdc, const RECT *rc, const CSideBarButton *item); + void (__fastcall *pfnBackgroundRenderer)(const HDC hdc, const RECT *rc, const CSideBarButton *item); + const SIZE& (__fastcall *pfnMeasureItem)(CSideBarButton *item); + void (__fastcall *pfnLayout)(const CSideBar *sideBar, RECT *rc); + UINT uId; // numeric id by which the layout is identified. basically, the index into the array. +}; + +class CSideBar; + +class CSideBarButton +{ +public: + CSideBarButton(const UINT id, CSideBar *sideBar); + CSideBarButton(const TWindowData *dat, CSideBar *sideBar); + ~CSideBarButton(); + + LONG getHeight() const { return(m_sz.cy); } + const SIZE& getSize() const { return(m_sz); } + void setSize(const SIZE& newSize){ m_sz = newSize; } + const bool isTopAligned() const { return(m_isTopAligned); } + const HWND getHwnd() const { return(m_hwnd); } + const UINT getID() const { return(m_id); } + const HANDLE getContactHandle() const { return(m_dat->hContact); } + const TWindowData* getDat() const { return(m_dat); } + const TSideBarLayout* getLayout() const { return(m_sideBarLayout); } + + void RenderThis (const HDC hdc) const; + void renderIconAndNick (const HDC hdc, const RECT *rcItem) const; + int testCloseButton() const; + void Show(const int showCmd) const; + void activateSession() const; + const SIZE& measureItem(); + void setLayout(const TSideBarLayout *newLayout); + void invokeContextMenu(); + +public: + CSideBar* m_sideBar; + const MButtonCtrl* m_buttonControl; // private data struct of the Win32 button object +private: + void _create(); +private: + const TSideBarLayout* m_sideBarLayout; + HWND m_hwnd; // window handle for the TSButton object + const TWindowData* m_dat; // session data + UINT m_id; // control id + bool m_isTopAligned; + SIZE m_sz; +}; + +typedef std::vector::iterator ButtonIterator; + +class CSideBar +{ +public: + enum { + NR_LAYOUTS = 4 + }; + + enum { + /* layout ids. index into m_layouts[] */ + + SIDEBARLAYOUT_VERTICAL = 0, + SIDEBARLAYOUT_NORMAL = 1, + SIDEBARLAYOUT_COMPLEX = 2, + SIDEBARLAYOUT_LARGE = 3, + + /* flags */ + + SIDEBARORIENTATION_LEFT = 8, + SIDEBARORIENTATION_RIGHT = 16, + + SIDEBARLAYOUT_DYNHEIGHT = 32, + SIDEBARLAYOUT_VERTICALORIENTATION = 64, + SIDEBARLAYOUT_NOCLOSEBUTTONS = 128 + }; + + enum { + SIDEBAR_GAP = 2 // gap between sidebar container window and content tab sheet border + }; + + CSideBar(TContainerData *pContainer); + ~CSideBar(); + + void Init (const bool fForce = false); + void addSession (const TWindowData *dat, int position = -1); + HRESULT removeSession (const TWindowData *dat); + void updateSession (const TWindowData *dat); + + void processScrollerButtons (UINT cmd); + void Layout (const RECT *rc = 0, bool fOnlyCalc = false); + void setVisible (bool fNewVisibility); + void showAll (int showCmd); + + const LONG getWidth() const { return(m_isVisible ? m_width + SIDEBAR_GAP : 0); } + const DWORD getFlags() const { return(m_dwFlags); } + const TContainerData* getContainer() const { return(m_pContainer); } + const bool isActive() const { return(m_isActive); } + const bool isVisible() const { return(m_isVisible); } + const CSideBarButton* getActiveItem() const { return(m_activeItem); } + const CSideBarButton* getScrollUp() const { return(m_up); } + const CSideBarButton* getScrollDown() const { return(m_down); } + bool isSkinnedContainer() const { return(CSkin::m_skinEnabled ? true : false); } + const UINT getLayoutId() const { return(m_uLayout); } + void invalidateButton (const TWindowData* dat); + + const CSideBarButton* setActiveItem (const CSideBarButton *newItem) + { + CSideBarButton *oldItem = m_activeItem; + m_activeItem = const_cast(newItem); + if (oldItem) + ::InvalidateRect(oldItem->getHwnd(), NULL, FALSE); + ::InvalidateRect(m_activeItem->getHwnd(), NULL, FALSE); + scrollIntoView(m_activeItem); + return(oldItem); + } + /** + * this item has its close button currently hovered + * @param item: the CSideBarButton* which is hovered + */ + void setHoveredClose (CSideBarButton* item) + { + m_hoveredClose = item; + } + HWND getScrollWnd() const { return(m_hwndScrollWnd); } + const CSideBarButton* getHoveredClose() const { return(m_hoveredClose); } + const CSideBarButton* setActiveItem (const TWindowData *dat); + + static const TSideBarLayout* getLayouts (int& uLayoutCount) + { + uLayoutCount = NR_LAYOUTS; + return(m_layouts); + } + void scrollIntoView (const CSideBarButton *item = 0); + void resizeScrollWnd (LONG x, LONG y, LONG width, LONG height) const; + static LRESULT CALLBACK wndProcStub (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + +private: + void createScroller(); + void destroyScroller(); + void populateAll(); + void removeAll(); + void Invalidate(); + ButtonIterator findSession (const TWindowData *dat); + ButtonIterator findSession (const HANDLE hContact); + + LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + +private: + HWND m_hwndScrollWnd; + std::vector m_buttonlist; // our list of buttons + TContainerData* m_pContainer; // our master and commander... + LONG m_width; // required width of the bar (m_elementWidth + padding) + DWORD m_dwFlags; + CSideBarButton* m_up, *m_down; // the scroller buttons (up down) + CSideBarButton* m_activeItem; // active button item (for highlighting) + const CSideBarButton* m_hoveredClose; // item which must display an active close button + LONG m_topHeight, m_bottomHeight; + LONG m_firstVisibleOffset, m_totalItemHeight; + int m_iTopButtons, m_iBottomButtons; + LONG m_elementHeight, m_elementWidth; // width / height for a single element. + // can be dynamic (see measeureItem() in CSideBarButtonItem + bool m_isActive; // the sidebar is active (false, if it does _nothing at all_ + bool m_isVisible; // visible aswell (not collapsed) + TSideBarLayout* m_currentLayout; // the layout in use. will be passed to new button items + UINT m_uLayout; // layout id number, currently in use + +private: + /* + * layouts. m_layouts[] is static and contains layout descriptions + * renderer functions are static aswell + */ + static TSideBarLayout m_layouts[NR_LAYOUTS]; + static void __fastcall m_DefaultBackgroundRenderer(const HDC hdc, const RECT *rc, const CSideBarButton *item); + static void __fastcall m_DefaultContentRenderer(const HDC hdc, const RECT *rc, const CSideBarButton *item); + static void __fastcall m_AdvancedContentRenderer(const HDC hdc, const RECT *rc, const CSideBarButton *item); + + static const SIZE& __fastcall m_measureAdvancedVertical(CSideBarButton *item); +}; + +inline void CSideBarButton::setLayout(const TSideBarLayout *newLayout) +{ + m_sideBarLayout = newLayout; +} + +#endif diff --git a/plugins/TabSRMM/src/include/taskbar.h b/plugins/TabSRMM/src/include/taskbar.h new file mode 100644 index 0000000000..9267f6a76a --- /dev/null +++ b/plugins/TabSRMM/src/include/taskbar.h @@ -0,0 +1,197 @@ +/* + * astyle --force-indent=tab=4 --brackets=linux --indent-switches + * --pad=oper --one-line=keep-blocks --unpad=paren + * + * Miranda NG: the free IM client for Microsoft* Windows* + * + * Copyright 2000-2009 Miranda ICQ/IM project, + * all portions of this codebase are copyrighted to the people + * listed in contributors.txt. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * you should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * part of tabSRMM messaging plugin for Miranda. + * + * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors + * + * $Id: taskbar.h 12227 2010-07-23 16:57:25Z silvercircle $ + * + * - Windows 7 taskbar integration class + * - Proxy window class, needed to support custom aero peek tab + * thumbnails + * - Thumbnail classes to provide task bar thumbnails for Aero peek + * preview. + */ + +#ifndef __TASKBAR_H +#define __TASKBAR_H + +#define PROXYCLASSNAME _T("TabSRMM_DWMProxy") +extern HINSTANCE g_hInst; + +class CProxyWindow; + +class CThumbBase { +public: + CThumbBase (const CProxyWindow* pWnd); + virtual ~CThumbBase (); + + const HBITMAP getHBM () const { return(m_hbmThumb); } + const bool isValid () const { return(m_isValid); } + virtual void setValid (const bool fNewValid) { m_isValid = fNewValid; } + virtual void update () = 0; + +protected: + HBITMAP m_hbmThumb, m_hbmOld; + const TWindowData* m_dat; + LONG m_width, m_height; + HDC m_hdc; + const CProxyWindow* m_pWnd; + RECT m_rc, m_rcTop, m_rcBottom, m_rcIcon; + DWORD m_dtFlags; + SIZE m_sz; + LONG m_cx, m_cy; + HFONT m_hOldFont; + + virtual void renderBase (); + +private: + virtual void renderContent () = 0; + void setupRect (); + +private: + bool m_isValid; +}; + +class CThumbIM : public CThumbBase { + +public: + CThumbIM (const CProxyWindow* pWnd); + virtual ~CThumbIM () {}; + void update (); + +private: + void renderContent (); +}; + +class CThumbMUC : public CThumbBase { + +public: + CThumbMUC (const CProxyWindow* pWnd); + virtual ~CThumbMUC () {}; + void update (); + +private: + void renderContent (); +}; + +class CProxyWindow +{ +public: + CProxyWindow(const TWindowData *dat); + ~CProxyWindow(); + + void updateIcon (const HICON hIcon) const; + void updateTitle (const TCHAR *tszTitle) const; + void setBigIcon (const HICON hIcon, bool fInvalidate = true); + void setOverlayIcon (const HICON hIcon, bool fInvalidate = true); + void activateTab () const; + void Invalidate () const; + const TWindowData* getDat () const { return(m_dat); } + const LONG getWidth () const { return(m_width); } + const LONG getHeight () const { return(m_height); } + const HWND getHwnd () const { return(m_hwndProxy); } + const HICON getBigIcon () const { return(m_hBigIcon); } + const HICON getOverlayIcon () const { return(m_hOverlayIcon); } + void verifyDwmState (); + + static LRESULT CALLBACK stubWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + static void add (TWindowData *dat); + static void verify (TWindowData *dat); + +private: + const TWindowData* m_dat; + HWND m_hwndProxy; + LONG m_width, m_height; + HICON m_hBigIcon, m_hOverlayIcon; + + LRESULT CALLBACK wndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + void sendThumb (LONG width, LONG height); + void sendPreview (); + CThumbBase* m_thumb; +}; + +class CTaskbarInteract +{ +public: + CTaskbarInteract() + { + m_pTaskbarInterface = 0; + m_IconSize = 0; + m_isEnabled = IsWinVer7Plus() ? true : false; + + if (m_isEnabled) { + ::CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_ALL, IID_ITaskbarList3, (void**)&m_pTaskbarInterface); + updateMetrics(); + if (0 == m_pTaskbarInterface) + m_isEnabled = false; + } + + /* + * register proxy window class + */ + WNDCLASSEX wcex = {0}; + wcex.cbSize = sizeof(wcex); + wcex.lpfnWndProc = CProxyWindow::stubWndProc; + wcex.hInstance = g_hInst; + wcex.hCursor = LoadCursor(NULL, IDC_ARROW); + wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); + wcex.lpszClassName = PROXYCLASSNAME; + ::RegisterClassEx(&wcex); + } + + ~CTaskbarInteract() + { + if (m_isEnabled && m_pTaskbarInterface) { + m_pTaskbarInterface->Release(); + m_pTaskbarInterface = 0; + m_isEnabled = false; + } + ::UnregisterClass(PROXYCLASSNAME, g_hInst); + } + const LONG getIconSize () const { return(m_IconSize); } + const bool haveAlwaysGroupingMode () const { return(m_fHaveAlwaysGrouping); } + + bool setOverlayIcon (HWND hwndDlg, LPARAM lParam) const; + void clearOverlayIcon (HWND hwndDlg) const; + bool haveLargeIcons (); + LONG updateMetrics (); + void registerTab (const HWND hwndTab, const HWND hwndContainer) const; + void unRegisterTab (const HWND hwndTab) const; + void SetTabActive (const HWND hwndTab, const HWND hwndGroup) const; + + //const TCHAR* getFileNameFromWindow (const HWND hWnd); +private: + bool m_isEnabled; + ITaskbarList3* m_pTaskbarInterface; + bool m_fHaveLargeicons; + bool m_fHaveAlwaysGrouping; + LONG m_IconSize; +}; + +extern CTaskbarInteract* Win7Taskbar; + +#endif /* __TASKBAR_H */ + diff --git a/plugins/TabSRMM/src/include/templates.h b/plugins/TabSRMM/src/include/templates.h new file mode 100644 index 0000000000..c2b84b1cbd --- /dev/null +++ b/plugins/TabSRMM/src/include/templates.h @@ -0,0 +1,50 @@ +/* + +Miranda NG: the free IM client for Microsoft* Windows* + +Copyright 2000-2003 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details . + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +$Id: templates.h 11044 2009-12-11 09:16:30Z silvercircle $ + +templates for the message log... + +*/ + +struct TemplateEditorInfo { + BOOL rtl; + BOOL changed; // template in edit field is changed + BOOL selchanging; + int inEdit; // template currently in editor + BOOL updateInfo[TMPL_ERRMSG + 1]; // item states... + HWND hwndParent; + HANDLE hContact; +}; + +struct TemplateEditorNew { + HANDLE hContact; + BOOL rtl; + HWND hwndParent; +}; + +BOOL CALLBACK DlgProcTemplateEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +static void LoadTemplatesFrom(TTemplateSet *tSet, HANDLE hContact, int rtl); +void LoadDefaultTemplates(); + +#define DM_UPDATETEMPLATEPREVIEW (WM_USER + 50) + diff --git a/plugins/TabSRMM/src/include/themes.h b/plugins/TabSRMM/src/include/themes.h new file mode 100644 index 0000000000..ca899ffdb7 --- /dev/null +++ b/plugins/TabSRMM/src/include/themes.h @@ -0,0 +1,415 @@ +/* + * astyle --force-indent=tab=4 --brackets=linux --indent-switches + * --pad=oper --one-line=keep-blocks --unpad=paren + * + * Miranda NG: the free IM client for Microsoft* Windows* + * + * Copyright 2000-2009 Miranda ICQ/IM project, + * all portions of this codebase are copyrighted to the people + * listed in contributors.txt. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * you should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * part of tabSRMM messaging plugin for Miranda. + * + * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors + * + * $Id: themes.h 11997 2010-06-14 20:12:34Z silvercircle $ + * + * The class CSkin implements the skinning engine and loads skins from + * their skin definition files (.tsk). + * + * CImageItem implements a single rectangular skin item with an image + * and its rendering. + * + */ + +#ifndef __THEMES_H +#define __THEMES_H + +HBITMAP IMG_LoadLogo(const TCHAR *szName); + +class CSideBarButton; + +typedef struct { + HWND hwnd; + int stateId; // button state + int focus; // has focus (1 or 0) + HFONT hFont; // font + HICON arrow; // uses down arrow + int defbutton; // default button + HICON hIcon, hIconPrivate; + HBITMAP hBitmap; + int pushBtn; + int pbState; + HANDLE hThemeButton; + HANDLE hThemeToolbar; + BOOL bThemed; + BOOL bToolbarButton; // is a toolbar button (important for aero background rendering) + BOOL bTitleButton; + TCHAR cHot; + int flatBtn; + int dimmed; + HICON overlay; + struct TContainerData *pContainer; + CSideBarButton *sitem; +} MButtonCtrl; + +#define BUTTONSETASDIMMED (BUTTONSETASFLATBTN + 11) +#define BUTTONSETCONTAINER (BUTTONSETASFLATBTN + 12) +#define BUTTONSETASTITLE (BUTTONSETASFLATBTN + 13) +#define BUTTONSETASNORMAL (BUTTONSETASFLATBTN + 14) +#define BUTTONGETSTATEID (BUTTONSETASFLATBTN + 15) +#define BUTTONSETASTOOLBARBUTTON (BUTTONSETASFLATBTN + 21) +#define BUTTONSETASSIDEBARBUTTON (BUTTONSETASFLATBTN + 22) +#define BUTTONSETOVERLAYICON (BUTTONSETASFLATBTN + 23) + +struct AeroEffect { + TCHAR tszName[40]; + DWORD m_baseColor; + DWORD m_gradientColor; + BYTE m_baseAlpha; + BYTE m_finalAlpha; + BYTE m_cornerType; + BYTE m_gradientType; + DWORD m_cornerRadius; + DWORD m_glowSize; + COLORREF m_clrBack; + COLORREF m_clrToolbar; + COLORREF m_clrToolbar2; + void (TSAPI *pfnEffectRenderer)(const HDC hdc, const RECT *rc, int iEffectArea); +}; +/** + * CImageItem implementes image-based skin items. These items are loaded + * from a skin file definition (.tsk file) and are then linked to one or + * more skin items. + */ +class CImageItem +{ +public: + CImageItem() + { + ZeroMemory(this, sizeof(CImageItem)); + } + CImageItem(const CImageItem& From) + { + *this = From; + m_nextItem = 0; + } + CImageItem(const TCHAR *szName) + { + ZeroMemory(this, sizeof(CImageItem)); + _sntprintf(m_szName, 40, szName); + m_szName[39] = 0; + } + + CImageItem(BYTE bottom, BYTE left, BYTE top, BYTE right, HDC hdc, HBITMAP hbm, DWORD dwFlags, + HBRUSH brush, BYTE alpha, LONG inner_height, LONG inner_width, LONG height, LONG width) + { + m_bBottom = bottom; + m_bLeft = left, + m_bTop = top; + m_bRight = right; + m_hdc = hdc; + m_hbm = hbm; + m_dwFlags = dwFlags; + m_fillBrush = brush; + m_inner_height = inner_height; + m_inner_width = inner_width; + m_height = height; + m_width = width; + + m_bf.SourceConstantAlpha = alpha; + m_bf.AlphaFormat = 0; + m_bf.BlendOp = AC_SRC_OVER; + m_bf.BlendFlags = 0; + } + ~CImageItem() + { + Free(); + } + + void Clear() + { + m_hdc = 0; m_hbm = 0; m_hbmOld = 0; + m_fillBrush = (HBRUSH)0; + } + + void setBitmap(const HBITMAP hbm) + { + m_hbm = hbm; + } + + void setAlphaFormat(const BYTE bFormat, const BYTE bConstantAlpha) + { + m_bf.AlphaFormat = bFormat; + m_bf.SourceConstantAlpha = bConstantAlpha; + } + + void setMetrics(const LONG width, const LONG height) + { + m_height = height; + m_width = width; + + m_inner_height = m_height - m_bBottom - m_bTop; + m_inner_width = m_width - m_bLeft - m_bRight; + if (!(m_dwFlags & IMAGE_FLAG_DIVIDED)) + m_bStretch = IMAGE_STRETCH_B; + } + + void Free(); + CImageItem* getNextItem() const { return(m_nextItem); } + void setNextItem(CImageItem *item) { m_nextItem = item; } + HBITMAP getHbm() const { return(m_hbm); } + DWORD getFlags() const { return(m_dwFlags); } + HDC getDC() const { return(m_hdc); } + const BLENDFUNCTION& getBF() const + { + const BLENDFUNCTION &bf = m_bf; + return(bf); + } + const TCHAR* getName() const { return (m_szName); } + TCHAR* Read(const TCHAR *szFilename); + void Create(const TCHAR *szImageFile); + void __fastcall Render(const HDC hdc, const RECT *rc, bool fIgnoreGlyph) const; + static void TSAPI PreMultiply(HBITMAP hBitmap, int mode); + static void TSAPI SetBitmap32Alpha(HBITMAP hBitmap, BYTE bAlpha = 255); + static void TSAPI Colorize(HBITMAP hBitmap, BYTE dr, BYTE dg, BYTE db, BYTE alpha = 0); + static HBITMAP TSAPI LoadPNG(const TCHAR *szFilename); + +public: + bool m_fValid; // verified item, indicates that all parameters are valid +private: + TCHAR m_szName[40]; // everything wants a name, an image item doesn't need one though + HBITMAP m_hbm; // the bitmap handle + BYTE m_bLeft, m_bRight, m_bTop, m_bBottom; // sizing margins for the outer 8 image parts + BYTE m_alpha; // constant alpha for the entire image, applied via m_bf. sums with perpixel alpha + DWORD m_dwFlags; // flags + HDC m_hdc; // *can* hold a pre-created hdc to speed up rendering + HBITMAP m_hbmOld; // old bitmap, needs to be selected into m_hdc before destroying it + LONG m_inner_height, m_inner_width; // dimensions of the inner image part + LONG m_width, m_height; // width and height of the image, in pixels + BLENDFUNCTION m_bf; // for AlphaBlend() + BYTE m_bStretch; // stretch mode (unused in tabSRMM + HBRUSH m_fillBrush; // brush to fill the inner part (faster) dwFlags & IMAGE_FILLSOLID must be set + LONG m_glyphMetrics[4]; // these coordinates point into the glyph image (if IMAGE_GLYPH is set) + CImageItem* m_nextItem; // next item in a set of image items (usually the skin set) +}; + +/** + * Implements the skinning engine. There is only one instance of this class and + * it always holds the currently loaded skin (if any). + */ +class CSkin +{ +public: + enum { + AERO_EFFECT_NONE = 0, + AERO_EFFECT_MILK = 1, + AERO_EFFECT_CARBON = 2, + AERO_EFFECT_SOLID = 3, + AERO_EFFECT_WHITE = 4, + AERO_EFFECT_CUSTOM = 5, + AERO_EFFECT_LAST = 6 + }; + enum { + AERO_EFFECT_AREA_MENUBAR = 0, + AERO_EFFECT_AREA_STATUSBAR = 1, + AERO_EFFECT_AREA_INFOPANEL = 2, + AERO_EFFECT_AREA_TAB_ACTIVE = 3, + AERO_EFFECT_AREA_TAB_HOVER = 4, + AERO_EFFECT_AREA_TAB_NORMAL = 5, + AERO_EFFECT_AREA_SIDEBAR_LEFT = 6, + AERO_EFFECT_AREA_SIDEBAR_RIGHT = 7, + AERO_EFFECT_AREA_TAB_TOP = 0x1000, + AERO_EFFECT_AREA_TAB_BOTTOM = 0x2000 + }; + + enum { + DEFAULT_GLOW_SIZE = 10 + }; + + /* + * avatar border types (skinned mode only) + */ + enum { + AVBORDER_NONE = 0, + AVBORDER_NORMAL = 1, + AVBORDER_ROUNDED = 2 + }; + + CSkin() + { + ZeroMemory(this, sizeof(CSkin)); + m_default_bf.SourceConstantAlpha = 255; + m_default_bf.AlphaFormat = AC_SRC_ALPHA; + m_default_bf.BlendOp = AC_SRC_OVER; + } + + ~CSkin() + { + Unload(); + } + + void Init(bool fStartup = false); + void Load(void); + void Unload(); + void UnloadAeroTabs(); + void setFileName(); + void ReadItem(const int id, const TCHAR *section); + void LoadItems(); + void LoadIcon(const TCHAR *szSection, const TCHAR *name, HICON *hIcon); + void ReadImageItem(const TCHAR *szItemName); + void ReadButtonItem(const TCHAR *itemName) const; + bool haveGlyphItem() const { return(m_fHaveGlyph); } + int getNrIcons() const { return(m_nrSkinIcons); } + const DWORD getDwmColor() const { return(m_dwmColor); } + + const TIconDescW* getIconDesc(const int id) const { return(&m_skinIcons[id]); } + /** + * get the glyph image item (a single PNG image, containing a number of textures + * for the skin. + * + * @return CImageItem&: reference to the glyph item. Cannot be + * modified. + * + */ + const CImageItem* getGlyphItem() const + { + return(m_fHaveGlyph ? &m_glyphItem : 0); + } + bool warnToClose() const; + COLORREF getColorKey() const { return(m_ContainerColorKey); } + + void setupAeroSkins(); + void extractSkinsAndLogo(bool fForceOverwrite = false) const; + void setupTabCloseBitmap(bool fDeleteOnly = false); + + /* + * static member functions + */ + static void TSAPI SkinDrawBGFromDC(HWND hwndClient, HWND hwnd, RECT *rcClient, HDC hdcTarget); + static void TSAPI SkinDrawBG(HWND hwndClient, HWND hwnd, struct TContainerData *pContainer, RECT *rcClient, HDC hdcTarget); + static void TSAPI MY_AlphaBlend(HDC hdcDraw, DWORD left, DWORD top, int width, int height, int bmWidth, int bmHeight, HDC hdcMem); + static void TSAPI DrawDimmedIcon(HDC hdc, LONG left, LONG top, LONG dx, LONG dy, HICON hIcon, BYTE alpha); + static DWORD __fastcall HexStringToLong(const TCHAR *szSource); + static UINT TSAPI DrawRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID, UINT msg, WPARAM wParam, LPARAM lParam, WNDPROC OldWndProc); + static UINT TSAPI NcCalcRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID, UINT msg, WPARAM wParam, LPARAM lParam, WNDPROC OldWndProc); + static HBITMAP TSAPI CreateAeroCompatibleBitmap(const RECT &rc, HDC dc); + static int TSAPI RenderText(HDC hdc, HANDLE hTheme, const TCHAR *szText, RECT *rc, DWORD dtFlags, const int iGlowSize = DEFAULT_GLOW_SIZE, COLORREF clr = 0, bool fForceAero = false); + static void TSAPI MapClientToParent(HWND hwndClient, HWND hwndParent, RECT &rc); + static void TSAPI RenderToolbarBG(const TWindowData *dat, HDC hdc, const RECT &rcWindow); + static HBITMAP TSAPI ResizeBitmap(HBITMAP hBmpSrc, LONG width, LONG height, bool &mustFree); + static void TSAPI ApplyAeroEffect(const HDC hdc, const RECT* rc, int iEffectArea, HANDLE hbp = 0); + static void TSAPI setAeroEffect(const LRESULT effect); + static void TSAPI initAeroEffect(); + static HANDLE TSAPI InitiateBufferedPaint(const HDC hdcSrc, RECT& rc, HDC& hdcOut); + static void TSAPI FinalizeBufferedPaint(HANDLE hbp, RECT *rc); + static bool __fastcall DrawItem(const HDC hdc, const RECT *rc, const CSkinItem *item); + static void TSAPI UpdateToolbarBG(TWindowData* dat, DWORD dwRdwOptFlags = 0); + static void TSAPI FillBack(const HDC hdc, RECT* rc); + +public: + static bool m_DisableScrollbars, m_bClipBorder; + static char m_SkinnedFrame_left, m_SkinnedFrame_right, m_SkinnedFrame_bottom, m_SkinnedFrame_caption; + static char m_realSkinnedFrame_left, m_realSkinnedFrame_right, m_realSkinnedFrame_bottom, m_realSkinnedFrame_caption; + static HPEN m_SkinLightShadowPen, m_SkinDarkShadowPen; + static int m_titleBarLeftOff, m_titleButtonTopOff, m_captionOffset, m_captionPadding, + m_titleBarRightOff, m_sidebarTopOffset, m_sidebarBottomOffset, m_bRoundedCorner; + static SIZE m_titleBarButtonSize; + static int m_bAvatarBorderType; + static COLORREF m_avatarBorderClr, m_tmp_tb_low, m_tmp_tb_high; + static COLORREF m_sideBarContainerBG; + static COLORREF m_ContainerColorKey, m_DefaultFontColor; + static HBRUSH m_ContainerColorKeyBrush, m_MenuBGBrush; + static bool m_skinEnabled; + static bool m_frameSkins; + static HICON m_closeIcon, m_minIcon, m_maxIcon; + static BLENDFUNCTION m_default_bf; // general purpose bf, dynamically modified when needed + + /* + * cached bitmap for tab close button + */ + + static HBITMAP m_tabCloseBitmap, m_tabCloseOldBitmap; + static HDC m_tabCloseHDC; + + /* + * controls the aero effect. Set by initAeroEffect() + */ + + static UINT m_aeroEffect; // effect id, initAeroEffect() is using it to set + // the parameters below. + static AeroEffect m_aeroEffects[AERO_EFFECT_LAST]; + static AeroEffect m_currentAeroEffect; + static AeroEffect* m_pCurrentAeroEffect; + static DWORD m_glowSize; + static HBRUSH m_BrushBack, m_BrushFill; + + static COLORREF m_dwmColorRGB; + + static CImageItem *m_switchBarItem, *m_tabTop, *m_tabBottom, *m_tabGlowTop, *m_tabGlowBottom; + static bool m_fAeroSkinsValid; + +private: + TCHAR m_tszFileName[MAX_PATH]; // full path and filename of the currently loaded skin + CSkinItem* m_SkinItems; + CImageItem* m_ImageItems; // the list of image item objects + CImageItem m_glyphItem; + + bool m_fLoadOnStartup; // load the skin on plugin initialization. + bool m_fHaveGlyph; + void SkinCalcFrameWidth(); + TIconDescW *m_skinIcons; + int m_nrSkinIcons; + DWORD m_dwmColor; + +private: + static void TSAPI AeroEffectCallback_Milk(const HDC hdc, const RECT *rc, int iEffectArea); + static void TSAPI AeroEffectCallback_Carbon(const HDC hdc, const RECT *rc, int iEffectArea); + static void TSAPI AeroEffectCallback_Solid(const HDC hdc, const RECT *rc, int iEffectArea); +}; + +/* + * window data for the tab control window class + */ + +struct TabControlData { + BOOL m_VisualStyles; + HWND hwnd; + DWORD dwStyle; + DWORD cx, cy; + HANDLE hTheme, hThemeButton, hbp; + BYTE m_xpad; + TContainerData *pContainer; + BOOL bDragging; + int iBeginIndex; + int iHoveredCloseIcon; + HWND hwndDrag; + TWindowData *dragDat; + HIMAGELIST himlDrag; + BOOL bRefreshWithoutClip; + BOOL fSavePos; + BOOL fTipActive; + BOOL fAeroTabs; + BOOL fCloseButton; + TWindowData* helperDat; // points to the client data of the active tab + CImageItem* helperItem, *helperGlowItem; // aero ui, holding the skin image for the tabs +}; + +extern CSkin *Skin; + +#endif /* __THEMES_H */ + diff --git a/plugins/TabSRMM/src/include/translator.h b/plugins/TabSRMM/src/include/translator.h new file mode 100644 index 0000000000..61590c6b16 --- /dev/null +++ b/plugins/TabSRMM/src/include/translator.h @@ -0,0 +1,63 @@ +/* + * astyle --force-indent=tab=4 --brackets=linux --indent-switches + * --pad=oper --one-line=keep-blocks --unpad=paren + * + * Miranda NG: the free IM client for Microsoft* Windows* + * + * Copyright 2000-2009 Miranda ICQ/IM project, + * all portions of this codebase are copyrighted to the people + * listed in contributors.txt. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * you should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * part of tabSRMM messaging plugin for Miranda. + * + * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors + * + * $Id: translator.h 12299 2010-08-10 02:39:36Z silvercircle $ + * + * string handling + * + */ + +#ifndef __STRINGS_H +#define __STRINGS_H + +class CTranslator { + +public: + + /* + * identities for the option trees + */ + + enum { + TREE_MODPLUS = 0, + TREE_NEN = 1, + TREE_MSG = 2, + TREE_LOG = 3, + TREE_TAB = 4, + }; + + CTranslator(); + ~CTranslator(); + + static TOptionListItem* getTree(UINT id); + static TOptionListGroup* getGroupTree(UINT id); +}; + +#endif + + diff --git a/plugins/TabSRMM/src/include/typingnotify.h b/plugins/TabSRMM/src/include/typingnotify.h new file mode 100644 index 0000000000..03fb9851b7 --- /dev/null +++ b/plugins/TabSRMM/src/include/typingnotify.h @@ -0,0 +1,76 @@ +#define UM_SETDLGITEMINT 5674 + +#define TIMEOUT_MINVALUE -1 +#define TIMEOUT_MAXVALUE 99 +#define TIMEOUT_POPUP 1 +#define TIMEOUT_CUSTOM 2 +#define TIMEOUT_PROTO 3 +#define TIMEOUT_PERMANENT 4 +#define COLOR_OWN 1 +#define COLOR_WINDOWS 2 +#define COLOR_POPUP 3 + +#define Module "TypingNotify" + +#define SET_WO "NotWhenFocused" +#define DEF_WO 0 +#define SET_DISABLED "Disabled" +#define DEF_DISABLED 0 +#define SET_TIMEOUT "Timeout" +#define DEF_TIMEOUT 7 +#define SET_TIMEOUT2 "Timeout2" +#define DEF_TIMEOUT2 7 +#define SET_TIMEOUT_MODE "TimeoutMode" +#define DEF_TIMEOUT_MODE TIMEOUT_POPUP +#define SET_TIMEOUT_MODE2 "TimeoutMode2" +#define DEF_TIMEOUT_MODE2 TIMEOUT_POPUP +#define SET_COLOR_MODE "ColorMode" +#define DEF_COLOR_MODE COLOR_OWN +#define SET_ICON_SETID "IconSet" +#define DEF_ICON_SETID 0 +#define SET_SHOWDISABLEMENU "ShowDisableMenu" +#define DEF_SHOWDISABLEMENU 1 +#define SET_ONEPOPUP "OnePopUp" +#define DEF_ONEPOPUP 1 + + +static HANDLE hDisableMenu = NULL; +static HANDLE hPopUpsList = NULL; + +static BYTE OnePopUp; +static BYTE ShowMenu; +static BYTE PopupService=0; +static BYTE StartDisabled; +static BYTE StopDisabled; +static BYTE Disabled; +static BYTE ColorMode; +static BYTE TimeoutMode; +static BYTE TimeoutMode2; +static int Timeout; +static int Timeout2; +static int newTimeout; +static int newTimeout2; +static BYTE newTimeoutMode; +static BYTE newTimeoutMode2; +static BYTE newColorMode; +static TCHAR szStart[128]; +static TCHAR szStop[128]; + +static HANDLE hntfStarted = 0; +static HANDLE hntfStopped = 0; + + +struct colors_s +{ + int res; + char desc[10]; + COLORREF color; +}; + +static struct colors_s colorPicker[4] = +{ + {IDC_TYPEON_BG, "ON_BG", RGB(255,255,255)}, + {IDC_TYPEON_TX, "ON_TX", RGB(0,0,0)}, + {IDC_TYPEOFF_BG, "OFF_BG", RGB(255,255,255)}, + {IDC_TYPEOFF_TX, "OFF_TX", RGB(0,0,0)} +}; diff --git a/plugins/TabSRMM/src/include/utils.h b/plugins/TabSRMM/src/include/utils.h new file mode 100644 index 0000000000..b2f2dab659 --- /dev/null +++ b/plugins/TabSRMM/src/include/utils.h @@ -0,0 +1,268 @@ +/* + * astyle --force-indent=tab=4 --brackets=linux --indent-switches + * --pad=oper --one-line=keep-blocks --unpad=paren + * + * Miranda NG: the free IM client for Microsoft* Windows* + * + * Copyright 2000-2009 Miranda ICQ/IM project, + * all portions of this codebase are copyrighted to the people + * listed in contributors.txt. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * you should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * part of tabSRMM messaging plugin for Miranda. + * + * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors + * + * $Id: utils.h 12833 2010-09-27 23:45:55Z silvercircle $ + * + * utility functions for TabSRMM + * + */ + +#ifndef __UTILS_H +#define __UTILS_H + +#define RTF_CTABLE_DEFSIZE 8 + +#define RTF_DEFAULT_HEADER _T("{\\rtf1\\ansi\\deff0\\pard\\li%u\\fi-%u\\ri%u\\tx%u") + +#define CNT_KEYNAME "CNTW_Def" +#define CNT_BASEKEYNAME "CNTW_" + +struct TRTFColorTable { + TCHAR szName[10]; + COLORREF clr; + int index; + int menuid; +}; + +static TRTFColorTable _rtf_ctable[] = { + _T("red"), RGB(255, 0, 0), 0, ID_FONT_RED, + _T("blue"), RGB(0, 0, 255), 0, ID_FONT_BLUE, + _T("green"), RGB(0, 255, 0), 0, ID_FONT_GREEN, + _T("magenta"), RGB(255, 0, 255), 0, ID_FONT_MAGENTA, + _T("yellow"), RGB(255, 255, 0), 0, ID_FONT_YELLOW, + _T("cyan"), RGB(0, 255, 255), 0, ID_FONT_CYAN, + _T("black"), 0, 0, ID_FONT_BLACK, + _T("white"), RGB(255, 255, 255), 0, ID_FONT_WHITE, + _T(""), 0, 0, 0 +}; + +class Utils { + +public: + enum { + CMD_CONTAINER = 1, + CMD_MSGDIALOG = 2, + CMD_INFOPANEL = 4, + }; + static int TSAPI FindRTLLocale (TWindowData *dat); + static TCHAR* TSAPI GetPreviewWithEllipsis (TCHAR *szText, size_t iMaxLen); + static TCHAR* TSAPI FilterEventMarkers (TCHAR *wszText); + static const TCHAR* TSAPI FormatRaw (TWindowData *dat, const TCHAR *msg, int flags, BOOL isSent); + static const TCHAR* TSAPI FormatTitleBar (const TWindowData *dat, const TCHAR *szFormat); + static char* TSAPI FilterEventMarkers (char *szText); + static const TCHAR* TSAPI DoubleAmpersands (TCHAR *pszText); + static void TSAPI RTF_CTableInit (); + static void TSAPI RTF_ColorAdd (const TCHAR *tszColname, size_t length); + static void TSAPI CreateColorMap (TCHAR *Text); + static int TSAPI RTFColorToIndex (int iCol); + static int TSAPI ReadContainerSettingsFromDB (const HANDLE hContact, TContainerSettings *cs, const char *szKey = 0); + static int TSAPI WriteContainerSettingsToDB (const HANDLE hContact, TContainerSettings *cs, const char *szKey = 0); + static void TSAPI SettingsToContainer (TContainerData *pContainer); + static void TSAPI ContainerToSettings (TContainerData *pContainer); + static void TSAPI ReadPrivateContainerSettings (TContainerData *pContainer, bool fForce = false); + static void TSAPI SaveContainerSettings (TContainerData *pContainer, const char *szSetting); + static DWORD CALLBACK StreamOut (DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG * pcb); + static LRESULT TSAPI CmdDispatcher (UINT uType, HWND hwndDlg, UINT cmd, WPARAM wParam, LPARAM lParam, TWindowData *dat = 0, + TContainerData *pContainer = 0); + static void TSAPI addMenuItem (const HMENU& m, MENUITEMINFO& mii, HICON hIcon, + const TCHAR *szText, UINT uID, UINT pos); + static void TSAPI enableDlgControl (const HWND hwnd, UINT id, BOOL fEnable = 1); + static void TSAPI showDlgControl (const HWND hwnd, UINT id, int showCmd); + static int TSAPI mustPlaySound (const TWindowData *dat); + static HICON TSAPI iconFromAvatar (const TWindowData *dat); + static void TSAPI getIconSize (HICON hIcon, int& sizeX, int& sizeY); + + static void TSAPI extractResource (const HMODULE h, const UINT uID, const TCHAR *tszName, const TCHAR *tszPath, + const TCHAR *tszFilename, bool fForceOverwrite); + static void TSAPI scaleAvatarHeightLimited (const HBITMAP hBm, double& dNewWidth, double& dNewHeight, const LONG maxHeight); + + static AVATARCACHEENTRY* TSAPI loadAvatarFromAVS (const HANDLE hContact); + static void TSAPI sanitizeFilename (wchar_t *tszFilename); + static void TSAPI ensureTralingBackslash (wchar_t *szPathname); + + static void* TSAPI safeAlloc (const size_t size); + static void* TSAPI safeCalloc (const size_t size); + static void* TSAPI safeMirAlloc (const size_t size); + static void* TSAPI safeMirCalloc (const size_t size); + + static HMODULE TSAPI loadSystemLibrary (const wchar_t* szFilename); + + static INT_PTR CALLBACK PopupDlgProcError (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); + static const TCHAR* extractURLFromRichEdit (const ENLINK* _e, const HWND hwndRich); + + template static size_t TSAPI CopyToClipBoard(T* _t, const HWND hwndOwner) + { + HGLOBAL hData; + + if (!OpenClipboard(hwndOwner) || _t == 0) + return 0; + + std::basic_string *s = new std::basic_string(_t); + size_t _s = sizeof(T); + size_t i = _s * (s->length() + 1); + + EmptyClipboard(); + hData = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, i); + + CopyMemory((void *)GlobalLock(hData), (void *)_t, i); + GlobalUnlock(hData); + SetClipboardData(_s == sizeof(char) ? CF_TEXT : CF_UNICODETEXT, hData); + CloseClipboard(); + delete s; + return(i); + } + + template static void AddToFileList(T ***pppFiles, int *totalCount, const TCHAR* szFilename) + { + size_t _s = sizeof(T); + + *pppFiles = (T**)mir_realloc(*pppFiles, (++*totalCount + 1) * sizeof(T*)); + (*pppFiles)[*totalCount] = NULL; + + if (_s == 1) + (*pppFiles)[*totalCount-1] = reinterpret_cast(mir_t2a(szFilename)); + else + (*pppFiles)[*totalCount-1] = reinterpret_cast(mir_tstrdup(szFilename)); + + if (GetFileAttributes(szFilename) & FILE_ATTRIBUTE_DIRECTORY) { + WIN32_FIND_DATA fd; + HANDLE hFind; + TCHAR szPath[MAX_PATH]; + + lstrcpy(szPath, szFilename); + lstrcat(szPath, _T("\\*")); + if ((hFind = FindFirstFile(szPath, &fd)) != INVALID_HANDLE_VALUE) { + do { + if (!lstrcmp(fd.cFileName, _T(".")) || !lstrcmp(fd.cFileName, _T(".."))) + continue; + lstrcpy(szPath, szFilename); + lstrcat(szPath, _T("\\")); + lstrcat(szPath, fd.cFileName); + AddToFileList(pppFiles, totalCount, szPath); + } while (FindNextFile(hFind, &fd)); + FindClose(hFind); + } + } + } + + /** + * safe strlen function - do not overflow the given buffer length + * if the buffer does not contain a valid (zero-terminated) string, it + * will return 0. + * + * careful: maxlen must be given in element counts!! + */ + template static size_t safe_strlen(const T* src, const size_t maxlen = 0) + { + size_t s = 0; + + while(s < maxlen && *(src++)) + s++; + + if (s >= maxlen && *src != 0) + return 0; + else + return(s); + } + +public: + static TRTFColorTable* rtf_ctable; + static int rtf_ctable_size; +}; + +LRESULT TSAPI _dlgReturn(HWND hWnd, LRESULT result); + + + +/** + * implement a warning dialog with a "do not show this again" check + * box + */ + +class CWarning { + +public: + /* + * the warning IDs + */ + enum { + WARN_RELNOTES = 0, + WARN_ICONPACK_VERSION = 1, + WARN_EDITUSERNOTES = 2, + WARN_ICONPACKMISSING = 3, + WARN_AEROPEEK_SKIN = 4, + WARN_CHAT_ENABLED = 5, + WARN_SENDFILE = 6, + WARN_HPP_APICHECK = 7, + WARN_NO_SENDLATER = 8, + WARN_CLOSEWINDOW = 9, + WARN_OPTION_CLOSE = 10, + WARN_THEME_OVERWRITE = 11, + WARN_LAST = 12 + }; + + /* + * the flags (low word is reserved for default windows flags like MB_OK etc. + */ + + enum { + CWF_UNTRANSLATED = 0x00010000, // do not translate the msg (useful for some error messages) + CWF_NOALLOWHIDE = 0x00020000 // critical message, hide the "do not show this again" check box + }; + + CWarning(const wchar_t* tszTitle, const wchar_t* tszText, const UINT uId, const DWORD dwFlags); + ~CWarning(); + +public: + /* + * static function to construct and show the dialog, returns the + * user's choice + */ + static LRESULT show (const int uId, DWORD dwFlags = 0, const wchar_t* tszTxt = 0); + static void destroyAll (); + LRESULT ShowDialog () const; + +private: + std::basic_string* m_szTitle; + std::basic_string* m_szText; + UINT m_uId; + HFONT m_hFontCaption; + DWORD m_dwFlags; + HWND m_hwnd; + bool m_fIsModal; + + INT_PTR CALLBACK dlgProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + //void resize () const; + static INT_PTR CALLBACK stubDlgProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + static __int64 getMask (); // get bit mask for disabled message classes + +private: + static HANDLE hWindowList; +}; + +#endif /* __UTILS_H */ diff --git a/plugins/TabSRMM/src/include/version.h b/plugins/TabSRMM/src/include/version.h new file mode 100644 index 0000000000..4390ed33dc --- /dev/null +++ b/plugins/TabSRMM/src/include/version.h @@ -0,0 +1,15 @@ +#define VER_PLAIN "3,1,99,8" +#define _VER_MAJOR 3 +#define _VER_MINOR 1 +#define _VER_REVISION 99 +#define _VER_BUILD 8 + +#if defined(_WIN64) + #define RES_FILE_DESC "TabSRMM (Unicode) x86_amd64" + #define ADDONS_UPDATE_URL "http://miranda-ng.org/" + #define ADDONS_DL_URL "http://miranda-ng.org/distr/x64/Plugins/tabsrmm.zip" +#else + #define RES_FILE_DESC "TabSRMM (Unicode) x86" + #define ADDONS_UPDATE_URL "http://miranda-ng.org/" + #define ADDONS_DL_URL "http://miranda-ng.org/distr/x32/Plugins/tabsrmm.zip" +#endif -- cgit v1.2.3