------------------------------------------------------------ revno: 3134 committer: poy <p...@123gen.com> branch nick: trunk timestamp: Sun 2012-11-11 19:37:03 +0100 message: plugin SDK: add VS project files removed: pluginsdk/c/pluginsdk/version.h pluginsdk/cpp/pluginsdk/version.h added: pluginsdk/cpp/projects/ pluginsdk/cpp/projects/vs2012/ pluginsdk/cpp/projects/vs2012/Plugin.sln pluginsdk/cpp/projects/vs2012/Plugin.vcxproj pluginsdk/cpp/projects/vs2012/Plugin.vcxproj.filters pluginsdk/cpp/src/ pluginsdk/cpp/src/Plugin.cpp pluginsdk/cpp/src/Plugin.def pluginsdk/cpp/src/Plugin.h pluginsdk/cpp/src/main.cpp pluginsdk/cpp/src/resource.h pluginsdk/cpp/src/resource.rc pluginsdk/cpp/src/stdafx.cpp pluginsdk/cpp/src/stdafx.h pluginsdk/cpp/src/version.h modified: .bzrignore plugins/Dev/Plugin.cpp plugins/Dev/pluginsdk.cpp plugins/Script/Plugin.cpp plugins/Script/pluginsdk.cpp plugins/Test/Plugin.cpp plugins/Test/Plugin.h plugins/Test/pluginsdk.cpp pluginsdk/cpp/pluginsdk/Config.cpp pluginsdk/cpp/pluginsdk/Config.h pluginsdk/cpp/pluginsdk/Queue.cpp
-- lp:dcplusplus https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk Your team Dcplusplus-team is subscribed to branch lp:dcplusplus. To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file '.bzrignore' --- .bzrignore 2012-09-17 18:25:16 +0000 +++ .bzrignore 2012-11-11 18:37:03 +0000 @@ -6,7 +6,11 @@ custom.py *.aps *.lib +*.opensdf *.pdb +*.sdf +*.suo +*.vcxproj.user ./dcpp/version-revno.inc ./help/changelog.html ./help/compile.html @@ -20,3 +24,6 @@ ./msvc/debug-* ./msvc/release-* ./mingw/include/*.h +./pluginsdk/cpp/pluginsdk/PluginDefs.h +./pluginsdk/cpp/projects/vs2012/Debug +./pluginsdk/cpp/projects/vs2012/Release === modified file 'plugins/Dev/Plugin.cpp' --- plugins/Dev/Plugin.cpp 2012-11-11 16:57:44 +0000 +++ plugins/Dev/Plugin.cpp 2012-11-11 18:37:03 +0000 @@ -110,7 +110,7 @@ bool Plugin::onLoad(DCCorePtr core, bool install) { Core::init(core); - if(!Config::init() || !Hooks::init() || !Hubs::init() || !Logger::init() || !UI::init() || !Util::init()) { + if(!Config::init(PLUGIN_GUID) || !Hooks::init() || !Hubs::init() || !Logger::init() || !UI::init() || !Util::init()) { return false; } === modified file 'plugins/Dev/pluginsdk.cpp' --- plugins/Dev/pluginsdk.cpp 2012-11-11 17:43:20 +0000 +++ plugins/Dev/pluginsdk.cpp 2012-11-11 18:37:03 +0000 @@ -1,8 +1,6 @@ /* This file compiles the plugin SDK. Normally the relevant files would be included directly in the project; but it's impractical in the DC++ repository (would need some decent symlink support). */ -#include "version.h" - #include <pluginsdk/Config.cpp> #include <pluginsdk/Core.cpp> #include <pluginsdk/Hooks.cpp> === modified file 'plugins/Script/Plugin.cpp' --- plugins/Script/Plugin.cpp 2012-11-11 17:43:20 +0000 +++ plugins/Script/Plugin.cpp 2012-11-11 18:37:03 +0000 @@ -87,7 +87,7 @@ bool Plugin::onLoad(DCCorePtr core, bool install) { Core::init(core); - if(!Config::init() || !Connections::init() || !Hooks::init() || !Hubs::init() || !Logger::init() || !Util::init()) { + if(!Config::init(PLUGIN_GUID) || !Connections::init() || !Hooks::init() || !Hubs::init() || !Logger::init() || !Util::init()) { return false; } === modified file 'plugins/Script/pluginsdk.cpp' --- plugins/Script/pluginsdk.cpp 2012-11-11 17:43:20 +0000 +++ plugins/Script/pluginsdk.cpp 2012-11-11 18:37:03 +0000 @@ -1,8 +1,6 @@ /* This file compiles the plugin SDK. Normally the relevant files would be included directly in the project; but it's impractical in the DC++ repository (would need some decent symlink support). */ -#include "version.h" - #include <pluginsdk/Config.cpp> #include <pluginsdk/Connections.cpp> #include <pluginsdk/Core.cpp> === modified file 'plugins/Test/Plugin.cpp' --- plugins/Test/Plugin.cpp 2012-11-11 17:07:47 +0000 +++ plugins/Test/Plugin.cpp 2012-11-11 18:37:03 +0000 @@ -70,7 +70,7 @@ bool Plugin::onLoad(DCCorePtr core, bool install) { Core::init(core); - if(!Config::init() || !Hooks::init() || !Logger::init() || !Tagger::init() || !UI::init() || !Util::init()) { + if(!Config::init(PLUGIN_GUID) || !Hooks::init() || !Logger::init() || !Tagger::init() || !UI::init() || !Util::init()) { return false; } === modified file 'plugins/Test/Plugin.h' --- plugins/Test/Plugin.h 2012-11-11 17:07:47 +0000 +++ plugins/Test/Plugin.h 2012-11-11 18:37:03 +0000 @@ -19,9 +19,6 @@ #ifndef PLUGINS_TEST_PLUGIN_H #define PLUGINS_TEST_PLUGIN_H -#include <map> - -using std::map; using std::string; class Plugin === modified file 'plugins/Test/pluginsdk.cpp' --- plugins/Test/pluginsdk.cpp 2012-11-11 17:43:20 +0000 +++ plugins/Test/pluginsdk.cpp 2012-11-11 18:37:03 +0000 @@ -1,8 +1,6 @@ /* This file compiles the plugin SDK. Normally the relevant files would be included directly in the project; but it's impractical in the DC++ repository (would need some decent symlink support). */ -#include "version.h" - #include <pluginsdk/Config.cpp> #include <pluginsdk/Core.cpp> #include <pluginsdk/Hooks.cpp> === removed file 'pluginsdk/c/pluginsdk/version.h' --- pluginsdk/c/pluginsdk/version.h 2012-11-04 19:15:24 +0000 +++ pluginsdk/c/pluginsdk/version.h 1970-01-01 00:00:00 +0000 @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com - * - * 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. - */ - -/* Information about the plugin - fill this out! */ - -#ifndef PLUGINSDK_VERSION_H -#define PLUGINSDK_VERSION_H - -/* UUID/GUID for this plugin project */ -#define PLUGIN_GUID "..." - -/* Name of the plugin */ -#define PLUGIN_NAME "..." - -/* Author of the plugin */ -#define PLUGIN_AUTHOR "..." - -/* Short description of the plugin */ -#define PLUGIN_DESC "..." - -/* Version of the plugin (note: not API version) */ -#define PLUGIN_VERSION 1.0 - -/* Plugin website, set to "N/A" if none */ -#define PLUGIN_WEB "N/A" - -#endif === modified file 'pluginsdk/cpp/pluginsdk/Config.cpp' --- pluginsdk/cpp/pluginsdk/Config.cpp 2012-11-11 16:28:14 +0000 +++ pluginsdk/cpp/pluginsdk/Config.cpp 2012-11-11 18:37:03 +0000 @@ -25,13 +25,14 @@ namespace dcapi { DCConfigPtr Config::config; +string Config::guid; -bool Config::init() { +bool Config::init(string pluginGuid) { if(!Core::handle()) { return false; } - init(reinterpret_cast<DCConfigPtr>(Core::handle()->query_interface(DCINTF_CONFIG, DCINTF_CONFIG_VER))); + init(reinterpret_cast<DCConfigPtr>(Core::handle()->query_interface(DCINTF_CONFIG, DCINTF_CONFIG_VER)), move(pluginGuid)); return config; } -void Config::init(DCConfigPtr coreConfig) { config = coreConfig; } +void Config::init(DCConfigPtr coreConfig, string pluginGuid) { config = coreConfig; guid = move(pluginGuid); } DCConfigPtr Config::handle() { return config; } void Config::setConfig(const char* name, const char* value) { setConfig<ConfigStr>(name, CFG_TYPE_STRING, value); } === modified file 'pluginsdk/cpp/pluginsdk/Config.h' --- pluginsdk/cpp/pluginsdk/Config.h 2012-11-11 16:28:14 +0000 +++ pluginsdk/cpp/pluginsdk/Config.h 2012-11-11 18:37:03 +0000 @@ -33,8 +33,8 @@ class Config { public: - static bool init(); - static void init(DCConfigPtr coreConfig); + static bool init(string pluginGuid); + static void init(DCConfigPtr coreConfig, string pluginGuid); static DCConfigPtr handle(); static void setConfig(const char* name, const char* value); @@ -58,15 +58,17 @@ template<typename ConfigT, typename RetT> static RetT getConfig(const char* name, ConfigType type); static DCConfigPtr config; + + static string guid; }; template<typename ConfigT, typename ValueT> void Config::setConfig(const char* name, ConfigType type, ValueT value) { ConfigT val = { type, value }; - config->set_cfg(PLUGIN_GUID, name, reinterpret_cast<ConfigValuePtr>(&val)); + config->set_cfg(guid.c_str(), name, reinterpret_cast<ConfigValuePtr>(&val)); } template<typename ConfigT, typename RetT> RetT Config::getConfig(const char* name, ConfigType type) { - auto cfg = config->get_cfg(PLUGIN_GUID, name, type); + auto cfg = config->get_cfg(guid.c_str(), name, type); RetT ret(reinterpret_cast<ConfigT>(cfg)->value); config->release(cfg); return ret; === modified file 'pluginsdk/cpp/pluginsdk/Queue.cpp' --- pluginsdk/cpp/pluginsdk/Queue.cpp 2012-11-11 16:57:44 +0000 +++ pluginsdk/cpp/pluginsdk/Queue.cpp 2012-11-11 18:37:03 +0000 @@ -28,7 +28,7 @@ bool Queue::init() { if(!Core::handle()) { return false; } - init(reinterpret_cast<DCQueuePtr>(Core::handle()->query_interface(DCINTF_QUEUE, DCINTF_QUEUE_VER))); + init(reinterpret_cast<DCQueuePtr>(Core::handle()->query_interface(DCINTF_DCPP_QUEUE, DCINTF_DCPP_QUEUE_VER))); return queue; } void Queue::init(DCQueuePtr coreQueue) { queue = coreQueue; } === removed file 'pluginsdk/cpp/pluginsdk/version.h' --- pluginsdk/cpp/pluginsdk/version.h 2012-11-04 19:15:24 +0000 +++ pluginsdk/cpp/pluginsdk/version.h 1970-01-01 00:00:00 +0000 @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com - * - * 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. - */ - -/* Information about the plugin - fill this out! */ - -#ifndef PLUGINSDK_VERSION_H -#define PLUGINSDK_VERSION_H - -/* UUID/GUID for this plugin project */ -#define PLUGIN_GUID "..." - -/* Name of the plugin */ -#define PLUGIN_NAME "..." - -/* Author of the plugin */ -#define PLUGIN_AUTHOR "..." - -/* Short description of the plugin */ -#define PLUGIN_DESC "..." - -/* Version of the plugin (note: not API version) */ -#define PLUGIN_VERSION 1.0 - -/* Plugin website, set to "N/A" if none */ -#define PLUGIN_WEB "N/A" - -#endif === added directory 'pluginsdk/cpp/projects' === added directory 'pluginsdk/cpp/projects/vs2012' === added file 'pluginsdk/cpp/projects/vs2012/Plugin.sln' --- pluginsdk/cpp/projects/vs2012/Plugin.sln 1970-01-01 00:00:00 +0000 +++ pluginsdk/cpp/projects/vs2012/Plugin.sln 2012-11-11 18:37:03 +0000 @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin", "Plugin.vcxproj", "{B5273AD8-8E53-46CD-8797-65FE814DBFB0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B5273AD8-8E53-46CD-8797-65FE814DBFB0}.Debug|Win32.ActiveCfg = Debug|Win32 + {B5273AD8-8E53-46CD-8797-65FE814DBFB0}.Debug|Win32.Build.0 = Debug|Win32 + {B5273AD8-8E53-46CD-8797-65FE814DBFB0}.Release|Win32.ActiveCfg = Release|Win32 + {B5273AD8-8E53-46CD-8797-65FE814DBFB0}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal === added file 'pluginsdk/cpp/projects/vs2012/Plugin.vcxproj' --- pluginsdk/cpp/projects/vs2012/Plugin.vcxproj 1970-01-01 00:00:00 +0000 +++ pluginsdk/cpp/projects/vs2012/Plugin.vcxproj 2012-11-11 18:37:03 +0000 @@ -0,0 +1,118 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{B5273AD8-8E53-46CD-8797-65FE814DBFB0}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;PLUGIN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>../../</AdditionalIncludeDirectories> + <DisableSpecificWarnings>4800</DisableSpecificWarnings> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <AdditionalIncludeDirectories>../../</AdditionalIncludeDirectories> + <DisableSpecificWarnings>4800</DisableSpecificWarnings> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\pluginsdk\Config.cpp" /> + <ClCompile Include="..\..\pluginsdk\Connections.cpp" /> + <ClCompile Include="..\..\pluginsdk\Core.cpp" /> + <ClCompile Include="..\..\pluginsdk\Hooks.cpp" /> + <ClCompile Include="..\..\pluginsdk\Hubs.cpp" /> + <ClCompile Include="..\..\pluginsdk\Logger.cpp" /> + <ClCompile Include="..\..\pluginsdk\Queue.cpp" /> + <ClCompile Include="..\..\pluginsdk\Tagger.cpp" /> + <ClCompile Include="..\..\pluginsdk\UI.cpp" /> + <ClCompile Include="..\..\pluginsdk\Util.cpp" /> + <ClCompile Include="..\..\src\main.cpp" /> + <ClCompile Include="..\..\src\Plugin.cpp" /> + <ClCompile Include="..\..\src\stdafx.cpp" /> + </ItemGroup> + <ItemGroup> + <None Include="..\..\src\Plugin.def" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\pluginsdk\Config.h" /> + <ClInclude Include="..\..\pluginsdk\Connections.h" /> + <ClInclude Include="..\..\pluginsdk\Core.h" /> + <ClInclude Include="..\..\pluginsdk\Hooks.h" /> + <ClInclude Include="..\..\pluginsdk\Hubs.h" /> + <ClInclude Include="..\..\pluginsdk\Logger.h" /> + <ClInclude Include="..\..\pluginsdk\PluginDefs.h" /> + <ClInclude Include="..\..\pluginsdk\Queue.h" /> + <ClInclude Include="..\..\pluginsdk\Tagger.h" /> + <ClInclude Include="..\..\pluginsdk\UI.h" /> + <ClInclude Include="..\..\pluginsdk\Util.h" /> + <ClInclude Include="..\..\src\Plugin.h" /> + <ClInclude Include="..\..\src\resource.h" /> + <ClInclude Include="..\..\src\stdafx.h" /> + <ClInclude Include="..\..\src\version.h" /> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="..\..\src\resource.rc" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file === added file 'pluginsdk/cpp/projects/vs2012/Plugin.vcxproj.filters' --- pluginsdk/cpp/projects/vs2012/Plugin.vcxproj.filters 1970-01-01 00:00:00 +0000 +++ pluginsdk/cpp/projects/vs2012/Plugin.vcxproj.filters 2012-11-11 18:37:03 +0000 @@ -0,0 +1,121 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions> + </Filter> + <Filter Include="Source Files\Plugin SDK"> + <UniqueIdentifier>{06f1f0f7-e8f5-48f2-999e-e53a04056b83}</UniqueIdentifier> + </Filter> + <Filter Include="Header Files\Plugin SDK"> + <UniqueIdentifier>{ff6b64da-cee7-4033-bcef-4b0545314cbe}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\src\main.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\Plugin.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\stdafx.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\pluginsdk\Config.cpp"> + <Filter>Source Files\Plugin SDK</Filter> + </ClCompile> + <ClCompile Include="..\..\pluginsdk\Connections.cpp"> + <Filter>Source Files\Plugin SDK</Filter> + </ClCompile> + <ClCompile Include="..\..\pluginsdk\Core.cpp"> + <Filter>Source Files\Plugin SDK</Filter> + </ClCompile> + <ClCompile Include="..\..\pluginsdk\Hooks.cpp"> + <Filter>Source Files\Plugin SDK</Filter> + </ClCompile> + <ClCompile Include="..\..\pluginsdk\Hubs.cpp"> + <Filter>Source Files\Plugin SDK</Filter> + </ClCompile> + <ClCompile Include="..\..\pluginsdk\Logger.cpp"> + <Filter>Source Files\Plugin SDK</Filter> + </ClCompile> + <ClCompile Include="..\..\pluginsdk\Queue.cpp"> + <Filter>Source Files\Plugin SDK</Filter> + </ClCompile> + <ClCompile Include="..\..\pluginsdk\UI.cpp"> + <Filter>Source Files\Plugin SDK</Filter> + </ClCompile> + <ClCompile Include="..\..\pluginsdk\Util.cpp"> + <Filter>Source Files\Plugin SDK</Filter> + </ClCompile> + <ClCompile Include="..\..\pluginsdk\Tagger.cpp"> + <Filter>Source Files\Plugin SDK</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <None Include="..\..\src\Plugin.def"> + <Filter>Source Files</Filter> + </None> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\src\Plugin.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\src\resource.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\src\stdafx.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\src\version.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\pluginsdk\Config.h"> + <Filter>Header Files\Plugin SDK</Filter> + </ClInclude> + <ClInclude Include="..\..\pluginsdk\Connections.h"> + <Filter>Header Files\Plugin SDK</Filter> + </ClInclude> + <ClInclude Include="..\..\pluginsdk\Core.h"> + <Filter>Header Files\Plugin SDK</Filter> + </ClInclude> + <ClInclude Include="..\..\pluginsdk\Hooks.h"> + <Filter>Header Files\Plugin SDK</Filter> + </ClInclude> + <ClInclude Include="..\..\pluginsdk\Hubs.h"> + <Filter>Header Files\Plugin SDK</Filter> + </ClInclude> + <ClInclude Include="..\..\pluginsdk\Logger.h"> + <Filter>Header Files\Plugin SDK</Filter> + </ClInclude> + <ClInclude Include="..\..\pluginsdk\Queue.h"> + <Filter>Header Files\Plugin SDK</Filter> + </ClInclude> + <ClInclude Include="..\..\pluginsdk\UI.h"> + <Filter>Header Files\Plugin SDK</Filter> + </ClInclude> + <ClInclude Include="..\..\pluginsdk\Util.h"> + <Filter>Header Files\Plugin SDK</Filter> + </ClInclude> + <ClInclude Include="..\..\pluginsdk\Tagger.h"> + <Filter>Header Files\Plugin SDK</Filter> + </ClInclude> + <ClInclude Include="..\..\pluginsdk\PluginDefs.h"> + <Filter>Header Files\Plugin SDK</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="..\..\src\resource.rc"> + <Filter>Resource Files</Filter> + </ResourceCompile> + </ItemGroup> +</Project> \ No newline at end of file === added directory 'pluginsdk/cpp/src' === added file 'pluginsdk/cpp/src/Plugin.cpp' --- pluginsdk/cpp/src/Plugin.cpp 1970-01-01 00:00:00 +0000 +++ pluginsdk/cpp/src/Plugin.cpp 2012-11-11 18:37:03 +0000 @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * + * 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 "stdafx.h" +#include "Plugin.h" + +/* Include plugin SDK helpers. There are more interfaces available that can be included in the same +fashion (check the pluginsdk directory). */ +#include <pluginsdk/Config.h> +#include <pluginsdk/Core.h> +#include <pluginsdk/Hooks.h> +#include <pluginsdk/Logger.h> +#include <pluginsdk/Util.h> + +/* Plugin SDK helpers are in the "dcapi" namespace; ease their calling. */ +using dcapi::Config; +using dcapi::Core; +using dcapi::Hooks; +using dcapi::Logger; +using dcapi::Util; + +Plugin::Plugin() { +} + +Plugin::~Plugin() { + Hooks::clear(); +} + +Bool DCAPI Plugin::main(PluginState state, DCCorePtr core, dcptr_t) { + static Plugin* instance; + + switch(state) { + case ON_INSTALL: + case ON_LOAD: + { + instance = new Plugin(); + return instance->onLoad(core, state == ON_INSTALL) ? True : False; + } + + case ON_UNINSTALL: + case ON_UNLOAD: + { + delete instance; + instance = nullptr; + return True; + } + + default: + { + return False; + } + } +} + +bool Plugin::onLoad(DCCorePtr core, bool install) { + /* Initialization phase. Initiate additional interfaces that you may have included from the + plugin SDK. */ + Core::init(core); + if(!Config::init(PLUGIN_GUID) || !Hooks::init() || !Logger::init() || !Util::init()) { + return false; + } + + if(install) { + // This only executes when the plugin has been installed for the first time. + } + + // Start the plugin logic here; add hooks with functions from the Hooks interface. + + return true; +} === added file 'pluginsdk/cpp/src/Plugin.def' --- pluginsdk/cpp/src/Plugin.def 1970-01-01 00:00:00 +0000 +++ pluginsdk/cpp/src/Plugin.def 2012-11-11 18:37:03 +0000 @@ -0,0 +1,2 @@ +EXPORTS + pluginInit = _pluginInit@4 @1 === added file 'pluginsdk/cpp/src/Plugin.h' --- pluginsdk/cpp/src/Plugin.h 1970-01-01 00:00:00 +0000 +++ pluginsdk/cpp/src/Plugin.h 2012-11-11 18:37:03 +0000 @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * + * 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 PLUGIN_PLUGIN_H +#define PLUGIN_PLUGIN_H + +using std::string; + +class Plugin +{ +public: + static Bool DCAPI main(PluginState state, DCCorePtr core, dcptr_t); + +private: + Plugin(); + ~Plugin(); + + bool onLoad(DCCorePtr core, bool install); +}; + +#endif === added file 'pluginsdk/cpp/src/main.cpp' --- pluginsdk/cpp/src/main.cpp 1970-01-01 00:00:00 +0000 +++ pluginsdk/cpp/src/main.cpp 2012-11-11 18:37:03 +0000 @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * + * 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 "stdafx.h" +#include "Plugin.h" +#include "version.h" + +extern "C" { + +// Plugin loader +DCEXP DCMAIN DCAPI pluginInit(MetaDataPtr info) { + info->name = PLUGIN_NAME; + info->author = PLUGIN_AUTHOR; + info->description = PLUGIN_DESC; + info->web = PLUGIN_WEB; + info->version = PLUGIN_VERSION; + info->apiVersion = DCAPI_CORE_VER; + info->guid = PLUGIN_GUID; + + return &Plugin::main; +} + +#ifdef _WIN32 +BOOL APIENTRY DllMain(HINSTANCE /*hinstDLL*/, DWORD /*fdwReason*/, LPVOID /*lpvReserved*/) { + return TRUE; +} +#endif + +} === added file 'pluginsdk/cpp/src/resource.h' --- pluginsdk/cpp/src/resource.h 1970-01-01 00:00:00 +0000 +++ pluginsdk/cpp/src/resource.h 2012-11-11 18:37:03 +0000 @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by resource.rc +// +#define VERSION_INFO 1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1002 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif === added file 'pluginsdk/cpp/src/resource.rc' --- pluginsdk/cpp/src/resource.rc 1970-01-01 00:00:00 +0000 +++ pluginsdk/cpp/src/resource.rc 2012-11-11 18:37:03 +0000 @@ -0,0 +1,100 @@ +// 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 (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) + +#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 + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,0 + PRODUCTVERSION 1,0,0,0 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080004b0" + BEGIN + VALUE "Comments", "..." + VALUE "FileDescription", "..." + VALUE "FileVersion", "1, 0, 0, 0" + VALUE "InternalName", "..." + VALUE "LegalCopyright", "..." + VALUE "OriginalFilename", "..." + VALUE "ProductName", "..." + VALUE "ProductVersion", "1, 0, 0, 0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x800, 1200 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + === added file 'pluginsdk/cpp/src/stdafx.cpp' --- pluginsdk/cpp/src/stdafx.cpp 1970-01-01 00:00:00 +0000 +++ pluginsdk/cpp/src/stdafx.cpp 2012-11-11 18:37:03 +0000 @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * + * 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 "stdafx.h" === added file 'pluginsdk/cpp/src/stdafx.h' --- pluginsdk/cpp/src/stdafx.h 1970-01-01 00:00:00 +0000 +++ pluginsdk/cpp/src/stdafx.h 2012-11-11 18:37:03 +0000 @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * + * 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 PLUGIN_STDAFX_H +#define PLUGIN_STDAFX_H + +#ifdef _WIN32 + +#include <windows.h> +#include <tchar.h> + +#else + +#include <unistd.h> + +#endif + +#include <cstdio> +#include <cstdint> +#include <string> + +#include <pluginsdk/PluginDefs.h> + +#include "version.h" + +#ifdef _UNICODE +typedef std::wstring tstring; +#else +typedef std::string tstring; +#endif + +#endif === added file 'pluginsdk/cpp/src/version.h' --- pluginsdk/cpp/src/version.h 1970-01-01 00:00:00 +0000 +++ pluginsdk/cpp/src/version.h 2012-11-11 18:37:03 +0000 @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * + * 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. + */ + +/* Information about the plugin - fill this out! Don't forget to edit the resource file as well. */ + +#ifndef PLUGIN_VERSION_H +#define PLUGIN_VERSION_H + +/* UUID/GUID for this plugin project */ +#define PLUGIN_GUID "..." + +/* Name of the plugin */ +#define PLUGIN_NAME "..." + +/* Author of the plugin */ +#define PLUGIN_AUTHOR "..." + +/* Short description of the plugin */ +#define PLUGIN_DESC "..." + +/* Version of the plugin (note: not API version) */ +#define PLUGIN_VERSION 1.0 + +/* Plugin website, set to "N/A" if none */ +#define PLUGIN_WEB "N/A" + +#endif
_______________________________________________ Mailing list: https://launchpad.net/~linuxdcpp-team Post to : linuxdcpp-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~linuxdcpp-team More help : https://help.launchpad.net/ListHelp