From 1416051048756ab769de52ab5eb67a31e41524fd Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sun, 10 Mar 2013 11:49:39 +0000 Subject: removed not used headers added version info git-svn-id: http://svn.miranda-ng.org/main/trunk@3952 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/res/Version.rc | 38 + plugins/TabSRMM/res/chat.rc | 12 +- plugins/TabSRMM/res/msgwindow.rc | 48 +- plugins/TabSRMM/res/resource.rc | 235 ++--- plugins/TabSRMM/src/ImageDataObject.cpp | 4 - plugins/TabSRMM/src/ImageDataObject.h | 131 +++ plugins/TabSRMM/src/TSButton.cpp | 1 - plugins/TabSRMM/src/buttonbar.h | 54 ++ plugins/TabSRMM/src/buttonsbar.cpp | 295 +++--- plugins/TabSRMM/src/chat/chat.h | 9 - plugins/TabSRMM/src/chat/chatprototypes.h | 3 - plugins/TabSRMM/src/chat/clist.cpp | 4 - plugins/TabSRMM/src/chat/colorchooser.cpp | 3 - plugins/TabSRMM/src/chat/log.cpp | 7 - plugins/TabSRMM/src/chat/main.cpp | 2 - plugins/TabSRMM/src/chat/manager.cpp | 8 - plugins/TabSRMM/src/chat/message.cpp | 3 - plugins/TabSRMM/src/chat/muchighlight.cpp | 4 - plugins/TabSRMM/src/chat/options.cpp | 9 - plugins/TabSRMM/src/chat/services.cpp | 9 +- plugins/TabSRMM/src/chat/tools.cpp | 9 - plugins/TabSRMM/src/chat/window.cpp | 7 +- plugins/TabSRMM/src/commonheaders.h | 365 +++---- plugins/TabSRMM/src/contactcache.cpp | 6 +- plugins/TabSRMM/src/contactcache.h | 165 ++++ plugins/TabSRMM/src/container.cpp | 8 +- plugins/TabSRMM/src/containeroptions.cpp | 3 - plugins/TabSRMM/src/controls.cpp | 14 +- plugins/TabSRMM/src/controls.h | 136 +++ plugins/TabSRMM/src/eventpopups.cpp | 17 +- plugins/TabSRMM/src/functions.h | 200 ++++ plugins/TabSRMM/src/generic_msghandlers.cpp | 35 +- plugins/TabSRMM/src/generic_msghandlers.h | 65 ++ plugins/TabSRMM/src/globals.cpp | 13 +- plugins/TabSRMM/src/globals.h | 236 +++++ plugins/TabSRMM/src/hotkeyhandler.cpp | 9 +- 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 | 138 --- plugins/TabSRMM/src/include/functions.h | 202 ---- plugins/TabSRMM/src/include/generic_msghandlers.h | 67 -- plugins/TabSRMM/src/include/globals.h | 238 ----- plugins/TabSRMM/src/include/infopanel.h | 221 ----- plugins/TabSRMM/src/include/m_cln_skinedit.h | 147 --- plugins/TabSRMM/src/include/mim.h | 300 ------ plugins/TabSRMM/src/include/msgdlgutils.h | 103 -- plugins/TabSRMM/src/include/msgs.h | 1063 --------------------- plugins/TabSRMM/src/include/nen.h | 169 ---- plugins/TabSRMM/src/include/resource.h | 798 ---------------- 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 - plugins/TabSRMM/src/infopanel.cpp | 8 +- plugins/TabSRMM/src/infopanel.h | 219 +++++ plugins/TabSRMM/src/m_cln_skinedit.h | 147 +++ plugins/TabSRMM/src/mim.cpp | 6 +- plugins/TabSRMM/src/mim.h | 298 ++++++ plugins/TabSRMM/src/modplus.cpp | 2 - plugins/TabSRMM/src/msgdialog.cpp | 10 +- plugins/TabSRMM/src/msgdlgutils.cpp | 50 +- plugins/TabSRMM/src/msgdlgutils.h | 100 ++ plugins/TabSRMM/src/msglog.cpp | 12 +- plugins/TabSRMM/src/msgoptions.cpp | 16 +- plugins/TabSRMM/src/msgoptions_plus.cpp | 6 - plugins/TabSRMM/src/msgs.cpp | 22 +- plugins/TabSRMM/src/msgs.h | 1055 ++++++++++++++++++++ plugins/TabSRMM/src/nen.h | 164 ++++ plugins/TabSRMM/src/resource.h | 798 ++++++++++++++++ plugins/TabSRMM/src/selectcontainer.cpp | 5 +- plugins/TabSRMM/src/sendlater.cpp | 3 - plugins/TabSRMM/src/sendlater.h | 153 +++ plugins/TabSRMM/src/sendqueue.cpp | 11 +- plugins/TabSRMM/src/sendqueue.h | 120 +++ plugins/TabSRMM/src/sidebar.cpp | 6 - plugins/TabSRMM/src/sidebar.h | 237 +++++ plugins/TabSRMM/src/srmm.cpp | 34 +- plugins/TabSRMM/src/tabctrl.cpp | 4 - plugins/TabSRMM/src/taskbar.cpp | 2 - plugins/TabSRMM/src/taskbar.h | 195 ++++ plugins/TabSRMM/src/templates.cpp | 5 +- plugins/TabSRMM/src/templates.h | 47 + plugins/TabSRMM/src/themeio.cpp | 15 +- plugins/TabSRMM/src/themes.cpp | 6 +- plugins/TabSRMM/src/themes.h | 413 ++++++++ plugins/TabSRMM/src/translator.cpp | 2 - plugins/TabSRMM/src/translator.h | 61 ++ plugins/TabSRMM/src/trayicon.cpp | 8 +- plugins/TabSRMM/src/typingnotify.cpp | 2 +- plugins/TabSRMM/src/typingnotify.h | 76 ++ plugins/TabSRMM/src/userprefs.cpp | 10 +- plugins/TabSRMM/src/utils.cpp | 3 - plugins/TabSRMM/src/utils.h | 266 ++++++ plugins/TabSRMM/src/version.h | 14 + plugins/TabSRMM/tabsrmm_10.vcxproj | 116 +-- plugins/TabSRMM/tabsrmm_10.vcxproj.filters | 166 ++-- plugins/TabSRMM/tabsrmm_11.vcxproj | 116 +-- plugins/TabSRMM/tabsrmm_11.vcxproj.filters | 166 ++-- 105 files changed, 6201 insertions(+), 6545 deletions(-) create mode 100644 plugins/TabSRMM/res/Version.rc create mode 100644 plugins/TabSRMM/src/ImageDataObject.h create mode 100644 plugins/TabSRMM/src/buttonbar.h create mode 100644 plugins/TabSRMM/src/contactcache.h create mode 100644 plugins/TabSRMM/src/controls.h create mode 100644 plugins/TabSRMM/src/functions.h create mode 100644 plugins/TabSRMM/src/generic_msghandlers.h create mode 100644 plugins/TabSRMM/src/globals.h delete mode 100644 plugins/TabSRMM/src/include/ImageDataObject.h delete mode 100644 plugins/TabSRMM/src/include/buttonbar.h delete mode 100644 plugins/TabSRMM/src/include/contactcache.h delete mode 100644 plugins/TabSRMM/src/include/controls.h delete mode 100644 plugins/TabSRMM/src/include/functions.h delete mode 100644 plugins/TabSRMM/src/include/generic_msghandlers.h delete mode 100644 plugins/TabSRMM/src/include/globals.h delete mode 100644 plugins/TabSRMM/src/include/infopanel.h delete mode 100644 plugins/TabSRMM/src/include/m_cln_skinedit.h delete mode 100644 plugins/TabSRMM/src/include/mim.h delete mode 100644 plugins/TabSRMM/src/include/msgdlgutils.h delete mode 100644 plugins/TabSRMM/src/include/msgs.h delete mode 100644 plugins/TabSRMM/src/include/nen.h delete mode 100644 plugins/TabSRMM/src/include/resource.h delete mode 100644 plugins/TabSRMM/src/include/sendlater.h delete mode 100644 plugins/TabSRMM/src/include/sendqueue.h delete mode 100644 plugins/TabSRMM/src/include/sidebar.h delete mode 100644 plugins/TabSRMM/src/include/taskbar.h delete mode 100644 plugins/TabSRMM/src/include/templates.h delete mode 100644 plugins/TabSRMM/src/include/themes.h delete mode 100644 plugins/TabSRMM/src/include/translator.h delete mode 100644 plugins/TabSRMM/src/include/typingnotify.h delete mode 100644 plugins/TabSRMM/src/include/utils.h delete mode 100644 plugins/TabSRMM/src/include/version.h create mode 100644 plugins/TabSRMM/src/infopanel.h create mode 100644 plugins/TabSRMM/src/m_cln_skinedit.h create mode 100644 plugins/TabSRMM/src/mim.h create mode 100644 plugins/TabSRMM/src/msgdlgutils.h create mode 100644 plugins/TabSRMM/src/msgs.h create mode 100644 plugins/TabSRMM/src/nen.h create mode 100644 plugins/TabSRMM/src/resource.h create mode 100644 plugins/TabSRMM/src/sendlater.h create mode 100644 plugins/TabSRMM/src/sendqueue.h create mode 100644 plugins/TabSRMM/src/sidebar.h create mode 100644 plugins/TabSRMM/src/taskbar.h create mode 100644 plugins/TabSRMM/src/templates.h create mode 100644 plugins/TabSRMM/src/themes.h create mode 100644 plugins/TabSRMM/src/translator.h create mode 100644 plugins/TabSRMM/src/typingnotify.h create mode 100644 plugins/TabSRMM/src/utils.h create mode 100644 plugins/TabSRMM/src/version.h diff --git a/plugins/TabSRMM/res/Version.rc b/plugins/TabSRMM/res/Version.rc new file mode 100644 index 0000000000..5bfbab4754 --- /dev/null +++ b/plugins/TabSRMM/res/Version.rc @@ -0,0 +1,38 @@ +// Microsoft Visual C++ generated resource script. +// +#ifdef APSTUDIO_INVOKED +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + +#include "afxres.h" +#include "..\src\version.h" + +VS_VERSION_INFO VERSIONINFO + FILEVERSION __FILEVERSION_STRING + PRODUCTVERSION __FILEVERSION_STRING + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x0L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "FileDescription", __DESCRIPTION + VALUE "InternalName", __PLUGIN_NAME + VALUE "LegalCopyright", __COPYRIGHT + VALUE "OriginalFilename", __FILENAME + VALUE "ProductName", __PLUGIN_NAME + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END diff --git a/plugins/TabSRMM/res/chat.rc b/plugins/TabSRMM/res/chat.rc index 6d3860ddff..05dacf3be7 100644 --- a/plugins/TabSRMM/res/chat.rc +++ b/plugins/TabSRMM/res/chat.rc @@ -290,16 +290,6 @@ BEGIN END #endif // APSTUDIO_INVOKED -#endif // Neutral resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// Swedish (Sweden) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE) -LANGUAGE LANG_SWEDISH, SUBLANG_SWEDISH -#pragma code_page(1252) #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// @@ -378,7 +368,7 @@ BEGIN END END -#endif // Swedish (Sweden) resources +#endif // Neutral resources ///////////////////////////////////////////////////////////////////////////// diff --git a/plugins/TabSRMM/res/msgwindow.rc b/plugins/TabSRMM/res/msgwindow.rc index 92d5916abe..99da819627 100644 --- a/plugins/TabSRMM/res/msgwindow.rc +++ b/plugins/TabSRMM/res/msgwindow.rc @@ -1,7 +1,7 @@ // Microsoft Visual C++ generated resource script. // #include -#include "..\src\include\resource.h" +#include "..\src\resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// @@ -9,11 +9,9 @@ // Generated from the TEXTINCLUDE 2 resource. // #define APSTUDIO_HIDDEN_SYMBOLS -#include "windows.h" #include "richedit.h" #undef APSTUDIO_HIDDEN_SYMBOLS #include "..\..\..\include\statusmodes.h" -#include "..\src\include\version.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -56,45 +54,6 @@ BEGIN END -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION _VER_MAJOR,_VER_MINOR,_VER_REVISION,_VER_BUILD - PRODUCTVERSION _VER_MAJOR,_VER_MINOR,_VER_REVISION,_VER_BUILD - FILEFLAGSMASK 0x17L -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "000004b0" - BEGIN - VALUE "CompanyName", "Miranda NG project" - VALUE "FileDescription", RES_FILE_DESC - VALUE "FileVersion", VER_PLAIN - VALUE "InternalName", "TabSRMsg" - VALUE "LegalCopyright", "Copyright (C) 2004-2010" - VALUE "LegalTrademarks", "Licensed under the Gnu general public license V2 or any later version." - VALUE "OriginalFilename", "tabsrmm.dll" - VALUE "ProductName", "TabSRMM message window plugin for Miranda NG" - VALUE "ProductVersion", VER_PLAIN - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0, 1200 - END -END - #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // @@ -103,15 +62,12 @@ END 1 TEXTINCLUDE BEGIN - "..\\src\\include\\resource.h\0" + "..\\src\\resource.h\0" END 2 TEXTINCLUDE BEGIN - "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""windows.h""\r\n" "#include ""richedit.h""\r\n" - "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" "#include ""..\\..\\..\\include\\statusmodes.h""\r\n" "\0" END diff --git a/plugins/TabSRMM/res/resource.rc b/plugins/TabSRMM/res/resource.rc index 7247cce001..1d5f8e539d 100644 --- a/plugins/TabSRMM/res/resource.rc +++ b/plugins/TabSRMM/res/resource.rc @@ -1,13 +1,12 @@ // Microsoft Visual C++ generated resource script. // -#include "..\src\include\resource.h" +#include "..\src\resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // -#include #include #include "..\..\..\include\statusmodes.h" @@ -610,6 +609,91 @@ BEGIN "Button",BS_AUTO3STATE | WS_TABSTOP,15,224,290,11 END +IDD_SENDLATER_QMGR DIALOGEX 0, 0, 484, 258 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Queued send jobs" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "Close",IDOK,391,239,86,14 + CONTROL "",IDC_QMGR_LIST,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,6,33,471,183 + GROUPBOX "Queued jobs",IDC_STATIC,3,24,477,198 + RTEXT "Filter by contact:",IDC_STATIC,9,8,324,12 + COMBOBOX IDC_QMGR_FILTER,345,6,132,15,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "Help on this",IDC_QMGR_HELP,"Hyperlink",WS_TABSTOP,246,240,141,12 + CONTROL "Display popups for failed jobs",IDC_QMGR_ERRORPOPUPS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,228,210,12 + CONTROL "Display popups for completed jobs",IDC_QMGR_SUCCESSPOPUPS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,242,210,12 +END + +IDD_WARNING DIALOGEX 0, 0, 298, 105 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Dialog" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "",IDC_STATIC,0,0,298,76 + CONTROL "Do not show this message again",IDC_DONTSHOWAGAIN, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,77,277,11 + CONTROL "",IDC_WARNTEXT,"RichEdit20W",WS_VSCROLL | 0x1944,36,23,250,51 + ICON "",IDC_WARNICON,6,8,24,24,SS_CENTERIMAGE + LTEXT "Static",IDC_CAPTION,36,5,252,16 + DEFPUSHBUTTON "OK",IDOK,245,88,50,14 + PUSHBUTTON "Cancel",IDCANCEL,241,88,50,14 + PUSHBUTTON "Yes",IDYES,136,88,50,14 + PUSHBUTTON "No",IDNO,189,88,50,14 + CONTROL "",IDC_WARNGROUP,"Static",SS_ENHMETAFILE,0,74,297,2 +END + +IDD_MODERNOPTS DIALOGEX 0, 0, 369, 210 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Message sending:",IDC_TXT_TITLE2,0,64,185,8 + LTEXT "Window:",IDC_TXT_TITLE1,1,0,182,8 + CONTROL "Esc closes sessions (minimizes window, if disabled)",IDC_CLOSEONESC, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,13,174,10 + CONTROL "Always pop up and activate new windows",IDC_ALWAYSPOPUP, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,25,174,10 + CONTROL "Create new windows in minimized state",IDC_CREATEMIN, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,37,174,10 + CONTROL "Check1",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,10,49,174,10 + CONTROL "Send on Shift+Enter",IDC_SENDSHIFTENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,89,174,10 + CONTROL "Send message on Enter",IDC_SENDENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,101,174,10 + CONTROL "Send message on double Enter",IDC_SENDDBLENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,113,174,10 + CONTROL "Minimize the message window on send",IDC_MINSEND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,125,174,10 + LTEXT "Tabs:",IDC_TXT_TITLE4,184,0,183,8 + CONTROL "Use tabbed interface",IDC_USETABS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,13,173,10 + CONTROL "Create new tabs without activating them",IDC_CREATENOACTIVATE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,25,173,10 + CONTROL "Pop up minimized window when a new tab is created",IDC_POPUPONCREATE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,37,173,10 + CONTROL "Automatically switch tabs in minimized windows",IDC_AUTOSWITCHTABS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,49,173,10 + LTEXT "History:",IDC_TXT_TITLE5,1,140,367,8 + CONTROL "Load unread events only",IDC_LOADUNREAD,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,10,153,135,10 + CONTROL "Load number of previous events",IDC_LOADCOUNT,"Button",BS_AUTORADIOBUTTON,10,166,138,10 + CONTROL "Load previous events less than",IDC_LOADTIME,"Button",BS_AUTORADIOBUTTON,10,179,138,10 + CONTROL "Always trim message log to",IDC_ALWAYSTRIM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,192,146,10 + EDITTEXT IDC_LOADCOUNTN,164,164,39,12,ES_RIGHT | ES_NUMBER | WS_DISABLED + CONTROL "",IDC_LOADCOUNTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,203,163,10,14 + EDITTEXT IDC_LOADTIMEN,164,177,39,12,ES_RIGHT | ES_NUMBER | WS_DISABLED + CONTROL "",IDC_LOADTIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK | WS_DISABLED,200,175,10,14 + EDITTEXT IDC_TRIM,164,190,39,12,ES_RIGHT | ES_NUMBER | WS_DISABLED + CONTROL "",IDC_TRIMSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK | WS_DISABLED,200,189,10,14 + LTEXT "Events",IDC_STATIC,215,192,82,8 + LTEXT "minutes old",IDC_STMINSOLD,215,179,83,8,WS_DISABLED + LTEXT "Notifications:",IDC_TXT_TITLE3,184,64,183,8 + CONTROL "Don't announce when dialog is open",IDC_NOOPENNOTIFY, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,77,173,10 + CONTROL "Message events",IDC_NOTIFYMSG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,89,173,10 + CONTROL "File events",IDC_NOTIFYFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,101,173,10 + CONTROL "URL events",IDC_NOTIFYURL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,113,173,10 + CONTROL "Other events",IDC_NOTIFYOTHER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,125,173,10 + CONTROL "Send message on Ctrl+Enter (always enabled)",IDC_SENDCTRLENTER, + "Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,10,77,174,10 +END + ///////////////////////////////////////////////////////////////////////////// // @@ -895,69 +979,7 @@ BEGIN BEGIN BOTTOMMARGIN, 191 END -END -#endif // APSTUDIO_INVOKED - -#endif // Neutral resources -///////////////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////////////////// -// Немецкий (Германия) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) -LANGUAGE LANG_GERMAN, SUBLANG_GERMAN -#pragma code_page(1252) - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_SENDLATER_QMGR DIALOGEX 0, 0, 484, 258 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Queued send jobs" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "Close",IDOK,391,239,86,14 - CONTROL "",IDC_QMGR_LIST,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,6,33,471,183 - GROUPBOX "Queued jobs",IDC_STATIC,3,24,477,198 - RTEXT "Filter by contact:",IDC_STATIC,9,8,324,12 - COMBOBOX IDC_QMGR_FILTER,345,6,132,15,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Help on this",IDC_QMGR_HELP,"Hyperlink",WS_TABSTOP,246,240,141,12 - CONTROL "Display popups for failed jobs",IDC_QMGR_ERRORPOPUPS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,228,210,12 - CONTROL "Display popups for completed jobs",IDC_QMGR_SUCCESSPOPUPS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,242,210,12 -END - -IDD_WARNING DIALOGEX 0, 0, 298, 105 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Dialog" -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "",IDC_STATIC,0,0,298,76 - CONTROL "Do not show this message again",IDC_DONTSHOWAGAIN, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,77,277,11 - CONTROL "",IDC_WARNTEXT,"RichEdit20W",WS_VSCROLL | 0x1944,36,23,250,51 - ICON "",IDC_WARNICON,6,8,24,24,SS_CENTERIMAGE - LTEXT "Static",IDC_CAPTION,36,5,252,16 - DEFPUSHBUTTON "OK",IDOK,245,88,50,14 - PUSHBUTTON "Cancel",IDCANCEL,241,88,50,14 - PUSHBUTTON "Yes",IDYES,136,88,50,14 - PUSHBUTTON "No",IDNO,189,88,50,14 - CONTROL "",IDC_WARNGROUP,"Static",SS_ENHMETAFILE,0,74,297,2 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN IDD_SENDLATER_QMGR, DIALOG BEGIN LEFTMARGIN, 7 @@ -973,84 +995,7 @@ BEGIN TOPMARGIN, 7 BOTTOMMARGIN, 98 END -END -#endif // APSTUDIO_INVOKED - -#endif // Немецкий (Германия) resources -///////////////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////////////////// -// Английский (США) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_MODERNOPTS DIALOGEX 0, 0, 369, 210 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Message sending:",IDC_TXT_TITLE2,0,64,185,8 - LTEXT "Window:",IDC_TXT_TITLE1,1,0,182,8 - CONTROL "Esc closes sessions (minimizes window, if disabled)",IDC_CLOSEONESC, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,13,174,10 - CONTROL "Always pop up and activate new windows",IDC_ALWAYSPOPUP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,25,174,10 - CONTROL "Create new windows in minimized state",IDC_CREATEMIN, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,37,174,10 - CONTROL "Check1",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,10,49,174,10 - CONTROL "Send on Shift+Enter",IDC_SENDSHIFTENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,89,174,10 - CONTROL "Send message on Enter",IDC_SENDENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,101,174,10 - CONTROL "Send message on double Enter",IDC_SENDDBLENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,113,174,10 - CONTROL "Minimize the message window on send",IDC_MINSEND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,125,174,10 - LTEXT "Tabs:",IDC_TXT_TITLE4,184,0,183,8 - CONTROL "Use tabbed interface",IDC_USETABS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,13,173,10 - CONTROL "Create new tabs without activating them",IDC_CREATENOACTIVATE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,25,173,10 - CONTROL "Pop up minimized window when a new tab is created",IDC_POPUPONCREATE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,37,173,10 - CONTROL "Automatically switch tabs in minimized windows",IDC_AUTOSWITCHTABS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,49,173,10 - LTEXT "History:",IDC_TXT_TITLE5,1,140,367,8 - CONTROL "Load unread events only",IDC_LOADUNREAD,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,10,153,135,10 - CONTROL "Load number of previous events",IDC_LOADCOUNT,"Button",BS_AUTORADIOBUTTON,10,166,138,10 - CONTROL "Load previous events less than",IDC_LOADTIME,"Button",BS_AUTORADIOBUTTON,10,179,138,10 - CONTROL "Always trim message log to",IDC_ALWAYSTRIM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,192,146,10 - EDITTEXT IDC_LOADCOUNTN,164,164,39,12,ES_RIGHT | ES_NUMBER | WS_DISABLED - CONTROL "",IDC_LOADCOUNTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,203,163,10,14 - EDITTEXT IDC_LOADTIMEN,164,177,39,12,ES_RIGHT | ES_NUMBER | WS_DISABLED - CONTROL "",IDC_LOADTIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK | WS_DISABLED,200,175,10,14 - EDITTEXT IDC_TRIM,164,190,39,12,ES_RIGHT | ES_NUMBER | WS_DISABLED - CONTROL "",IDC_TRIMSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK | WS_DISABLED,200,189,10,14 - LTEXT "Events",IDC_STATIC,215,192,82,8 - LTEXT "minutes old",IDC_STMINSOLD,215,179,83,8,WS_DISABLED - LTEXT "Notifications:",IDC_TXT_TITLE3,184,64,183,8 - CONTROL "Don't announce when dialog is open",IDC_NOOPENNOTIFY, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,77,173,10 - CONTROL "Message events",IDC_NOTIFYMSG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,89,173,10 - CONTROL "File events",IDC_NOTIFYFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,101,173,10 - CONTROL "URL events",IDC_NOTIFYURL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,113,173,10 - CONTROL "Other events",IDC_NOTIFYOTHER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,125,173,10 - CONTROL "Send message on Ctrl+Enter (always enabled)",IDC_SENDCTRLENTER, - "Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,10,77,174,10 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN IDD_MODERNOPTS, DIALOG BEGIN VERTGUIDE, 10 @@ -1072,16 +1017,14 @@ END 1 TEXTINCLUDE BEGIN - "..\\src\\include\\resource.h\0" + "..\\src\\resource.h\0" END 2 TEXTINCLUDE BEGIN - "#include \r\n" "#include \r\n" "#include ""..\\..\\..\\include\\statusmodes.h""\r\n" - "\r\r\n" - "\r\0" + "\0" END 3 TEXTINCLUDE @@ -1101,7 +1044,7 @@ IDR_SKIN_AERO SKIN_GLYPH "SKIN\\tabskin_aero.png" IDR_SKIN_AERO_GLOW SKIN_GLYPH "SKIN\\tabskin_aero_glow.png" IDR_SKIN_AERO_SWITCHBAR SKIN_GLYPH "SKIN\\tabskin_aero_button.png" IDR_SKIN_LOGO SKIN_GLYPH "SKIN\\unknown.png" -#endif // Английский (США) resources +#endif // Neutral resources ///////////////////////////////////////////////////////////////////////////// diff --git a/plugins/TabSRMM/src/ImageDataObject.cpp b/plugins/TabSRMM/src/ImageDataObject.cpp index 65e8e8d4dd..9d6b6f2ddf 100644 --- a/plugins/TabSRMM/src/ImageDataObject.cpp +++ b/plugins/TabSRMM/src/ImageDataObject.cpp @@ -24,9 +24,6 @@ * * part of tabSRMM messaging plugin for Miranda. * - * * - * $Id: ImageDataObject.cpp 11611 2010-04-22 12:36:29Z silvercircle $ - * * This inserts a bitmap into a rich edit control using OLE * code partially taken from public example on the internet, source unknown. * @@ -35,7 +32,6 @@ */ #include "commonheaders.h" -#include "include\ImageDataObject.h" extern void ReleaseRichEditOle(IRichEditOle *ole) { diff --git a/plugins/TabSRMM/src/ImageDataObject.h b/plugins/TabSRMM/src/ImageDataObject.h new file mode 100644 index 0000000000..2c83b1c27d --- /dev/null +++ b/plugins/TabSRMM/src/ImageDataObject.h @@ -0,0 +1,131 @@ +/* +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. + +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/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp index 0488a3e45e..e32ab00173 100644 --- a/plugins/TabSRMM/src/TSButton.cpp +++ b/plugins/TabSRMM/src/TSButton.cpp @@ -33,7 +33,6 @@ */ #include "commonheaders.h" -#include #define PBS_PUSHDOWNPRESSED 6 diff --git a/plugins/TabSRMM/src/buttonbar.h b/plugins/TabSRMM/src/buttonbar.h new file mode 100644 index 0000000000..9be67e965b --- /dev/null +++ b/plugins/TabSRMM/src/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/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index 4a86c79137..2d05a0a9e1 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -1,5 +1,4 @@ #include "commonheaders.h" -#pragma hdrstop static HANDLE hButtonsBarAddButton; static HANDLE hButtonsBarRemoveButton; @@ -933,127 +932,127 @@ void CB_InitDefaultButtons() bbd.cbSize = sizeof(BBButton); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISARROWBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_PROTOCOL; - bbd.dwDefPos = 10; - bbd.hIcon = LoadSkinnedIconHandle(SKINICON_OTHER_CONNECTING); - bbd.pszModuleName = "Tabsrmm"; - bbd.ptszTooltip = LPGENT("Protocol Button"); - - CB_AddButton(0, (LPARAM)&bbd); - + bbd.dwDefPos = 10; + bbd.hIcon = LoadSkinnedIconHandle(SKINICON_OTHER_CONNECTING); + bbd.pszModuleName = "Tabsrmm"; + bbd.ptszTooltip = LPGENT("Protocol Button"); + + CB_AddButton(0, (LPARAM)&bbd); + bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISARROWBUTTON | BBBF_CREATEBYID; - bbd.dwButtonID = IDC_NAME; - bbd.dwDefPos = 20; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[20]; - bbd.ptszTooltip = LPGENT("Info button"); - - CB_AddButton(0, (LPARAM)&bbd); - + bbd.dwButtonID = IDC_NAME; + bbd.dwDefPos = 20; + bbd.hIcon = PluginConfig.g_buttonBarIconHandles[20]; + bbd.ptszTooltip = LPGENT("Info button"); + + CB_AddButton(0, (LPARAM)&bbd); + if (PluginConfig.g_SmileyAddAvail) { bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_SMILEYBTN; - bbd.iButtonWidth = 0; - bbd.dwDefPos = 30; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[9]; - bbd.ptszTooltip = LPGENT("Insert Emoticon"); - CB_AddButton(0, (LPARAM)&bbd); - } - + bbd.iButtonWidth = 0; + bbd.dwDefPos = 30; + bbd.hIcon = PluginConfig.g_buttonBarIconHandles[9]; + bbd.ptszTooltip = LPGENT("Insert Emoticon"); + CB_AddButton(0, (LPARAM)&bbd); + } + bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; - bbd.dwButtonID = IDC_FONTBOLD; - bbd.dwDefPos = 40; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[10]; - bbd.ptszTooltip = LPGENT("Bold text"); - - CB_AddButton(0, (LPARAM)&bbd); - + bbd.dwButtonID = IDC_FONTBOLD; + bbd.dwDefPos = 40; + bbd.hIcon = PluginConfig.g_buttonBarIconHandles[10]; + bbd.ptszTooltip = LPGENT("Bold text"); + + CB_AddButton(0, (LPARAM)&bbd); + bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; - bbd.dwButtonID = IDC_FONTITALIC; - bbd.dwDefPos = 50; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[11]; - bbd.ptszTooltip = LPGENT("Italic text"); - - CB_AddButton(0, (LPARAM)&bbd); - + bbd.dwButtonID = IDC_FONTITALIC; + bbd.dwDefPos = 50; + bbd.hIcon = PluginConfig.g_buttonBarIconHandles[11]; + bbd.ptszTooltip = LPGENT("Italic text"); + + CB_AddButton(0, (LPARAM)&bbd); + bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; - bbd.dwButtonID = IDC_FONTUNDERLINE; - bbd.dwDefPos = 60; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[12]; - bbd.ptszTooltip = LPGENT("Underlined text"); - - CB_AddButton(0, (LPARAM)&bbd); - + bbd.dwButtonID = IDC_FONTUNDERLINE; + bbd.dwDefPos = 60; + bbd.hIcon = PluginConfig.g_buttonBarIconHandles[12]; + bbd.ptszTooltip = LPGENT("Underlined text"); + + CB_AddButton(0, (LPARAM)&bbd); + bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; - bbd.dwButtonID = IDC_FONTSTRIKEOUT; - bbd.dwDefPos = 70; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[15]; - bbd.ptszTooltip = LPGENT("Strike-through text"); - - CB_AddButton(0, (LPARAM)&bbd); - + bbd.dwButtonID = IDC_FONTSTRIKEOUT; + bbd.dwDefPos = 70; + bbd.hIcon = PluginConfig.g_buttonBarIconHandles[15]; + bbd.ptszTooltip = LPGENT("Strike-through text"); + + CB_AddButton(0, (LPARAM)&bbd); + bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; - bbd.dwButtonID = IDC_FONTFACE; - bbd.dwDefPos = 80; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[14]; - bbd.ptszTooltip = LPGENT("Select font color"); - - CB_AddButton(0, (LPARAM)&bbd); - + bbd.dwButtonID = IDC_FONTFACE; + bbd.dwDefPos = 80; + bbd.hIcon = PluginConfig.g_buttonBarIconHandles[14]; + bbd.ptszTooltip = LPGENT("Select font color"); + + CB_AddButton(0, (LPARAM)&bbd); + bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_ISARROWBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDOK; - bbd.dwDefPos = 10; - bbd.iButtonWidth = 51; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[6]; - bbd.ptszTooltip = LPGENT("Send message\nClick dropdown arrow for sending options"); - - CB_AddButton(0, (LPARAM)&bbd); - + bbd.dwDefPos = 10; + bbd.iButtonWidth = 51; + bbd.hIcon = PluginConfig.g_buttonBarIconHandles[6]; + bbd.ptszTooltip = LPGENT("Send message\nClick dropdown arrow for sending options"); + + CB_AddButton(0, (LPARAM)&bbd); + bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_SAVE; - bbd.dwDefPos = 20; - bbd.iButtonWidth = 0; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[8]; - bbd.ptszTooltip = LPGENT("Close session"); - - CB_AddButton(0, (LPARAM)&bbd); - + bbd.dwDefPos = 20; + bbd.iButtonWidth = 0; + bbd.hIcon = PluginConfig.g_buttonBarIconHandles[8]; + bbd.ptszTooltip = LPGENT("Close session"); + + CB_AddButton(0, (LPARAM)&bbd); + bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_QUOTE; - bbd.dwDefPos = 30; - bbd.iButtonWidth = 0; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[4]; - bbd.ptszTooltip = LPGENT("Quote last message OR selected text"); - - CB_AddButton(0, (LPARAM)&bbd); - + bbd.dwDefPos = 30; + bbd.iButtonWidth = 0; + bbd.hIcon = PluginConfig.g_buttonBarIconHandles[4]; + bbd.ptszTooltip = LPGENT("Quote last message OR selected text"); + + CB_AddButton(0, (LPARAM)&bbd); + bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_TIME; - bbd.dwDefPos = 40; - bbd.iButtonWidth = 0; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[2]; - bbd.ptszTooltip = LPGENT("Message Log Options"); - - CB_AddButton(0, (LPARAM)&bbd); - + bbd.dwDefPos = 40; + bbd.iButtonWidth = 0; + bbd.hIcon = PluginConfig.g_buttonBarIconHandles[2]; + bbd.ptszTooltip = LPGENT("Message Log Options"); + + CB_AddButton(0, (LPARAM)&bbd); + bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_HISTORY; - bbd.dwDefPos = 50; - bbd.iButtonWidth = 0; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[0]; - bbd.ptszTooltip = LPGENT("View User's History"); - - CB_AddButton(0, (LPARAM)&bbd); - + bbd.dwDefPos = 50; + bbd.iButtonWidth = 0; + bbd.hIcon = PluginConfig.g_buttonBarIconHandles[0]; + bbd.ptszTooltip = LPGENT("View User's History"); + + CB_AddButton(0, (LPARAM)&bbd); + bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_PIC; - bbd.dwDefPos = 60; - bbd.iButtonWidth = 0; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[7]; - bbd.ptszTooltip = LPGENT("Edit user notes"); - - CB_AddButton(0, (LPARAM)&bbd); - + bbd.dwDefPos = 60; + bbd.iButtonWidth = 0; + bbd.hIcon = PluginConfig.g_buttonBarIconHandles[7]; + bbd.ptszTooltip = LPGENT("Edit user notes"); + + CB_AddButton(0, (LPARAM)&bbd); + //chat buttons bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISDUMMYBUTTON; @@ -1088,41 +1087,41 @@ void CB_InitDefaultButtons() bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISPUSHBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_BKGCOLOR; bbd.pszModuleName = "Tabsrmm"; - bbd.dwDefPos = 81; - bbd.iButtonWidth = 22; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[16]; - bbd.ptszTooltip = LPGENT("Change background color"); - - CB_AddButton(0, (LPARAM)&bbd); - // + bbd.dwDefPos = 81; + bbd.iButtonWidth = 22; + bbd.hIcon = PluginConfig.g_buttonBarIconHandles[16]; + bbd.ptszTooltip = LPGENT("Change background color"); + + CB_AddButton(0, (LPARAM)&bbd); + // bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_SHOWNICKLIST; - bbd.dwDefPos = 22; - bbd.iButtonWidth = 22; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[19]; - bbd.ptszTooltip = LPGENT("Toggle nick list"); - - CB_AddButton(0, (LPARAM)&bbd); - + bbd.dwDefPos = 22; + bbd.iButtonWidth = 22; + bbd.hIcon = PluginConfig.g_buttonBarIconHandles[19]; + bbd.ptszTooltip = LPGENT("Toggle nick list"); + + CB_AddButton(0, (LPARAM)&bbd); + bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_FILTER; - bbd.dwDefPos = 24; - bbd.iButtonWidth = 22; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[18]; - bbd.ptszTooltip = LPGENT("Event filter - right click to setup, left click to activate/deactivate"); - - CB_AddButton(0, (LPARAM)&bbd); - + bbd.dwDefPos = 24; + bbd.iButtonWidth = 22; + bbd.hIcon = PluginConfig.g_buttonBarIconHandles[18]; + bbd.ptszTooltip = LPGENT("Event filter - right click to setup, left click to activate/deactivate"); + + CB_AddButton(0, (LPARAM)&bbd); + bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_CHANMGR; - bbd.dwDefPos = 33; - bbd.iButtonWidth = 22; - bbd.hIcon = PluginConfig.g_buttonBarIconHandles[17]; - bbd.ptszTooltip = LPGENT("Channel manager"); - - CB_AddButton(0, (LPARAM)&bbd); - + bbd.dwDefPos = 33; + bbd.iButtonWidth = 22; + bbd.hIcon = PluginConfig.g_buttonBarIconHandles[17]; + bbd.ptszTooltip = LPGENT("Channel manager"); + + CB_AddButton(0, (LPARAM)&bbd); + BB_RegisterSeparators(); } @@ -1231,13 +1230,13 @@ static int BuildMenuObjectsTree(HWND hToolBarTree) for (i=0; i < LButtonsList->realCount; i++) { CustomButtonData * cbd = (CustomButtonData *)LButtonsList->items[i]; - tvis.item.lParam = (LPARAM)cbd; - - if (cbd->bDummy) { - tvis.item.pszText = TranslateT(""); - tvis.item.iImage = tvis.item.iSelectedImage = 0; - } else { - tvis.item.pszText = TranslateTS(cbd->ptszTooltip); + tvis.item.lParam = (LPARAM)cbd; + + if (cbd->bDummy) { + tvis.item.pszText = TranslateT(""); + tvis.item.iImage = tvis.item.iSelectedImage = 0; + } else { + tvis.item.pszText = TranslateTS(cbd->ptszTooltip); iImage = ImageList_AddIcon(himgl, Skin_GetIconByHandle(cbd->hIcon)); tvis.item.iImage = tvis.item.iSelectedImage = iImage; } @@ -1261,13 +1260,13 @@ static int BuildMenuObjectsTree(HWND hToolBarTree) for (i = RButtonsList->realCount; i > 0; i--) { CustomButtonData * cbd = (CustomButtonData *)RButtonsList->items[i-1]; - tvis.item.lParam = (LPARAM)cbd; - - if (cbd->bDummy) { - tvis.item.pszText = TranslateT(""); - tvis.item.iImage = tvis.item.iSelectedImage = -1; - } else { - tvis.item.pszText = TranslateTS(cbd->ptszTooltip); + tvis.item.lParam = (LPARAM)cbd; + + if (cbd->bDummy) { + tvis.item.pszText = TranslateT(""); + tvis.item.iImage = tvis.item.iSelectedImage = -1; + } else { + tvis.item.pszText = TranslateTS(cbd->ptszTooltip); iImage = ImageList_AddIcon(himgl, Skin_GetIconByHandle(cbd->hIcon)); tvis.item.iImage = tvis.item.iSelectedImage = iImage; } @@ -1421,13 +1420,13 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l List_InsertPtr(LButtonsList, cbd); tvis.hParent = NULL; - tvis.hInsertAfter = hti; - tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE; - - tvis.item.pszText = TranslateT(""); - tvis.item.iImage = tvis.item.iSelectedImage = -1; - tvis.item.lParam = (LPARAM)cbd; - + tvis.hInsertAfter = hti; + tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE; + + tvis.item.pszText = TranslateT(""); + tvis.item.iImage = tvis.item.iSelectedImage = -1; + tvis.item.lParam = (LPARAM)cbd; + hti = TreeView_InsertItem(hToolBarTree, &tvis); TreeView_SetCheckState(hToolBarTree, hti, (cbd->bIMButton || cbd->bChatButton)); diff --git a/plugins/TabSRMM/src/chat/chat.h b/plugins/TabSRMM/src/chat/chat.h index 97224cef53..12fa5bb75d 100644 --- a/plugins/TabSRMM/src/chat/chat.h +++ b/plugins/TabSRMM/src/chat/chat.h @@ -30,20 +30,11 @@ * * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: chat.h 12272 2010-08-04 08:24:08Z silvercircle $ - * */ #ifndef _CHAT_H_ #define _CHAT_H_ -#pragma warning( disable : 4786 ) // limitation in MSVC's debugger. -#pragma warning( disable : 4996 ) // limitation in MSVC's debugger. - -#define WIN32_LEAN_AND_MEAN - -#include "m_stdhdr.h" - //defines #define OPTIONS_FONTCOUNT 20 #define GC_UPDATETITLE (WM_USER+100) diff --git a/plugins/TabSRMM/src/chat/chatprototypes.h b/plugins/TabSRMM/src/chat/chatprototypes.h index c304b38cec..4f682ce6b4 100644 --- a/plugins/TabSRMM/src/chat/chatprototypes.h +++ b/plugins/TabSRMM/src/chat/chatprototypes.h @@ -16,9 +16,6 @@ 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: chatprototypes.h 13184 2010-12-07 14:16:58Z silvercircle $ - */ void LoadIcons(void); diff --git a/plugins/TabSRMM/src/chat/clist.cpp b/plugins/TabSRMM/src/chat/clist.cpp index d3714fc820..d465202497 100644 --- a/plugins/TabSRMM/src/chat/clist.cpp +++ b/plugins/TabSRMM/src/chat/clist.cpp @@ -26,8 +26,6 @@ contacts and handle default action for such contacts. This code was taken in almost unmodified from from the chat.dll plugin, originally written by Jцrgen Persson -$Id: clist.c 10402 2009-07-24 00:35:21Z silvercircle $ - */ /* @@ -38,8 +36,6 @@ $Id: clist.c 10402 2009-07-24 00:35:21Z silvercircle $ char *szChatIconString = "chaticon"; -extern HANDLE hJoinMenuItem, hLeaveMenuItem; - static HANDLE Clist_GroupExists(TCHAR *tszGroup) { unsigned int i = 0; diff --git a/plugins/TabSRMM/src/chat/colorchooser.cpp b/plugins/TabSRMM/src/chat/colorchooser.cpp index 2bf8b4ded2..53a0ae67cc 100644 --- a/plugins/TabSRMM/src/chat/colorchooser.cpp +++ b/plugins/TabSRMM/src/chat/colorchooser.cpp @@ -30,14 +30,11 @@ * original chat module for Miranda NG, written and copyrighted * by Joergen Persson in 2005. * - * $Id: colorchooser.cpp 10670 2009-09-11 03:28:50Z silvercircle $ - * * Color chooser for group chats * */ #include "..\commonheaders.h" -#include static int CalculateCoordinatesToButton(COLORCHOOSER * pCC, POINT pt) { diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index 9aa450af3d..cf58bec369 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -30,25 +30,18 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: log.cpp 13614 2011-04-22 13:16:21Z borkra $ - * * Implements the richedit-based message history display for the group * chat window. * */ #include "..\commonheaders.h" -#include -#include /* * The code for streaming the text is to a large extent copied from * the srmm module and then modified to fit the chat module. */ -extern FONTINFO aFonts[OPTIONS_FONTCOUNT]; -extern HICON hIcons[30]; - static PBYTE pLogIconBmpBits[14]; static int logIconBmpSize[ SIZEOF(pLogIconBmpBits)]; diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp index 56489a2fc9..1e8919e8c0 100644 --- a/plugins/TabSRMM/src/chat/main.cpp +++ b/plugins/TabSRMM/src/chat/main.cpp @@ -30,8 +30,6 @@ * * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: main.cpp 13132 2010-11-17 03:47:44Z silvercircle $ - * * chat module exports and functions to load/unload the plugin. * */ diff --git a/plugins/TabSRMM/src/chat/manager.cpp b/plugins/TabSRMM/src/chat/manager.cpp index e8a203a470..090f4ce119 100644 --- a/plugins/TabSRMM/src/chat/manager.cpp +++ b/plugins/TabSRMM/src/chat/manager.cpp @@ -19,24 +19,16 @@ 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: manager.cpp 14208 2012-03-26 13:56:42Z silvercircle $ */ #include "..\commonheaders.h" -extern TCHAR *pszActiveWndID ; -extern char *pszActiveWndModule ; -extern HICON hIcons[30]; - #define WINDOWS_COMMANDS_MAX 30 #define STATUSICONCOUNT 6 SESSION_INFO *m_WndList = 0; MODULEINFO *m_ModList = 0; -extern CRITICAL_SECTION cs; - void SetActiveSession(const TCHAR* pszID, const char* pszModule) { SESSION_INFO* si = SM_FindSession(pszID, pszModule); diff --git a/plugins/TabSRMM/src/chat/message.cpp b/plugins/TabSRMM/src/chat/message.cpp index 5fb99a38c4..0b6e0b00a4 100644 --- a/plugins/TabSRMM/src/chat/message.cpp +++ b/plugins/TabSRMM/src/chat/message.cpp @@ -19,12 +19,9 @@ 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: message.c 10402 2009-07-24 00:35:21Z silvercircle $ */ #include "..\commonheaders.h" -#include static int RTFColorToIndex(int *pIndex, int iCol, SESSION_INFO* si) { diff --git a/plugins/TabSRMM/src/chat/muchighlight.cpp b/plugins/TabSRMM/src/chat/muchighlight.cpp index 36bf980b3c..935d2e38d4 100644 --- a/plugins/TabSRMM/src/chat/muchighlight.cpp +++ b/plugins/TabSRMM/src/chat/muchighlight.cpp @@ -26,16 +26,12 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: muchighlight.cpp 13184 2010-12-07 14:16:58Z silvercircle $ - * * highlighter class for multi user chats * */ #include "..\commonheaders.h" -//#define __HLT_PERFSTATS 0 - void CMUCHighlight::cleanup() { if (m_NickPatternString) diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index 5057f53ab7..d74e321c5d 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -30,21 +30,12 @@ * * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: options.cpp 13412 2011-03-08 19:13:11Z george.hazan $ - * * group chat options and generic font handling * */ #include "..\commonheaders.h" -extern HBRUSH hListBkgBrush; -extern HICON hIcons[30]; -extern FONTINFO aFonts[OPTIONS_FONTCOUNT]; -extern HMODULE g_hIconDLL; - -extern HIMAGELIST CreateStateImageList(); - #define FONTF_BOLD 1 #define FONTF_ITALIC 2 diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp index 9219d730f2..ed4907467a 100644 --- a/plugins/TabSRMM/src/chat/services.cpp +++ b/plugins/TabSRMM/src/chat/services.cpp @@ -30,17 +30,12 @@ * * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: services.cpp 13046 2010-10-28 10:02:50Z silvercircle $ - * * This implements the services that form the group chat API * */ #include "..\commonheaders.h" -// defs -extern HICON hIcons[30]; - CRITICAL_SECTION cs; HANDLE hSendEvent; @@ -454,9 +449,9 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT TCHAR newcontactname[128]; if ( lstrlen(contactName) > 0) { if (M->GetByte("cuttitle", 0)) - CutContactName(contactName, newcontactname, safe_sizeof(newcontactname)); + CutContactName(contactName, newcontactname, SIZEOF(newcontactname)); else { - lstrcpyn(newcontactname, contactName, safe_sizeof(newcontactname)); + lstrcpyn(newcontactname, contactName, SIZEOF(newcontactname)); newcontactname[127] = 0; } } diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index dfe7071225..e6576b39e9 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -30,21 +30,12 @@ * * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: tools.cpp 13650 2011-05-30 11:53:13Z silvercircle@gmail.com $ - * * Helper functions for the group chat module. * */ #include "..\commonheaders.h" -// externs -extern HICON hIcons[30]; -extern FONTINFO aFonts[OPTIONS_FONTCOUNT]; -extern HMENU g_hMenu; -extern HANDLE hBuildMenuEvent ; -extern HANDLE hSendEvent; - int GetRichTextLength(HWND hwnd) { GETTEXTLENGTHEX gtl; diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 17c8f5580a..ed591ba6d1 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -30,15 +30,12 @@ * * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: window.cpp 13631 2011-04-24 08:44:57Z silvercircle $ - * * This implements the group chat dialog window * */ #include "..\commonheaders.h" -#include //#include "../m_MathModule.h" @@ -2118,9 +2115,9 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (lstrlen(szNick) > 0) { if (M->GetByte("cuttitle", 0)) - CutContactName(szNick, dat->newtitle, safe_sizeof(dat->newtitle)); + CutContactName(szNick, dat->newtitle, SIZEOF(dat->newtitle)); else { - lstrcpyn(dat->newtitle, szNick, safe_sizeof(dat->newtitle)); + lstrcpyn(dat->newtitle, szNick, SIZEOF(dat->newtitle)); dat->newtitle[129] = 0; } } diff --git a/plugins/TabSRMM/src/commonheaders.h b/plugins/TabSRMM/src/commonheaders.h index 83ccf13448..ab646524f8 100644 --- a/plugins/TabSRMM/src/commonheaders.h +++ b/plugins/TabSRMM/src/commonheaders.h @@ -26,8 +26,6 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: commonheaders.h 13596 2011-04-15 19:07:23Z george.hazan $ - * * global include file, used to build the precompiled header. * */ @@ -36,15 +34,6 @@ #ifndef __COMMONHEADERS_H #define __COMMONHEADERS_H -#define _UNICODE 1 - -//#define __LOGDEBUG_ 1 // log some stuff to %profile_dir%/tabsrmm_debug.log -//#define __FEAT_DEPRECATED_DYNAMICSWITCHLOGVIEWER 1 - -//#define __USE_EX_HANDLERS 1 - -// #define __DELAYED_FOR_3_1 1 // features not going into 3.0.x and will be completed later - #if !defined __DELAYED_FOR_3_1 #define __FEAT_EXP_AUTOSPLITTER 1 #endif @@ -54,64 +43,146 @@ #define _WIN32_IE 0x0501 #define WIN32_LEAN_AND_MEAN -#define MIRANDA_VER 0x0A00 - -#include - #include -#include #include #include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define TSAPI __stdcall #define FASTCALL __fastcall - /* - * text shadow types (DrawThemeTextEx() / Vista+ uxtheme) - */ - #define TST_NONE 0 - #define TST_SINGLE 1 - #define TST_CONTINUOUS 2 +typedef HANDLE HTHUMBNAIL; +typedef HTHUMBNAIL* PHTHUMBNAIL; + +typedef struct _DWM_BLURBEHIND +{ + DWORD dwFlags; + BOOL fEnable; + HRGN hRgnBlur; + BOOL fTransitionOnMaximized; +} DWM_BLURBEHIND, *PDWM_BLURBEHIND; + +typedef struct _DWM_THUMBNAIL_PROPERTIES +{ + DWORD dwFlags; + RECT rcDestination; + RECT rcSource; + BYTE opacity; + BOOL fVisible; + BOOL fSourceClientAreaOnly; +} DWM_THUMBNAIL_PROPERTIES, *PDWM_THUMBNAIL_PROPERTIES; + +#include "m_cln_skinedit.h" + +#include "resource.h" +#include "version.h" +#include "buttonbar.h" +#include "msgs.h" +#include "msgdlgutils.h" +#include "typingnotify.h" +#include "generic_msghandlers.h" +#include "nen.h" +#include "functions.h" +#include "chat/chat.h" +#include "contactcache.h" +#include "translator.h" +#include "themes.h" +#include "globals.h" +#include "mim.h" +#include "sendqueue.h" +#include "taskbar.h" +#include "controls.h" +#include "infopanel.h" +#include "sidebar.h" +#include "utils.h" +#include "sendlater.h" +#include "ImageDataObject.h" +#include "chat/muchighlight.h" + + +/* +* text shadow types (DrawThemeTextEx() / Vista+ uxtheme) +*/ +#define TST_NONE 0 +#define TST_SINGLE 1 +#define TST_CONTINUOUS 2 + +enum DWMWINDOWATTRIBUTE +{ + DWMWA_NCRENDERING_ENABLED = 1, // [get] Is non-client rendering enabled/disabled + DWMWA_NCRENDERING_POLICY, // [set] Non-client rendering policy + DWMWA_TRANSITIONS_FORCEDISABLED, // [set] Potentially enable/forcibly disable transitions + DWMWA_ALLOW_NCPAINT, // [set] Allow contents rendered in the non-client area to be visible on the DWM-drawn frame. + DWMWA_CAPTION_BUTTON_BOUNDS, // [get] Bounds of the caption button area in window-relative space. + DWMWA_NONCLIENT_RTL_LAYOUT, // [set] Is non-client content RTL mirrored + DWMWA_FORCE_ICONIC_REPRESENTATION, // [set] Force this window to display iconic thumbnails. + DWMWA_FLIP3D_POLICY, // [set] Designates how Flip3D will treat the window. + DWMWA_EXTENDED_FRAME_BOUNDS, // [get] Gets the extended frame bounds rectangle in screen space + DWMWA_HAS_ICONIC_BITMAP, // [set] Indicates an available bitmap when there is no better thumbnail representation. + DWMWA_DISALLOW_PEEK, // [set] Don't invoke Peek on the window. + DWMWA_EXCLUDED_FROM_PEEK, // [set] LivePreview exclusion information + DWMWA_LAST +}; + +#define DWM_TNP_RECTDESTINATION 0x00000001 +#define DWM_TNP_RECTSOURCE 0x00000002 +#define DWM_TNP_OPACITY 0x00000004 +#define DWM_TNP_VISIBLE 0x00000008 +#define DWM_TNP_SOURCECLIENTAREAONLY 0x00000010 + +#define DWM_SIT_DISPLAYFRAME 0x00000001 // Display a window frame around the provided bitmap - typedef struct _DWM_THUMBNAIL_PROPERTIES - { - DWORD dwFlags; - RECT rcDestination; - RECT rcSource; - BYTE opacity; - BOOL fVisible; - BOOL fSourceClientAreaOnly; - } DWM_THUMBNAIL_PROPERTIES, *PDWM_THUMBNAIL_PROPERTIES; - - enum DWMWINDOWATTRIBUTE - { - DWMWA_NCRENDERING_ENABLED = 1, // [get] Is non-client rendering enabled/disabled - DWMWA_NCRENDERING_POLICY, // [set] Non-client rendering policy - DWMWA_TRANSITIONS_FORCEDISABLED, // [set] Potentially enable/forcibly disable transitions - DWMWA_ALLOW_NCPAINT, // [set] Allow contents rendered in the non-client area to be visible on the DWM-drawn frame. - DWMWA_CAPTION_BUTTON_BOUNDS, // [get] Bounds of the caption button area in window-relative space. - DWMWA_NONCLIENT_RTL_LAYOUT, // [set] Is non-client content RTL mirrored - DWMWA_FORCE_ICONIC_REPRESENTATION, // [set] Force this window to display iconic thumbnails. - DWMWA_FLIP3D_POLICY, // [set] Designates how Flip3D will treat the window. - DWMWA_EXTENDED_FRAME_BOUNDS, // [get] Gets the extended frame bounds rectangle in screen space - DWMWA_HAS_ICONIC_BITMAP, // [set] Indicates an available bitmap when there is no better thumbnail representation. - DWMWA_DISALLOW_PEEK, // [set] Don't invoke Peek on the window. - DWMWA_EXCLUDED_FROM_PEEK, // [set] LivePreview exclusion information - DWMWA_LAST - }; - - #define DWM_TNP_RECTDESTINATION 0x00000001 - #define DWM_TNP_RECTSOURCE 0x00000002 - #define DWM_TNP_OPACITY 0x00000004 - #define DWM_TNP_VISIBLE 0x00000008 - #define DWM_TNP_SOURCECLIENTAREAONLY 0x00000010 - - #define DWM_SIT_DISPLAYFRAME 0x00000001 // Display a window frame around the provided bitmap - - typedef HANDLE HTHUMBNAIL; - typedef HTHUMBNAIL* PHTHUMBNAIL; #ifndef BPPF_ERASE typedef enum _BP_BUFFERFORMAT @@ -136,15 +207,8 @@ #define BPPF_NONCLIENT 4 #endif - typedef struct _DWM_BLURBEHIND - { - DWORD dwFlags; - BOOL fEnable; - HRGN hRgnBlur; - BOOL fTransitionOnMaximized; - } DWM_BLURBEHIND, *PDWM_BLURBEHIND; - #define DWM_BB_ENABLE 1 +#define DWM_BB_ENABLE 1 #ifndef LOCALE_SISO3166CTRYNAME2 #define LOCALE_SISO3166CTRYNAME2 0x00000068 // 3 character ISO country name, eg "USA Vista+ @@ -161,95 +225,10 @@ #define WM_DWMSENDICONICLIVEPREVIEWBITMAP 0x0326 #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "include/resource.h" /* State of icon with such flag will not be saved, and you must set it manually */ #define MBF_OWNERSTATE 0x04 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define safe_sizeof(a) (unsigned int)((sizeof((a)) / sizeof((a)[0]))) - -#include "include/version.h" -#include "m_ieview.h" -#include "m_popup2.h" -#include "m_metacontacts.h" -#include "m_fingerprint.h" -#include "m_nudge.h" -#include "m_folders.h" -#include "m_msg_buttonsbar.h" -#include "m_flash.h" -#include "m_spellchecker.h" -#include "m_mathmodule.h" -#include "m_historyevents.h" -#include "m_smileyadd.h" - -#include "include/m_cln_skinedit.h" -#include "include/buttonbar.h" -#include "include/msgs.h" -#include "include/msgdlgutils.h" -#include "include/typingnotify.h" -#include "include/generic_msghandlers.h" -#include "include/nen.h" -extern NEN_OPTIONS nen_options; -#include "include/functions.h" -#include "chat/chat.h" - -#include "include/contactcache.h" -#include "include/translator.h" -#include "include/themes.h" -#include "include/globals.h" -#include "include/mim.h" -#include "include/sendqueue.h" -#include "include/taskbar.h" -#include "include/controls.h" -#include "include/infopanel.h" -#include "include/sidebar.h" -#include "include/utils.h" -#include "include/sendlater.h" - -#include "chat/muchighlight.h" #if !defined(_WIN64) && !defined(_USE_32BIT_TIME_T) #define _USE_32BIT_TIME_T @@ -257,32 +236,72 @@ extern NEN_OPTIONS nen_options; #undef _USE_32BIT_TIME_T #endif -#if defined(__GNUWIN32__) - #define wEffects wReserved -#endif - -#if defined(__GNUG__) -#define __except(x) if (x) -#define __try -#define __finally - -EXCEPTION_POINTERS* GetExceptionInformation() -{ - EXCEPTION_POINTERS e; - return(&e); -} -#endif - /* - * tchar-like std::string - */ - +* tchar-like std::string +*/ typedef std::basic_string tstring; -extern HINSTANCE g_hInst; +extern NEN_OPTIONS nen_options; +extern HINSTANCE g_hInst; extern CSkinItem SkinItems[]; extern TContainerData *pFirstContainer, *pLastActiveContainer; extern HANDLE hTypingNotify; +extern SESSION_INFO *m_WndList; +extern ButtonSet g_ButtonSet; +extern int status_icon_list_size; +extern TStatusBarIconNode *status_icon_list; +extern HANDLE g_hEvent; +extern RECT rcLastStatusBarClick; +extern PLUGININFOEX pluginInfo; +extern HICON hIcons[]; +extern TTemplateSet RTL_Active, LTR_Active; +extern LOGFONTA logfonts[MSGDLGFONTCOUNT + 2]; +extern COLORREF fontcolors[MSGDLGFONTCOUNT + 2]; +extern HINSTANCE hinstance; +extern BOOL g_bIMGtagButton; +extern HIMAGELIST g_himlOptions; +extern HANDLE hHookToolBarLoadedEvt; +extern struct TLogIcon msgLogIcons[NR_LOGICONS * 3]; +extern const TCHAR *pszIDCSAVE_save, *pszIDCSAVE_close; +extern char *TemplateNames[]; +extern HANDLE hUserPrefsWindowList; +extern struct TCpTable cpTable[]; +extern HANDLE hJoinMenuItem, hLeaveMenuItem; +extern FONTINFO aFonts[OPTIONS_FONTCOUNT]; +extern TCHAR *pszActiveWndID; +extern char *pszActiveWndModule; +extern CRITICAL_SECTION cs; +extern HBRUSH hListBkgBrush; +extern HMODULE g_hIconDLL; +extern HMENU g_hMenu; +extern HANDLE hBuildMenuEvent; +extern HANDLE hSendEvent; + +extern int LoadSendRecvMessageModule(void); +extern int SplitmsgShutdown(void); +extern void LogErrorMessage(HWND hwndDlg, struct TWindowData *dat, int i, TCHAR *szMsg); +extern int Chat_Load(), Chat_Unload(); +extern void FreeLogFonts(); +extern INT_PTR CALLBACK DlgProcSetupStatusModes(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +extern HIMAGELIST CreateStateImageList(); +extern INT_PTR SendMessageCommand(WPARAM wParam, LPARAM lParam); +extern INT_PTR SendMessageCommand_W(WPARAM wParam, LPARAM lParam); +extern void ReleaseRichEditOle(IRichEditOle *ole); +extern void ImageDataInsertBitmap(IRichEditOle *ole, HBITMAP hBm); +extern int CacheIconToBMP(struct TLogIcon *theIcon, HICON hIcon, COLORREF backgroundColor, int sizeX, int sizeY); +extern void DeleteCachedIcon(struct TLogIcon *theIcon); +extern INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK DlgProcTabConfig(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK PlusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +extern INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +extern int TSAPI TBStateConvert2Flat(int state); +extern int TSAPI RBStateConvert2Flat(int state); +extern void TSAPI FillTabBackground(const HDC hdc, int iStateId, const TWindowData* dat, RECT* rc); #define IS_EXTKEY(a) (a & (1 << 24)) diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 046ed7377e..8a1b014c54 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -26,8 +26,6 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: contactcache.cpp 13336 2011-01-27 20:02:17Z george.hazan $ - * * contact cache implementation * * the contact cache provides various services to the message window(s) @@ -207,11 +205,11 @@ bool CContactCache::updateUIN() if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci)) { switch (ci.type) { case CNFT_ASCIIZ: - mir_sntprintf(m_szUIN, safe_sizeof(m_szUIN), _T("%s"), reinterpret_cast(ci.pszVal)); + mir_sntprintf(m_szUIN, SIZEOF(m_szUIN), _T("%s"), reinterpret_cast(ci.pszVal)); mir_free((void*)ci.pszVal); break; case CNFT_DWORD: - mir_sntprintf(m_szUIN, safe_sizeof(m_szUIN), _T("%u"), ci.dVal); + mir_sntprintf(m_szUIN, SIZEOF(m_szUIN), _T("%u"), ci.dVal); break; default: m_szUIN[0] = 0; diff --git a/plugins/TabSRMM/src/contactcache.h b/plugins/TabSRMM/src/contactcache.h new file mode 100644 index 0000000000..ab166e6b3c --- /dev/null +++ b/plugins/TabSRMM/src/contactcache.h @@ -0,0 +1,165 @@ +/* + * 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 + * + * 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/container.cpp b/plugins/TabSRMM/src/container.cpp index f1a3aa3ade..434ba36676 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -26,18 +26,12 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: container.cpp 13447 2011-03-14 19:55:07Z george.hazan $ - * * implements the "Container" window which acts as a toplevel window * for message sessions. * */ #include "commonheaders.h" -#pragma hdrstop - -extern SESSION_INFO* m_WndList; -extern ButtonSet g_ButtonSet; TContainerData *pFirstContainer = 0; // the linked list of struct ContainerWindowData TContainerData *pLastActiveContainer = NULL; @@ -2675,7 +2669,7 @@ HMENU TSAPI BuildMCProtocolMenu(HWND hwndDlg) { wStatus = (WORD)DBGetContactSettingWord(dat->hContact, PluginConfig.szMetaName, szTemp, 0); szStatusText = (TCHAR *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, wStatus, GSMDF_TCHAR); } - mir_sntprintf(szMenuLine, safe_sizeof(szMenuLine), _T("%s: %s [%s] %s"), acc->tszAccountName, nick, szStatusText, + mir_sntprintf(szMenuLine, SIZEOF(szMenuLine), _T("%s: %s [%s] %s"), acc->tszAccountName, nick, szStatusText, i == isForced ? TranslateT("(Forced)") : _T("")); iChecked = MF_UNCHECKED; if (hContactMostOnline != 0 && hContactMostOnline == handle) diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp index 48ce593a44..17b7a84fb0 100644 --- a/plugins/TabSRMM/src/containeroptions.cpp +++ b/plugins/TabSRMM/src/containeroptions.cpp @@ -26,14 +26,11 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: containeroptions.cpp 13631 2011-04-24 08:44:57Z silvercircle $ - * * The dialog to customize per container options * */ #include "commonheaders.h" -#pragma hdrstop static void MY_CheckDlgButton(HWND hWnd, UINT id, int iCheck) { diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index 1cad737eb4..07d0bc117d 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -26,17 +26,13 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: controls.cpp 13587 2011-04-12 13:54:26Z george.hazan $ - * * Menu and status bar control(s) for the container window. * */ #include "commonheaders.h" -static WNDPROC OldStatusBarproc = 0; -extern int status_icon_list_size; -extern TStatusBarIconNode *status_icon_list; +static WNDPROC OldStatusBarproc = 0; bool CMenuBar::m_buttonsInit = false; HHOOK CMenuBar::m_hHook = 0; @@ -1080,7 +1076,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR if ((int)iconNum == list_icons && pContainer) { TCHAR wBuf[512]; - mir_sntprintf(wBuf, safe_sizeof(wBuf), TranslateT("Sounds are %s. Click to toggle status, hold SHIFT and click to set for all open containers"), + mir_sntprintf(wBuf, SIZEOF(wBuf), TranslateT("Sounds are %s. Click to toggle status, hold SHIFT and click to set for all open containers"), pContainer->dwFlags & CNT_NOSOUND ? TranslateT("disabled") : TranslateT("enabled")); CallService(szTTService, (WPARAM)wBuf, (LPARAM)&ti); tooltip_active = TRUE; @@ -1089,7 +1085,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR int mtnStatus = (int)M->GetByte(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, M->GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW)); TCHAR wBuf[512]; - mir_sntprintf(wBuf, safe_sizeof(wBuf), TranslateT("Sending typing notifications is %s."), + mir_sntprintf(wBuf, SIZEOF(wBuf), TranslateT("Sending typing notifications is %s."), mtnStatus ? TranslateT("enabled") : TranslateT("disabled")); CallService(szTTService, (WPARAM)wBuf, (LPARAM)&ti); tooltip_active = TRUE; @@ -1097,7 +1093,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR else if ((int)iconNum == list_icons + 2) { TCHAR wBuf[512]; - mir_sntprintf(wBuf, safe_sizeof(wBuf), _T("%s"), TranslateT("Session list.\nClick left for a list of open sessions.\nClick right to access favorites and quickly configure message window behavior")); + mir_sntprintf(wBuf, SIZEOF(wBuf), _T("%s"), TranslateT("Session list.\nClick left for a list of open sessions.\nClick right to access favorites and quickly configure message window behavior")); CallService(szTTService, (WPARAM)wBuf, (LPARAM)&ti); tooltip_active = TRUE; @@ -1122,7 +1118,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR TCHAR wBuf[512]; const TCHAR *szFormat = TranslateT("There are %d pending send jobs. Message length: %d bytes, message length limit: %d bytes\n\n%d messages are queued for later delivery"); - mir_sntprintf(wBuf, safe_sizeof(wBuf), szFormat, dat->iOpenJobs, iLength, dat->nMax ? dat->nMax : 20000, iQueued); + mir_sntprintf(wBuf, SIZEOF(wBuf), szFormat, dat->iOpenJobs, iLength, dat->nMax ? dat->nMax : 20000, iQueued); CallService(szTTService, (WPARAM)wBuf, (LPARAM)&ti); } //MAD diff --git a/plugins/TabSRMM/src/controls.h b/plugins/TabSRMM/src/controls.h new file mode 100644 index 0000000000..d04f589021 --- /dev/null +++ b/plugins/TabSRMM/src/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 + * + * 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 resetLP(void); + 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; + + /* + * 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(); + void TSAPI checkButtons(); + + 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/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 79af801c17..362adf97b3 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -26,8 +26,6 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: eventpopups.cpp 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. @@ -41,11 +39,6 @@ */ #include "commonheaders.h" -#pragma hdrstop - -extern INT_PTR CALLBACK DlgProcSetupStatusModes(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); -extern HIMAGELIST CreateStateImageList(); -extern HANDLE g_hEvent; typedef std::vector::iterator PopupListIterator; static std::vector PopupList; @@ -614,7 +607,7 @@ static int PopupUpdateT(HANDLE hContact, HANDLE hEvent) if (hEvent) { if (pdata->pluginOptions->bShowHeaders) { - mir_sntprintf(pdata->szHeader, safe_sizeof(pdata->szHeader), _T("%s %d\n"), + mir_sntprintf(pdata->szHeader, SIZEOF(pdata->szHeader), _T("%s %d\n"), TranslateT("New messages: "), pdata->nrMerged + 1); pdata->szHeader[255] = 0; } @@ -808,7 +801,7 @@ void TSAPI UpdateTrayMenuState(struct TWindowData *dat, BOOL bForced) if (!bForced) mii.dwItemData = 0; mii.fMask |= MIIM_STRING; - mir_sntprintf(szMenuEntry, safe_sizeof(szMenuEntry), _T("%s: %s (%s) [%d]"), tszProto, dat->cache->getNick(), dat->szStatus[0] ? dat->szStatus : _T("(undef)"), mii.dwItemData & 0x0000ffff); + mir_sntprintf(szMenuEntry, SIZEOF(szMenuEntry), _T("%s: %s (%s) [%d]"), tszProto, dat->cache->getNick(), dat->szStatus[0] ? dat->szStatus : _T("(undef)"), mii.dwItemData & 0x0000ffff); mii.dwTypeData = (LPTSTR)szMenuEntry; mii.cch = lstrlen(szMenuEntry) + 1; } @@ -854,7 +847,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro if (fromEvent == 2) // from chat... mii.dwItemData |= 0x10000000; DeleteMenu(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, MF_BYCOMMAND); - mir_sntprintf(szMenuEntry, safe_sizeof(szMenuEntry), _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff); + mir_sntprintf(szMenuEntry, SIZEOF(szMenuEntry), _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff); AppendMenu(PluginConfig.g_hMenuTrayUnread, MF_BYCOMMAND | MF_STRING, (UINT_PTR)hContact, szMenuEntry); PluginConfig.m_UnreadInTray++; if (PluginConfig.m_UnreadInTray) @@ -863,7 +856,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro } else { szNick = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR); if (CheckMenuItem(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, MF_BYCOMMAND | MF_UNCHECKED) == -1) { - mir_sntprintf(szMenuEntry, safe_sizeof(szMenuEntry), _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, fromEvent ? 1 : 0); + mir_sntprintf(szMenuEntry, SIZEOF(szMenuEntry), _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, fromEvent ? 1 : 0); AppendMenu(PluginConfig.g_hMenuTrayUnread, MF_BYCOMMAND | MF_STRING, (UINT_PTR)hContact, szMenuEntry); mii.dwItemData = fromEvent ? 1 : 0; PluginConfig.m_UnreadInTray += (mii.dwItemData & 0x0000ffff); @@ -880,7 +873,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro mii.fMask |= MIIM_STRING; if (fromEvent == 2) mii.dwItemData |= 0x10000000; - mir_sntprintf(szMenuEntry, safe_sizeof(szMenuEntry), _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff); + mir_sntprintf(szMenuEntry, SIZEOF(szMenuEntry), _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff); mii.cch = lstrlen(szMenuEntry) + 1; mii.dwTypeData = (LPTSTR)szMenuEntry; } diff --git a/plugins/TabSRMM/src/functions.h b/plugins/TabSRMM/src/functions.h new file mode 100644 index 0000000000..5b440cb7aa --- /dev/null +++ b/plugins/TabSRMM/src/functions.h @@ -0,0 +1,200 @@ +/* + * 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 + * + * 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); +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); +HWND TSAPI GetHWNDFromTabIndex(HWND hwndTab, int idx); +int TSAPI GetTabItemFromMouse(HWND hwndTab, POINT *pt); +void TSAPI CloseOtherTabs(HWND hwndTab, TWindowData &dat); +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(); +void TSAPI SetAeroMargins(TContainerData *pContainer); +int TABSRMM_FireEvent(HANDLE hContact, HWND hwnd, unsigned int type, unsigned int subType); + +INT_PTR MessageWindowOpened(WPARAM wParam, LPARAM lParam); + +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_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); + +int TSAPI InitOptions(void); +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/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 90c8d5dd04..e8654cfacb 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -26,8 +26,6 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: generic_msghandlers.cpp 13587 2011-04-12 13:54:26Z george.hazan $ - * * these are generic message handlers which are used by the message dialog window procedure. * calling them directly instead of using SendMessage() is faster. * also contains various callback functions for custom buttons @@ -36,9 +34,6 @@ #include "commonheaders.h" -extern RECT rcLastStatusBarClick; - - /** * Save message log for given session as RTF document */ @@ -1222,7 +1217,7 @@ LRESULT TSAPI DM_UpdateLastMessage(const TWindowData *dat) if (dat->showTyping) { TCHAR szBuf[80]; - mir_sntprintf(szBuf, safe_sizeof(szBuf), TranslateT("%s is typing a message."), dat->cache->getNick()); + mir_sntprintf(szBuf, SIZEOF(szBuf), TranslateT("%s is typing a message."), dat->cache->getNick()); SendMessage(dat->pContainer->hwndStatus, SB_SETTEXT, 0, (LPARAM) szBuf); SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, (LPARAM) PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]); return 0; @@ -1234,18 +1229,18 @@ LRESULT TSAPI DM_UpdateLastMessage(const TWindowData *dat) TCHAR date[64], time[64]; if (!(dat->pContainer->dwFlags & CNT_UINSTATUSBAR)) { - tmi.printTimeStamp(NULL, dat->lastMessage, _T("d"), date, safe_sizeof(date), 0); + tmi.printTimeStamp(NULL, dat->lastMessage, _T("d"), date, SIZEOF(date), 0); if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR && lstrlen(date) > 6) date[lstrlen(date) - 5] = 0; - tmi.printTimeStamp(NULL, dat->lastMessage, _T("t"), time, safe_sizeof(time), 0); + tmi.printTimeStamp(NULL, dat->lastMessage, _T("t"), time, SIZEOF(time), 0); } if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR) { TCHAR fmt[100]; - mir_sntprintf(fmt, safe_sizeof(fmt), _T("UID: %s"), dat->cache->getUIN()); + mir_sntprintf(fmt, SIZEOF(fmt), _T("UID: %s"), dat->cache->getUIN()); SendMessage(dat->pContainer->hwndStatus, SB_SETTEXT, 0, (LPARAM)fmt); } else { TCHAR fmt[100]; - mir_sntprintf(fmt, safe_sizeof(fmt), TranslateT("Last received: %s at %s"), date, time); + mir_sntprintf(fmt, SIZEOF(fmt), TranslateT("Last received: %s at %s"), date, time); SendMessage(dat->pContainer->hwndStatus, SB_SETTEXT, 0, (LPARAM) fmt); } } else @@ -1617,7 +1612,7 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff) dat->showTyping = 2; dat->nTypeSecs = 86400; - mir_sntprintf(dat->szStatusBar, safe_sizeof(dat->szStatusBar), + mir_sntprintf(dat->szStatusBar, SIZEOF(dat->szStatusBar), TranslateT("%s has entered text."), dat->cache->getNick()); if (hwndStatus && dat->pContainer->hwndActive == hwndDlg) SendMessage(hwndStatus, SB_SETTEXT, 0, (LPARAM) dat->szStatusBar); @@ -1643,7 +1638,7 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff) } else { if (dat->nTypeSecs > 0) { - mir_sntprintf(dat->szStatusBar, safe_sizeof(dat->szStatusBar), TranslateT("%s is typing a message."), dat->cache->getNick()); + mir_sntprintf(dat->szStatusBar, SIZEOF(dat->szStatusBar), TranslateT("%s is typing a message."), dat->cache->getNick()); dat->nTypeSecs--; if (hwndStatus && dat->pContainer->hwndActive == hwndDlg) { @@ -1854,7 +1849,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM wParam, LPARAM lParam) dat->iEventQueueSize += 10; } dat->hQueuedEvents[dat->iNextQueuedEvent++] = (HANDLE)lParam; - mir_sntprintf(szBuf, safe_sizeof(szBuf), TranslateT("Autoscrolling is disabled, %d message(s) queued (press F12 to enable it)"), + mir_sntprintf(szBuf, SIZEOF(szBuf), TranslateT("Autoscrolling is disabled, %d message(s) queued (press F12 to enable it)"), dat->iNextQueuedEvent); SetDlgItemText(hwndDlg, IDC_LOGFROZENTEXT, szBuf); RedrawWindow(GetDlgItem(hwndDlg, IDC_LOGFROZENTEXT), NULL, NULL, RDW_INVALIDATE); @@ -2007,13 +2002,13 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM wParam, LPARAM lParam) dat->dwFlagsEx = dat->idle ? dat->dwFlagsEx | MWF_SHOW_ISIDLE : dat->dwFlagsEx & ~MWF_SHOW_ISIDLE; dat->wStatus = dat->cache->getStatus(); - mir_sntprintf(dat->szStatus, safe_sizeof(dat->szStatus), _T("%s"), (char *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, GSMDF_TCHAR)); + mir_sntprintf(dat->szStatus, SIZEOF(dat->szStatus), _T("%s"), (char *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, GSMDF_TCHAR)); if (lParam != 0) { if (PluginConfig.m_CutContactNameOnTabs) - CutContactName(szNick, newcontactname, safe_sizeof(newcontactname)); + CutContactName(szNick, newcontactname, SIZEOF(newcontactname)); else - lstrcpyn(newcontactname, szNick, safe_sizeof(newcontactname)); + lstrcpyn(newcontactname, szNick, SIZEOF(newcontactname)); Utils::DoubleAmpersands(newcontactname); @@ -2029,24 +2024,24 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM wParam, LPARAM lParam) } SendMessage(hwndDlg, DM_UPDATEWINICON, 0, 0); if (dat->bIsMeta) - mir_sntprintf(fulluin, safe_sizeof(fulluin), + mir_sntprintf(fulluin, SIZEOF(fulluin), TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for User's Details\nRight click for MetaContact control\nClick dropdown to add or remove user from your favorites."), iHasName ? dat->cache->getUIN() : TranslateT("No UID")); else - mir_sntprintf(fulluin, safe_sizeof(fulluin), + mir_sntprintf(fulluin, SIZEOF(fulluin), TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for User's Details\nClick dropdown to change this contact's favorite status."), iHasName ? dat->cache->getUIN() : TranslateT("No UID")); SendMessage(GetDlgItem(hwndDlg, IDC_NAME), BUTTONADDTOOLTIP, /*iHasName ?*/ (WPARAM)fulluin /*: (WPARAM)_T("")*/, 0); } } else - lstrcpyn(newtitle, pszNewTitleEnd, safe_sizeof(newtitle)); + lstrcpyn(newtitle, pszNewTitleEnd, SIZEOF(newtitle)); if (dat->idle != dwOldIdle || lParam != 0) { if (item.mask & TCIF_TEXT) { item.pszText = newtitle; - _tcsncpy(dat->newtitle, newtitle, safe_sizeof(dat->newtitle)); + _tcsncpy(dat->newtitle, newtitle, SIZEOF(dat->newtitle)); dat->newtitle[127] = 0; item.cchTextMax = 127; if (dat->pWnd) diff --git a/plugins/TabSRMM/src/generic_msghandlers.h b/plugins/TabSRMM/src/generic_msghandlers.h new file mode 100644 index 0000000000..4916a90c06 --- /dev/null +++ b/plugins/TabSRMM/src/generic_msghandlers.h @@ -0,0 +1,65 @@ +/* + * 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 + * + * 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/globals.cpp b/plugins/TabSRMM/src/globals.cpp index b807218b0b..b8329eb8e1 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -26,15 +26,12 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: globals.cpp 13447 2011-03-14 19:55:07Z george.hazan $ - * * Plugin configuration variables and functions. Implemented as a class * though there will always be only a single instance. * */ #include "commonheaders.h" -extern PLUGININFOEX pluginInfo; CGlobals PluginConfig; CGlobals* pConfig = &PluginConfig; @@ -187,7 +184,7 @@ void CGlobals::reloadSystemModulesChanged() if (m_MathModAvail) { char *szDelim = (char *)CallService(MATH_GET_STARTDELIMITER, 0, 0); if (szDelim) { - MultiByteToWideChar(CP_ACP, 0, szDelim, -1, PluginConfig.m_MathModStartDelimiter, safe_sizeof(PluginConfig.m_MathModStartDelimiter)); + MultiByteToWideChar(CP_ACP, 0, szDelim, -1, PluginConfig.m_MathModStartDelimiter, SIZEOF(PluginConfig.m_MathModStartDelimiter)); CallService(MTH_FREE_MATH_BUFFER, 0, (LPARAM)szDelim); } } @@ -683,7 +680,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void) cle.hContact = hContact; cle.hDbEvent = hDbEvent; - mir_sntprintf(toolTip, safe_sizeof(toolTip), TranslateT("Message from %s"), + mir_sntprintf(toolTip, SIZEOF(toolTip), TranslateT("Message from %s"), (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) hContact, GCDNF_TCHAR)); cle.ptszTooltip = toolTip; CallService(MS_CLIST_ADDEVENT, 0, (LPARAM) & cle); @@ -734,11 +731,11 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c) if (c->isValid()) { if (wStatus == ID_STATUS_OFFLINE) - mir_sntprintf(buffer, safe_sizeof(buffer), TranslateT("signed off.")); + mir_sntprintf(buffer, SIZEOF(buffer), TranslateT("signed off.")); else if (wOldStatus == ID_STATUS_OFFLINE) - mir_sntprintf(buffer, safe_sizeof(buffer), TranslateT("signed on and is now %s."), szNewStatus); + mir_sntprintf(buffer, SIZEOF(buffer), TranslateT("signed on and is now %s."), szNewStatus); else - mir_sntprintf(buffer, safe_sizeof(buffer), TranslateT("changed status from %s to %s."), szOldStatus, szNewStatus); + mir_sntprintf(buffer, SIZEOF(buffer), TranslateT("changed status from %s to %s."), szOldStatus, szNewStatus); } char *szMsg = mir_utf8encodeT(buffer); diff --git a/plugins/TabSRMM/src/globals.h b/plugins/TabSRMM/src/globals.h new file mode 100644 index 0000000000..279016b8df --- /dev/null +++ b/plugins/TabSRMM/src/globals.h @@ -0,0 +1,236 @@ +/* + * 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 + * + * 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 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 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/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index a66951c93e..936d1991b7 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -26,8 +26,6 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: hotkeyhandler.cpp 13596 2011-04-15 19:07:23Z george.hazan $ - * * The hotkeyhandler is a small, invisible window which handles the following things: a) event notify stuff, messages posted from the popups to avoid threading @@ -40,11 +38,6 @@ */ #include "commonheaders.h" -#pragma hdrstop - -extern HICON hIcons[]; -extern INT_PTR SendMessageCommand(WPARAM wParam, LPARAM lParam); -extern INT_PTR SendMessageCommand_W(WPARAM wParam, LPARAM lParam); static UINT WM_TASKBARCREATED; static HANDLE hSvcHotkeyProcessor = 0; @@ -166,7 +159,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP switch (msg) { case WM_CREATE: - for (int i=0; i < safe_sizeof(_hotkeydescs); i++) { + for (int i=0; i < SIZEOF(_hotkeydescs); i++) { _hotkeydescs[i].cbSize = sizeof(HOTKEYDESC); Hotkey_Register(&_hotkeydescs[i]); } diff --git a/plugins/TabSRMM/src/include/ImageDataObject.h b/plugins/TabSRMM/src/include/ImageDataObject.h deleted file mode 100644 index 0e2c112827..0000000000 --- a/plugins/TabSRMM/src/include/ImageDataObject.h +++ /dev/null @@ -1,136 +0,0 @@ -/* -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 deleted file mode 100644 index 9be67e965b..0000000000 --- a/plugins/TabSRMM/src/include/buttonbar.h +++ /dev/null @@ -1,54 +0,0 @@ -#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 deleted file mode 100644 index 309e95131d..0000000000 --- a/plugins/TabSRMM/src/include/contactcache.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - * 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 deleted file mode 100644 index 31eb0239cc..0000000000 --- a/plugins/TabSRMM/src/include/controls.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * 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 resetLP(void); - 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; - - /* - * 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(); - void TSAPI checkButtons(); - - 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 deleted file mode 100644 index 8d3dabb7ba..0000000000 --- a/plugins/TabSRMM/src/include/functions.h +++ /dev/null @@ -1,202 +0,0 @@ -/* - * 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); -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); -HWND TSAPI GetHWNDFromTabIndex(HWND hwndTab, int idx); -int TSAPI GetTabItemFromMouse(HWND hwndTab, POINT *pt); -void TSAPI CloseOtherTabs(HWND hwndTab, TWindowData &dat); -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(); -void TSAPI SetAeroMargins(TContainerData *pContainer); -int TABSRMM_FireEvent(HANDLE hContact, HWND hwnd, unsigned int type, unsigned int subType); - -INT_PTR MessageWindowOpened(WPARAM wParam, LPARAM lParam); - -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_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); - -int TSAPI InitOptions(void); -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 deleted file mode 100644 index 4f756b24f0..0000000000 --- a/plugins/TabSRMM/src/include/generic_msghandlers.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 deleted file mode 100644 index 071928c0af..0000000000 --- a/plugins/TabSRMM/src/include/globals.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - * 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 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 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 deleted file mode 100644 index a7c64e469a..0000000000 --- a/plugins/TabSRMM/src/include/infopanel.h +++ /dev/null @@ -1,221 +0,0 @@ -/* - * 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 LRESULT 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) - HICON m_hIcon; // optional icon to show in the title line - LPCTSTR m_szTitle; // optional text to show in the title - int m_leftWidth; - - const CInfoPanel *m_panel; // the info panel parent (if any) -}; - -/** - * 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); - } - - __forceinline const LONG getHeight() const { return m_height; } - __forceinline bool isActive() const { return m_active; } - __forceinline bool isPrivateHeight() const { return m_fPrivateHeight; } - __forceinline DWORD isHovered() const { return m_active ? m_hoverFlags : 0; } - __forceinline const TWindowData* getDat() const { return m_dat; } - - void setHeight(LONG newHeight, bool fBroadcast = false); - 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 LRESULT CALLBACK avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); - -private: - void mapRealRect(const RECT& rcSrc, RECT& rcDest, const SIZE& sz); - void mapRealRectOnTop(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); - HMENU constructContextualMenu() const; - LRESULT cmdHandler(UINT cmd); - 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 deleted file mode 100644 index 5ee66829c5..0000000000 --- a/plugins/TabSRMM/src/include/m_cln_skinedit.h +++ /dev/null @@ -1,147 +0,0 @@ - -/* - * 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 deleted file mode 100644 index 30d89406e6..0000000000 --- a/plugins/TabSRMM/src/include/mim.h +++ /dev/null @@ -1,300 +0,0 @@ -/* - * 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 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 deleted file mode 100644 index 59e349f07c..0000000000 --- a/plugins/TabSRMM/src/include/msgdlgutils.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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 deleted file mode 100644 index 13f64e33e2..0000000000 --- a/plugins/TabSRMM/src/include/msgs.h +++ /dev/null @@ -1,1063 +0,0 @@ -/* - * 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_LOCALTIME 8192 -#define MWF_LOG_BBCODE 1 -#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 TStatusBarIconNode { - TStatusBarIconNode* next; - StatusIconData sid; -}; - -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]; - - 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; - 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; - 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_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_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 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_CLOSE_OTHER 32 - -#define TABSRMM_HK_SECTION_IM LPGEN("Message windows - IM") -#define TABSRMM_HK_SECTION_GENERIC LPGEN("Message windows - all") -#define TABSRMM_HK_SECTION_GC LPGEN("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 deleted file mode 100644 index 106238b320..0000000000 --- a/plugins/TabSRMM/src/include/nen.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - * 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 deleted file mode 100644 index 8008176c14..0000000000 --- a/plugins/TabSRMM/src/include/resource.h +++ /dev/null @@ -1,798 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by ..\..\res\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_CLOSEOTHERTABS 40032 -#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_FILE_CLOSEOTHERMSGSESSIONS 40090 -#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 deleted file mode 100644 index a81c08f4ae..0000000000 --- a/plugins/TabSRMM/src/include/sendlater.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * 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 deleted file mode 100644 index 8fdb8205d7..0000000000 --- a/plugins/TabSRMM/src/include/sendqueue.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - -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 deleted file mode 100644 index 415b96c5ac..0000000000 --- a/plugins/TabSRMM/src/include/sidebar.h +++ /dev/null @@ -1,239 +0,0 @@ -/* - * 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 deleted file mode 100644 index 9267f6a76a..0000000000 --- a/plugins/TabSRMM/src/include/taskbar.h +++ /dev/null @@ -1,197 +0,0 @@ -/* - * 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 deleted file mode 100644 index c2b84b1cbd..0000000000 --- a/plugins/TabSRMM/src/include/templates.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - -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 deleted file mode 100644 index ca899ffdb7..0000000000 --- a/plugins/TabSRMM/src/include/themes.h +++ /dev/null @@ -1,415 +0,0 @@ -/* - * 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 deleted file mode 100644 index 61590c6b16..0000000000 --- a/plugins/TabSRMM/src/include/translator.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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 deleted file mode 100644 index 03fb9851b7..0000000000 --- a/plugins/TabSRMM/src/include/typingnotify.h +++ /dev/null @@ -1,76 +0,0 @@ -#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 deleted file mode 100644 index f3918c1c87..0000000000 --- a/plugins/TabSRMM/src/include/utils.h +++ /dev/null @@ -1,268 +0,0 @@ -/* - * 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 deleted file mode 100644 index 4390ed33dc..0000000000 --- a/plugins/TabSRMM/src/include/version.h +++ /dev/null @@ -1,15 +0,0 @@ -#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 diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index 5399a6da56..5399d5a9bb 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -26,8 +26,6 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: infopanel.cpp 12702 2010-09-16 02:36:17Z borkra $ - * * the info area for both im and chat sessions */ @@ -509,7 +507,7 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) time_t diff = time(NULL) - m_dat->idle; int i_hrs = diff / 3600; int i_mins = (diff - i_hrs * 3600) / 60; - mir_sntprintf(szBuf, safe_sizeof(szBuf), TranslateT("%s Idle: %dh,%02dm"), tszUin, i_hrs, i_mins); + mir_sntprintf(szBuf, SIZEOF(szBuf), TranslateT("%s Idle: %dh,%02dm"), tszUin, i_hrs, i_mins); } else _tcscpy_s (szBuf, 256, tszUin); @@ -645,7 +643,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) if (m_height < DEGRADE_THRESHOLD) { TCHAR tszText[2048]; - mir_sntprintf(tszText, safe_sizeof(tszText), TranslateT("Topic is: %s"), si->ptszTopic ? si->ptszTopic : + mir_sntprintf(tszText, SIZEOF(tszText), TranslateT("Topic is: %s"), si->ptszTopic ? si->ptszTopic : TranslateT("no topic set.")); hOldFont = reinterpret_cast(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN])); @@ -986,7 +984,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) m_tip->show(rc, pt, m_dat->hTabIcon, m_dat->szStatus); return; } - mir_sntprintf(szTitle, safe_sizeof(szTitle), TranslateT("tabSRMM Information")); + mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("tabSRMM Information")); ::SendMessage(m_dat->hwndTip, TTM_UPDATETIPTEXT, 0, (LPARAM)&m_dat->ti); ::SendMessage(m_dat->hwndTip, TTM_SETMAXTIPWIDTH, 0, 350); diff --git a/plugins/TabSRMM/src/infopanel.h b/plugins/TabSRMM/src/infopanel.h new file mode 100644 index 0000000000..86caf2b1a9 --- /dev/null +++ b/plugins/TabSRMM/src/infopanel.h @@ -0,0 +1,219 @@ +/* + * 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 + * + * 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 LRESULT 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) + HICON m_hIcon; // optional icon to show in the title line + LPCTSTR m_szTitle; // optional text to show in the title + int m_leftWidth; + + const CInfoPanel *m_panel; // the info panel parent (if any) +}; + +/** + * 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); + } + + __forceinline const LONG getHeight() const { return m_height; } + __forceinline bool isActive() const { return m_active; } + __forceinline bool isPrivateHeight() const { return m_fPrivateHeight; } + __forceinline DWORD isHovered() const { return m_active ? m_hoverFlags : 0; } + __forceinline const TWindowData* getDat() const { return m_dat; } + + void setHeight(LONG newHeight, bool fBroadcast = false); + 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 LRESULT CALLBACK avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + +private: + void mapRealRect(const RECT& rcSrc, RECT& rcDest, const SIZE& sz); + void mapRealRectOnTop(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); + HMENU constructContextualMenu() const; + LRESULT cmdHandler(UINT cmd); + 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/m_cln_skinedit.h b/plugins/TabSRMM/src/m_cln_skinedit.h new file mode 100644 index 0000000000..5ee66829c5 --- /dev/null +++ b/plugins/TabSRMM/src/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/mim.cpp b/plugins/TabSRMM/src/mim.cpp index b254604484..dbc529f4c5 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -26,16 +26,12 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: mim.cpp 12842 2010-09-28 04:32:57Z borkra $ - * * wraps some parts of Miranda API * Also, OS dependent stuff (visual styles api etc.) * */ - #include "commonheaders.h" -extern PLUGININFOEX pluginInfo; PITA CMimAPI::m_pfnIsThemeActive = 0; POTD CMimAPI::m_pfnOpenThemeData = 0; @@ -320,7 +316,7 @@ void CMimAPI::configureCustomFolders() { m_hDataPath = FoldersRegisterCustomPathT("TabSRMM", "Data path", const_cast(getDataPath())); m_hSkinsPath = FoldersRegisterCustomPathT("TabSRMM", "Skins root", const_cast(getSkinPath())); - m_hAvatarsPath = FoldersRegisterCustomPathT("TabSRMM", "Saved Avatars", const_cast(getSavedAvatarPath())); + m_hAvatarsPath = FoldersRegisterCustomPathT("Avatars", "Saved TabSRMM avatars", const_cast(getSavedAvatarPath())); m_hChatLogsPath = FoldersRegisterCustomPathT("TabSRMM", "Group chat logs root", const_cast(getChatLogPath())); if (m_hDataPath) diff --git a/plugins/TabSRMM/src/mim.h b/plugins/TabSRMM/src/mim.h new file mode 100644 index 0000000000..42beca34b2 --- /dev/null +++ b/plugins/TabSRMM/src/mim.h @@ -0,0 +1,298 @@ +/* + * 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 + * + * 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 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/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp index 5eb4748c79..f3430b4f28 100644 --- a/plugins/TabSRMM/src/modplus.cpp +++ b/plugins/TabSRMM/src/modplus.cpp @@ -26,8 +26,6 @@ * * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: modplus.cpp 11848 2010-05-27 14:57:22Z silvercircle $ - * * implements features of the tabSRMM "MADMOD" patch, developed by * Mad Cluster in May 2008 * diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 1de04854b4..bb3424ad7b 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -26,18 +26,14 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: msgdialog.cpp 13447 2011-03-14 19:55:07Z george.hazan $ - * * This implements the message dialog window. * */ #include "commonheaders.h" -#pragma hdrstop #define MS_HTTPSERVER_ADDFILENAME "HTTPServer/AddFileName" -extern TTemplateSet RTL_Active, LTR_Active; const TCHAR* pszIDCSAVE_close = 0, *pszIDCSAVE_save = 0; static const UINT sendControls[] = { IDC_MESSAGE, IDC_LOG }; @@ -1336,7 +1332,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (dat->hContact && dat->szProto != NULL) { dat->wStatus = DBGetContactSettingWord(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE); - mir_sntprintf(dat->szStatus, safe_sizeof(dat->szStatus), _T("%s"), (char *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, GSMDF_TCHAR)); + mir_sntprintf(dat->szStatus, SIZEOF(dat->szStatus), _T("%s"), (char *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, GSMDF_TCHAR)); } else dat->wStatus = ID_STATUS_OFFLINE; @@ -2672,7 +2668,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (iIndex < SendQueue::NR_SENDJOBS) { // single sendjob timer SendJob *job = sendQueue->getJobByIndex(iIndex); KillTimer(hwndDlg, wParam); - mir_sntprintf(job->szErrorMsg, safe_sizeof(job->szErrorMsg), TranslateT("Delivery failure: %s"), + mir_sntprintf(job->szErrorMsg, SIZEOF(job->szErrorMsg), TranslateT("Delivery failure: %s"), TranslateT("The message send timed out")); job->iStatus = SendQueue::SQ_ERROR; if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND)) @@ -3498,7 +3494,7 @@ quote_from_last: if (!(pcaps & PF4_OFFLINEFILES)) { TCHAR szBuffer[256]; - _sntprintf(szBuffer, safe_sizeof(szBuffer), TranslateT("Contact is offline and this protocol does not support sending files to offline users.")); + _sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("Contact is offline and this protocol does not support sending files to offline users.")); SendMessage(hwndDlg, DM_ACTIVATETOOLTIP, IDC_MESSAGE, (LPARAM)szBuffer); break; } diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 3b394d5975..0570d4db2a 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -26,21 +26,11 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: msgdlgutils.cpp 13650 2011-05-30 11:53:13Z silvercircle@gmail.com $ - * * Helper functions for the message dialog. * */ #include "commonheaders.h" -#pragma hdrstop - -//#include "m_MathModule.h" - -extern NEN_OPTIONS nen_options; -extern LOGFONTA logfonts[MSGDLGFONTCOUNT + 2]; -extern COLORREF fontcolors[MSGDLGFONTCOUNT + 2]; -extern TTemplateSet LTR_Active, RTL_Active; #ifndef SHVIEW_THUMBNAIL #define SHVIEW_THUMBNAIL 0x702D @@ -540,7 +530,7 @@ void TSAPI UpdateReadChars(const TWindowData *dat) if (dat->fInsertMode || fCaps || fNum) lstrcat(szIndicators, _T(" | ")); - mir_sntprintf(buf, safe_sizeof(buf), _T("%s%s %d/%d"), szIndicators, dat->lcID, dat->iOpenJobs, len); + mir_sntprintf(buf, SIZEOF(buf), _T("%s%s %d/%d"), szIndicators, dat->lcID, dat->iOpenJobs, len); SendMessage(dat->pContainer->hwndStatus, SB_SETTEXT, 1, (LPARAM) buf); if (PluginConfig.m_visualMessageSizeIndicator) InvalidateRect(dat->pContainer->hwndStatus, NULL, FALSE); @@ -1077,48 +1067,48 @@ BOOL TSAPI DoRtfToTags(TCHAR * pszText, const TWindowData *dat) bTextHasStarted = TRUE; bJustRemovedRTF = TRUE; iRemoveChars = 5; - _sntprintf(InsertThis, safe_sizeof(InsertThis), _T("\n")); + _sntprintf(InsertThis, SIZEOF(InsertThis), _T("\n")); } else if (p1 == _tcsstr(p1, _T("\\endash"))) { bTextHasStarted = bJustRemovedRTF = TRUE; iRemoveChars = 7; - _sntprintf(InsertThis, safe_sizeof(InsertThis), _T("%c"), 0x2013); + _sntprintf(InsertThis, SIZEOF(InsertThis), _T("%c"), 0x2013); } else if (p1 == _tcsstr(p1, _T("\\emdash"))) { bTextHasStarted = TRUE; bJustRemovedRTF = TRUE; iRemoveChars = 7; - _sntprintf(InsertThis, safe_sizeof(InsertThis), _T("%c"), 0x2014); + _sntprintf(InsertThis, SIZEOF(InsertThis), _T("%c"), 0x2014); } else if (p1 == _tcsstr(p1, _T("\\bullet"))) { bTextHasStarted = TRUE; bJustRemovedRTF = TRUE; iRemoveChars = 7; - _sntprintf(InsertThis, safe_sizeof(InsertThis), _T("%c"), 0x2022); + _sntprintf(InsertThis, SIZEOF(InsertThis), _T("%c"), 0x2022); } else if (p1 == _tcsstr(p1, _T("\\ldblquote"))) { bTextHasStarted = TRUE; bJustRemovedRTF = TRUE; iRemoveChars = 10; - _sntprintf(InsertThis, safe_sizeof(InsertThis), _T("%c"), 0x201C); + _sntprintf(InsertThis, SIZEOF(InsertThis), _T("%c"), 0x201C); } else if (p1 == _tcsstr(p1, _T("\\rdblquote"))) { bTextHasStarted = TRUE; bJustRemovedRTF = TRUE; iRemoveChars = 10; - _sntprintf(InsertThis, safe_sizeof(InsertThis), _T("%c"), 0x201D); + _sntprintf(InsertThis, SIZEOF(InsertThis), _T("%c"), 0x201D); } else if (p1 == _tcsstr(p1, _T("\\lquote"))) { bTextHasStarted = TRUE; bJustRemovedRTF = TRUE; iRemoveChars = 7; - _sntprintf(InsertThis, safe_sizeof(InsertThis), _T("%c"), 0x2018); + _sntprintf(InsertThis, SIZEOF(InsertThis), _T("%c"), 0x2018); } else if (p1 == _tcsstr(p1, _T("\\rquote"))) { bTextHasStarted = TRUE; bJustRemovedRTF = TRUE; iRemoveChars = 7; - _sntprintf(InsertThis, safe_sizeof(InsertThis), _T("%c"), 0x2019); + _sntprintf(InsertThis, SIZEOF(InsertThis), _T("%c"), 0x2019); } else if (p1 == _tcsstr(p1, _T("\\b"))) { //bold bTextHasStarted = TRUE; bJustRemovedRTF = TRUE; iRemoveChars = (p1[2] != (TCHAR) '0') ? 2 : 3; if (!(lf.lfWeight == FW_BOLD)) { // only allow bold if the font itself isn't a bold one, otherwise just strip it.. if (dat->SendFormat) - _sntprintf(InsertThis, safe_sizeof(InsertThis), (p1[2] != (TCHAR) '0') ? _T("[b]") : _T("[/b]")); + _sntprintf(InsertThis, SIZEOF(InsertThis), (p1[2] != (TCHAR) '0') ? _T("[b]") : _T("[/b]")); } } else if (p1 == _tcsstr(p1, _T("\\i"))) { // italics @@ -1127,7 +1117,7 @@ BOOL TSAPI DoRtfToTags(TCHAR * pszText, const TWindowData *dat) iRemoveChars = (p1[2] != (TCHAR) '0') ? 2 : 3; if (!lf.lfItalic) { // same as for bold if (dat->SendFormat) - _sntprintf(InsertThis, safe_sizeof(InsertThis), (p1[2] != (TCHAR) '0') ? _T("[i]") : _T("[/i]")); + _sntprintf(InsertThis, SIZEOF(InsertThis), (p1[2] != (TCHAR) '0') ? _T("[i]") : _T("[/i]")); } } else if (p1 == _tcsstr(p1, _T("\\strike"))) { // strike-out @@ -1136,7 +1126,7 @@ BOOL TSAPI DoRtfToTags(TCHAR * pszText, const TWindowData *dat) iRemoveChars = (p1[7] != (TCHAR) '0') ? 7 : 8; if (!lf.lfStrikeOut) { // same as for bold if (dat->SendFormat) - _sntprintf(InsertThis, safe_sizeof(InsertThis), (p1[7] != (TCHAR) '0') ? _T("[s]") : _T("[/s]")); + _sntprintf(InsertThis, SIZEOF(InsertThis), (p1[7] != (TCHAR) '0') ? _T("[s]") : _T("[/s]")); } } else if (p1 == _tcsstr(p1, _T("\\ul"))) { // underlined @@ -1150,19 +1140,19 @@ BOOL TSAPI DoRtfToTags(TCHAR * pszText, const TWindowData *dat) iRemoveChars = 3; if (!lf.lfUnderline) { // same as for bold if (dat->SendFormat) - _sntprintf(InsertThis, safe_sizeof(InsertThis), (p1[3] != (TCHAR) '0' && p1[3] != (TCHAR) 'n') ? _T("[u]") : _T("[/u]")); + _sntprintf(InsertThis, SIZEOF(InsertThis), (p1[3] != (TCHAR) '0' && p1[3] != (TCHAR) 'n') ? _T("[u]") : _T("[/u]")); } } else if (p1 == _tcsstr(p1, _T("\\tab"))) { // tab bTextHasStarted = TRUE; bJustRemovedRTF = TRUE; iRemoveChars = 4; - _sntprintf(InsertThis, safe_sizeof(InsertThis), _T("%c"), 0x09); + _sntprintf(InsertThis, SIZEOF(InsertThis), _T("%c"), 0x09); } else if (p1[1] == (TCHAR) '\\' || p1[1] == (TCHAR) '{' || p1[1] == (TCHAR) '}') { // escaped characters bTextHasStarted = TRUE; //bJustRemovedRTF = TRUE; iRemoveChars = 2; - _sntprintf(InsertThis, safe_sizeof(InsertThis), _T("%c"), p1[1]); + _sntprintf(InsertThis, SIZEOF(InsertThis), _T("%c"), p1[1]); } else if (p1[1] == (TCHAR) '\'') { // special character bTextHasStarted = TRUE; bJustRemovedRTF = FALSE; @@ -1183,7 +1173,7 @@ BOOL TSAPI DoRtfToTags(TCHAR * pszText, const TWindowData *dat) // convert string containing char in hex format to int. p3 = InsertThis; iLame = _tcstol(p3, &stoppedHere, 16); - _sntprintf(InsertThis, safe_sizeof(InsertThis), _T("%c"), (TCHAR) iLame); + _sntprintf(InsertThis, SIZEOF(InsertThis), _T("%c"), (TCHAR) iLame); } else iRemoveChars = 2; @@ -1271,11 +1261,11 @@ void TSAPI GetMYUIN(TWindowData *dat) if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci)) { switch (ci.type) { case CNFT_ASCIIZ: - mir_sntprintf(dat->myUin, safe_sizeof(dat->myUin), _T("%s"), reinterpret_cast(ci.pszVal)); + mir_sntprintf(dat->myUin, SIZEOF(dat->myUin), _T("%s"), reinterpret_cast(ci.pszVal)); mir_free((void*)ci.pszVal); break; case CNFT_DWORD: - mir_sntprintf(dat->myUin, safe_sizeof(dat->myUin), _T("%u"), ci.dVal); + mir_sntprintf(dat->myUin, SIZEOF(dat->myUin), _T("%u"), ci.dVal); break; default: dat->myUin[0] = 0; @@ -1633,7 +1623,7 @@ void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName) _tcsupr(szLI); } fLocaleNotSet = (dat->lcID[0] == 0 && dat->lcID[1] == 0); - mir_sntprintf(dat->lcID, safe_sizeof(dat->lcID), szLI); + mir_sntprintf(dat->lcID, SIZEOF(dat->lcID), szLI); GetStringTypeA(dat->lcid, CT_CTYPE2, szTest, 3, wCtype2); pf2.cbSize = sizeof(pf2); pf2.dwMask = PFM_RTLPARA; @@ -2272,7 +2262,7 @@ void TSAPI GetMyNick(TWindowData *dat) if (ci.type == CNFT_ASCIIZ) { if (lstrlen(reinterpret_cast(ci.pszVal)) < 1 || !_tcscmp(reinterpret_cast(ci.pszVal), TranslateT("'(Unknown Contact)'"))) { - mir_sntprintf(dat->szMyNickname, safe_sizeof(dat->szMyNickname), _T("%s"), dat->myUin[0] ? dat->myUin : TranslateT("'(Unknown Contact)'")); + mir_sntprintf(dat->szMyNickname, SIZEOF(dat->szMyNickname), _T("%s"), dat->myUin[0] ? dat->myUin : TranslateT("'(Unknown Contact)'")); if (ci.pszVal) { mir_free(ci.pszVal); ci.pszVal = NULL; diff --git a/plugins/TabSRMM/src/msgdlgutils.h b/plugins/TabSRMM/src/msgdlgutils.h new file mode 100644 index 0000000000..40141064a2 --- /dev/null +++ b/plugins/TabSRMM/src/msgdlgutils.h @@ -0,0 +1,100 @@ +/* + * 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 + * + */ + +#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/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index c8dd66df89..047476d6fe 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -26,21 +26,11 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: msglog.cpp 13642 2011-05-27 10:26:12Z silvercircle $ - * * implements the richedit based message log and the template parser * */ #include "commonheaders.h" -#include - -#pragma hdrstop - -extern void ReleaseRichEditOle(IRichEditOle *ole); -extern void ImageDataInsertBitmap(IRichEditOle *ole, HBITMAP hBm); -extern int CacheIconToBMP(struct TLogIcon *theIcon, HICON hIcon, COLORREF backgroundColor, int sizeX, int sizeY); -extern void DeleteCachedIcon(struct TLogIcon *theIcon); struct TCpTable cpTable[] = { { 874, LPGENT("Thai") }, @@ -1619,7 +1609,7 @@ static TCHAR *Template_MakeRelativeDate(struct TWindowData *dat, HANDLE hTimeZon else szFormat = _T("d"); - tmi.printTimeStamp(hTimeZone, check, szFormat, szResult, safe_sizeof(szResult), 0); + tmi.printTimeStamp(hTimeZone, check, szFormat, szResult, SIZEOF(szResult), 0); } return szResult; } diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index be168ccc19..77d73409db 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -26,28 +26,14 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: msgoptions.cpp 13750 2011-08-03 20:10:43Z george.hazan $ - * * Implementation of the option pages * */ #include "commonheaders.h" -#pragma hdrstop -#include #define DM_GETSTATUSMASK (WM_USER + 10) -extern INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); -extern INT_PTR CALLBACK DlgProcTabConfig(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); -extern INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); -extern INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -extern INT_PTR CALLBACK PlusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); - -extern INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -extern INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -extern INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); - INT_PTR CALLBACK DlgProcSetupStatusModes(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); struct FontOptionsList { @@ -694,7 +680,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, Utils::showDlgControl(hwndDlg, IDC_EXPLAINMSGLOGSETTINGS, r == 0 ? SW_HIDE : SW_SHOW); Utils::showDlgControl(hwndDlg, IDC_LOGOPTIONS, r == 0 ? SW_SHOW : SW_HIDE); Utils::enableDlgControl(GetDlgItem(hwndDlg, IDC_MSGLOGDIDSPLAY),r == 0 ? FALSE : TRUE); - for (int i=0; i < safe_sizeof(__ctrls); i++) + for (int i=0; i < SIZEOF(__ctrls); i++) Utils::enableDlgControl(hwndDlg, __ctrls[i], r == 0 ? TRUE : FALSE); return 0; } diff --git a/plugins/TabSRMM/src/msgoptions_plus.cpp b/plugins/TabSRMM/src/msgoptions_plus.cpp index e407f392d6..9ebb60fea0 100644 --- a/plugins/TabSRMM/src/msgoptions_plus.cpp +++ b/plugins/TabSRMM/src/msgoptions_plus.cpp @@ -26,8 +26,6 @@ * * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: msgoptions_plus.cpp 13034 2010-10-24 20:39:04Z silvercircle $ - * * implements the "advanced tweak" option page * * originally developed by Mad Cluster for the tabSRMM "MADMOD" patch in @@ -37,10 +35,6 @@ #include "commonheaders.h" -extern HINSTANCE hinstance; -extern BOOL g_bIMGtagButton; -extern HIMAGELIST g_himlOptions, CreateStateImageList(); - static void FillDialog(HWND hwndDlg) { TVINSERTSTRUCT tvi = {0}; diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 43a1ce0137..b08d31f0a9 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -26,32 +26,22 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: msgs.cpp 13587 2011-04-12 13:54:26Z george.hazan $ - * * Load, setup and shutdown the plugin * core plugin messaging services (single IM chats only). * */ #include "commonheaders.h" -#pragma hdrstop #define IDI_CORE_LOAD 132 // icon id for the "connecting" icon REOLECallback* mREOLECallback; NEN_OPTIONS nen_options; -extern PLUGININFOEX pluginInfo; -extern HANDLE hHookToolBarLoadedEvt; static HANDLE hUserPrefsWindowLis = 0; HMODULE g_hIconDLL = 0; static void UnloadIcons(); -extern INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); -extern struct TLogIcon msgLogIcons[NR_LOGICONS * 3]; -extern int CacheIconToBMP (struct TLogIcon *theIcon, HICON hIcon, COLORREF backgroundColor, int sizeX, int sizeY); -extern void DeleteCachedIcon(struct TLogIcon *theIcon); - int Chat_IconsChanged(WPARAM wp, LPARAM lp); void Chat_AddIcons(void); int Chat_PreShutdown(WPARAM wParam, LPARAM lParam); @@ -541,7 +531,7 @@ static void TSAPI InitAPI() { ZeroMemory(PluginConfig.hSvc, sizeof(HANDLE) * CGlobals::SERVICE_LAST); - for (int i=0; i < safe_sizeof(SERVICES); i++) + for (int i=0; i < SIZEOF(SERVICES); i++) *(SERVICES[i].h) = CreateServiceFunction(SERVICES[i].szName, SERVICES[i].pfnService); *(SERVICES[CGlobals::H_MS_MSG_SENDMESSAGEW].h) = CreateServiceFunction(MS_MSG_SENDMESSAGE "W", SendMessageCommand_W); @@ -709,23 +699,23 @@ HWND TSAPI CreateNewTabForContact(struct TContainerData *pContainer, HANDLE hCon if (contactName && lstrlen(contactName) > 0) { if (M->GetByte("cuttitle", 0)) - CutContactName(contactName, newcontactname, safe_sizeof(newcontactname)); + CutContactName(contactName, newcontactname, SIZEOF(newcontactname)); else { - lstrcpyn(newcontactname, contactName, safe_sizeof(newcontactname)); + lstrcpyn(newcontactname, contactName, SIZEOF(newcontactname)); newcontactname[127] = 0; } //Mad: to fix tab width for nicknames with ampersands Utils::DoubleAmpersands(newcontactname); } else - lstrcpyn(newcontactname, _T("_U_"), safe_sizeof(newcontactname)); + lstrcpyn(newcontactname, _T("_U_"), SIZEOF(newcontactname)); WORD wStatus = (szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE)); TCHAR *szStatus = (TCHAR *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), GSMDF_TCHAR); if (M->GetByte("tabstatus", 1)) - mir_sntprintf(tabtitle, safe_sizeof(tabtitle), _T("%s (%s) "), newcontactname, szStatus); + mir_sntprintf(tabtitle, SIZEOF(tabtitle), _T("%s (%s) "), newcontactname, szStatus); else - mir_sntprintf(tabtitle, safe_sizeof(tabtitle), _T("%s "), newcontactname); + mir_sntprintf(tabtitle, SIZEOF(tabtitle), _T("%s "), newcontactname); newData.item.pszText = tabtitle; newData.item.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM; diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h new file mode 100644 index 0000000000..3486988b96 --- /dev/null +++ b/plugins/TabSRMM/src/msgs.h @@ -0,0 +1,1055 @@ +/* + * 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 + * + */ + +#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 + +#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_LOCALTIME 8192 +#define MWF_LOG_BBCODE 1 +#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 TStatusBarIconNode { + TStatusBarIconNode* next; + StatusIconData sid; +}; + +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]; + + 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; + 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; + 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_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_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 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_CLOSE_OTHER 32 + +#define TABSRMM_HK_SECTION_IM LPGEN("Message windows - IM") +#define TABSRMM_HK_SECTION_GENERIC LPGEN("Message windows - all") +#define TABSRMM_HK_SECTION_GC LPGEN("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/nen.h b/plugins/TabSRMM/src/nen.h new file mode 100644 index 0000000000..d21f2533b6 --- /dev/null +++ b/plugins/TabSRMM/src/nen.h @@ -0,0 +1,164 @@ +/* + * 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 + * + * 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_ + +#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/resource.h b/plugins/TabSRMM/src/resource.h new file mode 100644 index 0000000000..8008176c14 --- /dev/null +++ b/plugins/TabSRMM/src/resource.h @@ -0,0 +1,798 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by ..\..\res\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_CLOSEOTHERTABS 40032 +#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_FILE_CLOSEOTHERMSGSESSIONS 40090 +#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/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp index cf5acbf816..dd9eb22145 100644 --- a/plugins/TabSRMM/src/selectcontainer.cpp +++ b/plugins/TabSRMM/src/selectcontainer.cpp @@ -26,14 +26,11 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: selectcontainer.cpp 12351 2010-08-21 21:44:54Z Michael.Kunz@s2005.TU-Chemnitz.de $ - * * dialog to manage containers (attaching sessions to containers etc.) * */ #include "commonheaders.h" -#pragma hdrstop INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -55,7 +52,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (lParam) { struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr((HWND)lParam, GWLP_USERDATA); if (dat) { - mir_sntprintf(szNewTitle, safe_sizeof(szNewTitle), TranslateT("Select container for %s"), dat->cache->getNick()); + mir_sntprintf(szNewTitle, SIZEOF(szNewTitle), TranslateT("Select container for %s"), dat->cache->getNick()); SetWindowText(hwndDlg, szNewTitle); } } diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index 632db61eab..4b62744ec7 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -26,13 +26,10 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: sendlater.cpp 14225 2012-05-08 19:49:18Z george.hazan $ - * * the sendlater class implementation */ #include "commonheaders.h" -#pragma hdrstop #define U_PREF_UNICODE PREF_UNICODE /* diff --git a/plugins/TabSRMM/src/sendlater.h b/plugins/TabSRMM/src/sendlater.h new file mode 100644 index 0000000000..e0d4b91ec8 --- /dev/null +++ b/plugins/TabSRMM/src/sendlater.h @@ -0,0 +1,153 @@ +/* + * 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 + * + * 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/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index 98b36e2d06..49a095064e 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -26,19 +26,14 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: sendqueue.cpp 13750 2011-08-03 20:10:43Z george.hazan $ - * * Implements a queued, asynchronous sending system for tabSRMM. * */ #include "commonheaders.h" -#pragma hdrstop SendQueue *sendQueue = 0; -extern const TCHAR *pszIDCSAVE_save, *pszIDCSAVE_close; - static char *pss_msg = "/SendMsg"; static char *pss_msgw = "/SendMsgW"; @@ -788,7 +783,7 @@ int SendQueue::ackMessage(TWindowData *dat, WPARAM wParam, LPARAM lParam) SkinPlaySound("SendError"); TCHAR *szAckMsg = mir_a2t((char *)ack->lParam); - mir_sntprintf(m_jobs[iFound].szErrorMsg, safe_sizeof(m_jobs[iFound].szErrorMsg), + mir_sntprintf(m_jobs[iFound].szErrorMsg, SIZEOF(m_jobs[iFound].szErrorMsg), TranslateT("Delivery failure: %s"), szAckMsg); m_jobs[iFound].iStatus = SQ_ERROR; mir_free(szAckMsg); @@ -937,10 +932,10 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, HANDLE hContact, boo _tcsftime(tszTimestamp, 30, formatTime, _localtime32((__time32_t *)&now)); tszTimestamp[29] = 0; mir_snprintf(szKeyName, 20, "S%d", now); - mir_sntprintf(tszHeader, safe_sizeof(tszHeader), TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp); + mir_sntprintf(tszHeader, SIZEOF(tszHeader), TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp); } else - mir_sntprintf(tszHeader, safe_sizeof(tszHeader), _T("M%d|"), time(0)); + mir_sntprintf(tszHeader, SIZEOF(tszHeader), _T("M%d|"), time(0)); if (job->dwFlags & PREF_UTF || !(job->dwFlags & PREF_UNICODE)) { char *utf_header = mir_utf8encodeT(tszHeader); diff --git a/plugins/TabSRMM/src/sendqueue.h b/plugins/TabSRMM/src/sendqueue.h new file mode 100644 index 0000000000..428ee49b32 --- /dev/null +++ b/plugins/TabSRMM/src/sendqueue.h @@ -0,0 +1,120 @@ +/* + +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. +*/ + +#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/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp index cadb433190..18b045794e 100644 --- a/plugins/TabSRMM/src/sidebar.cpp +++ b/plugins/TabSRMM/src/sidebar.cpp @@ -26,18 +26,12 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: sidebar.cpp 12647 2010-09-09 22:17:49Z silvercircle $ - * * the contact switch bar on the left (or right) side * */ #include "commonheaders.h" -extern int TSAPI TBStateConvert2Flat(int state); -extern int TSAPI RBStateConvert2Flat(int state); -extern void TSAPI FillTabBackground(const HDC hdc, int iStateId, const TWindowData* dat, RECT* rc); - TSideBarLayout CSideBar::m_layouts[CSideBar::NR_LAYOUTS] = { { LPGENT("Like tabs, vertical text orientation"), diff --git a/plugins/TabSRMM/src/sidebar.h b/plugins/TabSRMM/src/sidebar.h new file mode 100644 index 0000000000..116806b2d3 --- /dev/null +++ b/plugins/TabSRMM/src/sidebar.h @@ -0,0 +1,237 @@ +/* + * 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 + * + * 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/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp index ab760a1e0e..ed6accf488 100644 --- a/plugins/TabSRMM/src/srmm.cpp +++ b/plugins/TabSRMM/src/srmm.cpp @@ -26,21 +26,12 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: srmm.cpp 13596 2011-04-15 19:07:23Z george.hazan $ - * * plugin loading functions and global exports. * */ #include "commonheaders.h" -extern int LoadSendRecvMessageModule(void); -extern int SplitmsgShutdown(void); -extern void LogErrorMessage(HWND hwndDlg, struct TWindowData *dat, int i, TCHAR *szMsg); -extern int Chat_Load(), Chat_Unload(); -extern void FreeLogFonts(); - - HINSTANCE g_hInst; LOGFONT lfDefault = {0}; @@ -53,19 +44,16 @@ TIME_API tmi = {0}; PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), -#ifdef __GNUWIN32__ - "TabSRMM (MINGW32)", -#else - "TabSRMM", -#endif - PLUGIN_MAKE_VERSION(_VER_MAJOR, _VER_MINOR, _VER_REVISION, _VER_BUILD), - "IM and group chat module for Miranda NG.", - "The Miranda developers team and contributors", - "silvercircle _at_ gmail _dot_ com", - "2000-2010 Miranda Project and contributors. See readme.txt for more.", - "http://miranda-ng.org/", + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESCRIPTION, + __AUTHOR, + __AUTHOREMAIL, + __COPYRIGHT, + __AUTHORWEB, UNICODE_AWARE, - {0x6ca5f042, 0x7a7f, 0x47cc, { 0xa7, 0x15, 0xfc, 0x8c, 0x46, 0xfb, 0xf4, 0x34 }} //{6CA5F042-7A7F-47cc-A715-FC8C46FBF434} + // {6CA5F042-7A7F-47CC-A715-FC8C46FBF434} + {0x6ca5f042, 0x7a7f, 0x47cc, {0xa7, 0x15, 0xfc, 0x8c, 0x46, 0xfb, 0xf4, 0x34}} }; BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) @@ -219,7 +207,7 @@ int _DebugPopup(HANDLE hContact, const TCHAR *fmt, ...) tn.szProto = NULL; tn.cbSize = sizeof(tn); - mir_sntprintf(szTitle, safe_sizeof(szTitle), TranslateT("tabSRMM Message (%s)"), (hContact != 0) ? (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR) : TranslateT("Global")); + mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("tabSRMM Message (%s)"), (hContact != 0) ? (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR) : TranslateT("Global")); tn.tszInfoTitle = szTitle; tn.tszInfo = debug; tn.dwInfoFlags = NIIF_INFO; @@ -250,7 +238,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar mir_snprintf(buildstr, 50, "[Build #%d]", build_nr); } TCHAR *szBuildstr = mir_a2t(buildstr); - mir_sntprintf(tStr, safe_sizeof(tStr), _T("TabSRMM\n%s %d.%d.%d.%d (Unicode) %s"), + mir_sntprintf(tStr, SIZEOF(tStr), _T("TabSRMM\n%s %d.%d.%d.%d (Unicode) %s"), _T("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v)), szBuildstr); SetDlgItemText(hwndDlg, IDC_HEADERBAR, tStr); diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp index d5c9b5a9f4..658584de6d 100644 --- a/plugins/TabSRMM/src/tabctrl.cpp +++ b/plugins/TabSRMM/src/tabctrl.cpp @@ -25,18 +25,14 @@ * * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: tabctrl.cpp 12643 2010-09-09 03:57:16Z silvercircle $ - * * a custom tab control, skinable, aero support, single/multi row, button * tabs support, proper rendering for bottom row tabs and more. * */ #include "commonheaders.h" -#pragma hdrstop static WNDPROC OldTabControlClassProc; -extern ButtonSet g_ButtonSet; static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp index 73f05e0172..37b7b6a746 100644 --- a/plugins/TabSRMM/src/taskbar.cpp +++ b/plugins/TabSRMM/src/taskbar.cpp @@ -26,8 +26,6 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: taskbar.cpp 13178 2010-12-05 21:29:17Z silvercircle $ - * * Windows 7 taskbar integration * * - overlay icons diff --git a/plugins/TabSRMM/src/taskbar.h b/plugins/TabSRMM/src/taskbar.h new file mode 100644 index 0000000000..b2390bc827 --- /dev/null +++ b/plugins/TabSRMM/src/taskbar.h @@ -0,0 +1,195 @@ +/* + * 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 + * + * - 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/templates.cpp b/plugins/TabSRMM/src/templates.cpp index e98e222075..94b7f53425 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -26,14 +26,11 @@ * * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: templates.cpp 13034 2010-10-24 20:39:04Z silvercircle $ - * * Simple editor for the message log templates * */ #include "commonheaders.h" -#pragma hdrstop /* * hardcoded default set of templates for both LTR and RTL. @@ -372,7 +369,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP dat->dwFlags = MWF_LOG_ALL; dat->dwFlags = (teInfo->rtl ? dat->dwFlags | MWF_LOG_RTL : dat->dwFlags & ~MWF_LOG_RTL); dat->dwFlags = (iIndex == 0 || iIndex == 1) ? dat->dwFlags & ~MWF_LOG_GROUPMODE : dat->dwFlags | MWF_LOG_GROUPMODE; - mir_sntprintf(dat->szMyNickname, safe_sizeof(dat->szMyNickname), _T("My Nickname")); + mir_sntprintf(dat->szMyNickname, SIZEOF(dat->szMyNickname), _T("My Nickname")); StreamInEvents(hwndDlg, 0, 1, 1, &dbei); SendDlgItemMessage(hwndDlg, IDC_PREVIEW, EM_SETSEL, -1, -1); if (teInfo->changed) diff --git a/plugins/TabSRMM/src/templates.h b/plugins/TabSRMM/src/templates.h new file mode 100644 index 0000000000..71b84b4ac6 --- /dev/null +++ b/plugins/TabSRMM/src/templates.h @@ -0,0 +1,47 @@ +/* + +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. + +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/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp index b54801461e..0a0d32197a 100644 --- a/plugins/TabSRMM/src/themeio.cpp +++ b/plugins/TabSRMM/src/themeio.cpp @@ -26,22 +26,15 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: themeio.cpp 13412 2011-03-08 19:13:11Z george.hazan $ - * * Import and export theme settings between files and the database * */ #include "commonheaders.h" -#pragma hdrstop #define CURRENT_THEME_VERSION 5 #define THEME_COOKIE 25099837 -extern char *TemplateNames[]; -extern TTemplateSet LTR_Active, RTL_Active; - - static struct _tagExtSettings { char* szIniSection; char* szIniName; @@ -218,12 +211,12 @@ void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, struct TWindowData *dat) } def = SRMSGDEFSET_BKGCOLOUR; - for (i=0; i < safe_sizeof(_extSettings); i++) { + for (i=0; i < SIZEOF(_extSettings); i++) { WritePrivateProfileStringA(_extSettings[i].szIniSection, _extSettings[i].szIniName, _itoa(M->GetDword(_extSettings[i].szDbModule, _extSettings[i].szDbSetting, _extSettings[i].dwDef), szBuf, 10), szIniFilename); } - for (i=0; i < safe_sizeof(_extSettings_v5); i++) { + for (i=0; i < SIZEOF(_extSettings_v5); i++) { WritePrivateProfileStringA(_extSettings_v5[i].szIniSection, _extSettings_v5[i].szIniName, _itoa(M->GetDword(_extSettings_v5[i].szDbModule, _extSettings_v5[i].szDbSetting, _extSettings_v5[i].dwDef), szBuf, 10), szIniFilename); } @@ -324,13 +317,13 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in if (dwFlags & THEME_READ_FONTS) { COLORREF defclr; - for (i=0; i < safe_sizeof(_extSettings); i++) { + for (i=0; i < SIZEOF(_extSettings); i++) { M->WriteDword(_extSettings[i].szDbModule, _extSettings[i].szDbSetting, GetPrivateProfileIntA(_extSettings[i].szIniSection, _extSettings[i].szIniName, _extSettings[i].dwDef, szIniFilename)); } if (version >= 5) { - for (i=0; i < safe_sizeof(_extSettings_v5); i++) { + for (i=0; i < SIZEOF(_extSettings_v5); i++) { M->WriteDword(_extSettings_v5[i].szDbModule, _extSettings_v5[i].szDbSetting, GetPrivateProfileIntA(_extSettings_v5[i].szIniSection, _extSettings_v5[i].szIniName, _extSettings_v5[i].dwDef, szIniFilename)); } diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index a40902dc0d..1e49f95f38 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -26,16 +26,12 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: themes.cpp 12512 2010-08-28 22:03:43Z silvercircle $ - * * Implements the skinning engine and most parts of the aero support in * tabSRMM 3.x+ * */ #include "commonheaders.h" -#include -#pragma hdrstop static SKINDESC my_default_skin[] = { IDR_SKIN_AERO, _T("tabskin_aero.png"), @@ -2582,7 +2578,7 @@ void CSkin::extractSkinsAndLogo(bool fForceOverwrite) const m_fAeroSkinsValid = true; try { - for (int i = 0; i < safe_sizeof(my_default_skin); i++) + for (int i = 0; i < SIZEOF(my_default_skin); i++) Utils::extractResource(g_hInst, my_default_skin[i].ulID, _T("SKIN_GLYPH"), tszBasePath, my_default_skin[i].tszName, fForceOverwrite); } catch(CRTException& ex) { diff --git a/plugins/TabSRMM/src/themes.h b/plugins/TabSRMM/src/themes.h new file mode 100644 index 0000000000..62b8efad81 --- /dev/null +++ b/plugins/TabSRMM/src/themes.h @@ -0,0 +1,413 @@ +/* + * 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 + * + * 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/translator.cpp b/plugins/TabSRMM/src/translator.cpp index 2aec8e1002..990d688dec 100644 --- a/plugins/TabSRMM/src/translator.cpp +++ b/plugins/TabSRMM/src/translator.cpp @@ -26,8 +26,6 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: translator.cpp 12999 2010-10-22 07:32:53Z silvercircle $ - * * handle pretranslated strings * */ diff --git a/plugins/TabSRMM/src/translator.h b/plugins/TabSRMM/src/translator.h new file mode 100644 index 0000000000..38f56b52b7 --- /dev/null +++ b/plugins/TabSRMM/src/translator.h @@ -0,0 +1,61 @@ +/* + * 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 + * + * 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/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index a653564415..48d6cb2417 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -30,15 +30,11 @@ * * (C) 2005-2009 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: trayicon.cpp 13447 2011-03-14 19:55:07Z george.hazan $ - * * The code that creates and animates the tray icon. * */ #include "commonheaders.h" -#pragma hdrstop -//#include "m_toptoolbar.h" static BOOL isAnimThreadRunning = TRUE; static HANDLE hTrayAnimThread = 0; @@ -244,7 +240,7 @@ void TSAPI AddContactToFavorites(HANDLE hContact, const TCHAR *szNickname, const TCHAR szFinalNick[100]; if (szNickname == NULL) { - mir_sntprintf(szFinalNick, safe_sizeof(szFinalNick), _T("%s"), (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)); + mir_sntprintf(szFinalNick, SIZEOF(szFinalNick), _T("%s"), (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)); } else { _tcsncpy(szFinalNick, szNickname, 100); @@ -269,7 +265,7 @@ void TSAPI AddContactToFavorites(HANDLE hContact, const TCHAR *szNickname, const if (acc && acc->tszAccountName) { mii.cbSize = sizeof(mii); - mir_sntprintf(szMenuEntry, safe_sizeof(szMenuEntry), _T("%s: %s (%s)"), acc->tszAccountName, szFinalNick, szStatus); + mir_sntprintf(szMenuEntry, SIZEOF(szMenuEntry), _T("%s: %s (%s)"), acc->tszAccountName, szFinalNick, szStatus); if (mode) { if (hMenu == PluginConfig.g_hMenuRecent) { if (CheckMenuItem(hMenu, (UINT_PTR)hContact, MF_BYCOMMAND | MF_UNCHECKED) == 0) { diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp index 6f65934041..8344486540 100644 --- a/plugins/TabSRMM/src/typingnotify.cpp +++ b/plugins/TabSRMM/src/typingnotify.cpp @@ -1,5 +1,5 @@ #include "commonheaders.h" -#pragma hdrstop + HANDLE hTypingNotify; static INT_PTR EnableDisableMenuCommand(WPARAM wParam,LPARAM lParam) diff --git a/plugins/TabSRMM/src/typingnotify.h b/plugins/TabSRMM/src/typingnotify.h new file mode 100644 index 0000000000..03fb9851b7 --- /dev/null +++ b/plugins/TabSRMM/src/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/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp index e176f14dbd..7a99d15480 100644 --- a/plugins/TabSRMM/src/userprefs.cpp +++ b/plugins/TabSRMM/src/userprefs.cpp @@ -26,9 +26,6 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: userprefs.cpp 12893 2010-10-04 06:19:57Z silvercircle $ - * - * * global/local message log options * local (per user) template overrides * view mode (ieview/default) @@ -38,16 +35,11 @@ #include "commonheaders.h" -#pragma hdrstop -#include #define UPREF_ACTION_APPLYOPTIONS 1 #define UPREF_ACTION_REMAKELOG 2 #define UPREF_ACTION_SWITCHLOGVIEWER 4 -extern HANDLE hUserPrefsWindowList; -extern struct TCpTable cpTable[]; - static HWND hCpCombo; static BOOL CALLBACK FillCpCombo(LPCTSTR str) @@ -489,7 +481,7 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP GetClientRect(hwndDlg, &rcClient); - mir_sntprintf(szBuffer, safe_sizeof(szBuffer), TranslateT("Set messaging options for %s"), + mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("Set messaging options for %s"), (TCHAR *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)); SetWindowText(hwndDlg, szBuffer); diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 34f1914e6d..741cea3ea2 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -26,14 +26,11 @@ * * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors * - * $Id: utils.cpp 13428 2011-03-10 13:15:44Z borkra $ - * * generic utility functions * */ #include "commonheaders.h" -#include #define MWF_LOG_BBCODE 1 #define MWF_LOG_TEXTFORMAT 0x2000000 diff --git a/plugins/TabSRMM/src/utils.h b/plugins/TabSRMM/src/utils.h new file mode 100644 index 0000000000..41284bcffb --- /dev/null +++ b/plugins/TabSRMM/src/utils.h @@ -0,0 +1,266 @@ +/* + * 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 + * + * 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/version.h b/plugins/TabSRMM/src/version.h new file mode 100644 index 0000000000..77e96ab0aa --- /dev/null +++ b/plugins/TabSRMM/src/version.h @@ -0,0 +1,14 @@ +#define __MAJOR_VERSION 3 +#define __MINOR_VERSION 1 +#define __RELEASE_NUM 99 +#define __BUILD_NUM 8 + +#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM + +#define __PLUGIN_NAME "TabSRMM" +#define __FILENAME "TabSRMM.dll" +#define __DESCRIPTION "IM and group chat module for Miranda NG." +#define __AUTHOR "The Miranda developers team and contributors" +#define __AUTHOREMAIL "silvercircle@gmail.com" +#define __AUTHORWEB "http://miranda-ng.org/" +#define __COPYRIGHT "© 2000-2010 Miranda Project and contributors. See readme.txt for more." diff --git a/plugins/TabSRMM/tabsrmm_10.vcxproj b/plugins/TabSRMM/tabsrmm_10.vcxproj index 5b1c2b1280..64599a6b87 100644 --- a/plugins/TabSRMM/tabsrmm_10.vcxproj +++ b/plugins/TabSRMM/tabsrmm_10.vcxproj @@ -198,6 +198,39 @@ + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + @@ -209,7 +242,6 @@ - @@ -218,12 +250,13 @@ + + Create - @@ -235,73 +268,42 @@ - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/TabSRMM/tabsrmm_10.vcxproj.filters b/plugins/TabSRMM/tabsrmm_10.vcxproj.filters index 780545c9b8..24ae2ebf8e 100644 --- a/plugins/TabSRMM/tabsrmm_10.vcxproj.filters +++ b/plugins/TabSRMM/tabsrmm_10.vcxproj.filters @@ -16,17 +16,44 @@ {c6aa9273-8563-4007-afa1-63e8d2164122} ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - {196b0a74-3839-43b9-a9e8-8220bd015468} - - - {34490cba-faaa-4738-91b7-f3f60bc24992} - - - {7dbf611a-769b-4495-9d7a-b7008268c0dc} + + {2ea6d9e6-399a-44c2-a431-9560e18f31fc} + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + Source Files @@ -87,6 +114,9 @@ Source Files + + Source Files + Source Files @@ -96,6 +126,9 @@ Source Files + + Source Files + Source Files @@ -129,138 +162,105 @@ Source Files - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files - - - Source Files - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat + + Header Files Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files + + Header Files\Chat + + + Header Files\Chat + + + Header Files\Chat + + + Header Files\Chat + - - Source Files\Chat - Resource Files Resource Files + + Resource Files + + + Resource Files + \ No newline at end of file diff --git a/plugins/TabSRMM/tabsrmm_11.vcxproj b/plugins/TabSRMM/tabsrmm_11.vcxproj index 1a5e431474..46f6a32dbf 100644 --- a/plugins/TabSRMM/tabsrmm_11.vcxproj +++ b/plugins/TabSRMM/tabsrmm_11.vcxproj @@ -202,6 +202,39 @@ + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + + + ..\commonheaders.h + @@ -213,7 +246,6 @@ - @@ -222,12 +254,13 @@ + + Create - @@ -239,73 +272,42 @@ - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - - - ../commonheaders.h - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/TabSRMM/tabsrmm_11.vcxproj.filters b/plugins/TabSRMM/tabsrmm_11.vcxproj.filters index 780545c9b8..24ae2ebf8e 100644 --- a/plugins/TabSRMM/tabsrmm_11.vcxproj.filters +++ b/plugins/TabSRMM/tabsrmm_11.vcxproj.filters @@ -16,17 +16,44 @@ {c6aa9273-8563-4007-afa1-63e8d2164122} ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - {196b0a74-3839-43b9-a9e8-8220bd015468} - - - {34490cba-faaa-4738-91b7-f3f60bc24992} - - - {7dbf611a-769b-4495-9d7a-b7008268c0dc} + + {2ea6d9e6-399a-44c2-a431-9560e18f31fc} + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + + + Source Files\Chat + Source Files @@ -87,6 +114,9 @@ Source Files + + Source Files + Source Files @@ -96,6 +126,9 @@ Source Files + + Source Files + Source Files @@ -129,138 +162,105 @@ Source Files - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files - - - Source Files - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat - - - Source Files\Chat + + Header Files Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files + + Header Files\Chat + + + Header Files\Chat + + + Header Files\Chat + + + Header Files\Chat + - - Source Files\Chat - Resource Files Resource Files + + Resource Files + + + Resource Files + \ No newline at end of file -- cgit v1.2.3