summaryrefslogtreecommitdiff
path: root/plugins/Bonsai
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-05-15 10:38:20 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-05-15 10:38:20 +0000
commit48540940b6c28bb4378abfeb500ec45a625b37b6 (patch)
tree2ef294c0763e802f91d868bdef4229b6868527de /plugins/Bonsai
parent5c350913f011e119127baeb32a6aedeb4f0d33bc (diff)
initial commit
git-svn-id: http://svn.miranda-ng.org/main/trunk@2 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Bonsai')
-rw-r--r--plugins/Bonsai/Bonsai.html11
-rw-r--r--plugins/Bonsai/Bonsai.sln26
-rw-r--r--plugins/Bonsai/FixOptions/Bonsai.cpp135
-rw-r--r--plugins/Bonsai/FixOptions/Bonsai.rc121
-rw-r--r--plugins/Bonsai/FixOptions/FixOptions.vcproj498
-rw-r--r--plugins/Bonsai/FixOptions/OptArrange.rc111
-rw-r--r--plugins/Bonsai/FixOptions/commonheaders.h93
-rw-r--r--plugins/Bonsai/FixOptions/dlg_handlers.cpp456
-rw-r--r--plugins/Bonsai/FixOptions/dlg_handlers.h50
-rw-r--r--plugins/Bonsai/FixOptions/hooked_events.cpp92
-rw-r--r--plugins/Bonsai/FixOptions/hooked_events.h39
-rw-r--r--plugins/Bonsai/FixOptions/icons/hidden.bmpbin0 -> 822 bytes
-rw-r--r--plugins/Bonsai/FixOptions/icons/modified.bmpbin0 -> 822 bytes
-rw-r--r--plugins/Bonsai/FixOptions/icons/newlymodified.bmpbin0 -> 1062 bytes
-rw-r--r--plugins/Bonsai/FixOptions/icons/unmodified.bmpbin0 -> 822 bytes
-rw-r--r--plugins/Bonsai/FixOptions/list.cpp228
-rw-r--r--plugins/Bonsai/FixOptions/list.h94
-rw-r--r--plugins/Bonsai/FixOptions/mirandaMem.cpp35
-rw-r--r--plugins/Bonsai/FixOptions/mirandaMem.h32
-rw-r--r--plugins/Bonsai/FixOptions/resource.h28
-rw-r--r--plugins/Bonsai/FixOptions/sdk/m_updater.h146
-rw-r--r--plugins/Bonsai/FixOptions/services.cpp192
-rw-r--r--plugins/Bonsai/FixOptions/services.h40
-rw-r--r--plugins/Bonsai/FixOptions/utils.cpp527
-rw-r--r--plugins/Bonsai/FixOptions/utils.h64
-rw-r--r--plugins/Bonsai/FixOptions/version.h49
-rw-r--r--plugins/Bonsai/FixOptions/version.rc100
-rw-r--r--plugins/Bonsai/docs/Bonsai_readme.txt131
-rw-r--r--plugins/Bonsai/files_release.txt1
-rw-r--r--plugins/Bonsai/files_releasex64.txt1
-rw-r--r--plugins/Bonsai/files_source.txt3
-rw-r--r--plugins/Bonsai/pack source.bat8
-rw-r--r--plugins/Bonsai/pack symbols.bat9
-rw-r--r--plugins/Bonsai/pack x64.bat10
-rw-r--r--plugins/Bonsai/pack.bat10
-rw-r--r--plugins/Bonsai/screenshot.pngbin0 -> 56668 bytes
-rw-r--r--plugins/Bonsai/symbols_exclude.txt1
37 files changed, 3341 insertions, 0 deletions
diff --git a/plugins/Bonsai/Bonsai.html b/plugins/Bonsai/Bonsai.html
new file mode 100644
index 0000000000..37c9753ac2
--- /dev/null
+++ b/plugins/Bonsai/Bonsai.html
@@ -0,0 +1,11 @@
+<html>
+ <head></head>
+ <body>
+ <center>
+ <h1>Bonsai Test Page</h1>
+
+ <p>Bonsai version 0.0.2.5</p>
+ <p><a href="Bonsai.zip">Bonsai.zip</a></p>
+ </center>
+ </body>
+</html>
diff --git a/plugins/Bonsai/Bonsai.sln b/plugins/Bonsai/Bonsai.sln
new file mode 100644
index 0000000000..0d68331f8d
--- /dev/null
+++ b/plugins/Bonsai/Bonsai.sln
@@ -0,0 +1,26 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Bonsai", "FixOptions\FixOptions.vcproj", "{C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}"
+EndProject
+Global
+ 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/FixOptions/Bonsai.cpp b/plugins/Bonsai/FixOptions/Bonsai.cpp
new file mode 100644
index 0000000000..dd2c33c35f
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/Bonsai.cpp
@@ -0,0 +1,135 @@
+/*
+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;
+
+PLUGININFOEX pluginInfo = {
+ sizeof(PLUGININFOEX),
+ __PLUGIN_DISPLAY_NAME,
+ VERSION,
+ __DESC,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ 1, //unicode aware
+ 0,
+ {0x2fe47261, 0x7f38, 0x45f4, {0x8f, 0xac, 0xb8, 0x7e, 0x97, 0x4a, 0x13, 0x50}} //{2fe47261-7f38-45f4-8fac-b87e974a1350}
+ }; //not used
+
+OLD_MIRANDAPLUGININFO_SUPPORT;
+
+extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
+{
+// Log("%s", "Entering function " __FUNCTION__);
+// Log("%s", "Leaving function " __FUNCTION__);
+ if (mirandaVersion < PLUGIN_MAKE_VERSION(0, 6, 0, 0))
+ {
+ return NULL;
+ }
+ 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;
+
+ InitServices();
+
+ HookEvents();
+
+ InitializeMirandaMemFunctions();
+
+
+ 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/FixOptions/Bonsai.rc b/plugins/Bonsai/FixOptions/Bonsai.rc
new file mode 100644
index 0000000000..fbb66130c3
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/Bonsai.rc
@@ -0,0 +1,121 @@
+// 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/FixOptions/FixOptions.vcproj b/plugins/Bonsai/FixOptions/FixOptions.vcproj
new file mode 100644
index 0000000000..57ff32ecd4
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/FixOptions.vcproj
@@ -0,0 +1,498 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="Bonsai"
+ ProjectGUID="{C2F9A2EE-128B-43BD-9F3A-DAD0D954CB67}"
+ RootNamespace="Bonsai"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="..\..\..\..\cvs\test miranda\Plugins"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include/"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;FIXOPTIONS_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include/"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN64;_DEBUG;_WINDOWS;_USRDLL;FIXOPTIONS_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="0"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../include/"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;FIXOPTIONS_EXPORTS"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="unicows.lib comctl32.lib"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ BaseAddress="0x2F080000"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="0"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../include/"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN64;NDEBUG;_WINDOWS;_USRDLL;FIXOPTIONS_EXPORTS"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ BaseAddress="0x2F080000"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\Bonsai.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="0"
+ Detect64BitPortabilityProblems="false"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="0"
+ Detect64BitPortabilityProblems="false"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="0"
+ Detect64BitPortabilityProblems="false"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="0"
+ Detect64BitPortabilityProblems="false"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\dlg_handlers.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\hooked_events.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\list.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\mirandaMem.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\services.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\utils.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\commonheaders.h"
+ >
+ </File>
+ <File
+ RelativePath=".\dlg_handlers.h"
+ >
+ </File>
+ <File
+ RelativePath=".\hooked_events.h"
+ >
+ </File>
+ <File
+ RelativePath=".\list.h"
+ >
+ </File>
+ <File
+ RelativePath=".\mirandaMem.h"
+ >
+ </File>
+ <File
+ RelativePath=".\resource.h"
+ >
+ </File>
+ <File
+ RelativePath=".\services.h"
+ >
+ </File>
+ <File
+ RelativePath=".\utils.h"
+ >
+ </File>
+ <File
+ RelativePath=".\version.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ <File
+ RelativePath=".\Bonsai.rc"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\hidden.bmp"
+ >
+ </File>
+ <File
+ RelativePath=".\icon1.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\modified.bmp"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\modified.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\newlymodified.bmp"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\unmodified.bmp"
+ >
+ </File>
+ <File
+ RelativePath=".\icons\unmodified.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\version.rc"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\docs\Bonsai_readme.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/plugins/Bonsai/FixOptions/OptArrange.rc b/plugins/Bonsai/FixOptions/OptArrange.rc
new file mode 100644
index 0000000000..ba9a6a0c50
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/OptArrange.rc
@@ -0,0 +1,111 @@
+// 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/FixOptions/commonheaders.h b/plugins/Bonsai/FixOptions/commonheaders.h
new file mode 100644
index 0000000000..718e799801
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/commonheaders.h
@@ -0,0 +1,93 @@
+/*
+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 0x0600
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <windows.h>
+#include <time.h>
+#include <math.h>
+#include <dbghelp.h>
+#include <commctrl.h>
+
+#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 "sdk/m_updater.h"
+#include "m_system.h"
+
+#include "version.h"
+#include "utils.h"
+#include "mirandaMem.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;
+
+#define OLD_MIRANDAPLUGININFO_SUPPORT PLUGININFO oldPluginInfo = { \
+ sizeof(PLUGININFO), \
+ pluginInfo.shortName, \
+ pluginInfo.version, \
+ pluginInfo.description, \
+ pluginInfo.author, \
+ pluginInfo.authorEmail, \
+ pluginInfo.copyright, \
+ pluginInfo.homepage, \
+ pluginInfo.flags, \
+ pluginInfo.replacesDefaultModule \
+}; \
+\
+extern "C" __declspec(dllexport) PLUGININFO *MirandaPluginInfo(DWORD mirandaVersion) \
+{ \
+ if (mirandaVersion < PLUGIN_MAKE_VERSION(0, 6, 0, 0)) \
+ { \
+ return NULL; \
+ } \
+ return &oldPluginInfo; \
+}
+
+#endif //M_WWI_COMMONHEADERS_H \ No newline at end of file
diff --git a/plugins/Bonsai/FixOptions/dlg_handlers.cpp b/plugins/Bonsai/FixOptions/dlg_handlers.cpp
new file mode 100644
index 0000000000..7bceb1026e
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/dlg_handlers.cpp
@@ -0,0 +1,456 @@
+/*
+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, &params);
+
+ 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:
+ {
+ //<TODO>
+
+ 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) &params);
+ 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/FixOptions/dlg_handlers.h b/plugins/Bonsai/FixOptions/dlg_handlers.h
new file mode 100644
index 0000000000..f51e7bb0d2
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/dlg_handlers.h
@@ -0,0 +1,50 @@
+/*
+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/FixOptions/hooked_events.cpp b/plugins/Bonsai/FixOptions/hooked_events.cpp
new file mode 100644
index 0000000000..ba1ee85d91
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/hooked_events.cpp
@@ -0,0 +1,92 @@
+/*
+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.ptszTitle = TranslateT("Arrange Options");
+ odp.ptszGroup = TranslateT("Services");
+ odp.groupPosition = 810000000;
+ odp.flags=ODPF_BOLDGROUPS;
+ odp.pfnDlgProc = DlgProcOptions;
+ CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
+
+ return 0;
+} \ No newline at end of file
diff --git a/plugins/Bonsai/FixOptions/hooked_events.h b/plugins/Bonsai/FixOptions/hooked_events.h
new file mode 100644
index 0000000000..70c1a0d0c6
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/hooked_events.h
@@ -0,0 +1,39 @@
+/*
+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/FixOptions/icons/hidden.bmp b/plugins/Bonsai/FixOptions/icons/hidden.bmp
new file mode 100644
index 0000000000..6ec1e60428
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/icons/hidden.bmp
Binary files differ
diff --git a/plugins/Bonsai/FixOptions/icons/modified.bmp b/plugins/Bonsai/FixOptions/icons/modified.bmp
new file mode 100644
index 0000000000..1d9e13262a
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/icons/modified.bmp
Binary files differ
diff --git a/plugins/Bonsai/FixOptions/icons/newlymodified.bmp b/plugins/Bonsai/FixOptions/icons/newlymodified.bmp
new file mode 100644
index 0000000000..87f7cc48f4
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/icons/newlymodified.bmp
Binary files differ
diff --git a/plugins/Bonsai/FixOptions/icons/unmodified.bmp b/plugins/Bonsai/FixOptions/icons/unmodified.bmp
new file mode 100644
index 0000000000..c9d552c032
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/icons/unmodified.bmp
Binary files differ
diff --git a/plugins/Bonsai/FixOptions/list.cpp b/plugins/Bonsai/FixOptions/list.cpp
new file mode 100644
index 0000000000..a7ce5c1033
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/list.cpp
@@ -0,0 +1,228 @@
+/*
+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/FixOptions/list.h b/plugins/Bonsai/FixOptions/list.h
new file mode 100644
index 0000000000..7143cb0f55
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/list.h
@@ -0,0 +1,94 @@
+/*
+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/FixOptions/mirandaMem.cpp b/plugins/Bonsai/FixOptions/mirandaMem.cpp
new file mode 100644
index 0000000000..05280dbbdb
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/mirandaMem.cpp
@@ -0,0 +1,35 @@
+/*
+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 "mirandaMem.h"
+
+void *(*MirandaMalloc)(size_t size) = NULL;
+void *(*MirandaRealloc)(void *data, size_t newSize) = NULL;
+void (*MirandaFree) (void *data) = NULL;
+
+void InitializeMirandaMemFunctions()
+{
+ struct MM_INTERFACE mmi = {0};
+ mmi.cbSize = sizeof(MM_INTERFACE);
+ CallService(MS_SYSTEM_GET_MMI, 0, (LPARAM) &mmi);
+ MirandaMalloc = mmi.mmi_malloc;
+ MirandaRealloc = mmi.mmi_realloc;
+ MirandaFree = mmi.mmi_free;
+} \ No newline at end of file
diff --git a/plugins/Bonsai/FixOptions/mirandaMem.h b/plugins/Bonsai/FixOptions/mirandaMem.h
new file mode 100644
index 0000000000..6f7b12aa9e
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/mirandaMem.h
@@ -0,0 +1,32 @@
+/*
+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_MIRANDA_MEM_H
+#define M_BONSAI_MIRANDA_MEM_H
+
+#include "commonheaders.h"
+
+extern void *(*MirandaMalloc)(size_t size);
+extern void *(*MirandaRealloc)(void *data, size_t newSize);
+extern void (*MirandaFree) (void *data);
+
+void InitializeMirandaMemFunctions();
+
+#endif \ No newline at end of file
diff --git a/plugins/Bonsai/FixOptions/resource.h b/plugins/Bonsai/FixOptions/resource.h
new file mode 100644
index 0000000000..fa0aefbfec
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/resource.h
@@ -0,0 +1,28 @@
+//{{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/FixOptions/sdk/m_updater.h b/plugins/Bonsai/FixOptions/sdk/m_updater.h
new file mode 100644
index 0000000000..371b7437a0
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/sdk/m_updater.h
@@ -0,0 +1,146 @@
+#ifndef _M_UPDATER_H
+#define _M_UPDATER_H
+
+// NOTES:
+// - For langpack updates, include a string of the following format in the langpack text file:
+// ";FLID: <file listing name> <version>"
+// version must be four numbers seperated by '.', in the range 0-255 inclusive
+// - Updater will disable plugins that are downloaded but were not active prior to the update (this is so that, if an archive contains e.g. ansi and
+// unicode versions, the correct plugin will be the only one active after the new version is installed)...so if you add a support plugin, you may need
+// to install an ini file to make the plugin activate when miranda restarts after the update
+// - Updater will replace all dlls that have the same internal shortName as a downloaded update dll (this is so that msn1.dll and msn2.dll, for example,
+// will both be updated) - so if you have a unicode and a non-unicode version of a plugin in your archive, you should make the internal names different (which will break automatic
+// updates from the file listing if there is only one file listing entry for both versions, unless you use the 'MS_UPDATE_REGISTER' service below)
+// - Updater will install all files in the root of the archive into the plugins folder, except for langpack files that contain the FLID string which go into the root folder (same
+// folder as miranda32.exe)...all folders in the archive will also be copied to miranda's root folder, and their contents transferred into the new folders. The only exception is a
+// special folder called 'root_files' - if there is a folder by that name in the archive, it's contents will also be copied into miranda's root folder - this is intended to be used
+// to install additional dlls etc that a plugin may require)
+
+// if you set Update.szUpdateURL to the following value when registering, as well as setting your beta site and version data,
+// Updater will ignore szVersionURL and pbVersionPrefix, and attempt to find the file listing URL's from the backend XML data.
+// for this to work, the plugin name in pluginInfo.shortName must match the file listing exactly (except for case)
+#define UPDATER_AUTOREGISTER "UpdaterAUTOREGISTER"
+// Updater will also use the backend xml data if you provide URL's that reference the miranda file listing for updates (so you can use that method
+// if e.g. your plugin shortName does not match the file listing) - it will grab the file listing id from the end of these URLs
+
+typedef struct Update_tag {
+ int cbSize;
+ char *szComponentName; // component name as it will appear in the UI (will be translated before displaying)
+
+ char *szVersionURL; // URL where the current version can be found (NULL to disable)
+ BYTE *pbVersionPrefix; // bytes occuring in VersionURL before the version, used to locate the version information within the URL data
+ // (note that this URL could point at a binary file - dunno why, but it could :)
+ int cpbVersionPrefix; // number of bytes pointed to by pbVersionPrefix
+ char *szUpdateURL; // URL where dll/zip is located
+ // set to UPDATER_AUTOREGISTER if you want Updater to find the file listing URLs (ensure plugin shortName matches file listing!)
+
+ char *szBetaVersionURL; // URL where the beta version can be found (NULL to disable betas)
+ BYTE *pbBetaVersionPrefix; // bytes occuring in VersionURL before the version, used to locate the version information within the URL data
+ int cpbBetaVersionPrefix; // number of bytes pointed to by pbVersionPrefix
+ char *szBetaUpdateURL; // URL where dll/zip is located
+
+ BYTE *pbVersion; // bytes of current version, used for comparison with those in VersionURL
+ int cpbVersion; // number of bytes pointed to by pbVersion
+
+ char *szBetaChangelogURL; // url for displaying changelog for beta versions
+} Update;
+
+// register a comonent with Updater
+//
+// wparam = 0
+// lparam = (LPARAM)&Update
+#define MS_UPDATE_REGISTER "Update/Register"
+
+// utility functions to create a version string from a DWORD or from pluginInfo
+// point buf at a buffer at least 16 chars wide - but note the version string returned may be shorter
+//
+__inline static char *CreateVersionString(DWORD version, char *buf) {
+ mir_snprintf(buf, 16, "%d.%d.%d.%d", (version >> 24) & 0xFF, (version >> 16) & 0xFF, (version >> 8) & 0xFF, version & 0xFF);
+ return buf;
+}
+
+__inline static char *CreateVersionStringPlugin(PLUGININFO *pluginInfo, char *buf) {
+ return CreateVersionString(pluginInfo->version, buf);
+}
+
+
+// register the 'easy' way - use this method if you have no beta URL and the plugin is on the miranda file listing
+// NOTE: the plugin version string on the file listing must be the string version of the version in pluginInfo (i.e. 0.0.0.1,
+// four numbers between 0 and 255 inclusivem, so no letters, brackets, etc.)
+//
+// wParam = (int)fileID - this is the file ID from the file listing (i.e. the number at the end of the download link)
+// lParam = (PLUGININFO*)&pluginInfo
+#define MS_UPDATE_REGISTERFL "Update/RegisterFL"
+
+// this function can be used to 'unregister' components - useful for plugins that register non-plugin/langpack components and
+// may need to change those components on the fly
+// lParam = (char *)szComponentName
+#define MS_UPDATE_UNREGISTER "Update/Unregister"
+
+// this event is fired when the startup process is complete, but NOT if a restart is imminent
+// it is designed for status managment plugins to use as a trigger for beggining their own startup process
+// wParam = lParam = 0 (unused)
+// (added in version 0.1.6.0)
+#define ME_UPDATE_STARTUPDONE "Update/StartupDone"
+
+// this service can be used to enable/disable Updater's global status control
+// it can be called from the StartupDone event handler
+// wParam = (BOOL)enable
+// lParam = 0
+// (added in version 0.1.6.0)
+#define MS_UPDATE_ENABLESTATUSCONTROL "Update/EnableStatusControl"
+
+// An description of usage of the above service and event:
+// Say you are a status control plugin that normally sets protocol or global statuses in your ModulesLoaded event handler.
+// In order to make yourself 'Updater compatible', you would move the status control code from ModulesLoaded to another function,
+// say DoStartup. Then, in ModulesLoaded you would check for the existence of the MS_UPDATE_ENABLESTATUSCONTROL service.
+// If it does not exist, call DoStartup. If it does exist, hook the ME_UPDATE_STARTUPDONE event and call DoStartup from there. You may
+// also wish to call MS_UPDATE_ENABLESTATUSCONTROL with wParam == FALSE at this time, to disable Updater's own status control feature.
+
+// this service can be used to determine whether updates are possible for a component with the given name
+// wParam = 0
+// lParam = (char *)szComponentName
+// returns TRUE if updates are supported, FALSE otherwise
+#define MS_UPDATE_ISUPDATESUPPORTED "Update/IsUpdateSupported"
+
+#endif
+
+
+/////////////// Usage Example ///////////////
+
+#ifdef EXAMPLE_CODE
+
+// you need to #include "m_updater.h" and HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded) in your Load function...
+
+int OnModulesLoaded(WPARAM wParam, LPARAM lParam) {
+
+ Update update = {0}; // for c you'd use memset or ZeroMemory...
+ char szVersion[16];
+
+ update.cbSize = sizeof(Update);
+
+ update.szComponentName = pluginInfo.shortName;
+ update.pbVersion = (BYTE *)CreateVersionString(&pluginInfo, szVersion);
+ update.cpbVersion = strlen((char *)update.pbVersion);
+
+ // these are the three lines that matter - the archive, the page containing the version string, and the text (or data)
+ // before the version that we use to locate it on the page
+ // (note that if the update URL and the version URL point to standard file listing entries, the backend xml
+ // data will be used to check for updates rather than the actual web page - this is not true for beta urls)
+ update.szUpdateURL = "http://scottellis.com.au:81/test/updater.zip";
+ update.szVersionURL = "http://scottellis.com.au:81/test/updater_test.html";
+ update.pbVersionPrefix = (BYTE *)"Updater version ";
+
+ update.cpbVersionPrefix = strlen((char *)update.pbVersionPrefix);
+
+ // do the same for the beta versions of the above struct members if you wish to allow beta updates from another URL
+
+ CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
+
+ // Alternatively, to register a plugin with e.g. file ID 2254 on the file listing...
+ // CallService(MS_UPDATE_REGISTERFL, (WPARAM)2254, (LPARAM)&pluginInfo);
+
+ return 0;
+}
+
+#endif
diff --git a/plugins/Bonsai/FixOptions/services.cpp b/plugins/Bonsai/FixOptions/services.cpp
new file mode 100644
index 0000000000..64d7f92c72
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/services.cpp
@@ -0,0 +1,192 @@
+/*
+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(MS_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/FixOptions/services.h b/plugins/Bonsai/FixOptions/services.h
new file mode 100644
index 0000000000..a78ba2b75c
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/services.h
@@ -0,0 +1,40 @@
+/*
+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/FixOptions/utils.cpp b/plugins/Bonsai/FixOptions/utils.cpp
new file mode 100644
index 0000000000..f47f78592c
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/utils.cpp
@@ -0,0 +1,527 @@
+/*
+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';
+ MirandaFree(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';
+ }
+ MirandaFree(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;
+#ifdef _UNICODE
+ ctInfo.dwFlag += CNF_UNICODE;
+#endif
+ 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);
+ }
+ MirandaFree(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;
+#ifdef _UNICODE
+ ctInfo.dwFlag |= CNF_UNICODE;
+#endif
+ 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;
+ }
+ }
+
+
+ }
+ MirandaFree(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]<<shift;
+ if(shift>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]<<shift;
+ if(shift>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/FixOptions/utils.h b/plugins/Bonsai/FixOptions/utils.h
new file mode 100644
index 0000000000..db5533c21c
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/utils.h
@@ -0,0 +1,64 @@
+/*
+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 <stdarg.h>
+#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/FixOptions/version.h b/plugins/Bonsai/FixOptions/version.h
new file mode 100644
index 0000000000..5ae566b4eb
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/version.h
@@ -0,0 +1,49 @@
+/*
+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/"
+
+#if defined(WIN64) || defined(_WIN64)
+#define __PLUGIN_DISPLAY_NAME "Bonsai (x64)"
+#else
+#define __PLUGIN_DISPLAY_NAME "Bonsai"
+#endif
+
+#endif //M_BONSAI_VERSION_H
diff --git a/plugins/Bonsai/FixOptions/version.rc b/plugins/Bonsai/FixOptions/version.rc
new file mode 100644
index 0000000000..0f8fea03fc
--- /dev/null
+++ b/plugins/Bonsai/FixOptions/version.rc
@@ -0,0 +1,100 @@
+// 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
+
diff --git a/plugins/Bonsai/docs/Bonsai_readme.txt b/plugins/Bonsai/docs/Bonsai_readme.txt
new file mode 100644
index 0000000000..42ea2d311a
--- /dev/null
+++ b/plugins/Bonsai/docs/Bonsai_readme.txt
@@ -0,0 +1,131 @@
+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/files_release.txt b/plugins/Bonsai/files_release.txt
new file mode 100644
index 0000000000..61e3b21c9d
--- /dev/null
+++ b/plugins/Bonsai/files_release.txt
@@ -0,0 +1 @@
+FixOptions\win32\Release\*.dll
diff --git a/plugins/Bonsai/files_releasex64.txt b/plugins/Bonsai/files_releasex64.txt
new file mode 100644
index 0000000000..bb3349e661
--- /dev/null
+++ b/plugins/Bonsai/files_releasex64.txt
@@ -0,0 +1 @@
+FixOptions\x64\Release\*.dll
diff --git a/plugins/Bonsai/files_source.txt b/plugins/Bonsai/files_source.txt
new file mode 100644
index 0000000000..6135031985
--- /dev/null
+++ b/plugins/Bonsai/files_source.txt
@@ -0,0 +1,3 @@
+FixOptions\*.*
+docs\*.*
+*.*
diff --git a/plugins/Bonsai/pack source.bat b/plugins/Bonsai/pack source.bat
new file mode 100644
index 0000000000..847ba36a5e
--- /dev/null
+++ b/plugins/Bonsai/pack source.bat
@@ -0,0 +1,8 @@
+for /F "tokens=4-8* delims=. " %%i in (docs\Bonsai_readme.txt) do (call :Pack %%i %%j %%k %%l; exit)
+
+:Pack
+d:\usr\PowerArchiver\pacl\pacomp.exe -p -a -c2 "Bonsai src %1.%2.%3.%4.zip" @files_source.txt -x*.zip -x*.ncb -x*.user
+exit
+
+error:
+echo "Error packing Bonsai"
diff --git a/plugins/Bonsai/pack symbols.bat b/plugins/Bonsai/pack symbols.bat
new file mode 100644
index 0000000000..3fd0bdb610
--- /dev/null
+++ b/plugins/Bonsai/pack symbols.bat
@@ -0,0 +1,9 @@
+@echo off
+if NOT EXIST "symbols\%1 - %3" (
+ mkdir "symbols\%1 - %3"
+)
+xcopy "%2\win32\Release\*.pdb" "symbols\%1 - %3\win32\*" /EXCLUDE:symbols_exclude.txt /Y
+xcopy "%2\x64\Release\*.pdb" "symbols\%1 - %3\x64\*" /EXCLUDE:symbols_exclude.txt /Y
+
+d:\usr\PowerArchiver\pacl\pacomp.exe -p -a -r -c2 "symbols - %1.zip" "symbols\*.*"
+rmdir "symbols\" /Q /S \ No newline at end of file
diff --git a/plugins/Bonsai/pack x64.bat b/plugins/Bonsai/pack x64.bat
new file mode 100644
index 0000000000..caabd8aae7
--- /dev/null
+++ b/plugins/Bonsai/pack x64.bat
@@ -0,0 +1,10 @@
+for /F "tokens=4-8* delims=. " %%i in (docs\Bonsai_readme.txt) do (call :Pack %%i %%j %%k %%l; exit)
+
+:Pack
+d:\usr\PowerArchiver\pacl\pacomp.exe -a -c2 "Bonsai %1.%2.%3.%4 x64.zip" @files_releasex64.txt
+d:\usr\PowerArchiver\pacl\pacomp.exe -p -a -c2 "Bonsai %1.%2.%3.%4 x64.zip" docs\*.* *.caca
+call "pack symbols.bat" Bonsai FixOptions %1.%2.%3.%4
+exit
+
+error:
+echo "Error packing Bonsai"
diff --git a/plugins/Bonsai/pack.bat b/plugins/Bonsai/pack.bat
new file mode 100644
index 0000000000..011d680281
--- /dev/null
+++ b/plugins/Bonsai/pack.bat
@@ -0,0 +1,10 @@
+for /F "tokens=4-8* delims=. " %%i in (docs\Bonsai_readme.txt) do (call :Pack %%i %%j %%k %%l; exit)
+
+:Pack
+d:\usr\PowerArchiver\pacl\pacomp.exe -a -c2 "Bonsai %1.%2.%3.%4 x32.zip" @files_release.txt
+d:\usr\PowerArchiver\pacl\pacomp.exe -p -a -c2 "Bonsai %1.%2.%3.%4 x32.zip" docs\*.* *.caca
+call "pack symbols.bat" Bonsai FixOptions %1.%2.%3.%4
+exit
+
+error:
+echo "Error packing Bonsai"
diff --git a/plugins/Bonsai/screenshot.png b/plugins/Bonsai/screenshot.png
new file mode 100644
index 0000000000..8436480191
--- /dev/null
+++ b/plugins/Bonsai/screenshot.png
Binary files differ
diff --git a/plugins/Bonsai/symbols_exclude.txt b/plugins/Bonsai/symbols_exclude.txt
new file mode 100644
index 0000000000..361cf2448b
--- /dev/null
+++ b/plugins/Bonsai/symbols_exclude.txt
@@ -0,0 +1 @@
+vc80.pdb \ No newline at end of file