From fe557276119e48389b9a471d5a4ed5d232a2857d Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Tue, 19 Jun 2012 15:15:45 +0000 Subject: Good bye Bonsai git-svn-id: http://svn.miranda-ng.org/main/trunk@481 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- bin10/mir_full.sln | 10 - plugins/Bonsai/Bonsai.cpp | 128 -------- plugins/Bonsai/Bonsai.filters | 95 ------ plugins/Bonsai/Bonsai.rc | 121 -------- plugins/Bonsai/Bonsai.sln | 29 -- plugins/Bonsai/Bonsai.vcxproj | 194 ------------ plugins/Bonsai/OptArrange.rc | 111 ------- plugins/Bonsai/commonheaders.h | 70 ----- plugins/Bonsai/dlg_handlers.cpp | 456 ---------------------------- plugins/Bonsai/dlg_handlers.h | 50 ---- plugins/Bonsai/docs/Bonsai_readme.txt | 131 -------- plugins/Bonsai/hooked_events.cpp | 91 ------ plugins/Bonsai/hooked_events.h | 39 --- plugins/Bonsai/icons/hidden.bmp | Bin 822 -> 0 bytes plugins/Bonsai/icons/modified.bmp | Bin 822 -> 0 bytes plugins/Bonsai/icons/newlymodified.bmp | Bin 1062 -> 0 bytes plugins/Bonsai/icons/unmodified.bmp | Bin 822 -> 0 bytes plugins/Bonsai/list.cpp | 228 -------------- plugins/Bonsai/list.h | 94 ------ plugins/Bonsai/resource.h | 28 -- plugins/Bonsai/services.cpp | 192 ------------ plugins/Bonsai/services.h | 40 --- plugins/Bonsai/utils.cpp | 527 --------------------------------- plugins/Bonsai/utils.h | 64 ---- plugins/Bonsai/version.h | 44 --- plugins/Bonsai/version.rc | 100 ------- 26 files changed, 2842 deletions(-) delete mode 100644 plugins/Bonsai/Bonsai.cpp delete mode 100644 plugins/Bonsai/Bonsai.filters delete mode 100644 plugins/Bonsai/Bonsai.rc delete mode 100644 plugins/Bonsai/Bonsai.sln delete mode 100644 plugins/Bonsai/Bonsai.vcxproj delete mode 100644 plugins/Bonsai/OptArrange.rc delete mode 100644 plugins/Bonsai/commonheaders.h delete mode 100644 plugins/Bonsai/dlg_handlers.cpp delete mode 100644 plugins/Bonsai/dlg_handlers.h delete mode 100644 plugins/Bonsai/docs/Bonsai_readme.txt delete mode 100644 plugins/Bonsai/hooked_events.cpp delete mode 100644 plugins/Bonsai/hooked_events.h delete mode 100644 plugins/Bonsai/icons/hidden.bmp delete mode 100644 plugins/Bonsai/icons/modified.bmp delete mode 100644 plugins/Bonsai/icons/newlymodified.bmp delete mode 100644 plugins/Bonsai/icons/unmodified.bmp delete mode 100644 plugins/Bonsai/list.cpp delete mode 100644 plugins/Bonsai/list.h delete mode 100644 plugins/Bonsai/resource.h delete mode 100644 plugins/Bonsai/services.cpp delete mode 100644 plugins/Bonsai/services.h delete mode 100644 plugins/Bonsai/utils.cpp delete mode 100644 plugins/Bonsai/utils.h delete mode 100644 plugins/Bonsai/version.h delete mode 100644 plugins/Bonsai/version.rc diff --git a/bin10/mir_full.sln b/bin10/mir_full.sln index 131bd4bf2f..12747e331e 100644 --- a/bin10/mir_full.sln +++ b/bin10/mir_full.sln @@ -246,8 +246,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SecureIM_icons", "..\plugin EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xstatus_MRA", "..\protocols\MRA\xstatus_MRA\xstatus_MRA.vcxproj", "{5B84781D-F1C3-4535-99B7-B84B6C9BCF15}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Bonsai", "..\plugins\Bonsai\Bonsai.vcxproj", "{C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AddContactPlus", "..\plugins\AddContactPlus\addcontactplus_10.vcxproj", "{253ADD1D-F7C9-4643-A957-51BFCD61A5D2}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimpleStatusMsg", "..\plugins\SimpleStatusMsg\simplestatusmsg_10.vcxproj", "{D3D80E27-D099-41EC-AFB2-A891A33F1608}" @@ -1314,14 +1312,6 @@ Global {5B84781D-F1C3-4535-99B7-B84B6C9BCF15}.Release|Win32.Build.0 = Release|Win32 {5B84781D-F1C3-4535-99B7-B84B6C9BCF15}.Release|x64.ActiveCfg = Release|x64 {5B84781D-F1C3-4535-99B7-B84B6C9BCF15}.Release|x64.Build.0 = Release|x64 - {C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}.Debug|Win32.ActiveCfg = Debug|Win32 - {C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}.Debug|Win32.Build.0 = Debug|Win32 - {C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}.Debug|x64.ActiveCfg = Debug|x64 - {C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}.Debug|x64.Build.0 = Debug|x64 - {C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}.Release|Win32.ActiveCfg = Release|Win32 - {C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}.Release|Win32.Build.0 = Release|Win32 - {C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}.Release|x64.ActiveCfg = Release|x64 - {C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}.Release|x64.Build.0 = Release|x64 {253ADD1D-F7C9-4643-A957-51BFCD61A5D2}.Debug|Win32.ActiveCfg = Debug|Win32 {253ADD1D-F7C9-4643-A957-51BFCD61A5D2}.Debug|Win32.Build.0 = Debug|Win32 {253ADD1D-F7C9-4643-A957-51BFCD61A5D2}.Debug|x64.ActiveCfg = Debug|x64 diff --git a/plugins/Bonsai/Bonsai.cpp b/plugins/Bonsai/Bonsai.cpp deleted file mode 100644 index 7952b0e334..0000000000 --- a/plugins/Bonsai/Bonsai.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* -Bonsai plugin for Miranda IM - -Copyright © 2006 Cristian Libotean - -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. -*/ - -#include "commonheaders.h" - -#define ICON_SIZE 16 - -char ModuleName[] = "Bonsai"; -HINSTANCE hInstance; -int bUseANSIStrings = 0; - -HBITMAP hbModified = NULL; -HBITMAP hbUnmodified = NULL; -HBITMAP hbHidden = NULL; -HBITMAP hbNewlyModified = NULL; -HIMAGELIST imgList = NULL; - -PLUGINLINK *pluginLink; -int hLangpack; -struct MM_INTERFACE mmi; - -PLUGININFOEX pluginInfo = { - sizeof(PLUGININFOEX), - __PLUGIN_DISPLAY_NAME, - VERSION, - __DESC, - __AUTHOR, - __AUTHOREMAIL, - __COPYRIGHT, - __AUTHORWEB, - UNICODE_AWARE, //unicode aware - 0, - {0x2fe47261, 0x7f38, 0x45f4, {0x8f, 0xac, 0xb8, 0x7e, 0x97, 0x4a, 0x13, 0x50}} //{2fe47261-7f38-45f4-8fac-b87e974a1350} -}; - -extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion) -{ - return &pluginInfo; -} - -static const MUUID interfaces[] = {MIID_BONSAI, MIID_LAST}; - -extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces() -{ - return interfaces; -} - -extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) -{ - INITCOMMONCONTROLSEX icex; - icex.dwSize = sizeof(INITCOMMONCONTROLSEX); - icex.dwICC = ICC_LISTVIEW_CLASSES; - - InitCommonControls(); - - LogInit(); - - pluginLink = link; - mir_getMMI(&mmi); - mir_getLP(&pluginInfo); - - InitServices(); - - HookEvents(); - - hbModified = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_MODIFIED)); - hbUnmodified = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_UNMODIFIED)); - hbHidden = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_HIDDEN)); - hbNewlyModified = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_NEWLYMODIFIED)); - imgList = ImageList_Create(ICON_SIZE, ICON_SIZE, ILC_COLORDDB | ILC_MASK, 2, 1); - ImageList_AddMasked(imgList, hbUnmodified, RGB(255, 0, 255)); - ImageList_AddMasked(imgList, hbModified, RGB(255, 0, 255)); - ImageList_AddMasked(imgList, hbHidden, RGB(255, 0, 255)); - ImageList_AddMasked(imgList, hbNewlyModified, RGB(255, 0, 255)); - - //are we running on Windows 98 ? - OSVERSIONINFO vi = {0}; - vi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&vi); - bUseANSIStrings = (vi.dwPlatformId == VER_PLATFORM_WIN32_NT) ? 0 : 1; - char mirVer[512]; - CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(mirVer), (LPARAM) mirVer); - _strlwr(mirVer); - bUseANSIStrings = (strstr(mirVer, "unicode") == NULL) ? 1 : bUseANSIStrings; - Log("Windows 98 ? %d", bUseANSIStrings); - - return 0; -} - -extern "C" int __declspec(dllexport) Unload() -{ - DestroyServices(); - - UnhookEvents(); - - ImageList_Destroy(imgList); - - return 0; -} - -bool WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) -{ - hInstance = hinstDLL; - if (fdwReason == DLL_PROCESS_ATTACH) - { - DisableThreadLibraryCalls(hinstDLL); - } - - return TRUE; -} - diff --git a/plugins/Bonsai/Bonsai.filters b/plugins/Bonsai/Bonsai.filters deleted file mode 100644 index 3bb27e93ca..0000000000 --- a/plugins/Bonsai/Bonsai.filters +++ /dev/null @@ -1,95 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - - \ No newline at end of file diff --git a/plugins/Bonsai/Bonsai.rc b/plugins/Bonsai/Bonsai.rc deleted file mode 100644 index fbb66130c3..0000000000 --- a/plugins/Bonsai/Bonsai.rc +++ /dev/null @@ -1,121 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_OPT_FIXOPTIONS DIALOGEX 0, 0, 314, 240 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Dialog" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - GROUPBOX "Plugins",IDC_STATIC,4,4,306,182 - CONTROL "",IDC_LIST_PLUGINS,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,8,11,298,171 - GROUPBOX "Options group and title",IDC_STATIC,4,189,306,47 - LTEXT "Group:",IDC_STATIC,8,202,47,8 - EDITTEXT IDC_GROUP,57,199,127,14,ES_AUTOHSCROLL - LTEXT "Title:",IDC_STATIC,8,219,47,8 - EDITTEXT IDC_TITLE,57,215,127,14,ES_AUTOHSCROLL - PUSHBUTTON "&Save",IDC_SAVE,256,200,50,14 - PUSHBUTTON "&Reset",IDC_CANCEL,256,215,50,14 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_OPT_FIXOPTIONS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 310 - VERTGUIDE, 8 - VERTGUIDE, 306 - TOPMARGIN, 4 - BOTTOMMARGIN, 236 - HORZGUIDE, 11 - HORZGUIDE, 182 - HORZGUIDE, 189 - HORZGUIDE, 229 - HORZGUIDE, 231 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_MODIFIED BITMAP "icons\\modified.bmp" -IDB_UNMODIFIED BITMAP "icons\\unmodified.bmp" -IDB_NEWLYMODIFIED BITMAP "icons\\newlymodified.bmp" -IDB_HIDDEN BITMAP "icons\\hidden.bmp" -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/plugins/Bonsai/Bonsai.sln b/plugins/Bonsai/Bonsai.sln deleted file mode 100644 index 8a446a5ac1..0000000000 --- a/plugins/Bonsai/Bonsai.sln +++ /dev/null @@ -1,29 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Bonsai", "Bonsai.vcxproj", "{C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}" -EndProject -Global - GlobalSection(DPCodeReviewSolutionGUID) = preSolution - DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} - EndGlobalSection - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}.Debug|Win32.ActiveCfg = Debug|Win32 - {C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}.Debug|Win32.Build.0 = Debug|Win32 - {C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}.Debug|x64.ActiveCfg = Debug|x64 - {C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}.Debug|x64.Build.0 = Debug|x64 - {C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}.Release|Win32.ActiveCfg = Release|Win32 - {C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}.Release|Win32.Build.0 = Release|Win32 - {C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}.Release|x64.ActiveCfg = Release|x64 - {C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/plugins/Bonsai/Bonsai.vcxproj b/plugins/Bonsai/Bonsai.vcxproj deleted file mode 100644 index 653fb1cc29..0000000000 --- a/plugins/Bonsai/Bonsai.vcxproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - Bonsai - {C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67} - - - - DynamicLibrary - MultiByte - true - - - DynamicLibrary - MultiByte - - - DynamicLibrary - MultiByte - true - - - DynamicLibrary - MultiByte - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - Disabled - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) - _CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;FIXOPTIONS_EXPORTS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level3 - EditAndContinue - - - comctl32.lib;%(AdditionalDependencies) - true - Windows - $(IntDir)$(TargetName).lib - 0x2F080000 - false - - - ..\..\include\msapi - - - - - Disabled - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) - _CRT_SECURE_NO_DEPRECATE;WIN64;_DEBUG;_WINDOWS;_USRDLL;FIXOPTIONS_EXPORTS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level3 - - - comctl32.lib;%(AdditionalDependencies) - true - Windows - $(IntDir)$(TargetName).lib - 0x2F080000 - false - - - ..\..\include\msapi - - - - - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) - _CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;FIXOPTIONS_EXPORTS;%(PreprocessorDefinitions) - Level3 - Full - Size - OnlyExplicitInline - - - comctl32.lib;%(AdditionalDependencies) - true - Windows - true - true - 0x2F080000 - $(IntDir)$(TargetName).lib - false - - - ..\..\include\msapi - - - - - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) - _CRT_SECURE_NO_DEPRECATE;WIN64;NDEBUG;_WINDOWS;_USRDLL;FIXOPTIONS_EXPORTS;%(PreprocessorDefinitions) - Level3 - Full - Size - OnlyExplicitInline - - - comctl32.lib;%(AdditionalDependencies) - true - Windows - true - true - 0x2F080000 - $(IntDir)$(TargetName).lib - false - - - ..\..\include\msapi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/Bonsai/OptArrange.rc b/plugins/Bonsai/OptArrange.rc deleted file mode 100644 index ba9a6a0c50..0000000000 --- a/plugins/Bonsai/OptArrange.rc +++ /dev/null @@ -1,111 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_OPT_FIXOPTIONS DIALOGEX 0, 0, 314, 240 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Dialog" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - GROUPBOX "Plugins",IDC_STATIC,4,4,306,182 - CONTROL "",IDC_LIST_PLUGINS,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,8,11,298,171 - GROUPBOX "Options group and title",IDC_STATIC,4,189,306,47 - LTEXT "Group:",IDC_STATIC,8,202,47,8 - EDITTEXT IDC_GROUP,57,199,127,14,ES_AUTOHSCROLL - LTEXT "Title:",IDC_STATIC,8,219,47,8 - EDITTEXT IDC_TITLE,57,215,127,14,ES_AUTOHSCROLL - PUSHBUTTON "&Reset",IDC_CANCEL,256,215,50,14 - PUSHBUTTON "&Save",IDC_SAVE,256,200,50,14 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_OPT_FIXOPTIONS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 310 - VERTGUIDE, 8 - VERTGUIDE, 306 - TOPMARGIN, 4 - BOTTOMMARGIN, 236 - HORZGUIDE, 11 - HORZGUIDE, 182 - HORZGUIDE, 189 - HORZGUIDE, 229 - HORZGUIDE, 231 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/plugins/Bonsai/commonheaders.h b/plugins/Bonsai/commonheaders.h deleted file mode 100644 index 13420915f0..0000000000 --- a/plugins/Bonsai/commonheaders.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -Bonsai plugin for Miranda IM - -Copyright © 2006 Cristian Libotean - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef M_BONSAI_COMMONHEADERS_H -#define M_BONSAI_COMMONHEADERS_H - -#define MIRANDA_VER 0x0A00 - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef MODULES_H_ -typedef INT_PTR (*MIRANDASERVICE)(WPARAM,LPARAM); -#endif - -#include "newpluginapi.h" -#include "m_database.h" -#include "m_contacts.h" -#include "m_langpack.h" -#include "m_options.h" -//#include "m_hotkeys.h" -//#include "sdk/m_hotkeysplus.h" -#include "m_popup.h" -#include "m_utils.h" -#include "m_updater.h" -#include "m_system.h" - -#include "version.h" -#include "utils.h" -#include "services.h" -#include "list.h" -#include "dlg_handlers.h" -#include "hooked_events.h" - -#include "resource.h" - -extern char ModuleName[]; -extern HINSTANCE hInstance; -extern PLUGINLINK *pluginLink; -extern int bUseANSIStrings; - -extern HBITMAP hbModified; -extern HBITMAP hbUnmodified; -extern HBITMAP hbNewlyModified; -extern HIMAGELIST imgList; - -#endif //M_WWI_COMMONHEADERS_H \ No newline at end of file diff --git a/plugins/Bonsai/dlg_handlers.cpp b/plugins/Bonsai/dlg_handlers.cpp deleted file mode 100644 index 7bceb1026e..0000000000 --- a/plugins/Bonsai/dlg_handlers.cpp +++ /dev/null @@ -1,456 +0,0 @@ -/* -Bonsai plugin for Miranda IM - -Copyright © 2006 Cristian Libotean - -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. -*/ - -#include "dlg_handlers.h" -#include "commctrl.h" - -#define CMP(a, b) ( ((a == b) ? 0 : ((a < b) ? -1 : 1)) ) - -HWND hOptDlg = NULL; - -const char *szColumns[] = {"Plugin", "Current group", "Current title", "Initial group", "Initial title"}; -const int cxColumns[] = {100, 120, 120, 120, 120}; -const int cColumns = sizeof(szColumns) / sizeof(szColumns[0]); - -WNDPROC oldPluginsListProc = NULL; - -inline int SettingChanged(WCHAR *defaultSetting, WCHAR *currentSetting, int nullTrueValue, int trueValue, int falseValue) -{ - if (currentSetting == NULL) - { - return ((defaultSetting != NULL) && (wcslen(defaultSetting) != 0)) ? nullTrueValue : falseValue; - } - else{ - return (_wcsicmp(currentSetting, defaultSetting)) ? trueValue : falseValue; - } -} - -void UpdatePlugin(HWND hList, int index, PPluginOptions plugin, int newlyModified) -{ - const int MAX_SIZE = 256; - WCHAR buffer[MAX_SIZE]; - - GetPluginGroup(plugin, buffer, MAX_SIZE); - ListView_SetItemTextW(hList, index, 1, buffer); - - GetPluginTitle(plugin, buffer, MAX_SIZE); - ListView_SetItemTextW(hList, index, 2, buffer); - - if (newlyModified) - { - LVITEM item = {0}; - item.iItem = index; - item.mask = LVIF_IMAGE; - item.iImage = 3; - ListView_SetItem(hList, &item); - } - - ListView_SetItemTextW(hList, index, 3, plugin->szGroup); - - ListView_SetItemTextW(hList, index, 4, plugin->szTitle); -} - -int ItemOptionEntryChanged(int index, PPluginOptions plugin) -{ - const int MAX_SIZE = 256; - WCHAR buffer[MAX_SIZE]; - WCHAR *res; - - int changed = 0; - - res = GetPluginGroup(plugin, buffer, MAX_SIZE); - changed = SettingChanged(plugin->szGroup, res, 1, 1, 0); -// changed = (res == NULL) ? plugin->szGroup != NULL : (_wcsicmp(buffer, plugin->szGroup)) ? 1 : 0; - - res = GetPluginTitle(plugin, buffer, MAX_SIZE); - changed = SettingChanged(plugin->szTitle, res, 2, 1, changed); -// changed = (res == NULL) ? plugin->szTitle != NULL : (_wcsicmp(buffer, plugin->szTitle)) ? 1 : changed; - - return changed; -} - -void LoadPlugins(HWND hWnd, int bAll = 1) -{ - HWND hList = GetDlgItem(hWnd, IDC_LIST_PLUGINS); - - if (bAll) - { - ListView_DeleteAllItems(hList); - } - - int i; - int init = (bAll) ? 0 : ListView_GetItemCount(hList); - PPluginOptions plugin = NULL; - - LVITEMW item = {0}; - item.mask = LVIF_INDENT | LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM; - for (i = init; i < lstPluginOptions.Count(); i++) - { - plugin = lstPluginOptions[i]; - item.iItem = i; - item.lParam = (LPARAM) plugin; - item.pszText = plugin->szPlugin; - item.iImage = ItemOptionEntryChanged(i, plugin); - ListView_InsertItemW(hList, &item); - - UpdatePlugin(hList, i, plugin, 0); - } -} - -struct SortParams{ - HWND hList; - int column; -}; - -static int lastColumn = -1; - -int CALLBACK PluginsCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam) -{ - SortParams params = *(SortParams *) myParam; - int res; - const int MAX_SIZE = 1024; - - wchar_t text1[MAX_SIZE]; - wchar_t text2[MAX_SIZE]; - - ListView_GetItemTextW(params.hList, (int) lParam1, params.column, text1, MAX_SIZE); - ListView_GetItemTextW(params.hList, (int) lParam2, params.column, text2, MAX_SIZE); - - res = _wcsicmp(text1, text2); - - res = (params.column == lastColumn) ? -res : res; - - return res; -} - -int LoadColumns(HWND hList) -{ - int i; - int start = 0; - LVCOLUMN col; - col.mask = LVCF_TEXT | LVCF_WIDTH; - - while (ListView_DeleteColumn(hList, 1)) //delete all columns - { - start = 1; - } - - for (i = start; i < cColumns; i++) - { - col.pszText = TranslateTS(szColumns[i]); - - col.cx = cxColumns[i]; - - ListView_InsertColumn(hList, i, &col); - } - - return 0; -} - -void LoadPluginInfo(HWND hWnd, PPluginOptions plugin) -{ - if (plugin) - { - const int MAX_SIZE = 256; - WCHAR buffer[MAX_SIZE]; - - GetPluginGroup(plugin, buffer, MAX_SIZE); - SetWindowTextW(GetDlgItem(hWnd, IDC_GROUP), buffer); - - GetPluginTitle(plugin, buffer, MAX_SIZE); - SetWindowTextW(GetDlgItem(hWnd, IDC_TITLE), buffer); - } -} - -PPluginOptions GetSelectedPlugin(HWND hWnd, int *index = NULL) -{ - int i; - HWND hList = GetDlgItem(hWnd, IDC_LIST_PLUGINS); - int count = ListView_GetItemCount(hList); - for (i = 0; i < count; i++) - { - if (ListView_GetItemState(hList, i, LVIS_SELECTED) == LVIS_SELECTED) - { - LVITEM item = {0}; - item.iItem = i; - item.mask = LVIF_PARAM; - - if (index) - { - *index = i; - } - - ListView_GetItem(hList, &item); - return (PPluginOptions) item.lParam; - } - } - - if (index) - { - *index = -1; - } - return NULL; -} - -INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - static int bInitializing = 0; - switch (msg) - { - case WM_INITDIALOG: - { - bInitializing = 1; - hOptDlg = hWnd; - HWND hList = GetDlgItem(hWnd, IDC_LIST_PLUGINS); - - TranslateDialogDefault(hWnd); - - ListView_SetExtendedListViewStyleEx(hList, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT); - //ListView_SetImageList(hList, imgList, LVSIL_NORMAL); - ImageList_SetBkColor(imgList, RGB(255, 255, 255)); - ListView_SetImageList(hList, imgList, LVSIL_SMALL); - - //ListView_SetImageList(hList, imgList, LVSIL_STATE); - - LoadColumns(hList); - - LoadPlugins(hWnd); - - SortParams params = {0}; - params.hList = hList; - params.column = DBGetContactSettingByte(NULL, ModuleName, "LastSortColumn", -1); - ListView_SortItemsEx(hList, PluginsCompare, ¶ms); - - EnableWindow(GetDlgItem(hWnd, IDC_SAVE), 0); - EnableWindow(GetDlgItem(hWnd, IDC_CANCEL), 0); - EnableWindow(GetDlgItem(hWnd, IDC_GROUP), 0); - EnableWindow(GetDlgItem(hWnd, IDC_TITLE), 0); - - bInitializing = 0; - return TRUE; - break; - } - - case WM_DESTROY: - { - DBWriteContactSettingByte(NULL, ModuleName, "LastSortColumn", lastColumn); - hOptDlg = NULL; - - lastColumn = -1; - - break; - } - - case FOM_UPDATEPLUGINS: - { - LoadPlugins(hWnd, 0); - - break; - } - - case WM_COMMAND: - { - switch (LOWORD(wParam)) - { - case IDC_GROUP: - case IDC_TITLE: - { - if ((HIWORD(wParam) == EN_CHANGE)) - { - if (!bInitializing) - { - EnableWindow(GetDlgItem(hWnd, IDC_SAVE), 1); - EnableWindow(GetDlgItem(hWnd, IDC_CANCEL), 1); - } - } - - break; - } - - case IDC_SAVE: - { - int index; - PPluginOptions plugin = GetSelectedPlugin(hWnd, &index); - if (plugin) - { - WCHAR buffer[256]; - int changed = 0; - - GetWindowTextW(GetDlgItem(hWnd, IDC_GROUP), buffer, 256); - SavePluginGroup(plugin, buffer); - changed = (_wcsicmp(plugin->szGroup, buffer) != 0) ? 1 : 0; - - GetWindowTextW(GetDlgItem(hWnd, IDC_TITLE), buffer, 256); - SavePluginTitle(plugin, buffer); - changed = (_wcsicmp(plugin->szTitle, buffer) != 0) ? 1 : changed; - - UpdatePlugin(GetDlgItem(hWnd, IDC_LIST_PLUGINS), index, plugin, 1); - - } - EnableWindow(GetDlgItem(hWnd, IDC_SAVE), 0); - - break; - } - - case IDC_CANCEL: - { - int state = GetKeyState(VK_CONTROL); - if (state & (1 << 8)) //ctrl pressed - { - if (MessageBox(hWnd, Translate("This will reset all plugins to their default group and title.\nDo you wish to reset all plugins to their default group and title ?"), Translate("Proceed ?"), MB_YESNO | MB_ICONWARNING) == IDYES) - { - int i; - HWND hList = GetDlgItem(hWnd, IDC_LIST_PLUGINS); - int count = ListView_GetItemCount(hList); - LVITEM item = {0}; - item.mask = LVIF_PARAM; - - PPluginOptions plugin; - - for (i = 0; i < count; i++) - { - item.iItem = i; - ListView_GetItem(hList, &item); - plugin = (PPluginOptions) item.lParam; - SavePluginGroup(plugin, plugin->szGroup); - SavePluginTitle(plugin, plugin->szTitle); - UpdatePlugin(hList, i, plugin, 1); - } - - LoadPluginInfo(hWnd, GetSelectedPlugin(hWnd)); - } - } - else{ - int index; - PPluginOptions plugin = GetSelectedPlugin(hWnd, &index); - if (plugin) - { - SavePluginGroup(plugin, plugin->szGroup); - SavePluginTitle(plugin, plugin->szTitle); - - UpdatePlugin(GetDlgItem(hWnd, IDC_LIST_PLUGINS), index, plugin, 1); - LoadPluginInfo(hWnd, GetSelectedPlugin(hWnd)); - } - - EnableWindow(GetDlgItem(hWnd, IDC_SAVE), 0); - EnableWindow(GetDlgItem(hWnd, IDC_CANCEL), 0); - } - - break; - } - } - - break; - } - - case WM_NOTIFY: - { - switch(((LPNMHDR)lParam)->idFrom) - { - case 0: - { - switch (((LPNMHDR)lParam)->code) - { - case PSN_APPLY: - { - // - - break; - } - } - - break; - } - - case IDC_LIST_PLUGINS: - { - switch (((LPNMHDR)lParam)->code) - { - case LVN_COLUMNCLICK: - { - LPNMLISTVIEW lv = (LPNMLISTVIEW) lParam; - int column = lv->iSubItem; - SortParams params = {0}; - params.hList = GetDlgItem(hWnd, IDC_LIST_PLUGINS); - params.column = column; - - ListView_SortItemsEx(params.hList, PluginsCompare, (LPARAM) ¶ms); - lastColumn = (params.column == lastColumn) ? -1 : params.column; - - break; - } - - case LVN_ITEMCHANGED: - { - NMLISTVIEW *data = (NMLISTVIEW *) lParam; - if (data->uNewState & LVIS_SELECTED) //new item - { - LoadPluginInfo(hWnd, GetSelectedPlugin(hWnd)); - - EnableWindow(GetDlgItem(hWnd, IDC_SAVE), 0); - EnableWindow(GetDlgItem(hWnd, IDC_CANCEL), 1); - EnableWindow(GetDlgItem(hWnd, IDC_GROUP), 1); - EnableWindow(GetDlgItem(hWnd, IDC_TITLE), 1); - } - else{ //selected item - if (data->uOldState & LVIS_SELECTED) - { - const int MAX_SIZE = 256; - PPluginOptions plugin = (PPluginOptions) data->lParam; - if (plugin) - { - WCHAR group[MAX_SIZE]; - WCHAR title[MAX_SIZE]; - WCHAR newGroup[MAX_SIZE]; - WCHAR newTitle[MAX_SIZE]; - - GetPluginGroup(plugin, group, MAX_SIZE); - GetPluginTitle(plugin, title, MAX_SIZE); - GetWindowTextW(GetDlgItem(hWnd, IDC_GROUP), newGroup, MAX_SIZE); - GetWindowTextW(GetDlgItem(hWnd, IDC_TITLE), newTitle, MAX_SIZE); - - if ((wcscmp(group, newGroup)) || (wcscmp(title, newTitle))) - { - if (MessageBox(hWnd, Translate("Do you want to save the changes now ?"), Translate("Changes not saved"), MB_YESNO | MB_ICONINFORMATION) == IDYES) - { - SavePluginGroup(plugin, newGroup); - SavePluginTitle(plugin, newTitle); - - UpdatePlugin(GetDlgItem(hWnd, IDC_LIST_PLUGINS), data->iItem, plugin, 1); - } - } - } - } - } - - break; - } - } - - break; - } - } - - break; - } - } - - return 0; -} \ No newline at end of file diff --git a/plugins/Bonsai/dlg_handlers.h b/plugins/Bonsai/dlg_handlers.h deleted file mode 100644 index f51e7bb0d2..0000000000 --- a/plugins/Bonsai/dlg_handlers.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -Bonsai plugin for Miranda IM - -Copyright © 2006 Cristian Libotean - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef M_BONSAI_DLGHANDLERS_H -#define M_BONSAI_DLGHANDLERS_H - -#include "commonheaders.h" - -#define ListView_GetItemTextW(hwndLV, i, iSubItem_, pszText_, cchTextMax_) \ -{ LVITEMW _ms_lvi;\ - _ms_lvi.iSubItem = iSubItem_;\ - _ms_lvi.cchTextMax = cchTextMax_;\ - _ms_lvi.pszText = pszText_;\ - SNDMSG((hwndLV), LVM_GETITEMTEXTW, (WPARAM)(i), (LPARAM)(LVITEMW *)&_ms_lvi);\ -} - -#define ListView_SetItemTextW(hwndLV, i, iSubItem_, pszText_) \ -{ LVITEMW _ms_lvi;\ - _ms_lvi.iSubItem = iSubItem_;\ - _ms_lvi.pszText = pszText_;\ - SNDMSG((hwndLV), LVM_SETITEMTEXTW, (WPARAM)(i), (LPARAM)(LVITEMW *)&_ms_lvi);\ -} - -#define ListView_InsertItemW(hwnd, pitem) \ - (int)SNDMSG((hwnd), LVM_INSERTITEMW, 0, (LPARAM)(const LVITEMW *)(pitem)) - -#define FOM_UPDATEPLUGINS (WM_USER + 10) - -extern HWND hOptDlg; - -INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); - -#endif \ No newline at end of file diff --git a/plugins/Bonsai/docs/Bonsai_readme.txt b/plugins/Bonsai/docs/Bonsai_readme.txt deleted file mode 100644 index 42ea2d311a..0000000000 --- a/plugins/Bonsai/docs/Bonsai_readme.txt +++ /dev/null @@ -1,131 +0,0 @@ -Bonsai plugin v.0.0.2.5 -Copyright © 2006-2008 Cristian Libotean - -This plugin lets you rearrange the options tree by changing the options -groups and titles that plugin options are displayed under. Now you can -move those stubborn plugin options to create the structure you want in options. - -NOTE: This plugin works by using a hack, and you should backup your -profile before installing the plugin. - -***** IMPORTANT DISCLAIMER ***** - -Before using this plugin you should be aware that editing the groups -and titles of plugin option pages can make it extremely difficult for -other users to provide you with support, as they will not be able to help -you navigate the options tree if you have edited it to suit your -tastes. By using this plugin you implicitly agree that any changes you make -are carried out AT YOUR OWN RISK and you are SOLELY RESPONSIBLE for the -consequences of any changes you make. - -Please also note that this plugin may in some instances be incompatible -with language packs, as by its very nature it can change the text to be -translated. - - -Requirements -============ -The plugin requires an Unicode aware system, so if you're on Windows 98 -you need Microsoft Layer for Unicode, UNICOWS. This can be downloaded -at the URL below: - -http://www.microsoft.com/globaldev/handson/dev/mslu_announce.mspx - - - -How to Use -========== -Change the text in group and title to the group and title you wish to -use. For example, to move a plugin to Plugins > MyPlugin, set the Group -to Plugins and the Title to MyPlugin, then press Save. - -To make an options page the root of a group, set the group text to an -empty string. - -To hide a plugin page completely change the title text to an empty -string. - -You can reset all plugins to their default group and title by holding down control -and clicking on the Reset button. - - -Changes -======= -+ : new feature -* : changed -! : bufgix -- : feature removed or disabled because of pending bugs - -version 0.0.2.5 - 2011/08/23 - + made x64 version updater aware - -version 0.0.2.4 - 2009/11/16 - + x64 support (not tested !!) - -version 0.0.2.3 - 2008/01/24 - * Changed beta versions server. - -version 0.0.2.2 - 2007/04/24 - * forgot some debug code in :) - -version 0.0.2.1 - 2007/04/16 - + Rebased dll (0x2F080000) - -version 0.0.2.0 - 2007/03/06 - + Added UUID ( {2fe47261-7f38-45f4-8fac-b87e974a1350} ) - + Added BONSAI interface. - -version 0.0.1.5 - 2007/02/12 - + Added unicode flag. - -version 0.0.1.4 - 2007/01/31 - * Changed beta URL. - -version 0.0.1.3 - 2007/01/12 - ! Fix for ANSI miranda versions. - -version 0.0.1.2 - 2007/01/07 - + New version resource file. - * Requires at least Miranda 0.6. - -version 0.0.1.1 - 2006/11/26 - + Added dll version info. - * Changed controls tab order. - -version 0.0.1.0 - 2006/11/10 - ! Fixed possible crash for plugins without a group. - + Added icon for hidden option entries. - -version 0.0.0.8 - 2006/10/27 - + Added refresh icon when settings get changed. - * Restate the question when resetting all plugins to their default group and title. - -version 0.0.0.7 - 2006/10/26 - ! Fix for Miranda 0.6 tab titles on Windows 98 - -version 0.0.0.6 - 2006/10/25 - ! Fix for plugins using the new options page structure. - -version 0.0.0.5 - 2006/10/24 - + Added icons to the list of menu entries - -version 0.0.0.4 - 2006/09/29 - * Use Bonsai module to store settings - -version 0.0.0.3 - 2006/09/29 - ! Fix for Windows 98 (UNICOWS still required). - ! Old plugins kept their default group and title. - * Show plugin name in lowercase on Windows 98. - -version 0.0.0.2 - 2006/09/27 - * Support for oooold plugins which use a really old structure for the option pages. - + Major rewrite, most strings are now kept internally as Unicode. - This means that you need an Unicode aware system to use the plugin, if you're on Windows 98 you need UNICOWS, Microsoft Layer for Unicode. - * Changed plugin name, now it's Bonsai (thanks to the people on #miranda who suggested and voted the name :) ) - * Disable the edit windows if no item is selected. - * Clicking Reset while holding down Ctrl will reset all option pages to their default values. - * Ask to save changes when selecting a new item without saving first. - - -version 0.0.0.1 - 2006/09/26 - + First release \ No newline at end of file diff --git a/plugins/Bonsai/hooked_events.cpp b/plugins/Bonsai/hooked_events.cpp deleted file mode 100644 index a104946229..0000000000 --- a/plugins/Bonsai/hooked_events.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* -Bonsai plugin for Miranda IM - -Copyright © 2006 Cristian Libotean - -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. -*/ - -#include "hooked_events.h" - -HANDLE hModulesLoaded; -HANDLE hOptionsInitialize; - -UINT_PTR hRefreshTimer = NULL; - -#define HOST "http://eblis.tla.ro/projects" - -#if defined(WIN64) || defined(_WIN64) - #define FIXOPTIONS_VERSION_URL HOST "/miranda/Bonsai/updater/x64/Bonsai.html" - #define FIXOPTIONS_UPDATE_URL HOST "/miranda/Bonsai/updater/x64/Bonsai.zip" -#else - #define FIXOPTIONS_VERSION_URL HOST "/miranda/Bonsai/updater/Bonsai.html" - #define FIXOPTIONS_UPDATE_URL HOST "/miranda/Bonsai/updater/Bonsai.zip" -#endif -#define FIXOPTIONS_VERSION_PREFIX "Bonsai version " - - -int HookEvents() -{ - hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); - hOptionsInitialize = HookEvent(ME_OPT_INITIALISE, OnOptionsInitialise); - - //UpdateTimer(); - - return 0; -} - -int UnhookEvents() -{ - UnhookEvent(hModulesLoaded); - UnhookEvent(hOptionsInitialize); - - return 0; -} - -int OnModulesLoaded(WPARAM wParam, LPARAM lParam) -{ - char buffer[1024]; - Update update = {0}; - update.cbSize = sizeof(Update); - update.szComponentName = __PLUGIN_DISPLAY_NAME; - update.pbVersion = (BYTE *) CreateVersionString(VERSION, buffer); - update.cpbVersion = (int) strlen((char *) update.pbVersion); - update.szUpdateURL = UPDATER_AUTOREGISTER; - update.szBetaVersionURL = FIXOPTIONS_VERSION_URL; - update.szBetaUpdateURL = FIXOPTIONS_UPDATE_URL; - update.pbBetaVersionPrefix = (BYTE *) FIXOPTIONS_VERSION_PREFIX; - update.cpbBetaVersionPrefix = (int) strlen(FIXOPTIONS_VERSION_PREFIX); - CallService(MS_UPDATE_REGISTER, 0, (LPARAM) &update); - - return 0; -} - -int OnOptionsInitialise(WPARAM wParam, LPARAM lParam) -{ - OPTIONSDIALOGPAGE odp = {0}; - odp.cbSize = sizeof(odp); - odp.position = 100000000; - odp.hInstance = hInstance; - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FIXOPTIONS); - odp.pszTitle = LPGEN(("Arrange Options"); - odp.pszGroup = LPGEN(("Services"); - odp.groupPosition = 810000000; - odp.flags = ODPF_BOLDGROUPS; - odp.pfnDlgProc = DlgProcOptions; - Options_AddPage(wParam, &odp); - - return 0; -} \ No newline at end of file diff --git a/plugins/Bonsai/hooked_events.h b/plugins/Bonsai/hooked_events.h deleted file mode 100644 index 70c1a0d0c6..0000000000 --- a/plugins/Bonsai/hooked_events.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -Bonsai plugin for Miranda IM - -Copyright © 2006 Cristian Libotean - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#ifndef M_BONSAI_HOOKED_EVENTS_H -#define M_BONSAI_HOOKED_EVENTS_H - -#include "commonheaders.h" -#include "dlg_handlers.h" - -extern HANDLE hModulesLoaded; -extern HANDLE hOptionsInitialize; - -extern UINT_PTR hRefreshTimer; - -int HookEvents(); -int UnhookEvents(); - -int OnModulesLoaded(WPARAM wParam, LPARAM lParam); -int OnOptionsInitialise(WPARAM wParam, LPARAM lParam); - -#endif \ No newline at end of file diff --git a/plugins/Bonsai/icons/hidden.bmp b/plugins/Bonsai/icons/hidden.bmp deleted file mode 100644 index 6ec1e60428..0000000000 Binary files a/plugins/Bonsai/icons/hidden.bmp and /dev/null differ diff --git a/plugins/Bonsai/icons/modified.bmp b/plugins/Bonsai/icons/modified.bmp deleted file mode 100644 index 1d9e13262a..0000000000 Binary files a/plugins/Bonsai/icons/modified.bmp and /dev/null differ diff --git a/plugins/Bonsai/icons/newlymodified.bmp b/plugins/Bonsai/icons/newlymodified.bmp deleted file mode 100644 index 87f7cc48f4..0000000000 Binary files a/plugins/Bonsai/icons/newlymodified.bmp and /dev/null differ diff --git a/plugins/Bonsai/icons/unmodified.bmp b/plugins/Bonsai/icons/unmodified.bmp deleted file mode 100644 index c9d552c032..0000000000 Binary files a/plugins/Bonsai/icons/unmodified.bmp and /dev/null differ diff --git a/plugins/Bonsai/list.cpp b/plugins/Bonsai/list.cpp deleted file mode 100644 index a7ce5c1033..0000000000 --- a/plugins/Bonsai/list.cpp +++ /dev/null @@ -1,228 +0,0 @@ -/* -Bonsai plugin for Miranda IM - -Copyright © 2006 Cristian Libotean - -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. -*/ - -#include "list.h" - -COptionsList &lstPluginOptions = COptionsList(); - -COptionsList::COptionsList(int initialCapacity) -{ - _plugins = NULL; - _count = 0; - _capacity = 0; - - Enlarge(initialCapacity); -} - -COptionsList::~COptionsList() -{ - Clear(); - free(_plugins); -} - -void COptionsList::Clear() -{ - int i; - for (i = 0; i < Count(); i++) - { - delete _plugins[i]; - } - _count = 0; -} - -int COptionsList::Count() const -{ - return _count; -} - -int COptionsList::Capacity() const -{ - return _capacity; -} - -void COptionsList::EnsureCapacity() -{ - if (_count >= _capacity) - { - Enlarge(_capacity / 2); - } -} - -void COptionsList::Enlarge(int increaseAmount) -{ - int newSize = _capacity + increaseAmount; - _plugins = (PPluginOptions *) realloc(_plugins, newSize * sizeof(PPluginOptions)); - _capacity = newSize; -} - -int COptionsList::Contains(const WCHAR *plugin, const WCHAR *group, const WCHAR *title) const -{ - int pos = Index(plugin, group, title); - return (pos >= 0); -} - -int COptionsList::Index(const WCHAR *plugin, const WCHAR *group, const WCHAR *title) const -{ - int i; - DWORD hPlugin = LangPackHashW(plugin); - DWORD hGroup = LangPackHashW(group); - DWORD hTitle = LangPackHashW(title); - PPluginOptions p; - - for (i = 0; i < Count(); i++) - { - p = _plugins[i]; - if ((hPlugin == p->pluginHash) && (hGroup == p->groupHash) && (hTitle == p->titleHash)) - { - return i; - } - } - - return -1; -} - -int COptionsList::Add(const WCHAR *plugin, const WCHAR *group, const WCHAR *title) -{ - int pos = Index(plugin, group, title); - if (pos < 0) - { - EnsureCapacity(); - - PPluginOptions s = new TPluginOptions(plugin, group, title, LangPackHashW(plugin), LangPackHashW(group), LangPackHashW(title)); - _plugins[_count++] = s; - if (hOptDlg) - { - SendMessage(hOptDlg, FOM_UPDATEPLUGINS, 0, 0); - } - pos = _count - 1; - } - - return pos; -} - -int COptionsList::Remove(int index) -{ - if ((index < 0) && (index >= Count())) - { - return 1; - } - - int i; - PPluginOptions tmp = _plugins[index]; - for (i = index; i < _count - 1; i++) - { - _plugins[i] = _plugins[i + 1]; - } - _count--; - delete tmp; - - return 0; -} - -const PPluginOptions COptionsList::operator [](int index) -{ - if ((index < 0) || (index >= Count())) - { - return NULL; - } - - return _plugins[index]; -} - -char *BuildPluginUniqueID(PPluginOptions plugin, char *out, int size, int type) -{ - mir_snprintf(out, size, "%lu-%lu-%lu-%s", plugin->pluginHash, plugin->groupHash, plugin->titleHash, (type == ID_GROUP) ? "G" : "T"); - - return out; -} - -WCHAR *GetPluginGroup(PPluginOptions plugin, WCHAR *group, int count) -{ - char name[256]; - WCHAR *res = plugin->szGroup; - - BuildPluginUniqueID(plugin, name, 256, ID_GROUP); - - GetStringFromDatabase(name, plugin->szGroup, group, count); - res = (wcslen(group) == 0) ? NULL : group; - - return res; -} - -WCHAR *GetPluginTitle(PPluginOptions plugin, WCHAR *title, int count) -{ - char name[256]; - WCHAR *res = plugin->szTitle; - - BuildPluginUniqueID(plugin, name, 256, ID_TITLE); - - GetStringFromDatabase(name, plugin->szTitle, title, count); - res = (wcslen(title) == 0) ? NULL : title; - - return res; -} - -void SavePluginGroup(PPluginOptions plugin, WCHAR *newGroup) -{ - char name[256]; - int del = 0; - - BuildPluginUniqueID(plugin, name, 256, ID_GROUP); - - if (plugin->szGroup) - { - del = (wcscmp(plugin->szGroup, newGroup) == 0) ? 1 : 0; - } - else{ - del = ((!newGroup) || (wcslen(newGroup) == 0)) ? 1 : 0; - } - - if (del) - { - DBDeleteContactSetting(NULL, ModuleName, name); - } - else{ - DBWriteContactSettingWString(NULL, ModuleName, name, newGroup); - } -} - -void SavePluginTitle(PPluginOptions plugin, WCHAR *newTitle) -{ - char name[256]; - int del = 0; - - BuildPluginUniqueID(plugin, name, sizeof(name), ID_TITLE); - - if (plugin->szTitle) - { - del = (wcscmp(plugin->szTitle, newTitle) == 0) ? 1 : 0; - } - else{ - del = ((!newTitle) || (wcslen(newTitle)) == 0) ? 1 : 0; - } - - if (del) - { - DBDeleteContactSetting(NULL, ModuleName, name); - } - else{ - DBWriteContactSettingWString(NULL, ModuleName, name, newTitle); - } -} \ No newline at end of file diff --git a/plugins/Bonsai/list.h b/plugins/Bonsai/list.h deleted file mode 100644 index 7143cb0f55..0000000000 --- a/plugins/Bonsai/list.h +++ /dev/null @@ -1,94 +0,0 @@ -/* -Bonsai plugin for Miranda IM - -Copyright © 2006 Cristian Libotean - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef M_BONSAI_LIST_H -#define M_BONSAI_LIST_H - -#define INITIAL_SIZE 20 - -#include "commonheaders.h" - -#define ID_GROUP 1 -#define ID_TITLE 2 - -struct TPluginOptions{ - WCHAR *szPlugin; - WCHAR *szGroup; - WCHAR *szTitle; - - DWORD pluginHash; - DWORD groupHash; - DWORD titleHash; - - TPluginOptions(const WCHAR *plugin, const WCHAR *group, const WCHAR *title, DWORD pluginHash, DWORD groupHash, DWORD titleHash) - { - szPlugin = _wcsdup(plugin); - szGroup = _wcsdup(group); - szTitle = _wcsdup(title); - this->pluginHash = pluginHash; - this->groupHash = groupHash; - this->titleHash = titleHash; - } - - ~TPluginOptions() - { - free(this->szPlugin); - free(this->szGroup); - free(this->szTitle); - } -}; - -typedef TPluginOptions *PPluginOptions; - -class COptionsList{ - protected: - PPluginOptions *_plugins; - int _count; - int _capacity; - - void Enlarge(int increaseAmount); - void EnsureCapacity(); - - public: - COptionsList(int initialSize = INITIAL_SIZE); - ~COptionsList(); - - void Clear(); - - int Add(const WCHAR *plugin, const WCHAR *group, const WCHAR *title); - int Remove(int index); - int Contains(const WCHAR *plugin, const WCHAR *group, const WCHAR *title) const; - int Index(const WCHAR *plugin, const WCHAR *group, const WCHAR *title) const; - - const PPluginOptions operator [](int index); - - int Count() const; - int Capacity() const; -}; - -extern COptionsList &lstPluginOptions; //list of services - -WCHAR *BuildPluginUniqueID(PPluginOptions plugin, WCHAR *out, int size, int type); -WCHAR *GetPluginGroup(PPluginOptions plugin, WCHAR *group, int count); -WCHAR *GetPluginTitle(PPluginOptions plugin, WCHAR *title, int count); -void SavePluginGroup(PPluginOptions plugin, WCHAR *newGroup); -void SavePluginTitle(PPluginOptions plugin, WCHAR *newTitle); - -#endif //M_SERVICESLIST_LIST_H \ No newline at end of file diff --git a/plugins/Bonsai/resource.h b/plugins/Bonsai/resource.h deleted file mode 100644 index fa0aefbfec..0000000000 --- a/plugins/Bonsai/resource.h +++ /dev/null @@ -1,28 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Bonsai.rc -// -#define IDD_FIXOPTIONS 101 -#define IDD_OPT_FIXOPTIONS 101 -#define IDB_MODIFIED 104 -#define IDB_UNMODIFIED 105 -#define IDB_NEWLYMODIFIED 106 -#define IDB_BITMAP1 107 -#define IDB_HIDDEN 107 -#define IDC_LIST_PLUGINS 1003 -#define IDC_GROUP 1004 -#define IDC_TITLE 1006 -#define IDC_SAVE 1007 -#define IDC_CANCEL 1008 -#define IDC_BUTTON1 1009 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 108 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1010 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/plugins/Bonsai/services.cpp b/plugins/Bonsai/services.cpp deleted file mode 100644 index b555d2d7d1..0000000000 --- a/plugins/Bonsai/services.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/* -Bonsai plugin for Miranda IM - -Copyright © 2006 Cristian Libotean - -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. -*/ - -#include "services.h" - -static CRITICAL_SECTION csServices; - -static DWORD OPTIONS_ADDPAGE_HASH = NameHashFunction("Opt/AddPage"); - -CALLSERVICEFUNCTION realCallServiceFunction = NULL; - -int InitServices() -{ - InitializeCriticalSection(&csServices); - - HookRealServices(); - - return 0; -} - -int DestroyServices() -{ - UnhookRealServices(); - - DeleteCriticalSection(&csServices); - - return 0; -} - -void HookRealServices() -{ - Log("Hooking real CallService(). Replacing 0x%p with 0x%p", pluginLink->CallService, BonsaiCallServiceFunction); - realCallServiceFunction = pluginLink->CallService; - pluginLink->CallService = BonsaiCallServiceFunction; -} - -void UnhookRealServices() -{ - Log("Unhooking real CallService(). Replacing 0x%p with 0x%p", pluginLink->CallService, realCallServiceFunction); - EnterCriticalSection(&csServices); - - pluginLink->CallService = realCallServiceFunction; - - LeaveCriticalSection(&csServices); -} - -INT_PTR BonsaiCallServiceFunction(const char *name, WPARAM wParam, LPARAM lParam) -{ - int res; - int run = 1; - int fix = 0; - const int MAX_SIZE = 256; - WCHAR group[MAX_SIZE]; - WCHAR title[MAX_SIZE]; - WCHAR tabTitle[MAX_SIZE]; - - BYTE temp[200] = {0}; - OPTIONSDIALOGPAGE *options = (OPTIONSDIALOGPAGE *) lParam; - - if (NameHashFunction(name) == OPTIONS_ADDPAGE_HASH) - { - memmove(temp, options, options->cbSize); - options = (OPTIONSDIALOGPAGE *) temp; - //EnterCriticalSection(&csServices); - if ((options->cbSize > 60) && !(options->flags & ODPF_UNICODE) && (options->pszTab) && (!bUseANSIStrings)) - { - MultiByteToWideChar(CP_ACP, 0, options->pszTab, -1, tabTitle, MAX_SIZE); - options->pszTab = (char *) tabTitle; - } - - FixPluginOptions(name, options, group, MAX_SIZE, title, MAX_SIZE); - if (!options->pszTitle) - { - run = 0; - } - } - res = (run) ? realCallServiceFunction(name, wParam, (LPARAM) options) : CALLSERVICE_NOTFOUND; - - return res; -} - -int FixPluginOptions(const char *serviceName, void *options, WCHAR *group, int cGroup, WCHAR *title, int cTitle) -{ - MEMORY_BASIC_INFORMATION mbi; - HINSTANCE hInstance; - const int MODULE_MAX_SIZE = 256; - char mod[MODULE_MAX_SIZE]; - WCHAR plugin[MODULE_MAX_SIZE]; - mod[0] = '\0'; - if(VirtualQuery(serviceName, &mbi, sizeof(mbi) )) - { - hInstance = (HINSTANCE)(mbi.AllocationBase); - char mod_path[MAX_PATH]; - GetModuleFileName(hInstance, mod_path, MAX_PATH); - // chop path - char *p = strrchr(mod_path, '.'); - if (p) - { - p[0] = '\0'; - } - - p = strrchr(mod_path, '\\'); - if(p) - { - p++; - strncpy(mod, p, sizeof(mod)); - } - } - - if (strlen(mod) > 0) - { - if (bUseANSIStrings) - { - _strlwr(mod); - } - MultiByteToWideChar(CP_ACP, 0, mod, -1, plugin, MODULE_MAX_SIZE); - const int MAX_SIZE = 256; - WCHAR temp1[MAX_SIZE]; - WCHAR temp2[MAX_SIZE]; - WCHAR *optGroup = temp1; - WCHAR *optTitle = temp2; - OPTIONSDIALOGPAGE *odp = (OPTIONSDIALOGPAGE *) options; - temp1[0] = temp2[0] = L'\0'; - - if ((odp->flags & ODPF_UNICODE) && (odp->cbSize > 40)) - { - - optGroup = (WCHAR *) odp->pszGroup; - optTitle = (WCHAR *) odp->pszTitle; - - Log("[UNICODE] %-15S - Initial options location %S->%S (unicode)", plugin, optGroup, optTitle); - } - else{ - Log(" %-15S - Initial options location %s->%s", plugin, odp->pszGroup, odp->pszTitle); - MultiByteToWideChar(CP_ACP, 0, odp->pszGroup, -1, temp1, MAX_SIZE); - MultiByteToWideChar(CP_ACP, 0, odp->pszTitle, -1, temp2, MAX_SIZE); - - if (odp->cbSize > 40) //some old plugins don't have flags variable in structure - { - odp->flags |= ODPF_UNICODE; - } - } - - int index = lstPluginOptions.Add(plugin, optGroup, optTitle); - odp->pszGroup = (char *) GetPluginGroup(lstPluginOptions[index], group, cGroup); - odp->pszTitle = (char *) GetPluginTitle(lstPluginOptions[index], title, cTitle); - Log("[UNICODE] %-15S - New options location %S->%S", plugin, odp->pszGroup, odp->pszTitle); - - if ((bUseANSIStrings) || (odp->cbSize <= 40)) //if plugins doesn't have flags variable in structure then they only support ansi strings - { - Log(" Plugin is either very old or we're running on Windows 98, converting back to ansi strings ..."); - WCHAR temp[MAX_SIZE]; - - if (odp->pszGroup) - { - wcsncpy(temp, (WCHAR *) odp->pszGroup, MAX_SIZE); - WideCharToMultiByte(CP_ACP, 0, temp, -1, odp->pszGroup, cGroup, NULL, NULL); - } - - if (odp->pszTitle) - { - wcsncpy(temp, (WCHAR *) odp->pszTitle, MAX_SIZE); - WideCharToMultiByte(CP_ACP, 0, temp, -1, odp->pszTitle, cTitle, NULL, NULL); - } - - if (odp->cbSize > 40) - { - Log(" Windows98 - Resetting ODPF_UNICODE flag"); - odp->flags &= ~ODPF_UNICODE; - } - } - } - - return 0; -} \ No newline at end of file diff --git a/plugins/Bonsai/services.h b/plugins/Bonsai/services.h deleted file mode 100644 index a78ba2b75c..0000000000 --- a/plugins/Bonsai/services.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -Bonsai plugin for Miranda IM - -Copyright © 2006 Cristian Libotean - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef M_BONSAI_SERVICES_H -#define M_BONSAI_SERVICES_H - -#include "commonheaders.h" - -typedef INT_PTR (*CALLSERVICEFUNCTION) (const char *, WPARAM wParam, LPARAM lParam); - -extern CALLSERVICEFUNCTION realCallServiceFunction; - -int InitServices(); -int DestroyServices(); - -void HookRealServices(); -void UnhookRealServices(); - -INT_PTR BonsaiCallServiceFunction(const char *name, WPARAM wParam, LPARAM lParam); - -int FixPluginOptions(const char *serviceName, void *options, WCHAR *group, int cGroup, WCHAR *title, int cTitle); - -#endif //M_SERVICESLIST_SERVICES_H diff --git a/plugins/Bonsai/utils.cpp b/plugins/Bonsai/utils.cpp deleted file mode 100644 index 1f62ac32c8..0000000000 --- a/plugins/Bonsai/utils.cpp +++ /dev/null @@ -1,527 +0,0 @@ -/* -Bonsai plugin for Miranda IM - -Copyright © 2006 Cristian Libotean - -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. -*/ - -#include "utils.h" - -int LogInit() -{ -#ifdef USE_LOG - //FILE *fout = fopen(LOG_FILE, "wt"); - //fclose(fout); - Log("********************** Miranda started **********************"); -#endif - return 0; -} - -int Log(char *format, ...) -{ -#ifdef USE_LOG - char str[4096]; - va_list vararg; - int tBytes; - FILE *fout = fopen(LOG_FILE, "at"); - if (!fout) - { -// MessageBox(0, "can't open file", NULL, MB_OK); - return -1; - } - time_t tNow = time(NULL); - struct tm *now = localtime(&tNow); - strftime(str, sizeof(str), "%d %b %Y @ %H:%M:%S: ", now); - fputs(str, fout); - va_start(vararg, format); - - tBytes = _vsnprintf(str, sizeof(str), format, vararg); - if (tBytes > 0) - { - str[tBytes] = 0; - } - - va_end(vararg); - if (str[strlen(str) - 1] != '\n') - { - strcat(str, "\n"); - } - fputs(str, fout); - fclose(fout); -#endif - return 0; -} - -int Info(char *title, char *format, ...) -{ - char str[4096]; - va_list vararg; - int tBytes; - va_start(vararg, format); - tBytes = _vsnprintf(str, sizeof(str), format, vararg); - if (tBytes > 0) - { - str[tBytes] = 0; - } - va_end(vararg); - return MessageBoxA(0, str, title, MB_OK | MB_ICONINFORMATION); -} - -int MyPUShowMessage(char *lpzText, BYTE kind) -{ - if (ServiceExists(MS_POPUP_SHOWMESSAGE)) - { - return PUShowMessage(lpzText, kind); - } - else{ - char *title = (kind == SM_NOTIFY) ? Translate("Notify") : Translate("Warning"); - - return MessageBox(NULL, lpzText, title, MB_OK | (kind == SM_NOTIFY) ? MB_ICONINFORMATION : MB_ICONEXCLAMATION); - } -} - -#define HEX_SIZE 8 - -char *BinToHex(int size, PBYTE data) -{ - char *szresult = NULL; - char buffer[32] = {0}; //should be more than enough - int maxSize = size * 2 + HEX_SIZE + 1; - szresult = (char *) new char[ maxSize ]; - memset(szresult, 0, maxSize); - sprintf(buffer, "%0*X", HEX_SIZE, size); - strcpy(szresult, buffer); - int i; - for (i = 0; i < size; i++) - { - sprintf(buffer, "%02X", data[i]); - strcpy(szresult + (HEX_SIZE + i * 2), buffer); - } - return szresult; -} - -void HexToBin(char *inData, ULONG &size, LPBYTE &outData) -{ - char buffer[32] = {0}; - strcpy(buffer, "0x"); - strncpy(buffer + 2, inData, HEX_SIZE); - sscanf(buffer, "%x", &size); - outData = (unsigned char*)new char[size*2]; - UINT i; - //size = i; - char *tmp = inData + HEX_SIZE; - buffer[4] = '\0'; //mark the end of the string - for (i = 0; i < size; i++) - { - strncpy(buffer + 2, &tmp[i * 2], 2); - sscanf(buffer, "%x", &outData[i]); - } - i = size; -} - -int GetStringFromDatabase(HANDLE hContact, char *szModule, char *szSettingName, char *szError, char *szResult, size_t size) -{ - DBVARIANT dbv = {0}; - int res = 1; - size_t len; - dbv.type = DBVT_ASCIIZ; - if (DBGetContactSetting(hContact, szModule, szSettingName, &dbv) == 0) - { - res = 0; - size_t tmp = strlen(dbv.pszVal); - len = (tmp < size - 1) ? tmp : size - 1; - strncpy(szResult, dbv.pszVal, len); - szResult[len] = '\0'; - mir_free(dbv.pszVal); - } - else{ - res = 1; - if (szError) - { - size_t tmp = strlen(szError); - len = (tmp < size - 1) ? tmp : size - 1; - strncpy(szResult, szError, len); - szResult[len] = '\0'; - } - else{ - szResult[0] = '\0'; - } - } - return res; -} - -int GetStringFromDatabase(HANDLE hContact, char *szModule, char *szSettingName, WCHAR *szError, WCHAR *szResult, size_t count) -{ - DBVARIANT dbv = {0}; - int res = 1; - size_t len; - dbv.type = DBVT_WCHAR; - if (DBGetContactSettingWString(hContact, szModule, szSettingName, &dbv) == 0) - { - res = 0; - if (dbv.type != DBVT_WCHAR) - { - MultiByteToWideChar(CP_ACP, 0, dbv.pszVal, -1, szResult, (int) count); - } - else{ - size_t tmp = wcslen(dbv.pwszVal); - len = (tmp < count - 1) ? tmp : count - 1; - wcsncpy(szResult, dbv.pwszVal, len); - szResult[len] = L'\0'; - } - mir_free(dbv.pwszVal); - } - else{ - res = 1; - if (szError) - { - size_t tmp = wcslen(szError); - len = (tmp < count - 1) ? tmp : count - 1; - wcsncpy(szResult, szError, len); - szResult[len] = L'\0'; - } - else{ - szResult[0] = L'\0'; - } - } - return res; -} - -int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, size_t size) -{ - return GetStringFromDatabase(NULL, ModuleName, szSettingName, szError, szResult, size); -} - -int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, size_t count) -{ - return GetStringFromDatabase(NULL, ModuleName, szSettingName, szError, szResult, count); -} - -#pragma warning (disable: 4312) -TCHAR *GetContactName(HANDLE hContact, char *szProto) -{ - CONTACTINFO ctInfo; - int ret; - char proto[200]; - - ZeroMemory((void *) &ctInfo, sizeof(ctInfo)); - ctInfo.cbSize = sizeof(ctInfo); - if (szProto) - { - ctInfo.szProto = szProto; - } - else{ - GetContactProtocol(hContact, proto, sizeof(proto)); - ctInfo.szProto = proto; - } - ctInfo.dwFlag = CNF_DISPLAY; - - ctInfo.dwFlag += CNF_UNICODE; - - ctInfo.hContact = hContact; - //_debug_message("retrieving contact name for %d", hContact); - ret = CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) &ctInfo); - //_debug_message(" contact name %s", ctInfo.pszVal); - TCHAR *buffer; - if (!ret) - { - buffer = _tcsdup(ctInfo.pszVal); - } - mir_free(ctInfo.pszVal); - if (!ret) - { - return buffer; - } - else{ - return NULL; - } - return buffer; -} -#pragma warning (default: 4312) - -#pragma warning (disable: 4312) -void GetContactProtocol(HANDLE hContact, char *szProto, size_t size) -{ - GetStringFromDatabase(hContact, "Protocol", "p", NULL, szProto, size); -} -#pragma warning (default: 4312) - -#pragma warning (disable: 4312) -TCHAR *GetContactID(HANDLE hContact) -{ - char protocol[256]; - GetContactProtocol(hContact, protocol, sizeof(protocol)); - - return GetContactID(hContact, protocol); -} - -TCHAR *GetContactID(HANDLE hContact, char *szProto) -{ - CONTACTINFO ctInfo; - int ret; - - ZeroMemory((void *) &ctInfo, sizeof(ctInfo)); - ctInfo.cbSize = sizeof(ctInfo); - ctInfo.szProto = szProto; - ctInfo.dwFlag = CNF_UNIQUEID; - - ctInfo.dwFlag |= CNF_UNICODE; - - ctInfo.hContact = hContact; - ret = CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) &ctInfo); - TCHAR *buffer; - if (!ret) - { - TCHAR tmp[16]; - switch (ctInfo.type) - { - case CNFT_BYTE: - { - _stprintf(tmp, _T("%d"), ctInfo.bVal); - buffer = _tcsdup(tmp); - - break; - } - - case CNFT_WORD: - { - _stprintf(tmp, _T("%d"), ctInfo.wVal); - buffer = _tcsdup(tmp); - - break; - } - - case CNFT_DWORD: - { - _stprintf(tmp, _T("%ld"), ctInfo.dVal); - buffer = _tcsdup(tmp); - - break; - } - - case CNFT_ASCIIZ: - default: - { - buffer = _tcsdup(ctInfo.pszVal); - - break; - } - } - - - } - mir_free(ctInfo.pszVal); - if (!ret) - { - return buffer; - } - else{ - return NULL; - } -} -#pragma warning (default: 4312) - -#pragma warning (disable: 4312) -HANDLE GetContactFromID(TCHAR *szID, char *szProto) -{ - HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); - TCHAR *szHandle; - char cProtocol[256]; - - int found = 0; - while (hContact) - { - GetContactProtocol(hContact, cProtocol, sizeof(cProtocol)); - szHandle = GetContactID(hContact, cProtocol); - if ((szHandle) && (_tcsicmp(szHandle, szID) == 0) && (_stricmp(szProto, cProtocol) == 0)) - { - found = 1; - } - if (szHandle) free(szHandle); - - if (found) - { - break; - } - hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0); - } - return hContact; -} -#pragma warning (default: 4312) - -#pragma warning (disable: 4312) -HANDLE GetContactFromID(TCHAR *szID, wchar_t *szProto) -{ - char protocol[1024]; - WideCharToMultiByte(CP_ACP, 0, szProto, -1, protocol, sizeof(protocol), NULL, NULL); - return GetContactFromID(szID, protocol); -} -#pragma warning (default: 4312) - -void ScreenToClient(HWND hWnd, LPRECT rect) -{ - POINT pt; - int cx = rect->right - rect->left; - int cy = rect->bottom - rect->top; - pt.x = rect->left; - pt.y = rect->top; - ScreenToClient(hWnd, &pt); - rect->left = pt.x; - rect->top = pt.y; - rect->right = pt.x + cx; - rect->bottom = pt.y + cy; -} - -void AnchorMoveWindow(HWND window, const WINDOWPOS *parentPos, int anchors) -{ - RECT rParent; - RECT rChild; - - if (parentPos->flags & SWP_NOSIZE) - { - return; - } - GetWindowRect(parentPos->hwnd, &rParent); - rChild = AnchorCalcPos(window, &rParent, parentPos, anchors); - MoveWindow(window, rChild.left, rChild.top, rChild.right - rChild.left, rChild.bottom - rChild.top, FALSE); -} - -RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, int anchors) -{ - RECT rChild; - RECT rTmp; - - GetWindowRect(window, &rChild); - ScreenToClient(parentPos->hwnd, &rChild); - - int cx = rParent->right - rParent->left; - int cy = rParent->bottom - rParent->top; - if ((cx == parentPos->cx) && (cy == parentPos->cy)) - { - return rChild; - } - if (parentPos->flags & SWP_NOSIZE) - { - return rChild; - } - - rTmp.left = parentPos->x - rParent->left; - rTmp.right = (parentPos->x + parentPos->cx) - rParent->right; - rTmp.bottom = (parentPos->y + parentPos->cy) - rParent->bottom; - rTmp.top = parentPos->y - rParent->top; - - cx = (rTmp.left) ? -rTmp.left : rTmp.right; - cy = (rTmp.top) ? -rTmp.top : rTmp.bottom; - - rChild.right += cx; - rChild.bottom += cy; - //expanded the window accordingly, now we need to enforce the anchors - if ((anchors & ANCHOR_LEFT) && (!(anchors & ANCHOR_RIGHT))) - { - rChild.right -= cx; - } - if ((anchors & ANCHOR_TOP) && (!(anchors & ANCHOR_BOTTOM))) - { - rChild.bottom -= cy; - } - if ((anchors & ANCHOR_RIGHT) && (!(anchors & ANCHOR_LEFT))) - { - rChild.left += cx; - } - if ((anchors & ANCHOR_BOTTOM) && (!(anchors & ANCHOR_TOP))) - { - rChild.top += cy; - } - return rChild; -} - -DWORD NameHashFunction(const char *szStr) -{ -#if defined _M_IX86 && !defined _NUMEGA_BC_FINALCHECK && !defined NOINLINEASM - __asm { //this breaks if szStr is empty - xor edx,edx - xor eax,eax - mov esi,szStr - cmp esi, 0x0 - je end - mov al,[esi] - xor cl,cl - lph_top: //only 4 of 9 instructions in here don't use AL, so optimal pipe use is impossible - xor edx,eax - inc esi - xor eax,eax - and cl,31 - mov al,[esi] - add cl,5 - test al,al - rol eax,cl //rol is u-pipe only, but pairable - //rol doesn't touch z-flag - jnz lph_top //5 clock tick loop. not bad. - - xor eax,edx - end: - } -#else - DWORD hash=0; - int i; - int shift=0; - for(i=0;szStr[i];i++) { - hash^=szStr[i]<24) hash^=(szStr[i]>>(32-shift))&0x7F; - shift=(shift+5)&0x1F; - } - return hash; -#endif -} - -DWORD LangPackHashW(const WCHAR *szStr) -{ -#if defined _M_IX86 && !defined _NUMEGA_BC_FINALCHECK && !defined __GNUC__ - __asm { //this is mediocrely optimised, but I'm sure it's good enough - xor edx,edx - xor eax, eax - mov esi,szStr - cmp esi, 0x0 - je end - xor cl,cl -lph_top: - xor eax,eax - and cl,31 - mov al,[esi] - inc esi - inc esi - test al,al - jz lph_end - rol eax,cl - add cl,5 - xor edx,eax - jmp lph_top -lph_end: - mov eax,edx -end: - } -#else - DWORD hash=0; - int i; - int shift=0; - for(i=0;szStr[i];i+=2) { - hash^=szStr[i]<24) hash^=(szStr[i]>>(32-shift))&0x7F; - shift=(shift+5)&0x1F; - } - return hash; -#endif -} \ No newline at end of file diff --git a/plugins/Bonsai/utils.h b/plugins/Bonsai/utils.h deleted file mode 100644 index db5533c21c..0000000000 --- a/plugins/Bonsai/utils.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -Bonsai plugin for Miranda IM - -Copyright © 2006 Cristian Libotean - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef M_BONSAI_UTILS_H -#define M_BONSAI_UTILS_H - -#include -#include "commonheaders.h" -#include "list.h" - -//#define USE_LOG -#define LOG_FILE "bonsai.log" - -#define ANCHOR_LEFT 0x000001 -#define ANCHOR_RIGHT 0x000002 -#define ANCHOR_TOP 0x000004 -#define ANCHOR_BOTTOM 0x000008 -#define ANCHOR_ALL ANCHOR_LEFT | ANCHOR_RIGHT | ANCHOR_TOP | ANCHOR_BOTTOM - -int LogInit(); -int Log(char *format, ...); -int Info(char *title, char *format, ...); - -char *BinToHex(int size, PBYTE data); -void HexToBin(char *inData, ULONG &size, PBYTE &outData); - -void ScreenToClient(HWND hWnd, LPRECT rect); -void AnchorMoveWindow(HWND window, const WINDOWPOS *parentPos, int anchors); -RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, int anchors); - -int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, size_t size); -int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, size_t count); - -TCHAR *GetContactName(HANDLE hContact, char *szProto); -TCHAR *GetContactID(HANDLE hContact); -TCHAR *GetContactID(HANDLE hContact, char *szProto); -HANDLE GetContactFromID(TCHAR *szID, char *szProto); -HANDLE GetContactFromID(TCHAR *szID, wchar_t *szProto); -void GetContactProtocol(HANDLE hContact, char *szProto, size_t size); - -DWORD NameHashFunction(const char *szStr); -DWORD LangPackHashW(const WCHAR *szStr); - -int MyPUShowMessage(char *lpzText, BYTE kind); - - -#endif \ No newline at end of file diff --git a/plugins/Bonsai/version.h b/plugins/Bonsai/version.h deleted file mode 100644 index 30aa0c24c3..0000000000 --- a/plugins/Bonsai/version.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -Bonsai plugin for Miranda IM - -Copyright © 2006 Cristian Libotean - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef M_BONSAI_VERSION_H -#define M_BONSAI_VERSION_H - -#define __MAJOR_VERSION 0 -#define __MINOR_VERSION 0 -#define __RELEASE_NUM 2 -#define __BUILD_NUM 5 - -#define VERSION PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM) - -#define __PLUGINVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM -#define __PLUGINVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM -#define __STRINGIFY_(x) #x -#define __STRINGIFY(x) __STRINGIFY_(x) -#define __VERSION_STRING __STRINGIFY(__PLUGINVERSION_STRING_DOTS) - -#define __DESC "This plugin lets you rearrange the options tree by changing the options groups and titles that plugin options are displayed under." -#define __AUTHOR "Cristian Libotean" -#define __AUTHOREMAIL "eblis102@yahoo.com" -#define __COPYRIGHT "© 2006-2007 Cristian Libotean" -#define __AUTHORWEB "http://www.miranda-im.org/" -#define __PLUGIN_DISPLAY_NAME "Bonsai" - -#endif //M_BONSAI_VERSION_H diff --git a/plugins/Bonsai/version.rc b/plugins/Bonsai/version.rc deleted file mode 100644 index 0f8fea03fc..0000000000 --- a/plugins/Bonsai/version.rc +++ /dev/null @@ -1,100 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" -#include "version.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource1.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION __PLUGINVERSION_STRING - PRODUCTVERSION __PLUGINVERSION_STRING - FILEFLAGSMASK 0x17L -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Author", __AUTHOR - VALUE "FileDescription", __DESC - VALUE "FileVersion", __VERSION_STRING - VALUE "InternalName", __PLUGIN_DISPLAY_NAME - VALUE "LegalCopyright", __COPYRIGHT - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - -- cgit v1.2.3