From: Leonardo Florez-Valencia Date: Mon, 8 Dec 2014 16:00:05 +0000 (+0100) Subject: Base objects migration X-Git-Tag: v0.1~452 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=8c23766af88a29c3e830299dffc4b95d9fe61df9;p=cpPlugins.git Base objects migration --- diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..d21e1bf --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,83 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +# for CMake 2.6 corrected behaviour (see "cmake --help-policy CMP0003") +IF( + COMMAND cmake_policy AND + ${CMAKE_MAJOR_VERSION} EQUAL 2 AND + ${CMAKE_MINOR_VERSION} GREATER 4 + ) + CMAKE_POLICY(SET CMP0003 NEW) + CMAKE_POLICY(SET CMP0005 NEW) + CMAKE_POLICY(SET CMP0011 NEW) + CMAKE_POLICY(SET CMP0012 NEW) +ENDIF( + COMMAND cmake_policy AND + ${CMAKE_MAJOR_VERSION} EQUAL 2 AND + ${CMAKE_MINOR_VERSION} GREATER 4 + ) + +## ================ +## = Project name = +## ================ + +PROJECT(cpPlugins) +SET(cpPlugins_MAJOR_VERSION "1") +SET(cpPlugins_MINOR_VERSION "0") +SET(cpPlugins_RELEASE_VERSION "0") +SET(cpPlugins_VERSION "${cpPlugins_MAJOR_VERSION}.${cpPlugins_MINOR_VERSION}.${cpPlugins_RELEASE_VERSION}") + +## =========== +## = Options = +## =========== + +OPTION(BUILD_EXAMPLES "Build examples" OFF) + +## ============ +## = Packages = +## ============ + +FIND_PACKAGE(ITK REQUIRED) +INCLUDE(${ITK_USE_FILE}) + +FIND_PACKAGE(VTK REQUIRED) +INCLUDE(${VTK_USE_FILE}) + +## ================================================ +## = Do not allow to build inside the source tree = +## ================================================ + +IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR}) + MESSAGE(FATAL_ERROR "Building in the source tree is not allowed") +ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR}) + +## ===================================== +## = Where to put executables and libs = +## ===================================== + +SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}) +SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}) +MARK_AS_ADVANCED( + CMAKE_BACKWARDS_COMPATIBILITY + EXECUTABLE_OUTPUT_PATH + LIBRARY_OUTPUT_PATH + ) + +## ============================== +## = Subdirs containing headers = +## ============================== + +INCLUDE_DIRECTORIES( + ${PROJECT_SOURCE_DIR}/lib + ${PROJECT_SOURCE_DIR}/lib/third_party + ) + +## =========================== +## = Subdirs containing code = +## =========================== + +SUBDIRS( + lib + appli + ) + +## eof - $RCSfile$ diff --git a/COMPILATION b/COMPILATION new file mode 100644 index 0000000..96717fa --- /dev/null +++ b/COMPILATION @@ -0,0 +1,26 @@ +@description + The project uses CMake as compilation helper. It should compile on the three + major box flavors (linux, windows, mac). However, as of december 2014, it + has only been tested on linux Fedora 20 and Ubuntu 14.04. + +@prerequisites + 1. CMake (>=2.8.12.2) + + 3. Visualization Toolkit -VTK- (>=6.1.0) + 3.1 Required cmake flags: + BUILD_SHARED_LIBS:BOOL=ON + + 4. Insight Toolkit -ITK- (>=4.6.0) + 4.1 Required cmake flags: + BUILD_SHARED_LIBS:BOOL=ON + Module_ITKVtkGlue:BOOL=ON + +@cmake_flags + BUILD_DEMOS:BOOL + Build example applications? (most of them are command line) + CMAKE_BUILD_TYPE:STRING + Debug/Release? + CMAKE_INSTALL_PREFIX:STRING + Where to put installation products? (in windows this option has no use) + +## eof - $RCSfile$ diff --git a/appli/CMakeLists.txt b/appli/CMakeLists.txt new file mode 100644 index 0000000..61d2cd0 --- /dev/null +++ b/appli/CMakeLists.txt @@ -0,0 +1,7 @@ +IF(BUILD_EXAMPLES) + SUBDIRS( + examples + ) +ENDIF(BUILD_EXAMPLES) + +## eof - $RCSfile$ diff --git a/appli/examples/CMakeLists.txt b/appli/examples/CMakeLists.txt new file mode 100644 index 0000000..209a58f --- /dev/null +++ b/appli/examples/CMakeLists.txt @@ -0,0 +1,23 @@ + +## ========================= +## = Command line programs = +## ========================= + +SET( + EXAMPLES_PROGRAMS + example_LoadPlugins + example_ReadWriteImage + ) + +FOREACH(prog ${EXAMPLES_PROGRAMS}) + ADD_EXECUTABLE( + ${prog} + ${prog}.cxx + ) + TARGET_LINK_LIBRARIES( + ${prog} + cpPlugins_Interface + ) +ENDFOREACH(prog) + +## eof - $RCSfile$ diff --git a/appli/examples/example_LoadPlugins.cxx b/appli/examples/example_LoadPlugins.cxx new file mode 100644 index 0000000..edbb600 --- /dev/null +++ b/appli/examples/example_LoadPlugins.cxx @@ -0,0 +1,34 @@ +#include +#include + +#include + +int main( int argc, char* argv[] ) +{ + if( argc < 2 ) + { + std::cerr << "Usage: " << argv[ 0 ] << " plugins_file" << std::endl; + return( 1 ); + + } // fi + std::string plugins_file = argv[ 1 ]; + + // Create interface + typedef cpPlugins::Interface::Interface TInterface; + typedef TInterface::TClasses TClasses; + + TInterface plugins; + plugins.Load( plugins_file ); + + std::cout << "---------------------------------------------" << std::endl; + std::cout << "Loaded classes:" << std::endl; + TClasses::const_iterator cIt = plugins.GetClasses( ).begin( ); + TClasses::const_iterator end_cIt = plugins.GetClasses( ).end( ); + for( ; cIt != end_cIt; ++cIt ) + std::cout << "\t:= " << cIt->first << std::endl; + std::cout << "---------------------------------------------" << std::endl; + + return( 0 ); +} + +// eof - $RCSfile$ diff --git a/appli/examples/example_ReadWriteImage.cxx b/appli/examples/example_ReadWriteImage.cxx new file mode 100644 index 0000000..4d5987b --- /dev/null +++ b/appli/examples/example_ReadWriteImage.cxx @@ -0,0 +1,77 @@ +#include +#include +#include + +#include +#include + +int main( int argc, char* argv[] ) +{ + if( argc < 7 ) + { + std::cerr + << "Usage: " << argv[ 0 ] + << " plugins_file" + << " input_image output_image" + << " dimensions pixel_type is_color" << std::endl; + return( 1 ); + + } // fi + std::string plugins_file = argv[ 1 ]; + std::string input_image_file = argv[ 2 ]; + std::string output_image_file = argv[ 3 ]; + std::string dimensions = argv[ 4 ]; + std::string pixel_type = argv[ 5 ]; + bool is_color = ( std::atoi( argv[ 6 ] ) == 1 ); + + // Create interface + typedef cpPlugins::Interface::Interface TInterface; + typedef TInterface::TClasses TClasses; + + TInterface plugins; + plugins.Load( plugins_file ); + + // Create objects + typedef cpPlugins::Interface::ProcessObject TProcessObject; + typedef TProcessObject::TParameters TParameters; + cpPlugins::Interface::ProcessObject* reader; + cpPlugins::Interface::ProcessObject* writer; + + reader = + dynamic_cast< TProcessObject* >( + plugins.CreateObject( "cpPlugins::Plugins::ImageReader" ) + ); + if( reader == NULL ) + { + std::cerr << "No suitable reader found in plugins." << std::endl; + return( 1 ); + + } // fi + writer = + dynamic_cast< TProcessObject* >( + plugins.CreateObject( "cpPlugins::Plugins::ImageWriter" ) + ); + if( writer == NULL ) + { + delete reader; + std::cerr << "No suitable writer found in plugins." << std::endl; + return( 1 ); + + } // fi + + // Configure reader + TParameters reader_params = reader->GetDefaultParameters( ); + reader_params[ "FileName" ].second = input_image_file; + reader_params[ "PixelType" ].second = pixel_type; + reader_params[ "ImageDimension" ].second = dimensions; + reader_params[ "IsColorImage" ].second = ( is_color )? "1": "0"; + reader->SetParameters( reader_params ); + + // Free memory + delete writer; + delete reader; + + return( 0 ); +} + +// eof - $RCSfile$ diff --git a/doc/third_party/Pluma/build/Doxyfile b/doc/third_party/Pluma/build/Doxyfile new file mode 100644 index 0000000..b0d5dd6 --- /dev/null +++ b/doc/third_party/Pluma/build/Doxyfile @@ -0,0 +1,1597 @@ +# Doxyfile 1.6.3 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = Pluma + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = .. + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = YES + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = YES + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it parses. +# With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this tag. +# The format is ext=language, where ext is a file extension, and language is one of +# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, +# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. Note that for custom extensions you also need to set +# FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will rougly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by +# doxygen. The layout file controls the global structure of the generated output files +# in an output format independent way. The create the layout file that represents +# doxygen's defaults, run doxygen with the -l option. You can optionally specify a +# file name after the option, if omitted DoxygenLayout.xml will be used as the name +# of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ../../../Pluma/ \ + Doxygen.hpp + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.dox \ + *.py + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = .svn \ + Linux \ + Unix \ + OSX* + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = priv + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = NO + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .htm + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = header.htm + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = footer.htm + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = doxygen.css + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = ../Pluma.chm + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = "C:/Program Files/HTML Help Workshop/hhc.exe" + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER +# are set, an additional index file will be generated that can be used as input for +# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated +# HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. +# For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's +# filter section matches. +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 1 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvances is that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = YES + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = YES + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = D:/Programmes/mscgen + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/doc/third_party/Pluma/build/Doxygen.hpp b/doc/third_party/Pluma/build/Doxygen.hpp new file mode 100644 index 0000000..9b307a1 --- /dev/null +++ b/doc/third_party/Pluma/build/Doxygen.hpp @@ -0,0 +1,101 @@ +//////////////////////////////////////////////////////////// +/// \mainpage +/// +/// \section welcome Welcome +/// Welcome to Pluma documentation. Here you will find a detailed +/// view of all Pluma classes.
+/// If you are looking for support, you can visit the official website +/// at http://pluma-framework.sourceforge.net/.

+/// +/// CSS based on SFML1.6 documentation
+/// +/// \section example Short Example +/// A short example to demonstrate Pluma usage:
+/// A host application define a Device interface. A certain plugin +/// defines a Keyboard, witch is a Device. +/// The host will use DeviceProviders to create objects of type Device. +/// The plugin will provide host specifically with a KeyboardProvider.
+/// +/// Device hpp (shared): +/// \code +/// #include +/// class Device{ +/// public: +/// virtual std::string getDescription() const = 0; +/// }; +/// // create DevicedProvider class +/// PLUMA_PROVIDER_HEADER(Device); +/// \endcode +/// +/// Device cpp (shared): +/// \code +/// #include "Device.hpp" +/// generate DevicedProvider with version 6, and compatible with at least v.3 +/// PLUMA_PROVIDER_SOURCE(Device, 6, 3); +/// \endcode +/// +/// +///
+/// Keyboard code on the plugin side: +/// \code +/// #include +/// #include "Device.hpp" +/// +/// class Keyboard: public Device{ +/// public: +/// std::string getDescription() const{ +/// return "keyboard"; +/// } +/// }; +/// +/// // create KeyboardProvider, it implements DeviceProvider +/// PLUMA_INHERIT_PROVIDER(Keyboard, Device); +/// \endcode +/// +/// plugin connector: +/// \code +/// #include +/// #include "Keyboard.hpp" +/// +/// PLUMA_CONNECTOR +/// bool connect(pluma::Host& host){ +/// // add a keyboard provider to host +/// host.add( new KeyboardProvider() ); +/// return true; +/// } +/// \endcode +/// +/// +/// Host application code: +/// \code +/// #include +/// +/// #include "Device.hpp" +/// #include +/// #include +/// +/// int main(){ +/// +/// pluma::Pluma plugins; +/// // Tell plugins manager to accept providers of the type DeviceProvider +/// plugins.acceptProviderType(); +/// // Load library "standard_devices" from folder "plugins" +/// plugins.load("plugins", "standard_devices"); +/// +/// // Get device providers into a vector +/// std::vector providers; +/// plugins.getProviders(providers); +/// +/// // create a Device from the first provider +/// if (!providers.empty()){ +/// Device* myDevice = providers.first()->create(); +/// // do something with myDevice +/// std::cout << device->getDescription() << std::endl; +/// // and delete it in the end +/// delete myDevice; +/// } +/// return 0; +/// } +/// \endcode +/// +//////////////////////////////////////////////////////////// diff --git a/doc/third_party/Pluma/build/doxygen.css b/doc/third_party/Pluma/build/doxygen.css new file mode 100644 index 0000000..de219ac --- /dev/null +++ b/doc/third_party/Pluma/build/doxygen.css @@ -0,0 +1,384 @@ +div#logo +{ + margin-bottom : 1em; + background : url("./logo-bg.jpg") repeat-x; +} + +div#logo a +{ + display : block; +} + +p#footer +{ + text-decoration : overline; + color : #606060; + padding-top : 1em; + text-align : center; + font-size : smaller; +} + +p#footer a +{ + color : #007298; + text-decoration : none; +} + +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Geneva, Arial, Helvetica, sans-serif; +} +BODY,TD { + font-size: 90%; +} +H1 { + text-align : center; + margin-top : 0px; + color : #2090B0; + font-size : 160%; +} +H2 { + font-size: 120%; +} +H3 { + font-size: 100%; +} +CAPTION { font-weight: bold } +DIV.qindex { + width: 100%; + background-color: #E0FFE0; + border: 1px dotted #808080; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.nav { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navtab { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +TD.navtab { + font-size: 70%; +} +A.qindex { + text-decoration: none; + font-weight: bold; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; +} +A.qindex:hover { + text-decoration: none; + background-color: #ddddff; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} +A.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; +} +A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code:link { text-decoration: none; font-weight: normal; border-bottom : 1px dotted #808080; color: black;} +A.code:visited { text-decoration: none; font-weight: normal; border-bottom : 1px dotted #808080; color: black;} +A.codeRef:link { font-weight: normal; color: #0000FF} +A.codeRef:visited { font-weight: normal; color: #0000FF} +/*A:hover { text-decoration: none; background-color: #f2f2ff }*/ +DL.el { margin-left: -1cm } +.fragment { + font-family: monospace, fixed; + font-size: 95%; +} +PRE.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } + +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} +DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } +BODY { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} +TD.indexkey { + background-color: #e8eef2; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TD.indexvalue { + background-color: #e8eef2; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { text-align: center; } +IMG.formulaDsp { } +IMG.formulaInl { vertical-align: middle; } +SPAN.keyword { color: #0000FF } +SPAN.keywordtype { color: #0000FF } +SPAN.keywordflow { color: #0000FF } +SPAN.comment { color: #008000 } +SPAN.preprocessor { color: #008080 } +SPAN.stringliteral { color: #008080 } +SPAN.charliteral { color: #008080 } +.mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplParams { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + color: #606060; + background-color: #FAFAFA; + font-size: 80%; +} +.search { color: #003399; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +TD.tiny { font-size: 75%; +} +a { + color: #2090B0; +} +a:visited { + color: #2090B0; +} +.dirtab { padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} +TH.dirtab { background: #e8eef2; + font-weight: bold; +} +HR { height: 1px; + border: none; + border-top: 1px solid black; +} + +/* Style for detailed member documentation */ +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; +} +.memnav { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +.memitem { + /*padding: 4px;*/ + background-color: #F0FFF0; + border-width: 1px; + border-style: solid; + border-color: #808080; + /*-moz-border-radius: 8px 8px 8px 8px;*/ +} +.memname { + white-space: nowrap; + font-weight: bold; +} +.memdoc{ + padding-left: 10px; +} +.memproto { + background-color: #D0FFD0; + width: 100%; + border-bottom-width: 1px; + border-bottom-style: dotted; + border-bottom-color: #808080; + font-weight: bold; + /*-moz-border-radius: 8px 8px 8px 8px;*/ +} +.paramkey { + text-align: right; +} +.paramtype { + white-space: nowrap; +} +.paramname { + color: #602020; + font-style: italic; + white-space: nowrap; +} +/* End Styling for detailed member documentation */ + +/* for the tree view */ +.ftvtree { + font-family: sans-serif; + margin:0.5em; +} +.directory { font-size: 9pt; font-weight: bold; } +.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } +.directory > h3 { margin-top: 0; } +.directory p { margin: 0px; white-space: nowrap; } +.directory div { display: none; margin: 0px; } +.directory img { vertical-align: -30%; } diff --git a/doc/third_party/Pluma/build/footer.htm b/doc/third_party/Pluma/build/footer.htm new file mode 100644 index 0000000..0681f33 --- /dev/null +++ b/doc/third_party/Pluma/build/footer.htm @@ -0,0 +1,8 @@ + + + + + diff --git a/doc/third_party/Pluma/build/header.htm b/doc/third_party/Pluma/build/header.htm new file mode 100644 index 0000000..e7890bd --- /dev/null +++ b/doc/third_party/Pluma/build/header.htm @@ -0,0 +1,12 @@ + + + + Pluma - Plug-in Management Framework + + + + + + diff --git a/doc/third_party/Pluma/html/Config_8hpp_source.htm b/doc/third_party/Pluma/html/Config_8hpp_source.htm new file mode 100644 index 0000000..fb54cd0 --- /dev/null +++ b/doc/third_party/Pluma/html/Config_8hpp_source.htm @@ -0,0 +1,170 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
Config.hpp
+
+
+
1 //
+
3 // Pluma - Plug-in Management Framework
+
4 // Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
+
5 //
+
6 // This software is provided 'as-is', without any express or implied warranty.
+
7 // In no event will the authors be held liable for any damages arising from the use of this software.
+
8 //
+
9 // Permission is granted to anyone to use this software for any purpose,
+
10 // including commercial applications, and to alter it and redistribute it freely,
+
11 // subject to the following restrictions:
+
12 //
+
13 // 1. The origin of this software must not be misrepresented;
+
14 // you must not claim that you wrote the original software.
+
15 // If you use this software in a product, an acknowledgment
+
16 // in the product documentation would be appreciated but is not required.
+
17 //
+
18 // 2. Altered source versions must be plainly marked as such,
+
19 // and must not be misrepresented as being the original software.
+
20 //
+
21 // 3. This notice may not be removed or altered from any source distribution.
+
22 //
+
24 
+
25 
+
27 //
+
28 // Based on SFML configuration header
+
29 // SFML Config.hpp:
+
30 // http://www.sfml-dev.org/documentation/2.0/Config_8hpp-source.htm
+
31 //
+
32 // Acknowledgements to Simple and Fast Multimedia Library
+
33 // http://www.sfml-dev.org/
+
34 //
+
36 
+
37 
+
38 #ifndef PLUMA_CONFIG_HPP
+
39 #define PLUMA_CONFIG_HPP
+
40 
+
41 
+
43 // Identify the operating system
+
45 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
+
46 
+
47  // Windows
+
48  #define PLUMA_SYS_WINDOWS
+
49  #ifndef WIN32_LEAN_AND_MEAN
+
50  #define WIN32_LEAN_AND_MEAN
+
51  #endif
+
52  #ifndef NOMINMAX
+
53  #define NOMINMAX
+
54  #endif
+
55 
+
56 #elif defined(linux) || defined(__linux)
+
57 
+
58  // Linux
+
59  #define PLUMA_SYS_LINUX
+
60 
+
61 #elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
+
62 
+
63  // MacOS
+
64  #define PLUMA_SYS_MACOS
+
65 
+
66 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+
67 
+
68  // FreeBSD
+
69  #define PLUMA_SYS_FREEBSD
+
70 
+
71 #else
+
72 
+
73  // Unsupported system
+
74  #error This operating system is not supported by this library
+
75 
+
76 #endif
+
77 
+
78 
+
79 
+
81 // Define library file extension based on OS
+
83 #ifdef PLUMA_SYS_WINDOWS
+
84  #define PLUMA_LIB_EXTENSION "dll"
+
85 #elif defined(PLUMA_SYS_MACOS)
+
86  #define PLUMA_LIB_EXTENSION "dylib"
+
87 #elif defined(PLUMA_SYS_LINUX) || defined(PLUMA_SYS_FREEBSD)
+
88  #define PLUMA_LIB_EXTENSION "so"
+
89 #else
+
90  // unknown library file type
+
91  #error Unknown library file extension for this operating system
+
92 #endif
+
93 
+
94 
+
96 // Define portable import / export macros
+
98 #if defined(PLUMA_SYS_WINDOWS)
+
99 
+
100  #ifndef PLUMA_STATIC
+
101 
+
102  // Windows platforms
+
103  #ifdef PLUMA_EXPORTS
+
104 
+
105  // From DLL side, we must export
+
106  #define PLUMA_API __declspec(dllexport)
+
107 
+
108  #else
+
109 
+
110  // From client application side, we must import
+
111  #define PLUMA_API __declspec(dllimport)
+
112 
+
113  #endif
+
114 
+
115  // For Visual C++ compilers, we also need to turn off this annoying C4251 warning.
+
116  // You can read lots ot different things about it, but the point is the code will
+
117  // just work fine, and so the simplest way to get rid of this warning is to disable it
+
118  #ifdef _MSC_VER
+
119 
+
120  #pragma warning(disable : 4251)
+
121 
+
122  #endif
+
123 
+
124  #else
+
125 
+
126  // No specific directive needed for static build
+
127  #define PLUMA_API
+
128 
+
129  #endif
+
130 
+
131 #else
+
132 
+
133  // Other platforms don't need to define anything
+
134  #define PLUMA_API
+
135 
+
136 #endif
+
137 
+
138 
+
139 
+
140 
+
141 #endif // PLUMA_CONFIG_HPP
+
+ + + + diff --git a/doc/third_party/Pluma/html/Connector_8hpp_source.htm b/doc/third_party/Pluma/html/Connector_8hpp_source.htm new file mode 100644 index 0000000..5a36cdf --- /dev/null +++ b/doc/third_party/Pluma/html/Connector_8hpp_source.htm @@ -0,0 +1,119 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
Connector.hpp
+
+
+
1 //
+
3 // Pluma - Plug-in Management Framework
+
4 // Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
+
5 //
+
6 // This software is provided 'as-is', without any express or implied warranty.
+
7 // In no event will the authors be held liable for any damages arising from the use of this software.
+
8 //
+
9 // Permission is granted to anyone to use this software for any purpose,
+
10 // including commercial applications, and to alter it and redistribute it freely,
+
11 // subject to the following restrictions:
+
12 //
+
13 // 1. The origin of this software must not be misrepresented;
+
14 // you must not claim that you wrote the original software.
+
15 // If you use this software in a product, an acknowledgment
+
16 // in the product documentation would be appreciated but is not required.
+
17 //
+
18 // 2. Altered source versions must be plainly marked as such,
+
19 // and must not be misrepresented as being the original software.
+
20 //
+
21 // 3. This notice may not be removed or altered from any source distribution.
+
22 //
+
24 
+
25 #ifndef PLUMA_CONNECTOR_HPP
+
26 #define PLUMA_CONNECTOR_HPP
+
27 
+
29 // Headers
+
31 #include <Pluma/Config.hpp>
+
32 #include <Pluma/Pluma.hpp>
+
33 
+
34 
+
36 // Define portable import/export macros for Plugin registration
+
38 #if defined(PLUMA_SYS_WINDOWS)
+
39 
+
40  #ifndef PLUMA_STATIC_PLUGIN
+
41 
+
42  // Windows platforms
+
43  #ifndef PLUGIN_IMPORTS
+
44 
+
45  // From DLL side, we must export
+
46  #ifdef __cplusplus
+
47  #define PLUMA_CONNECTOR extern "C" __declspec(dllexport)
+
48  #else
+
49  #define PLUMA_CONNECTOR __declspec(dllexport)
+
50  #endif
+
51 
+
52  #else
+
53 
+
54  // From client application side, we must import
+
55  #ifdef __cplusplus
+
56  #define PLUMA_CONNECTOR extern "C" __declspec(dllimport)
+
57  #else
+
58  #define PLUMA_CONNECTOR __declspec(dllimport)
+
59  #endif
+
60 
+
61  #endif
+
62 
+
63  #else
+
64 
+
65  // Only define the extern "C" for static build
+
66  #ifdef __cplusplus
+
67  #define PLUMA_CONNECTOR extern "C"
+
68  #else
+
69  #define PLUMA_CONNECTOR
+
70  #endif
+
71 
+
72  #endif
+
73 
+
74 #else
+
75 
+
76  // Only define the extern "C" for other platforms
+
77  #ifdef __cplusplus
+
78  #define PLUMA_CONNECTOR extern "C"
+
79  #else
+
80  #define PLUMA_CONNECTOR
+
81  #endif
+
82 
+
83 #endif
+
84 
+
85 
+
86 #endif // PLUMA_CONNECTOR_HPP
+
+ + + + diff --git a/doc/third_party/Pluma/html/DLibrary_8cpp_source.htm b/doc/third_party/Pluma/html/DLibrary_8cpp_source.htm new file mode 100644 index 0000000..e4e4562 --- /dev/null +++ b/doc/third_party/Pluma/html/DLibrary_8cpp_source.htm @@ -0,0 +1,141 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
DLibrary.cpp
+
+
+
1 //
+
3 // Pluma - Plug-in Management Framework
+
4 // Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
+
5 //
+
6 // This software is provided 'as-is', without any express or implied warranty.
+
7 // In no event will the authors be held liable for any damages arising from the use of this software.
+
8 //
+
9 // Permission is granted to anyone to use this software for any purpose,
+
10 // including commercial applications, and to alter it and redistribute it freely,
+
11 // subject to the following restrictions:
+
12 //
+
13 // 1. The origin of this software must not be misrepresented;
+
14 // you must not claim that you wrote the original software.
+
15 // If you use this software in a product, an acknowledgment
+
16 // in the product documentation would be appreciated but is not required.
+
17 //
+
18 // 2. Altered source versions must be plainly marked as such,
+
19 // and must not be misrepresented as being the original software.
+
20 //
+
21 // 3. This notice may not be removed or altered from any source distribution.
+
22 //
+
24 
+
25 
+
27 // Headers
+
29 #include <Pluma/DLibrary.hpp>
+
30 #include <cstdio>
+
31 #include <string>
+
32 
+
33 
+
34 namespace pluma{
+
35 
+
37 DLibrary* DLibrary::load(const std::string& path){
+
38  if ( path.empty() ){
+
39  fprintf(stderr, "Failed to load library: Empty path\n");
+
40  return NULL;
+
41  }
+
42  void* handle = NULL;
+
43 
+
44  // load library - OS dependent operation
+
45  #ifdef PLUMA_SYS_WINDOWS
+
46  handle = ::LoadLibraryA(path.c_str());
+
47  if (!handle){
+
48  fprintf(stderr, "Failed to load library \"%s\".\n", path.c_str());
+
49  return NULL;
+
50  }
+
51  #else
+
52  handle = ::dlopen(path.c_str(), RTLD_NOW);
+
53  if (!handle){
+
54  const char* errorString = ::dlerror();
+
55  fprintf(stderr, "Failed to load library \"%s\".", path.c_str());
+
56  if(errorString) fprintf(stderr, " OS returned error: \"%s\".", errorString);
+
57  fprintf(stderr, "\n");
+
58  return NULL;
+
59  }
+
60  #endif
+
61  // return a DLibrary with the DLL handle
+
62  return new DLibrary(handle);
+
63 }
+
64 
+
65 
+ +
68  if (handle){
+
69  #ifdef PLUMA_SYS_WINDOWS
+
70  ::FreeLibrary( (HMODULE)handle );
+
71  #else
+
72  ::dlclose(handle);
+
73  #endif
+
74  }
+
75 }
+
76 
+
77 
+
79 void* DLibrary::getSymbol(const std::string& symbol){
+
80  if (!handle){
+
81  fprintf(stderr, "Cannot inspect library symbols, library isn't loaded.\n");
+
82  return NULL;
+
83  }
+
84  void* res;
+
85  #ifdef PLUMA_SYS_WINDOWS
+
86  res = (void*)(::GetProcAddress((HMODULE)handle, symbol.c_str()));
+
87  #else
+
88  res = (void*)(::dlsym(handle, symbol.c_str()));
+
89  #endif
+
90  if (!res){
+
91  fprintf(stderr, "Library symbol \"%s\" not found.\n", symbol.c_str());
+
92  return NULL;
+
93  }
+
94  return res;
+
95 }
+
96 
+
97 
+
99 DLibrary::DLibrary(void* handle):
+
100  handle(handle)
+
101 {
+
102  // Nothing to do
+
103 }
+
104 
+
105 } // namespace pluma
+
106 
+
static DLibrary * load(const std::string &path)
Load a library.
Definition: DLibrary.cpp:37
+
Manages a Dynamic Linking Library.
Definition: DLibrary.hpp:49
+
void * getSymbol(const std::string &symbol)
Get a symbol from the library.
Definition: DLibrary.cpp:79
+
~DLibrary()
Destructor.
Definition: DLibrary.cpp:67
+
+ + + + diff --git a/doc/third_party/Pluma/html/DLibrary_8hpp_source.htm b/doc/third_party/Pluma/html/DLibrary_8hpp_source.htm new file mode 100644 index 0000000..6030a7a --- /dev/null +++ b/doc/third_party/Pluma/html/DLibrary_8hpp_source.htm @@ -0,0 +1,117 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
DLibrary.hpp
+
+
+
1 //
+
3 // Pluma - Plug-in Management Framework
+
4 // Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
+
5 //
+
6 // This software is provided 'as-is', without any express or implied warranty.
+
7 // In no event will the authors be held liable for any damages arising from the use of this software.
+
8 //
+
9 // Permission is granted to anyone to use this software for any purpose,
+
10 // including commercial applications, and to alter it and redistribute it freely,
+
11 // subject to the following restrictions:
+
12 //
+
13 // 1. The origin of this software must not be misrepresented;
+
14 // you must not claim that you wrote the original software.
+
15 // If you use this software in a product, an acknowledgment
+
16 // in the product documentation would be appreciated but is not required.
+
17 //
+
18 // 2. Altered source versions must be plainly marked as such,
+
19 // and must not be misrepresented as being the original software.
+
20 //
+
21 // 3. This notice may not be removed or altered from any source distribution.
+
22 //
+
24 
+
25 #ifndef PLUMA_DYNAMIC_LIBRARY_HPP
+
26 #define PLUMA_DYNAMIC_LIBRARY_HPP
+
27 
+
29 // Headers
+
31 #include <Pluma/Config.hpp>
+
32 #include <string>
+
33 
+
34 // include OS dependent support for DLL
+
35 #ifdef PLUMA_SYS_WINDOWS
+
36  #include <Windows.h>
+
37 #else
+
38  #include <dlfcn.h>
+
39 #endif
+
40 
+
41 
+
42 
+
43 namespace pluma{
+
44 
+
49 class DLibrary{
+
50 
+
51 
+
52 public:
+
53 
+
62  static DLibrary* load(const std::string& path);
+
63 
+
70  ~DLibrary();
+
71 
+
81  void* getSymbol(const std::string& symbol);
+
82 
+
83 
+
84 private:
+
85 
+
94  DLibrary();
+
95 
+
104  DLibrary(void* handle);
+
105 
+
106 
+
107 
+
109 // Member data
+
111 
+
112 
+
113 private:
+
114 
+
115  void* handle;
+
116 
+
117 };
+
118 
+
119 
+
120 } // namespace pluma
+
121 
+
122 
+
123 #endif // PLUMA_DYNAMIC_LIBRARY_HPP
+
static DLibrary * load(const std::string &path)
Load a library.
Definition: DLibrary.cpp:37
+
Manages a Dynamic Linking Library.
Definition: DLibrary.hpp:49
+
void * getSymbol(const std::string &symbol)
Get a symbol from the library.
Definition: DLibrary.cpp:79
+
~DLibrary()
Destructor.
Definition: DLibrary.cpp:67
+
+ + + + diff --git a/doc/third_party/Pluma/html/Dir_8cpp_source.htm b/doc/third_party/Pluma/html/Dir_8cpp_source.htm new file mode 100644 index 0000000..8c2d4c2 --- /dev/null +++ b/doc/third_party/Pluma/html/Dir_8cpp_source.htm @@ -0,0 +1,137 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
Dir.cpp
+
+
+
1 //
+
3 // Pluma - Plug-in Management Framework
+
4 // Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
+
5 //
+
6 // This software is provided 'as-is', without any express or implied warranty.
+
7 // In no event will the authors be held liable for any damages arising from the use of this software.
+
8 //
+
9 // Permission is granted to anyone to use this software for any purpose,
+
10 // including commercial applications, and to alter it and redistribute it freely,
+
11 // subject to the following restrictions:
+
12 //
+
13 // 1. The origin of this software must not be misrepresented;
+
14 // you must not claim that you wrote the original software.
+
15 // If you use this software in a product, an acknowledgment
+
16 // in the product documentation would be appreciated but is not required.
+
17 //
+
18 // 2. Altered source versions must be plainly marked as such,
+
19 // and must not be misrepresented as being the original software.
+
20 //
+
21 // 3. This notice may not be removed or altered from any source distribution.
+
22 //
+
24 
+
25 
+
27 // Headers
+
29 #include <Pluma/Dir.hpp>
+
30 #include <Pluma/uce-dirent.h>
+
31 #include <cstdio>
+
32 #include <queue>
+
33 
+
34 
+
35 namespace pluma{
+
36 
+
37 namespace dir{
+
38 
+
39 
+
41 void listFiles(std::list<std::string>& list, const std::string& folder, const std::string& extension, bool recursive){
+
42  DIR* dir;
+
43  DIR* subDir;
+
44  struct dirent *ent;
+
45  // try to open top folder
+
46  dir = opendir(folder.c_str());
+
47  if (dir == NULL){
+
48  // could not open directory
+
49  fprintf(stderr, "Could not open \"%s\" directory.\n", folder.c_str());
+
50  return;
+
51  }else{
+
52  // close, we'll process it next
+
53  closedir(dir);
+
54  }
+
55  // enqueue top folder
+
56  std::queue<std::string> folders;
+
57  folders.push(folder);
+
58 
+
59  // run while has queued folders
+
60  while (!folders.empty()){
+
61  std::string currFolder = folders.front();
+
62  folders.pop();
+
63  dir = opendir(currFolder.c_str());
+
64  if (dir == NULL) continue;
+
65  // iterate through all the files and directories
+
66  while ((ent = readdir (dir)) != NULL) {
+
67  std::string name(ent->d_name);
+
68  // ignore "." and ".." directories
+
69  if ( name.compare(".") == 0 || name.compare("..") == 0) continue;
+
70  // add path to the file name
+
71  std::string path = currFolder;
+
72  path.append("/");
+
73  path.append(name);
+
74  // check if it's a folder by trying to open it
+
75  subDir = opendir(path.c_str());
+
76  if (subDir != NULL){
+
77  // it's a folder: close, we can process it later
+
78  closedir(subDir);
+
79  if (recursive) folders.push(path);
+
80  }else{
+
81  // it's a file
+
82  if (extension.empty()){
+
83  list.push_back(path);
+
84  }else{
+
85  // check file extension
+
86  size_t lastDot = name.find_last_of('.');
+
87  std::string ext = name.substr(lastDot+1);
+
88  if (ext.compare(extension) == 0){
+
89  // match
+
90  list.push_back(path);
+
91  }
+
92  } // endif (extension test)
+
93  } // endif (folder test)
+
94  } // endwhile (nextFile)
+
95  closedir(dir);
+
96  } // endwhile (queued folders)
+
97 
+
98 } // end listFiles
+
99 
+
100 
+
101 } // namespace dir
+
102 
+
103 } // namespace pluma
+
+ + + + diff --git a/doc/third_party/Pluma/html/Dir_8hpp_source.htm b/doc/third_party/Pluma/html/Dir_8hpp_source.htm new file mode 100644 index 0000000..1b8b876 --- /dev/null +++ b/doc/third_party/Pluma/html/Dir_8hpp_source.htm @@ -0,0 +1,88 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
Dir.hpp
+
+
+
1 //
+
3 // Pluma - Plug-in Management Framework
+
4 // Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
+
5 //
+
6 // This software is provided 'as-is', without any express or implied warranty.
+
7 // In no event will the authors be held liable for any damages arising from the use of this software.
+
8 //
+
9 // Permission is granted to anyone to use this software for any purpose,
+
10 // including commercial applications, and to alter it and redistribute it freely,
+
11 // subject to the following restrictions:
+
12 //
+
13 // 1. The origin of this software must not be misrepresented;
+
14 // you must not claim that you wrote the original software.
+
15 // If you use this software in a product, an acknowledgment
+
16 // in the product documentation would be appreciated but is not required.
+
17 //
+
18 // 2. Altered source versions must be plainly marked as such,
+
19 // and must not be misrepresented as being the original software.
+
20 //
+
21 // 3. This notice may not be removed or altered from any source distribution.
+
22 //
+
24 
+
25 #ifndef PLUMA_DIRECTORY_HPP
+
26 #define PLUMA_DIRECTORY_HPP
+
27 
+
29 // Headers
+
31 #include <Pluma/Config.hpp>
+
32 #include <string>
+
33 #include <list>
+
34 
+
35 
+
36 namespace pluma{
+
37 
+
38 namespace dir{
+
39 
+
51 void listFiles(
+
52  std::list<std::string>& list,
+
53  const std::string& folder,
+
54  const std::string& extension = "",
+
55  bool recursive = false
+
56 );
+
57 
+
58 
+
59 } // namespace dir
+
60 
+
61 } // namespace pluma
+
62 
+
63 
+
64 #endif // PLUMA_DIRECTORY_HPP
+
+ + + + diff --git a/doc/third_party/Pluma/html/Doxygen_8hpp_source.htm b/doc/third_party/Pluma/html/Doxygen_8hpp_source.htm new file mode 100644 index 0000000..0a8d6d5 --- /dev/null +++ b/doc/third_party/Pluma/html/Doxygen_8hpp_source.htm @@ -0,0 +1,39 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
Doxygen.hpp
+
+
+
1 
+ + + + diff --git a/doc/third_party/Pluma/html/Host_8cpp_source.htm b/doc/third_party/Pluma/html/Host_8cpp_source.htm new file mode 100644 index 0000000..b70cfb6 --- /dev/null +++ b/doc/third_party/Pluma/html/Host_8cpp_source.htm @@ -0,0 +1,203 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + +
+
+
+
Host.cpp
+
+
+
1 //
+
3 // Pluma - Plug-in Management Framework
+
4 // Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
+
5 //
+
6 // This software is provided 'as-is', without any express or implied warranty.
+
7 // In no event will the authors be held liable for any damages arising from the use of this software.
+
8 //
+
9 // Permission is granted to anyone to use this software for any purpose,
+
10 // including commercial applications, and to alter it and redistribute it freely,
+
11 // subject to the following restrictions:
+
12 //
+
13 // 1. The origin of this software must not be misrepresented;
+
14 // you must not claim that you wrote the original software.
+
15 // If you use this software in a product, an acknowledgment
+
16 // in the product documentation would be appreciated but is not required.
+
17 //
+
18 // 2. Altered source versions must be plainly marked as such,
+
19 // and must not be misrepresented as being the original software.
+
20 //
+
21 // 3. This notice may not be removed or altered from any source distribution.
+
22 //
+
24 
+
25 
+
27 // Headers
+
29 #include <Pluma/Host.hpp>
+
30 #include <cstdio>
+
31 
+
32 
+
33 namespace pluma{
+
34 
+
36 Host::Host(){
+
37  // Nothing to do
+
38 }
+
39 
+
40 
+
42 bool Host::add(Provider* provider){
+
43  if (provider == NULL){
+
44  fprintf(stderr, "Trying to add a null provider.\n");
+
45  return false;
+
46  }
+
47  if (!validateProvider(provider)){
+
48  delete provider;
+
49  return false;
+
50  }
+
51  addRequests[ provider->plumaGetType() ].push_back(provider);
+
52  return true;
+
53 }
+
54 
+
55 
+
57 Host::~Host(){
+
58  clearProviders();
+
59  // map frees itself
+
60 }
+
61 
+
62 
+
64 void Host::clearProviders(){
+
65  ProvidersMap::iterator it;
+
66  for (it = knownTypes.begin() ; it != knownTypes.end() ; ++it){
+
67  std::list<Provider*>& providers = it->second.providers;
+
68  std::list<Provider*>::iterator provIt;
+
69  for (provIt = providers.begin() ; provIt != providers.end() ; ++provIt){
+
70  delete *provIt;
+
71  }
+
72  std::list<Provider*>().swap(providers);
+
73  }
+
74 }
+
75 
+
76 
+
78 bool Host::knows(const std::string& type) const{
+
79  return knownTypes.find(type) != knownTypes.end();
+
80 }
+
81 
+
82 
+
84 unsigned int Host::getVersion(const std::string& type) const{
+
85  ProvidersMap::const_iterator it = knownTypes.find(type);
+
86  if (it != knownTypes.end())
+
87  return it->second.version;
+
88  return 0;
+
89 }
+
90 
+
91 
+
93 unsigned int Host::getLowestVersion(const std::string& type) const{
+
94  ProvidersMap::const_iterator it = knownTypes.find(type);
+
95  if (it != knownTypes.end())
+
96  return it->second.lowestVersion;
+
97  return 0;
+
98 }
+
99 
+
100 
+
102 void Host::registerType(const std::string& type, unsigned int version, unsigned int lowestVersion){
+
103  if (!knows(type)){
+
104  ProviderInfo pi;
+
105  pi.version = version;
+
106  pi.lowestVersion = lowestVersion;
+
107  knownTypes[type] = pi;
+
108  }
+
109 }
+
110 
+
111 
+
113 const std::list<Provider*>* Host::getProviders(const std::string& type) const{
+
114  ProvidersMap::const_iterator it = knownTypes.find(type);
+
115  if (it != knownTypes.end())
+
116  return &it->second.providers;
+
117  return NULL;
+
118 }
+
119 
+
120 
+
122 bool Host::validateProvider(Provider* provider) const{
+
123  const std::string& type = provider->plumaGetType();
+
124  if ( !knows(type) ){
+
125  fprintf(stderr, "%s provider type isn't registered.\n", type.c_str());
+
126  return false;
+
127  }
+
128  if (!provider->isCompatible(*this)){
+
129  fprintf(stderr, "Incompatible %s provider version.\n", type.c_str());
+
130  return false;
+
131  }
+
132  return true;
+
133 }
+
134 
+
135 
+
137 bool Host::registerProvider(Provider* provider){
+
138  if (!validateProvider(provider)){
+
139  delete provider;
+
140  return false;
+
141  }
+
142  knownTypes[ provider->plumaGetType() ].providers.push_back(provider);
+
143  return true;
+
144 }
+
145 
+
146 
+
148 void Host::cancelAddictions(){
+
149  TempProvidersMap::iterator it;
+
150  for( it = addRequests.begin() ; it != addRequests.end() ; ++it){
+
151  std::list<Provider*> lst = it->second;
+
152  std::list<Provider*>::iterator providerIt;
+
153  for (providerIt = lst.begin() ; providerIt != lst.end() ; ++providerIt){
+
154  delete *providerIt;
+
155  }
+
156  }
+
157  // clear map
+
158  TempProvidersMap().swap(addRequests);
+
159 }
+
160 
+
161 
+
163 bool Host::confirmAddictions(){
+
164  if (addRequests.empty()) return false;
+
165  TempProvidersMap::iterator it;
+
166  for( it = addRequests.begin() ; it != addRequests.end() ; ++it){
+
167  std::list<Provider*> lst = it->second;
+
168  std::list<Provider*>::iterator providerIt;
+
169  for (providerIt = lst.begin() ; providerIt != lst.end() ; ++providerIt){
+
170  knownTypes[it->first].providers.push_back(*providerIt);
+
171  }
+
172  }
+
173  // clear map
+
174  TempProvidersMap().swap(addRequests);
+
175  return true;
+
176 }
+
177 
+
178 
+
179 } //namespace pluma
+
Interface to provide applications with objects from plugins.
Definition: Provider.hpp:42
+
bool add(Provider *provider)
Add provider.
Definition: Host.cpp:42
+
+ + + + diff --git a/doc/third_party/Pluma/html/Host_8hpp_source.htm b/doc/third_party/Pluma/html/Host_8hpp_source.htm new file mode 100644 index 0000000..8ca0182 --- /dev/null +++ b/doc/third_party/Pluma/html/Host_8hpp_source.htm @@ -0,0 +1,136 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
Host.hpp
+
+
+
1 //
+
3 // Pluma - Plug-in Management Framework
+
4 // Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
+
5 //
+
6 // This software is provided 'as-is', without any express or implied warranty.
+
7 // In no event will the authors be held liable for any damages arising from the use of this software.
+
8 //
+
9 // Permission is granted to anyone to use this software for any purpose,
+
10 // including commercial applications, and to alter it and redistribute it freely,
+
11 // subject to the following restrictions:
+
12 //
+
13 // 1. The origin of this software must not be misrepresented;
+
14 // you must not claim that you wrote the original software.
+
15 // If you use this software in a product, an acknowledgment
+
16 // in the product documentation would be appreciated but is not required.
+
17 //
+
18 // 2. Altered source versions must be plainly marked as such,
+
19 // and must not be misrepresented as being the original software.
+
20 //
+
21 // 3. This notice may not be removed or altered from any source distribution.
+
22 //
+
24 
+
25 #ifndef PLUMA_HOST_HPP
+
26 #define PLUMA_HOST_HPP
+
27 
+
29 // Headers
+
31 #include <Pluma/Config.hpp>
+
32 #include <Pluma/Provider.hpp>
+
33 
+
34 #include <vector>
+
35 #include <list>
+
36 #include <map>
+
37 
+
38 namespace pluma{
+
39 
+
44 class PLUMA_API Host{
+
45 friend class PluginManager;
+
46 friend class Provider;
+
47 
+
48 
+
49 public:
+
50 
+
62  bool add(Provider* provider);
+
63 
+
64 
+
65 private:
+
66 
+
73  Host();
+
74 
+
81  ~Host();
+
82 
+
91  bool knows(const std::string& type) const;
+
92 
+
101  unsigned int getVersion(const std::string& type) const;
+
102 
+
111  unsigned int getLowestVersion(const std::string& type) const;
+
112 
+
121  void registerType(const std::string& type, unsigned int version, unsigned int lowestVersion);
+
122 
+
132  const std::list<Provider*>* getProviders(const std::string& type) const;
+
133 
+
138  void clearProviders();
+
139 
+
146  bool validateProvider(Provider* provider) const;
+
147 
+
160  bool registerProvider(Provider* provider);
+
161 
+
170  void cancelAddictions();
+
171 
+
182  bool confirmAddictions();
+
183 
+
184 
+
185 
+
187 // Member data
+
189 
+
190 private:
+
191 
+
196  struct ProviderInfo{
+
197  unsigned int version;
+
198  unsigned int lowestVersion;
+
199  std::list<Provider*> providers;
+
200  };
+
201 
+
202  typedef std::map<std::string, ProviderInfo > ProvidersMap;
+
203  typedef std::map<std::string, std::list<Provider*> > TempProvidersMap;
+
204 
+
205  ProvidersMap knownTypes;
+
206  TempProvidersMap addRequests;
+
207 
+
208 };
+
209 
+
210 } // namespace pluma
+
211 
+
212 #endif // PLUMA_HOST_HPP
+
Manages loaded plugins.
+
Interface to provide applications with objects from plugins.
Definition: Provider.hpp:42
+
Manages providers.
Definition: Host.hpp:44
+
+ + + + diff --git a/doc/third_party/Pluma/html/PluginManager_8cpp_source.htm b/doc/third_party/Pluma/html/PluginManager_8cpp_source.htm new file mode 100644 index 0000000..20f62fb --- /dev/null +++ b/doc/third_party/Pluma/html/PluginManager_8cpp_source.htm @@ -0,0 +1,237 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
PluginManager.cpp
+
+
+
1 //
+
3 // Pluma - Plug-in Management Framework
+
4 // Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
+
5 //
+
6 // This software is provided 'as-is', without any express or implied warranty.
+
7 // In no event will the authors be held liable for any damages arising from the use of this software.
+
8 //
+
9 // Permission is granted to anyone to use this software for any purpose,
+
10 // including commercial applications, and to alter it and redistribute it freely,
+
11 // subject to the following restrictions:
+
12 //
+
13 // 1. The origin of this software must not be misrepresented;
+
14 // you must not claim that you wrote the original software.
+
15 // If you use this software in a product, an acknowledgment
+
16 // in the product documentation would be appreciated but is not required.
+
17 //
+
18 // 2. Altered source versions must be plainly marked as such,
+
19 // and must not be misrepresented as being the original software.
+
20 //
+
21 // 3. This notice may not be removed or altered from any source distribution.
+
22 //
+
24 
+
25 
+
27 // Headers
+
29 #include <Pluma/PluginManager.hpp>
+
30 #include <Pluma/DLibrary.hpp>
+
31 #include <Pluma/Dir.hpp>
+
32 #include <cstdio>
+
33 
+
34 namespace pluma{
+
35 
+ +
38  // Nothing to do
+
39 }
+
40 
+
41 
+ +
44  unloadAll();
+
45 }
+
46 
+
47 
+
49 bool PluginManager::load(const std::string& path){
+
50  std::string plugName = getPluginName(path);
+
51  std::string realPath = resolvePathExtension(path);
+
52  DLibrary* lib = DLibrary::load(realPath);
+
53  if (!lib) return false;
+
54 
+
55  fnRegisterPlugin* registerFunction;
+
56  registerFunction = reinterpret_cast<fnRegisterPlugin*>(lib->getSymbol("connect"));
+
57 
+
58  if(!registerFunction){
+
59  fprintf(stderr, "Failed to initialize plugin \"%s\": connect function not found\n", plugName.c_str());
+
60  delete lib;
+
61  return false;
+
62  }
+
63  // try to initialize plugin:
+
64  if (!registerFunction(host)){
+
65  // plugin decided to fail
+
66  fprintf(stderr, "Self registry failed on plugin \"%s\".\n", plugName.c_str());
+
67  host.cancelAddictions();
+
68  delete lib;
+
69  return false;
+
70  }
+
71  // Store the library if addictions are confirmed
+
72  if (host.confirmAddictions())
+
73  libraries[plugName] = lib;
+
74  else{
+
75  // otherwise nothing was registered
+
76  fprintf(stderr, "Nothing registered by plugin \"%s\".\n", plugName.c_str());
+
77  delete lib;
+
78  return false;
+
79  }
+
80  return true;
+
81 }
+
82 
+
83 
+
85 bool PluginManager::load(const std::string& folder, const std::string& pluginName){
+
86  if (folder.empty())
+
87  return load(pluginName);
+
88  else if (folder[folder.size()-1] == '/' || folder[folder.size()-1] == '\\')
+
89  return load(folder + pluginName);
+
90  return load(folder + '/' + pluginName);
+
91 }
+
92 
+
93 
+
95 int PluginManager::loadFromFolder(const std::string& folder, bool recursive){
+
96  std::list<std::string> files;
+
97  dir::listFiles(files, folder, PLUMA_LIB_EXTENSION, recursive);
+
98  // try to load every library
+
99  int res = 0;
+
100  std::list<std::string>::const_iterator it;
+
101  for (it = files.begin() ; it != files.end() ; ++it){
+
102  if ( load(*it) ) ++res;
+
103  }
+
104  return res;
+
105 }
+
106 
+
107 
+
109 bool PluginManager::unload(const std::string& pluginName){
+
110  std::string plugName = getPluginName(pluginName);
+
111  LibMap::iterator it = libraries.find(plugName);
+
112  if( it != libraries.end() ) {
+
113  delete it->second;
+
114  libraries.erase(it);
+
115  return true;
+
116  }
+
117  return false;
+
118 }
+
119 
+
120 
+ +
123 
+
124  host.clearProviders();
+
125  LibMap::iterator it;
+
126  for (it = libraries.begin() ; it != libraries.end() ; ++it){
+
127  delete it->second;
+
128  }
+
129  libraries.clear();
+
130 }
+
131 
+
132 
+
134 std::string PluginManager::getPluginName(const std::string& path){
+
135  size_t lastDash = path.find_last_of("/\\");
+
136  size_t lastDot = path.find_last_of('.');
+
137  if (lastDash == std::string::npos) lastDash = 0;
+
138  else ++lastDash;
+
139  if (lastDot < lastDash || lastDot == std::string::npos){
+
140  // path without extension
+
141  lastDot = path.length();
+
142  }
+
143  return path.substr(lastDash, lastDot-lastDash);
+
144 }
+
145 
+
146 
+
148 std::string PluginManager::resolvePathExtension(const std::string& path){
+
149  size_t lastDash = path.find_last_of("/\\");
+
150  size_t lastDot = path.find_last_of('.');
+
151  if (lastDash == std::string::npos) lastDash = 0;
+
152  else ++lastDash;
+
153  if (lastDot < lastDash || lastDot == std::string::npos){
+
154  // path without extension, add it
+
155  return path + "." + PLUMA_LIB_EXTENSION;
+
156  }
+
157  return path;
+
158 }
+
159 
+
160 
+
162 void PluginManager::registerType(const std::string& type, unsigned int version, unsigned int lowestVersion){
+
163  host.registerType(type, version, lowestVersion);
+
164 }
+
165 
+
166 
+ +
169  if (provider == NULL){
+
170  fprintf(stderr, "Trying to add null provider\n");
+
171  return false;
+
172  }
+
173  return host.registerProvider(provider);
+
174 }
+
175 
+
176 
+
178 void PluginManager::getLoadedPlugins(std::vector<const std::string*>& pluginNames) const{
+
179  pluginNames.reserve(pluginNames.size()+libraries.size());
+
180  LibMap::const_iterator it;
+
181  for(it = libraries.begin() ; it != libraries.end() ; ++it){
+
182  pluginNames.push_back(&(it->first));
+
183  }
+
184 }
+
185 
+
186 
+
188 bool PluginManager::isLoaded(const std::string& pluginName) const{
+
189  return libraries.find(getPluginName(pluginName)) != libraries.end();
+
190 }
+
191 
+
192 
+
194 const std::list<Provider*>* PluginManager::getProviders(const std::string& type) const{
+
195  return host.getProviders(type);
+
196 }
+
197 
+
198 
+
199 
+
200 } // namespace pluma
+
201 
+
bool unload(const std::string &pluginName)
Unload a plugin.
+
void registerType(const std::string &type, unsigned int version, unsigned int lowestVersion)
Register a provider type.
+
void unloadAll()
Unload all loaded plugins.
+
PluginManager()
Default constructor.
+
Interface to provide applications with objects from plugins.
Definition: Provider.hpp:42
+
const std::list< Provider * > * getProviders(const std::string &type) const
Get providers of a certain type.
+
static DLibrary * load(const std::string &path)
Load a library.
Definition: DLibrary.cpp:37
+
Manages a Dynamic Linking Library.
Definition: DLibrary.hpp:49
+
int loadFromFolder(const std::string &folder, bool recursive=false)
Load all plugins from a given folder.
+
void * getSymbol(const std::string &symbol)
Get a symbol from the library.
Definition: DLibrary.cpp:79
+
bool load(const std::string &path)
Load a plugin given it's path.
+
~PluginManager()
Destructor.
+
bool isLoaded(const std::string &pluginName) const
Check if a plug-in is loaded.
+
void getLoadedPlugins(std::vector< const std::string * > &pluginNames) const
Get the name of all loaded plugins.
+
bool addProvider(Provider *provider)
Directly add a new provider.
+
+ + + + diff --git a/doc/third_party/Pluma/html/PluginManager_8hpp_source.htm b/doc/third_party/Pluma/html/PluginManager_8hpp_source.htm new file mode 100644 index 0000000..ace857e --- /dev/null +++ b/doc/third_party/Pluma/html/PluginManager_8hpp_source.htm @@ -0,0 +1,131 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
PluginManager.hpp
+
+
+
1 //
+
3 // Pluma - Plug-in Management Framework
+
4 // Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
+
5 //
+
6 // This software is provided 'as-is', without any express or implied warranty.
+
7 // In no event will the authors be held liable for any damages arising from the use of this software.
+
8 //
+
9 // Permission is granted to anyone to use this software for any purpose,
+
10 // including commercial applications, and to alter it and redistribute it freely,
+
11 // subject to the following restrictions:
+
12 //
+
13 // 1. The origin of this software must not be misrepresented;
+
14 // you must not claim that you wrote the original software.
+
15 // If you use this software in a product, an acknowledgment
+
16 // in the product documentation would be appreciated but is not required.
+
17 //
+
18 // 2. Altered source versions must be plainly marked as such,
+
19 // and must not be misrepresented as being the original software.
+
20 //
+
21 // 3. This notice may not be removed or altered from any source distribution.
+
22 //
+
24 
+
25 #ifndef PLUMA_PLUGIN_MANAGER_HPP
+
26 #define PLUMA_PLUGIN_MANAGER_HPP
+
27 
+
29 // Headers
+
31 #include <Pluma/Config.hpp>
+
32 #include <Pluma/Host.hpp>
+
33 
+
34 #include <string>
+
35 #include <map>
+
36 
+
37 namespace pluma{
+
38 class DLibrary;
+
39 
+
44 class PLUMA_API PluginManager{
+
45 
+
46 
+
47 public:
+
48 
+
53  ~PluginManager();
+
54 
+
71  bool load(const std::string& path);
+
72 
+
73 
+
91  bool load(const std::string& folder, const std::string& pluginName);
+
92 
+
107  int loadFromFolder(const std::string& folder, bool recursive = false);
+
108 
+
123  bool unload(const std::string& pluginName);
+
124 
+
134  void unloadAll();
+
135 
+
142  bool addProvider(Provider* provider);
+
143 
+
150  void getLoadedPlugins(std::vector<const std::string*>& pluginNames) const;
+
151 
+
158  bool isLoaded(const std::string& pluginName) const;
+
159 
+
160 
+
161 protected:
+
162 
+
169  PluginManager();
+
170 
+
181  void registerType(const std::string& type, unsigned int version, unsigned int lowestVersion);
+
182 
+
194  const std::list<Provider*>* getProviders(const std::string& type) const;
+
195 
+
196 
+
197 private:
+
198 
+
212  static std::string getPluginName(const std::string& path);
+
213 
+
229  static std::string resolvePathExtension(const std::string& path);
+
230 
+
231 
+
232 private:
+
233 
+
235  typedef bool fnRegisterPlugin(Host&);
+
236  typedef std::map<std::string,DLibrary*> LibMap;
+
237 
+
238  LibMap libraries;
+
239  Host host;
+
240 
+
241 };
+
242 
+
243 } // namespace pluma
+
244 
+
245 #endif // PLUMA_PLUGIN_MANAGER_HPP
+
Manages loaded plugins.
+
Interface to provide applications with objects from plugins.
Definition: Provider.hpp:42
+
Manages providers.
Definition: Host.hpp:44
+
+ + + + diff --git a/doc/third_party/Pluma/html/Pluma_8hpp_source.htm b/doc/third_party/Pluma/html/Pluma_8hpp_source.htm new file mode 100644 index 0000000..54cbe25 --- /dev/null +++ b/doc/third_party/Pluma/html/Pluma_8hpp_source.htm @@ -0,0 +1,137 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
Pluma.hpp
+
+
+
1 //
+
3 // Pluma - Plug-in Management Framework
+
4 // Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
+
5 //
+
6 // This software is provided 'as-is', without any express or implied warranty.
+
7 // In no event will the authors be held liable for any damages arising from the use of this software.
+
8 //
+
9 // Permission is granted to anyone to use this software for any purpose,
+
10 // including commercial applications, and to alter it and redistribute it freely,
+
11 // subject to the following restrictions:
+
12 //
+
13 // 1. The origin of this software must not be misrepresented;
+
14 // you must not claim that you wrote the original software.
+
15 // If you use this software in a product, an acknowledgment
+
16 // in the product documentation would be appreciated but is not required.
+
17 //
+
18 // 2. Altered source versions must be plainly marked as such,
+
19 // and must not be misrepresented as being the original software.
+
20 //
+
21 // 3. This notice may not be removed or altered from any source distribution.
+
22 //
+
24 
+
25 #ifndef PLUMA_PLUMA_HPP
+
26 #define PLUMA_PLUMA_HPP
+
27 
+
29 // Headers
+
31 #include <Pluma/Config.hpp>
+
32 #include <Pluma/Provider.hpp>
+
33 #include <Pluma/PluginManager.hpp>
+
34 
+
36 // Andy macro to convert parameter to string
+
38 #define PLUMA_2STRING(X) #X
+
39 
+
41 // Macro that helps host applications defining
+
42 // their provider classes
+
44 #define PLUMA_PROVIDER_HEADER(TYPE)\
+
45 PLUMA_PROVIDER_HEADER_BEGIN(TYPE)\
+
46 virtual TYPE* create() const = 0;\
+
47 PLUMA_PROVIDER_HEADER_END
+
48 
+
50 // Macro that generate first part of the provider definition
+
52 #define PLUMA_PROVIDER_HEADER_BEGIN(TYPE)\
+
53 class TYPE##Provider: public pluma::Provider{\
+
54 private:\
+
55  friend class pluma::Pluma;\
+
56  static const unsigned int PLUMA_INTERFACE_VERSION;\
+
57  static const unsigned int PLUMA_INTERFACE_LOWEST_VERSION;\
+
58  static const std::string PLUMA_PROVIDER_TYPE;\
+
59  std::string plumaGetType() const{ return PLUMA_PROVIDER_TYPE; }\
+
60 public:\
+
61  unsigned int getVersion() const{ return PLUMA_INTERFACE_VERSION; }
+
62 
+
64 // Macro that generate last part of the provider definition
+
66 #define PLUMA_PROVIDER_HEADER_END };
+
67 
+
69 // Macro that generate the provider declaration
+
71 #define PLUMA_PROVIDER_SOURCE(TYPE, Version, LowestVersion)\
+
72 const std::string TYPE##Provider::PLUMA_PROVIDER_TYPE = PLUMA_2STRING( TYPE );\
+
73 const unsigned int TYPE##Provider::PLUMA_INTERFACE_VERSION = Version;\
+
74 const unsigned int TYPE##Provider::PLUMA_INTERFACE_LOWEST_VERSION = LowestVersion;
+
75 
+
76 
+
78 // Macro that helps plugins generating their provider implementations
+
79 // PRE: SPECIALIZED_TYPE must inherit from BASE_TYPE
+
81 #define PLUMA_INHERIT_PROVIDER(SPECIALIZED_TYPE, BASE_TYPE)\
+
82 class SPECIALIZED_TYPE##Provider: public BASE_TYPE##Provider{\
+
83 public:\
+
84  BASE_TYPE * create() const{ return new SPECIALIZED_TYPE (); }\
+
85 };
+
86 
+
87 
+
88 namespace pluma{
+
89 
+
94 class Pluma: public PluginManager{
+
95 
+
96 public:
+
101  Pluma();
+
102 
+
114  template<typename ProviderType>
+
115  void acceptProviderType();
+
116 
+
127  template<typename ProviderType>
+
128  void getProviders(std::vector<ProviderType*>& providers);
+
129 };
+
130 
+
131 #include <Pluma/Pluma.inl>
+
132 
+
133 }
+
134 
+
135 
+
136 #endif // PLUMA_PLUMA_HPP
+
137 
+
138 
+
Manages loaded plugins.
+
Pluma plugins management.
Definition: Pluma.hpp:94
+
void getProviders(std::vector< ProviderType * > &providers)
Get the stored providers of a certain type.
+
void acceptProviderType()
Tell Pluma to accept a certain type of providers.
+
Pluma()
Default Constructor.
Definition: Pluma.inl:27
+
+ + + + diff --git a/doc/third_party/Pluma/html/Pluma_8inl_source.htm b/doc/third_party/Pluma/html/Pluma_8inl_source.htm new file mode 100644 index 0000000..3955ab5 --- /dev/null +++ b/doc/third_party/Pluma/html/Pluma_8inl_source.htm @@ -0,0 +1,86 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
Pluma.inl
+
+
+
1 //
+
3 // Pluma - Plug-in Management Framework
+
4 // Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
+
5 //
+
6 // This software is provided 'as-is', without any express or implied warranty.
+
7 // In no event will the authors be held liable for any damages arising from the use of this software.
+
8 //
+
9 // Permission is granted to anyone to use this software for any purpose,
+
10 // including commercial applications, and to alter it and redistribute it freely,
+
11 // subject to the following restrictions:
+
12 //
+
13 // 1. The origin of this software must not be misrepresented;
+
14 // you must not claim that you wrote the original software.
+
15 // If you use this software in a product, an acknowledgment
+
16 // in the product documentation would be appreciated but is not required.
+
17 //
+
18 // 2. Altered source versions must be plainly marked as such,
+
19 // and must not be misrepresented as being the original software.
+
20 //
+
21 // 3. This notice may not be removed or altered from any source distribution.
+
22 //
+
24 
+
25 
+
27 inline Pluma::Pluma(){
+
28  // Nothing to do
+
29 }
+
30 
+
31 
+
33 template<typename ProviderType>
+
34 void Pluma::acceptProviderType(){
+
35  PluginManager::registerType(
+
36  ProviderType::PLUMA_PROVIDER_TYPE,
+
37  ProviderType::PLUMA_INTERFACE_VERSION,
+
38  ProviderType::PLUMA_INTERFACE_LOWEST_VERSION
+
39  );
+
40 }
+
41 
+
42 
+
44 template<typename ProviderType>
+
45 void Pluma::getProviders(std::vector<ProviderType*>& providers){
+
46  const std::list<Provider*>* lst = PluginManager::getProviders(ProviderType::PLUMA_PROVIDER_TYPE);
+
47  if (!lst) return;
+
48  providers.reserve(providers.size() + lst->size());
+
49  std::list<Provider*>::const_iterator it;
+
50  for (it = lst->begin() ; it != lst->end() ; ++it)
+
51  providers.push_back(static_cast<ProviderType*>(*it));
+
52 }
+
+ + + + diff --git a/doc/third_party/Pluma/html/Provider_8cpp_source.htm b/doc/third_party/Pluma/html/Provider_8cpp_source.htm new file mode 100644 index 0000000..64e9be5 --- /dev/null +++ b/doc/third_party/Pluma/html/Provider_8cpp_source.htm @@ -0,0 +1,89 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
Provider.cpp
+
+
+
1 //
+
3 // Pluma - Plug-in Management Framework
+
4 // Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
+
5 //
+
6 // This software is provided 'as-is', without any express or implied warranty.
+
7 // In no event will the authors be held liable for any damages arising from the use of this software.
+
8 //
+
9 // Permission is granted to anyone to use this software for any purpose,
+
10 // including commercial applications, and to alter it and redistribute it freely,
+
11 // subject to the following restrictions:
+
12 //
+
13 // 1. The origin of this software must not be misrepresented;
+
14 // you must not claim that you wrote the original software.
+
15 // If you use this software in a product, an acknowledgment
+
16 // in the product documentation would be appreciated but is not required.
+
17 //
+
18 // 2. Altered source versions must be plainly marked as such,
+
19 // and must not be misrepresented as being the original software.
+
20 //
+
21 // 3. This notice may not be removed or altered from any source distribution.
+
22 //
+
24 
+
25 
+
27 // Headers
+
29 #include <Pluma/Provider.hpp>
+
30 #include <Pluma/Host.hpp>
+
31 
+
32 
+
33 namespace pluma{
+
34 
+ +
37  // Nothing to do
+
38 }
+
39 
+
40 
+
42 bool Provider::isCompatible(const Host& host) const{
+
43  // check compatibility with host
+
44  const std::string& type = this->plumaGetType();
+
45  if (!host.knows(type)) return false;
+
46  unsigned int lowest = host.getLowestVersion(type);
+
47  unsigned int current = host.getVersion(type);
+
48  unsigned int myVersion = this->getVersion();
+
49  return lowest <= myVersion && myVersion <= current;
+
50 }
+
51 
+
52 } // namespace pluma
+
virtual ~Provider()
Destructor.
Definition: Provider.cpp:36
+
virtual unsigned int getVersion() const =0
Get provider version.
+
Manages providers.
Definition: Host.hpp:44
+
bool isCompatible(const Host &host) const
Check compatibility with host.
Definition: Provider.cpp:42
+
+ + + + diff --git a/doc/third_party/Pluma/html/Provider_8hpp_source.htm b/doc/third_party/Pluma/html/Provider_8hpp_source.htm new file mode 100644 index 0000000..bba5d6a --- /dev/null +++ b/doc/third_party/Pluma/html/Provider_8hpp_source.htm @@ -0,0 +1,99 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
Provider.hpp
+
+
+
1 //
+
3 // Pluma - Plug-in Management Framework
+
4 // Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
+
5 //
+
6 // This software is provided 'as-is', without any express or implied warranty.
+
7 // In no event will the authors be held liable for any damages arising from the use of this software.
+
8 //
+
9 // Permission is granted to anyone to use this software for any purpose,
+
10 // including commercial applications, and to alter it and redistribute it freely,
+
11 // subject to the following restrictions:
+
12 //
+
13 // 1. The origin of this software must not be misrepresented;
+
14 // you must not claim that you wrote the original software.
+
15 // If you use this software in a product, an acknowledgment
+
16 // in the product documentation would be appreciated but is not required.
+
17 //
+
18 // 2. Altered source versions must be plainly marked as such,
+
19 // and must not be misrepresented as being the original software.
+
20 //
+
21 // 3. This notice may not be removed or altered from any source distribution.
+
22 //
+
24 
+
25 #ifndef PLUMA_PROVIDER_HPP
+
26 #define PLUMA_PROVIDER_HPP
+
27 
+
29 // Headers
+
31 #include <Pluma/Config.hpp>
+
32 #include <string>
+
33 
+
34 
+
35 namespace pluma{
+
36 class Host;
+
37 
+
42 class PLUMA_API Provider{
+
43 friend class Host;
+
44 
+
45 
+
46 public:
+
47 
+
52  virtual ~Provider();
+
53 
+
60  virtual unsigned int getVersion() const = 0;
+
61 
+
75  bool isCompatible(const Host& host) const;
+
76 
+
77 
+
78 private:
+
79 
+
90  virtual std::string plumaGetType() const = 0;
+
91 
+
92 };
+
93 
+
94 } // namespace pluma
+
95 
+
96 
+
97 #endif // PLUMA_PROVIDER_HPP
+
98 
+
99 
+
Interface to provide applications with objects from plugins.
Definition: Provider.hpp:42
+
Manages providers.
Definition: Host.hpp:44
+
+ + + + diff --git a/doc/third_party/Pluma/html/annotated.htm b/doc/third_party/Pluma/html/annotated.htm new file mode 100644 index 0000000..b5d70dd --- /dev/null +++ b/doc/third_party/Pluma/html/annotated.htm @@ -0,0 +1,52 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
Class List
+
+
+
Here are the classes, structs, unions and interfaces with brief descriptions:
+
[detail level 12]
+ + + + + + +
\Npluma
 oCDLibraryManages a Dynamic Linking Library
 oCHostManages providers
 oCPluginManagerManages loaded plugins
 oCPlumaPluma plugins management
 \CProviderInterface to provide applications with objects from plugins
+
+
+ + + + diff --git a/doc/third_party/Pluma/html/bc_s.png b/doc/third_party/Pluma/html/bc_s.png new file mode 100644 index 0000000..224b29a Binary files /dev/null and b/doc/third_party/Pluma/html/bc_s.png differ diff --git a/doc/third_party/Pluma/html/bdwn.png b/doc/third_party/Pluma/html/bdwn.png new file mode 100644 index 0000000..940a0b9 Binary files /dev/null and b/doc/third_party/Pluma/html/bdwn.png differ diff --git a/doc/third_party/Pluma/html/classes.htm b/doc/third_party/Pluma/html/classes.htm new file mode 100644 index 0000000..cb2c15c --- /dev/null +++ b/doc/third_party/Pluma/html/classes.htm @@ -0,0 +1,53 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
Class Index
+
+
+
D | H | P
+ + + + + +
  D  
+
  H  
+
  P  
+
Pluma (pluma)   
Provider (pluma)   
DLibrary (pluma)   Host (pluma)   PluginManager (pluma)   
+
D | H | P
+
+ + + + diff --git a/doc/third_party/Pluma/html/classpluma_1_1DLibrary-members.htm b/doc/third_party/Pluma/html/classpluma_1_1DLibrary-members.htm new file mode 100644 index 0000000..0a21d3f --- /dev/null +++ b/doc/third_party/Pluma/html/classpluma_1_1DLibrary-members.htm @@ -0,0 +1,52 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + + +
+
+
pluma::DLibrary Member List
+
+
+ +

This is the complete list of members for pluma::DLibrary, including all inherited members.

+ + + + +
getSymbol(const std::string &symbol)pluma::DLibrary
load(const std::string &path)pluma::DLibrarystatic
~DLibrary()pluma::DLibrary
+ + + + diff --git a/doc/third_party/Pluma/html/classpluma_1_1DLibrary.htm b/doc/third_party/Pluma/html/classpluma_1_1DLibrary.htm new file mode 100644 index 0000000..3d34b08 --- /dev/null +++ b/doc/third_party/Pluma/html/classpluma_1_1DLibrary.htm @@ -0,0 +1,163 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + + +
+ +
+
pluma::DLibrary Class Reference
+
+
+ +

Manages a Dynamic Linking Library. + More...

+ +

#include <DLibrary.hpp>

+ + + + + + + + +

+Public Member Functions

 ~DLibrary ()
 Destructor. More...
 
void * getSymbol (const std::string &symbol)
 Get a symbol from the library. More...
 
+ + + + +

+Static Public Member Functions

static DLibraryload (const std::string &path)
 Load a library. More...
 
+

Detailed Description

+

Manages a Dynamic Linking Library.

+ +

Definition at line 49 of file DLibrary.hpp.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + +
pluma::DLibrary::~DLibrary ()
+
+ +

Destructor.

+

Close and free the opened library (if any).

+ +

Definition at line 67 of file DLibrary.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + +
void * pluma::DLibrary::getSymbol (const std::string & symbol)
+
+ +

Get a symbol from the library.

+
Parameters
+ + +
symbolSymbol that we're looking for.
+
+
+
Returns
Pointer to what the symbol refers to, or NULL if the symbol is not found.
+ +

Definition at line 79 of file DLibrary.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
DLibrary * pluma::DLibrary::load (const std::string & path)
+
+static
+
+ +

Load a library.

+
Parameters
+ + +
pathPath to the library.
+
+
+
Returns
Pointer to the loaded library, or NULL if failed.
+ +

Definition at line 37 of file DLibrary.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/doc/third_party/Pluma/html/classpluma_1_1Host-members.htm b/doc/third_party/Pluma/html/classpluma_1_1Host-members.htm new file mode 100644 index 0000000..dae8f08 --- /dev/null +++ b/doc/third_party/Pluma/html/classpluma_1_1Host-members.htm @@ -0,0 +1,52 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + + +
+
+
pluma::Host Member List
+
+
+ +

This is the complete list of members for pluma::Host, including all inherited members.

+ + + + +
add(Provider *provider)pluma::Host
PluginManager (defined in pluma::Host)pluma::Hostfriend
Provider (defined in pluma::Host)pluma::Hostfriend
+ + + + diff --git a/doc/third_party/Pluma/html/classpluma_1_1Host.htm b/doc/third_party/Pluma/html/classpluma_1_1Host.htm new file mode 100644 index 0000000..b5b0096 --- /dev/null +++ b/doc/third_party/Pluma/html/classpluma_1_1Host.htm @@ -0,0 +1,109 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + + +
+ +
+
pluma::Host Class Reference
+
+
+ +

Manages providers. + More...

+ +

#include <Host.hpp>

+ + + + + +

+Public Member Functions

bool add (Provider *provider)
 Add provider. More...
 
+ + + + + +

+Friends

+class PluginManager
 
+class Provider
 
+

Detailed Description

+

Manages providers.

+ +

Definition at line 44 of file Host.hpp.

+

Member Function Documentation

+ +
+
+ + + + + + + + +
bool pluma::Host::add (Providerprovider)
+
+ +

Add provider.

+

Provider type and version are checked. Only known and valid provider types are accepted.

+
Parameters
+ + +
providerProvider to be added.
+
+
+
Returns
True if the provider is accepted.
+ +

Definition at line 42 of file Host.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/doc/third_party/Pluma/html/classpluma_1_1PluginManager-members.htm b/doc/third_party/Pluma/html/classpluma_1_1PluginManager-members.htm new file mode 100644 index 0000000..93bfd8a --- /dev/null +++ b/doc/third_party/Pluma/html/classpluma_1_1PluginManager-members.htm @@ -0,0 +1,61 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + + +
+
+
pluma::PluginManager Member List
+
+
+ +

This is the complete list of members for pluma::PluginManager, including all inherited members.

+ + + + + + + + + + + + + +
addProvider(Provider *provider)pluma::PluginManager
getLoadedPlugins(std::vector< const std::string * > &pluginNames) const pluma::PluginManager
getProviders(const std::string &type) const pluma::PluginManagerprotected
isLoaded(const std::string &pluginName) const pluma::PluginManager
load(const std::string &path)pluma::PluginManager
load(const std::string &folder, const std::string &pluginName)pluma::PluginManager
loadFromFolder(const std::string &folder, bool recursive=false)pluma::PluginManager
PluginManager()pluma::PluginManagerprotected
registerType(const std::string &type, unsigned int version, unsigned int lowestVersion)pluma::PluginManagerprotected
unload(const std::string &pluginName)pluma::PluginManager
unloadAll()pluma::PluginManager
~PluginManager()pluma::PluginManager
+ + + + diff --git a/doc/third_party/Pluma/html/classpluma_1_1PluginManager.htm b/doc/third_party/Pluma/html/classpluma_1_1PluginManager.htm new file mode 100644 index 0000000..eec4670 --- /dev/null +++ b/doc/third_party/Pluma/html/classpluma_1_1PluginManager.htm @@ -0,0 +1,515 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + + +
+ +
+
pluma::PluginManager Class Reference
+
+
+ +

Manages loaded plugins. + More...

+ +

#include <PluginManager.hpp>

+
+Inheritance diagram for pluma::PluginManager:
+
+
+ + +pluma::Pluma + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 ~PluginManager ()
 Destructor. More...
 
bool load (const std::string &path)
 Load a plugin given it's path. More...
 
bool load (const std::string &folder, const std::string &pluginName)
 Load a plugin from a given folder. More...
 
int loadFromFolder (const std::string &folder, bool recursive=false)
 Load all plugins from a given folder. More...
 
bool unload (const std::string &pluginName)
 Unload a plugin. More...
 
void unloadAll ()
 Unload all loaded plugins. More...
 
bool addProvider (Provider *provider)
 Directly add a new provider. More...
 
void getLoadedPlugins (std::vector< const std::string * > &pluginNames) const
 Get the name of all loaded plugins. More...
 
bool isLoaded (const std::string &pluginName) const
 Check if a plug-in is loaded. More...
 
+ + + + + + + + + + +

+Protected Member Functions

 PluginManager ()
 Default constructor. More...
 
void registerType (const std::string &type, unsigned int version, unsigned int lowestVersion)
 Register a provider type. More...
 
const std::list< Provider * > * getProviders (const std::string &type) const
 Get providers of a certain type. More...
 
+

Detailed Description

+

Manages loaded plugins.

+ +

Definition at line 44 of file PluginManager.hpp.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + +
pluma::PluginManager::~PluginManager ()
+
+ +

Destructor.

+ +

Definition at line 43 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
pluma::PluginManager::PluginManager ()
+
+protected
+
+ +

Default constructor.

+

PluginManager cannot be publicly instantiated.

+ +

Definition at line 37 of file PluginManager.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + +
bool pluma::PluginManager::addProvider (Providerprovider)
+
+ +

Directly add a new provider.

+
Parameters
+ + +
providerProvider.
+
+
+ +

Definition at line 168 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void pluma::PluginManager::getLoadedPlugins (std::vector< const std::string * > & pluginNames) const
+
+ +

Get the name of all loaded plugins.

+
Parameters
+ + +
pluginNamesA vector to fill with the plugins names.
+
+
+ +

Definition at line 178 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
const std::list< Provider * > * pluma::PluginManager::getProviders (const std::string & type) const
+
+protected
+
+ +

Get providers of a certain type.

+
Parameters
+ + +
typeProvider type.
+
+
+
Returns
Pointer to the list of providers of that type, or NULL if type is not registered.
+
See Also
Host::getProviders
+ +

Definition at line 194 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool pluma::PluginManager::isLoaded (const std::string & pluginName) const
+
+ +

Check if a plug-in is loaded.

+
Parameters
+ + +
pluginNamethe plug-in tname o check.
+
+
+ +

Definition at line 188 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool pluma::PluginManager::load (const std::string & path)
+
+ +

Load a plugin given it's path.

+
Parameters
+ + +
pathPath for the plugin, including plugin name. File extension may be included, but is discouraged for better cross platform code. If file extension isn't present on the path, Pluma will deduce it from the operating system.
+
+
+
Returns
True if the plugin is successfully loaded.
+
See Also
load(const std::string&, const std::string&)
+
+loadFromFolder
+
+unload
+
+unloadAll
+ +

Definition at line 49 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool pluma::PluginManager::load (const std::string & folder,
const std::string & pluginName 
)
+
+ +

Load a plugin from a given folder.

+
Parameters
+ + + +
folderThe folder path.
pluginNameName of the plugin. File extension may be included, but is discouraged for better cross platform code. If file extension is omitted, Pluma will deduce it from the operating system.
+
+
+
Returns
True if the plugin is successfully loaded.
+
See Also
load(const std::string&)
+
+loadFromFolder
+
+unload
+
+unloadAll
+ +

Definition at line 85 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pluma::PluginManager::loadFromFolder (const std::string & folder,
bool recursive = false 
)
+
+ +

Load all plugins from a given folder.

+
Parameters
+ + + +
folderPath for the folder where the plug-ins are.
recursiveIf true it will search on sub-folders as well
+
+
+
Returns
Number of successfully loaded plug-ins.
+
See Also
load(const std::string&, const std::string&)
+
+load(const std::string&)
+
+unload
+
+unloadAll
+ +

Definition at line 95 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void pluma::PluginManager::registerType (const std::string & type,
unsigned int version,
unsigned int lowestVersion 
)
+
+protected
+
+ +

Register a provider type.

+
Parameters
+ + + + +
typeProvider type.
versionCurrent version of that provider type.
lowestVersionLowest compatible version of that provider type.
+
+
+
See Also
Host::registerType
+ +

Definition at line 162 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool pluma::PluginManager::unload (const std::string & pluginName)
+
+ +

Unload a plugin.

+
Parameters
+ + +
pluginNameName or path of the plugin.
+
+
+
Returns
True if the plugin is successfully unloaded, false if no such plugin exists on the manager.
+
See Also
load(const std::string&, const std::string&)
+
+load(const std::string&)
+
+loadFromFolder
+
+unloadAll
+ +

Definition at line 109 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + + + +
void pluma::PluginManager::unloadAll ()
+
+ +

Unload all loaded plugins.

+
See Also
load(const std::string&, const std::string&)
+
+load(const std::string&)
+
+loadFromFolder
+
+unload
+ +

Definition at line 122 of file PluginManager.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/doc/third_party/Pluma/html/classpluma_1_1PluginManager.png b/doc/third_party/Pluma/html/classpluma_1_1PluginManager.png new file mode 100644 index 0000000..a5fc17e Binary files /dev/null and b/doc/third_party/Pluma/html/classpluma_1_1PluginManager.png differ diff --git a/doc/third_party/Pluma/html/classpluma_1_1Pluma-members.htm b/doc/third_party/Pluma/html/classpluma_1_1Pluma-members.htm new file mode 100644 index 0000000..074fc71 --- /dev/null +++ b/doc/third_party/Pluma/html/classpluma_1_1Pluma-members.htm @@ -0,0 +1,66 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + + +
+
+
pluma::Pluma Member List
+
+
+ +

This is the complete list of members for pluma::Pluma, including all inherited members.

+ + + + + + + + + + + + + + + + + + +
acceptProviderType()pluma::Pluma
acceptProviderType() (defined in pluma::Pluma)pluma::Pluma
addProvider(Provider *provider)pluma::PluginManager
getLoadedPlugins(std::vector< const std::string * > &pluginNames) const pluma::PluginManager
getProviders(std::vector< ProviderType * > &providers)pluma::Pluma
getProviders(std::vector< ProviderType * > &providers) (defined in pluma::Pluma)pluma::Pluma
pluma::PluginManager::getProviders(const std::string &type) const pluma::PluginManagerprotected
isLoaded(const std::string &pluginName) const pluma::PluginManager
load(const std::string &path)pluma::PluginManager
load(const std::string &folder, const std::string &pluginName)pluma::PluginManager
loadFromFolder(const std::string &folder, bool recursive=false)pluma::PluginManager
PluginManager()pluma::PluginManagerprotected
Pluma()pluma::Plumainline
registerType(const std::string &type, unsigned int version, unsigned int lowestVersion)pluma::PluginManagerprotected
unload(const std::string &pluginName)pluma::PluginManager
unloadAll()pluma::PluginManager
~PluginManager()pluma::PluginManager
+ + + + diff --git a/doc/third_party/Pluma/html/classpluma_1_1Pluma.htm b/doc/third_party/Pluma/html/classpluma_1_1Pluma.htm new file mode 100644 index 0000000..95fc1bd --- /dev/null +++ b/doc/third_party/Pluma/html/classpluma_1_1Pluma.htm @@ -0,0 +1,650 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + + +
+ +
+
pluma::Pluma Class Reference
+
+
+ +

Pluma plugins management. + More...

+ +

#include <Pluma.hpp>

+
+Inheritance diagram for pluma::Pluma:
+
+
+ + +pluma::PluginManager + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Pluma ()
 Default Constructor. More...
 
template<typename ProviderType >
void acceptProviderType ()
 Tell Pluma to accept a certain type of providers. More...
 
template<typename ProviderType >
void getProviders (std::vector< ProviderType * > &providers)
 Get the stored providers of a certain type. More...
 
+template<typename ProviderType >
void acceptProviderType ()
 
+template<typename ProviderType >
void getProviders (std::vector< ProviderType * > &providers)
 
bool load (const std::string &path)
 Load a plugin given it's path. More...
 
bool load (const std::string &folder, const std::string &pluginName)
 Load a plugin from a given folder. More...
 
int loadFromFolder (const std::string &folder, bool recursive=false)
 Load all plugins from a given folder. More...
 
bool unload (const std::string &pluginName)
 Unload a plugin. More...
 
void unloadAll ()
 Unload all loaded plugins. More...
 
bool addProvider (Provider *provider)
 Directly add a new provider. More...
 
void getLoadedPlugins (std::vector< const std::string * > &pluginNames) const
 Get the name of all loaded plugins. More...
 
bool isLoaded (const std::string &pluginName) const
 Check if a plug-in is loaded. More...
 
+ + + + + + + +

+Protected Member Functions

void registerType (const std::string &type, unsigned int version, unsigned int lowestVersion)
 Register a provider type. More...
 
const std::list< Provider * > * getProviders (const std::string &type) const
 Get providers of a certain type. More...
 
+

Detailed Description

+

Pluma plugins management.

+

Pluma is the main class of Pluma library. Allows hosting applications to load/unload dlls in runtime (plugins), and to get providers of shared interface objects.

+

Example:

+
+
// Tell it to accept providers of the type DeviceProvider
+
pluma.acceptProviderType<DeviceProvider>();
+
// Load some dll
+
pluma.load("plugins/standard_devices");
+
// Get device providers into a vector
+
std::vector<DeviceProvider*> providers;
+
pluma.getProviders(providers);
+
// create a Device from the first provider
+
if (!providers.empty()){
+
Device* myDevice = providers.first()->create();
+
// do something with myDevice
+
std::cout << device->getDescription() << std::endl;
+
// (...)
+
delete myDevice;
+
}
+

It is also possible to add local providers, providers that are defined directly on the host application. That can be useful to provide and use default implementations of certain interfaces, along with plugin implementations.

+ +

Definition at line 94 of file Pluma.hpp.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + +
Pluma::Pluma ()
+
+inline
+
+ +

Default Constructor.

+ +

Definition at line 27 of file Pluma.inl.

+ +
+
+

Member Function Documentation

+ +
+
+
+template<typename ProviderType >
+ + + + + + + +
void pluma::Pluma::acceptProviderType ()
+
+ +

Tell Pluma to accept a certain type of providers.

+

A Pluma object is able to accept multiple types of providers. When a plugin is loaded, it tries to register it's providers implementations. Those are only accepted by the host application if it's accepting providers of that kind.

+
Template Parameters
+ + +
ProviderTypetype of provider.
+
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool pluma::PluginManager::addProvider (Providerprovider)
+
+inherited
+
+ +

Directly add a new provider.

+
Parameters
+ + +
providerProvider.
+
+
+ +

Definition at line 168 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void pluma::PluginManager::getLoadedPlugins (std::vector< const std::string * > & pluginNames) const
+
+inherited
+
+ +

Get the name of all loaded plugins.

+
Parameters
+ + +
pluginNamesA vector to fill with the plugins names.
+
+
+ +

Definition at line 178 of file PluginManager.cpp.

+ +
+
+ +
+
+
+template<typename ProviderType >
+ + + + + + + + +
void pluma::Pluma::getProviders (std::vector< ProviderType * > & providers)
+
+ +

Get the stored providers of a certain type.

+

Providers are added at the end of the providers vector.

+
Template Parameters
+ + +
ProviderTypetype of provider to be returned.
+
+
+
Parameters
+ + +
[out]providersVector to fill with the existing providers.
+
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
const std::list< Provider * > * pluma::PluginManager::getProviders (const std::string & type) const
+
+protectedinherited
+
+ +

Get providers of a certain type.

+
Parameters
+ + +
typeProvider type.
+
+
+
Returns
Pointer to the list of providers of that type, or NULL if type is not registered.
+
See Also
Host::getProviders
+ +

Definition at line 194 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool pluma::PluginManager::isLoaded (const std::string & pluginName) const
+
+inherited
+
+ +

Check if a plug-in is loaded.

+
Parameters
+ + +
pluginNamethe plug-in tname o check.
+
+
+ +

Definition at line 188 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool pluma::PluginManager::load (const std::string & path)
+
+inherited
+
+ +

Load a plugin given it's path.

+
Parameters
+ + +
pathPath for the plugin, including plugin name. File extension may be included, but is discouraged for better cross platform code. If file extension isn't present on the path, Pluma will deduce it from the operating system.
+
+
+
Returns
True if the plugin is successfully loaded.
+
See Also
load(const std::string&, const std::string&)
+
+loadFromFolder
+
+unload
+
+unloadAll
+ +

Definition at line 49 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool pluma::PluginManager::load (const std::string & folder,
const std::string & pluginName 
)
+
+inherited
+
+ +

Load a plugin from a given folder.

+
Parameters
+ + + +
folderThe folder path.
pluginNameName of the plugin. File extension may be included, but is discouraged for better cross platform code. If file extension is omitted, Pluma will deduce it from the operating system.
+
+
+
Returns
True if the plugin is successfully loaded.
+
See Also
load(const std::string&)
+
+loadFromFolder
+
+unload
+
+unloadAll
+ +

Definition at line 85 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
int pluma::PluginManager::loadFromFolder (const std::string & folder,
bool recursive = false 
)
+
+inherited
+
+ +

Load all plugins from a given folder.

+
Parameters
+ + + +
folderPath for the folder where the plug-ins are.
recursiveIf true it will search on sub-folders as well
+
+
+
Returns
Number of successfully loaded plug-ins.
+
See Also
load(const std::string&, const std::string&)
+
+load(const std::string&)
+
+unload
+
+unloadAll
+ +

Definition at line 95 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void pluma::PluginManager::registerType (const std::string & type,
unsigned int version,
unsigned int lowestVersion 
)
+
+protectedinherited
+
+ +

Register a provider type.

+
Parameters
+ + + + +
typeProvider type.
versionCurrent version of that provider type.
lowestVersionLowest compatible version of that provider type.
+
+
+
See Also
Host::registerType
+ +

Definition at line 162 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool pluma::PluginManager::unload (const std::string & pluginName)
+
+inherited
+
+ +

Unload a plugin.

+
Parameters
+ + +
pluginNameName or path of the plugin.
+
+
+
Returns
True if the plugin is successfully unloaded, false if no such plugin exists on the manager.
+
See Also
load(const std::string&, const std::string&)
+
+load(const std::string&)
+
+loadFromFolder
+
+unloadAll
+ +

Definition at line 109 of file PluginManager.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void pluma::PluginManager::unloadAll ()
+
+inherited
+
+ +

Unload all loaded plugins.

+
See Also
load(const std::string&, const std::string&)
+
+load(const std::string&)
+
+loadFromFolder
+
+unload
+ +

Definition at line 122 of file PluginManager.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/doc/third_party/Pluma/html/classpluma_1_1Pluma.png b/doc/third_party/Pluma/html/classpluma_1_1Pluma.png new file mode 100644 index 0000000..29983ad Binary files /dev/null and b/doc/third_party/Pluma/html/classpluma_1_1Pluma.png differ diff --git a/doc/third_party/Pluma/html/classpluma_1_1Provider-members.htm b/doc/third_party/Pluma/html/classpluma_1_1Provider-members.htm new file mode 100644 index 0000000..7dfdf91 --- /dev/null +++ b/doc/third_party/Pluma/html/classpluma_1_1Provider-members.htm @@ -0,0 +1,53 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + + +
+
+
pluma::Provider Member List
+
+
+ +

This is the complete list of members for pluma::Provider, including all inherited members.

+ + + + + +
getVersion() const =0pluma::Providerpure virtual
Host (defined in pluma::Provider)pluma::Providerfriend
isCompatible(const Host &host) const pluma::Provider
~Provider()pluma::Providervirtual
+ + + + diff --git a/doc/third_party/Pluma/html/classpluma_1_1Provider.htm b/doc/third_party/Pluma/html/classpluma_1_1Provider.htm new file mode 100644 index 0000000..ea7b0ee --- /dev/null +++ b/doc/third_party/Pluma/html/classpluma_1_1Provider.htm @@ -0,0 +1,233 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + + +
+ +
+
pluma::Provider Class Referenceabstract
+
+
+ +

Interface to provide applications with objects from plugins. + More...

+ +

#include <Provider.hpp>

+ + + + + + + + + + + +

+Public Member Functions

virtual ~Provider ()
 Destructor. More...
 
virtual unsigned int getVersion () const =0
 Get provider version. More...
 
bool isCompatible (const Host &host) const
 Check compatibility with host. More...
 
+ + + +

+Friends

+class Host
 
+

Detailed Description

+

Interface to provide applications with objects from plugins.

+

The plugin specific implementations are unknown at the host side, only their shared interfaces are known. Then, host app needs a generic way of create interface objects. That's what provider classes are for. It is the factory design pattern (http://www.oodesign.com/factory-pattern.html)

+

Shared interfaces define their provider types (by inheriting from pluma::Provider). Hosts then use those tipes to get objects from the plugins. Plugins derive the shared interface providers so that they can provide host with specific implementations of the shared interface. Those specific providers are given to the host through a connect function.

+

Example: A host app uses objects of type Device. A certain plugin defines a Keyboard, witch is a Device. The Host will use DeviceProviders to create objects of type Device. The plugin will provide host specifically with a KeyboardProvider. Other plugins may provide host with other derived DeviceProvider types.

+

Device hpp (shared):

+
#include <Pluma/Pluma.hpp>
+
class Device{
+
public:
+
virtual std::string getDescription() const = 0;
+
};
+
// create DevicedProvider class
+
PLUMA_PROVIDER_HEADER(Device);
+

Device cpp (shared):

+
#include "Device.hpp"
+
generate DevicedProvider with version 6, and compatible with at least v.3
+
PLUMA_PROVIDER_SOURCE(Device, 6, 3);
+


+ Keyboard code on the plugin side:

+
#include <Pluma/Pluma.hpp>
+
#include "Device.hpp"
+
+
class Keyboard: public Device{
+
public:
+
std::string getDescription() const{
+
return "keyboard";
+
}
+
};
+
+
// create KeyboardProvider, it implements DeviceProvider
+
PLUMA_INHERIT_PROVIDER(Keyboard, Device);
+

plugin connector:

+
#include <Pluma/Connector.hpp>
+
#include "Keyboard.hpp"
+
+
PLUMA_CONNECTOR
+
bool connect(pluma::Host& host){
+
// add a keyboard provider to host
+
host.add( new KeyboardProvider() );
+
return true;
+
}
+

Host application code:

+
#include <Pluma/Pluma.hpp>
+
+
#include "Device.hpp"
+
#include <iostream>
+
#include <vector>
+
+
int main(){
+
+
pluma::Pluma plugins;
+
// Tell plugins manager to accept providers of the type DeviceProvider
+
plugins.acceptProviderType<DeviceProvider>();
+
// Load library "standard_devices" from folder "plugins"
+
plugins.load("plugins", "standard_devices");
+
+
// Get device providers into a vector
+
std::vector<DeviceProvider*> providers;
+
plugins.getProviders(providers);
+
+
// create a Device from the first provider
+
if (!providers.empty()){
+
Device* myDevice = providers.first()->create();
+
// do something with myDevice
+
std::cout << device->getDescription() << std::endl;
+
// and delete it in the end
+
delete myDevice;
+
}
+
return 0;
+
}
+
+

Definition at line 42 of file Provider.hpp.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + +
pluma::Provider::~Provider ()
+
+virtual
+
+ +

Destructor.

+ +

Definition at line 36 of file Provider.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
virtual unsigned int pluma::Provider::getVersion () const
+
+pure virtual
+
+ +

Get provider version.

+
Returns
Version number.
+ +
+
+ +
+
+ + + + + + + + +
bool pluma::Provider::isCompatible (const Hosthost) const
+
+ +

Check compatibility with host.

+

The same provider may be compiled with different versions on host side and on plugins side. This function checks if a plugin provider is compatible with the current version of the same provider type on the host side.

+
Parameters
+ + +
hostHost, proxy of host application.
+
+
+
Returns
True if it's compatible with host.
+ +

Definition at line 42 of file Provider.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/doc/third_party/Pluma/html/closed.png b/doc/third_party/Pluma/html/closed.png new file mode 100644 index 0000000..98cc2c9 Binary files /dev/null and b/doc/third_party/Pluma/html/closed.png differ diff --git a/doc/third_party/Pluma/html/doxygen.css b/doc/third_party/Pluma/html/doxygen.css new file mode 100644 index 0000000..3f2e69f --- /dev/null +++ b/doc/third_party/Pluma/html/doxygen.css @@ -0,0 +1,384 @@ +div#logo +{ + margin-bottom : 1em; + background : url("./logo-bg.jpg") repeat-x; +} + +div#logo a +{ + display : block; +} + +p#footer +{ + text-decoration : overline; + color : #606060; + padding-top : 1em; + text-align : center; + font-size : smaller; +} + +p#footer a +{ + color : #007298; + text-decoration : none; +} + +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Geneva, Arial, Helvetica, sans-serif; +} +BODY,TD { + font-size: 90%; +} +H1 { + text-align : center; + margin-top : 0px; + color : #2090B0; + font-size : 160%; +} +H2 { + font-size: 120%; +} +H3 { + font-size: 100%; +} +CAPTION { font-weight: bold } +DIV.qindex { + width: 100%; + background-color: #E0FFE0; + border: 1px dotted #808080; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.nav { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navtab { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +TD.navtab { + font-size: 70%; +} +A.qindex { + text-decoration: none; + font-weight: bold; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; +} +A.qindex:hover { + text-decoration: none; + background-color: #ddddff; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} +A.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; +} +A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code:link { text-decoration: none; font-weight: normal; border-bottom : 1px dotted #808080; color: black;} +A.code:visited { text-decoration: none; font-weight: normal; border-bottom : 1px dotted #808080; color: black;} +A.codeRef:link { font-weight: normal; color: #0000FF} +A.codeRef:visited { font-weight: normal; color: #0000FF} +/*A:hover { text-decoration: none; background-color: #f2f2ff }*/ +DL.el { margin-left: -1cm } +.fragment { + font-family: monospace, fixed; + font-size: 95%; +} +PRE.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } + +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} +DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } +BODY { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} +TD.indexkey { + background-color: #e8eef2; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TD.indexvalue { + background-color: #e8eef2; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { text-align: center; } +IMG.formulaDsp { } +IMG.formulaInl { vertical-align: middle; } +SPAN.keyword { color: #0000FF } +SPAN.keywordtype { color: #0000FF } +SPAN.keywordflow { color: #0000FF } +SPAN.comment { color: #008000 } +SPAN.preprocessor { color: #008080 } +SPAN.stringliteral { color: #008080 } +SPAN.charliteral { color: #008080 } +.mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplParams { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + color: #606060; + background-color: #FAFAFA; + font-size: 80%; +} +.search { color: #003399; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +TD.tiny { font-size: 75%; +} +a { + color: #2090B0; +} +a:visited { + color: #2090B0; +} +.dirtab { padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} +TH.dirtab { background: #e8eef2; + font-weight: bold; +} +HR { height: 1px; + border: none; + border-top: 1px solid black; +} + +/* Style for detailed member documentation */ +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; +} +.memnav { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +.memitem { + /*padding: 4px;*/ + background-color: #F0FFF0; + border-width: 1px; + border-style: solid; + border-color: #808080; + /*-moz-border-radius: 8px 8px 8px 8px;*/ +} +.memname { + white-space: nowrap; + font-weight: bold; +} +.memdoc{ + padding-left: 10px; +} +.memproto { + background-color: #D0FFD0; + width: 100%; + border-bottom-width: 1px; + border-bottom-style: dotted; + border-bottom-color: #808080; + font-weight: bold; + /*-moz-border-radius: 8px 8px 8px 8px;*/ +} +.paramkey { + text-align: right; +} +.paramtype { + white-space: nowrap; +} +.paramname { + color: #602020; + font-style: italic; + white-space: nowrap; +} +/* End Styling for detailed member documentation */ + +/* for the tree view */ +.ftvtree { + font-family: sans-serif; + margin:0.5em; +} +.directory { font-size: 9pt; font-weight: bold; } +.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } +.directory > h3 { margin-top: 0; } +.directory p { margin: 0px; white-space: nowrap; } +.directory div { display: none; margin: 0px; } +.directory img { vertical-align: -30%; } diff --git a/doc/third_party/Pluma/html/doxygen.png b/doc/third_party/Pluma/html/doxygen.png new file mode 100644 index 0000000..3ff17d8 Binary files /dev/null and b/doc/third_party/Pluma/html/doxygen.png differ diff --git a/doc/third_party/Pluma/html/dynsections.js b/doc/third_party/Pluma/html/dynsections.js new file mode 100644 index 0000000..2f15470 --- /dev/null +++ b/doc/third_party/Pluma/html/dynsections.js @@ -0,0 +1,104 @@ +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); +} +function toggleLevel(level) +{ + $('table.directory tr').each(function(){ + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
File List
+
+
+
Here is a list of all documented files with brief descriptions:
+ + + + + + + + + + + + + + + + +
o*Config.hpp
o*Connector.hpp
o*Dir.cpp
o*Dir.hpp
o*DLibrary.cpp
o*DLibrary.hpp
o*Doxygen.hpp
o*Host.cpp
o*Host.hpp
o*PluginManager.cpp
o*PluginManager.hpp
o*Pluma.hpp
o*Pluma.inl
o*Provider.cpp
\*Provider.hpp
+
+
+ + + + diff --git a/doc/third_party/Pluma/html/ftv2blank.png b/doc/third_party/Pluma/html/ftv2blank.png new file mode 100644 index 0000000..63c605b Binary files /dev/null and b/doc/third_party/Pluma/html/ftv2blank.png differ diff --git a/doc/third_party/Pluma/html/ftv2cl.png b/doc/third_party/Pluma/html/ftv2cl.png new file mode 100644 index 0000000..132f657 Binary files /dev/null and b/doc/third_party/Pluma/html/ftv2cl.png differ diff --git a/doc/third_party/Pluma/html/ftv2doc.png b/doc/third_party/Pluma/html/ftv2doc.png new file mode 100644 index 0000000..17edabf Binary files /dev/null and b/doc/third_party/Pluma/html/ftv2doc.png differ diff --git a/doc/third_party/Pluma/html/ftv2folderclosed.png b/doc/third_party/Pluma/html/ftv2folderclosed.png new file mode 100644 index 0000000..bb8ab35 Binary files /dev/null and b/doc/third_party/Pluma/html/ftv2folderclosed.png differ diff --git a/doc/third_party/Pluma/html/ftv2folderopen.png b/doc/third_party/Pluma/html/ftv2folderopen.png new file mode 100644 index 0000000..d6c7f67 Binary files /dev/null and b/doc/third_party/Pluma/html/ftv2folderopen.png differ diff --git a/doc/third_party/Pluma/html/ftv2lastnode.png b/doc/third_party/Pluma/html/ftv2lastnode.png new file mode 100644 index 0000000..63c605b Binary files /dev/null and b/doc/third_party/Pluma/html/ftv2lastnode.png differ diff --git a/doc/third_party/Pluma/html/ftv2link.png b/doc/third_party/Pluma/html/ftv2link.png new file mode 100644 index 0000000..17edabf Binary files /dev/null and b/doc/third_party/Pluma/html/ftv2link.png differ diff --git a/doc/third_party/Pluma/html/ftv2mlastnode.png b/doc/third_party/Pluma/html/ftv2mlastnode.png new file mode 100644 index 0000000..0b63f6d Binary files /dev/null and b/doc/third_party/Pluma/html/ftv2mlastnode.png differ diff --git a/doc/third_party/Pluma/html/ftv2mnode.png b/doc/third_party/Pluma/html/ftv2mnode.png new file mode 100644 index 0000000..0b63f6d Binary files /dev/null and b/doc/third_party/Pluma/html/ftv2mnode.png differ diff --git a/doc/third_party/Pluma/html/ftv2mo.png b/doc/third_party/Pluma/html/ftv2mo.png new file mode 100644 index 0000000..4bfb80f Binary files /dev/null and b/doc/third_party/Pluma/html/ftv2mo.png differ diff --git a/doc/third_party/Pluma/html/ftv2node.png b/doc/third_party/Pluma/html/ftv2node.png new file mode 100644 index 0000000..63c605b Binary files /dev/null and b/doc/third_party/Pluma/html/ftv2node.png differ diff --git a/doc/third_party/Pluma/html/ftv2ns.png b/doc/third_party/Pluma/html/ftv2ns.png new file mode 100644 index 0000000..72e3d71 Binary files /dev/null and b/doc/third_party/Pluma/html/ftv2ns.png differ diff --git a/doc/third_party/Pluma/html/ftv2plastnode.png b/doc/third_party/Pluma/html/ftv2plastnode.png new file mode 100644 index 0000000..c6ee22f Binary files /dev/null and b/doc/third_party/Pluma/html/ftv2plastnode.png differ diff --git a/doc/third_party/Pluma/html/ftv2pnode.png b/doc/third_party/Pluma/html/ftv2pnode.png new file mode 100644 index 0000000..c6ee22f Binary files /dev/null and b/doc/third_party/Pluma/html/ftv2pnode.png differ diff --git a/doc/third_party/Pluma/html/ftv2splitbar.png b/doc/third_party/Pluma/html/ftv2splitbar.png new file mode 100644 index 0000000..fe895f2 Binary files /dev/null and b/doc/third_party/Pluma/html/ftv2splitbar.png differ diff --git a/doc/third_party/Pluma/html/ftv2vertline.png b/doc/third_party/Pluma/html/ftv2vertline.png new file mode 100644 index 0000000..63c605b Binary files /dev/null and b/doc/third_party/Pluma/html/ftv2vertline.png differ diff --git a/doc/third_party/Pluma/html/functions.htm b/doc/third_party/Pluma/html/functions.htm new file mode 100644 index 0000000..cdc44a7 --- /dev/null +++ b/doc/third_party/Pluma/html/functions.htm @@ -0,0 +1,105 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + + +
+
Here is a list of all documented class members with links to the class documentation for each member:
+
+ + + + diff --git a/doc/third_party/Pluma/html/functions_func.htm b/doc/third_party/Pluma/html/functions_func.htm new file mode 100644 index 0000000..64622da --- /dev/null +++ b/doc/third_party/Pluma/html/functions_func.htm @@ -0,0 +1,105 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + + +
+
+ + + + diff --git a/doc/third_party/Pluma/html/hierarchy.htm b/doc/third_party/Pluma/html/hierarchy.htm new file mode 100644 index 0000000..297a965 --- /dev/null +++ b/doc/third_party/Pluma/html/hierarchy.htm @@ -0,0 +1,51 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + + +
+
+
Class Hierarchy
+
+
+
This inheritance list is sorted roughly, but not completely, alphabetically:
+
[detail level 12]
+ + + + + +
oCpluma::DLibraryManages a Dynamic Linking Library
oCpluma::HostManages providers
oCpluma::PluginManagerManages loaded plugins
|\Cpluma::PlumaPluma plugins management
\Cpluma::ProviderInterface to provide applications with objects from plugins
+
+
+ + + + diff --git a/doc/third_party/Pluma/html/index.htm b/doc/third_party/Pluma/html/index.htm new file mode 100644 index 0000000..df4076e --- /dev/null +++ b/doc/third_party/Pluma/html/index.htm @@ -0,0 +1,112 @@ + + + + Pluma - Plug-in Management Framework + + + + + + + + + +
+
+
Pluma Documentation
+
+
+

+Welcome

+

Welcome to Pluma documentation. Here you will find a detailed view of all Pluma classes.
+ If you are looking for support, you can visit the official website at http://pluma-framework.sourceforge.net/.
+
+

+

CSS based on SFML1.6 documentation
+

+

+Short Example

+

A short example to demonstrate Pluma usage:
+ A host application define a Device interface. A certain plugin defines a Keyboard, witch is a Device. The host will use DeviceProviders to create objects of type Device. The plugin will provide host specifically with a KeyboardProvider.
+

+

Device hpp (shared):

+
#include <Pluma/Pluma.hpp>
+
class Device{
+
public:
+
virtual std::string getDescription() const = 0;
+
};
+
// create DevicedProvider class
+
PLUMA_PROVIDER_HEADER(Device);
+

Device cpp (shared):

+
#include "Device.hpp"
+
generate DevicedProvider with version 6, and compatible with at least v.3
+
PLUMA_PROVIDER_SOURCE(Device, 6, 3);
+


+ Keyboard code on the plugin side:

+
#include <Pluma/Pluma.hpp>
+
#include "Device.hpp"
+
+
class Keyboard: public Device{
+
public:
+
std::string getDescription() const{
+
return "keyboard";
+
}
+
};
+
+
// create KeyboardProvider, it implements DeviceProvider
+
PLUMA_INHERIT_PROVIDER(Keyboard, Device);
+

plugin connector:

+
#include <Pluma/Connector.hpp>
+
#include "Keyboard.hpp"
+
+
PLUMA_CONNECTOR
+
bool connect(pluma::Host& host){
+
// add a keyboard provider to host
+
host.add( new KeyboardProvider() );
+
return true;
+
}
+

Host application code:

+
#include <Pluma/Pluma.hpp>
+
+
#include "Device.hpp"
+
#include <iostream>
+
#include <vector>
+
+
int main(){
+
+
pluma::Pluma plugins;
+
// Tell plugins manager to accept providers of the type DeviceProvider
+
plugins.acceptProviderType<DeviceProvider>();
+
// Load library "standard_devices" from folder "plugins"
+
plugins.load("plugins", "standard_devices");
+
+
// Get device providers into a vector
+
std::vector<DeviceProvider*> providers;
+
plugins.getProviders(providers);
+
+
// create a Device from the first provider
+
if (!providers.empty()){
+
Device* myDevice = providers.first()->create();
+
// do something with myDevice
+
std::cout << device->getDescription() << std::endl;
+
// and delete it in the end
+
delete myDevice;
+
}
+
return 0;
+
}
+
+ + + + diff --git a/doc/third_party/Pluma/html/logo.png b/doc/third_party/Pluma/html/logo.png new file mode 100644 index 0000000..f3d74cd Binary files /dev/null and b/doc/third_party/Pluma/html/logo.png differ diff --git a/doc/third_party/Pluma/html/nav_f.png b/doc/third_party/Pluma/html/nav_f.png new file mode 100644 index 0000000..72a58a5 Binary files /dev/null and b/doc/third_party/Pluma/html/nav_f.png differ diff --git a/doc/third_party/Pluma/html/nav_g.png b/doc/third_party/Pluma/html/nav_g.png new file mode 100644 index 0000000..2093a23 Binary files /dev/null and b/doc/third_party/Pluma/html/nav_g.png differ diff --git a/doc/third_party/Pluma/html/nav_h.png b/doc/third_party/Pluma/html/nav_h.png new file mode 100644 index 0000000..33389b1 Binary files /dev/null and b/doc/third_party/Pluma/html/nav_h.png differ diff --git a/doc/third_party/Pluma/html/open.png b/doc/third_party/Pluma/html/open.png new file mode 100644 index 0000000..30f75c7 Binary files /dev/null and b/doc/third_party/Pluma/html/open.png differ diff --git a/doc/third_party/Pluma/html/sync_off.png b/doc/third_party/Pluma/html/sync_off.png new file mode 100644 index 0000000..3b443fc Binary files /dev/null and b/doc/third_party/Pluma/html/sync_off.png differ diff --git a/doc/third_party/Pluma/html/sync_on.png b/doc/third_party/Pluma/html/sync_on.png new file mode 100644 index 0000000..e08320f Binary files /dev/null and b/doc/third_party/Pluma/html/sync_on.png differ diff --git a/doc/third_party/Pluma/html/tab_a.png b/doc/third_party/Pluma/html/tab_a.png new file mode 100644 index 0000000..3b725c4 Binary files /dev/null and b/doc/third_party/Pluma/html/tab_a.png differ diff --git a/doc/third_party/Pluma/html/tab_b.png b/doc/third_party/Pluma/html/tab_b.png new file mode 100644 index 0000000..e2b4a86 Binary files /dev/null and b/doc/third_party/Pluma/html/tab_b.png differ diff --git a/doc/third_party/Pluma/html/tab_h.png b/doc/third_party/Pluma/html/tab_h.png new file mode 100644 index 0000000..fd5cb70 Binary files /dev/null and b/doc/third_party/Pluma/html/tab_h.png differ diff --git a/doc/third_party/Pluma/html/tab_s.png b/doc/third_party/Pluma/html/tab_s.png new file mode 100644 index 0000000..ab478c9 Binary files /dev/null and b/doc/third_party/Pluma/html/tab_s.png differ diff --git a/doc/third_party/Pluma/html/tabs.css b/doc/third_party/Pluma/html/tabs.css new file mode 100644 index 0000000..9cf578f --- /dev/null +++ b/doc/third_party/Pluma/html/tabs.css @@ -0,0 +1,60 @@ +.tabs, .tabs2, .tabs3 { + background-image: url('tab_b.png'); + width: 100%; + z-index: 101; + font-size: 13px; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +} + +.tabs2 { + font-size: 10px; +} +.tabs3 { + font-size: 9px; +} + +.tablist { + margin: 0; + padding: 0; + display: table; +} + +.tablist li { + float: left; + display: table-cell; + background-image: url('tab_b.png'); + line-height: 36px; + list-style: none; +} + +.tablist a { + display: block; + padding: 0 20px; + font-weight: bold; + background-image:url('tab_s.png'); + background-repeat:no-repeat; + background-position:right; + color: #283A5D; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; + outline: none; +} + +.tabs3 .tablist a { + padding: 0 10px; +} + +.tablist a:hover { + background-image: url('tab_h.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); + text-decoration: none; +} + +.tablist li.current a { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt new file mode 100644 index 0000000..ef245aa --- /dev/null +++ b/lib/CMakeLists.txt @@ -0,0 +1,6 @@ +SUBDIRS( + cpPlugins + third_party + ) + +## eof - $RCSfile$ diff --git a/lib/cpPlugins/CMakeLists.txt b/lib/cpPlugins/CMakeLists.txt new file mode 100644 index 0000000..fe78cf1 --- /dev/null +++ b/lib/cpPlugins/CMakeLists.txt @@ -0,0 +1,6 @@ +SUBDIRS( + Interface + Plugins + ) + +## eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/CMakeLists.txt b/lib/cpPlugins/Interface/CMakeLists.txt new file mode 100644 index 0000000..8daa761 --- /dev/null +++ b/lib/cpPlugins/Interface/CMakeLists.txt @@ -0,0 +1,30 @@ +SET(LIBRARY_NAME cpPlugins_Interface) + +## =============== +## = Source code = +## =============== + +FILE(GLOB LIB_HEADERS_H "*.h") +FILE(GLOB LIB_HEADERS_HPP "*.hpp") +FILE(GLOB LIB_HEADERS_HXX "*.hxx") +FILE(GLOB LIB_SOURCES_C "*.c") +FILE(GLOB LIB_SOURCES_CPP "*.cpp") +FILE(GLOB LIB_SOURCES_CXX "*.cxx") + +## ===================== +## = Compilation rules = +## ===================== + +ADD_LIBRARY( + ${LIBRARY_NAME} + SHARED + ${LIB_SOURCES_C} + ${LIB_SOURCES_CPP} + ${LIB_SOURCES_CXX} + ) +TARGET_LINK_LIBRARIES( + ${LIBRARY_NAME} + cpPlugins_Pluma + ) + +## eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/DataObject.cxx b/lib/cpPlugins/Interface/DataObject.cxx new file mode 100644 index 0000000..0b64bec --- /dev/null +++ b/lib/cpPlugins/Interface/DataObject.cxx @@ -0,0 +1,40 @@ +#include + +// ------------------------------------------------------------------------- +cpPlugins::Interface::DataObject:: +DataObject( ) + : Superclass( ), + m_Source( NULL ) +{ +} + +// ------------------------------------------------------------------------- +cpPlugins::Interface::DataObject:: +~DataObject( ) +{ +} + +// ------------------------------------------------------------------------- +std::string cpPlugins::Interface::DataObject:: +GetClassName( ) const +{ + return( "cpPlugins::Interface::DataObject" ); +} + +// ------------------------------------------------------------------------- +cpPlugins::Interface::ProcessObject* cpPlugins::Interface::DataObject:: +GetSource( ProcessObject* src ) const +{ + return( this->m_Source ); +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::DataObject:: +SetSource( cpPlugins::Interface::ProcessObject* src ) +{ + this->m_Source = src; +} + +#endif // __CPPLUGINS__INTERFACE__DATAOBJECT__H__ + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/DataObject.h b/lib/cpPlugins/Interface/DataObject.h new file mode 100644 index 0000000..359b2b4 --- /dev/null +++ b/lib/cpPlugins/Interface/DataObject.h @@ -0,0 +1,47 @@ +#ifndef __CPPLUGINS__INTERFACE__DATAOBJECT__H__ +#define __CPPLUGINS__INTERFACE__DATAOBJECT__H__ + +#include +#include +#include +#include + +namespace cpPlugins +{ + namespace Interface + { + class ProcessObject; + + /** + */ + class DataObject + : public Object + { + public: + typedef DataObject Self; + typedef Object Superclass; + + public: + DataObject( ); + virtual ~DataObject( ); + + virtual std::string GetClassName( ) const; + + itk::DataObject* GetDataObject( ) const; + void SetDataObject( itk::DataObject* src ); + + ProcessObject* GetSource( ) const; + void SetSource( ProcessObject* src ); + + protected: + itk::DataObject::Pointer m_DataObject; + ProcessObject* m_Source; + }; + + } // ecapseman + +} // ecapseman + +#endif // __CPPLUGINS__INTERFACE__DATAOBJECT__H__ + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/FilterObject.h b/lib/cpPlugins/Interface/FilterObject.h new file mode 100644 index 0000000..e69de29 diff --git a/lib/cpPlugins/Interface/Image.h b/lib/cpPlugins/Interface/Image.h new file mode 100644 index 0000000..e69de29 diff --git a/lib/cpPlugins/Interface/ImageToImageFilter.h b/lib/cpPlugins/Interface/ImageToImageFilter.h new file mode 100644 index 0000000..e69de29 diff --git a/lib/cpPlugins/Interface/ImageToMeshFilter.h b/lib/cpPlugins/Interface/ImageToMeshFilter.h new file mode 100644 index 0000000..e69de29 diff --git a/lib/cpPlugins/Interface/Interface.cxx b/lib/cpPlugins/Interface/Interface.cxx new file mode 100644 index 0000000..332ace5 --- /dev/null +++ b/lib/cpPlugins/Interface/Interface.cxx @@ -0,0 +1,144 @@ +#include + +// ------------------------------------------------------------------------- +cpPlugins::Interface::Interface:: +Interface( ) +{ + this->m_Pluma.acceptProviderType< ObjectProvider >( ); +} + +// ------------------------------------------------------------------------- +cpPlugins::Interface::Interface:: +~Interface( ) +{ + this->UnloadAll( ); +} + +// ------------------------------------------------------------------------- +cpPlugins::Interface::Interface:: +TClasses& cpPlugins::Interface::Interface:: +GetClasses( ) +{ + return( this->m_Classes ); +} + +// ------------------------------------------------------------------------- +const cpPlugins::Interface::Interface:: +TClasses& cpPlugins::Interface::Interface:: +GetClasses( ) const +{ + return( this->m_Classes ); +} + +// ------------------------------------------------------------------------- +cpPlugins::Interface::Object* cpPlugins::Interface::Interface:: +CreateObject( const std::string& name ) const +{ + TClassesIterator cIt = this->m_Classes.find( name ); + if( cIt != this->m_Classes.end( ) ) + { + ObjectProvider* provider = + dynamic_cast< ObjectProvider* >( this->m_Providers[ cIt->second ] ); + if( provider != NULL ) + return( dynamic_cast< Object* >( provider->create( ) ) ); + + } // fi + return( NULL ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Interface:: +Load( const std::string& path ) +{ + if( this->m_Pluma.load( path ) ) + { + this->_LoadClasses( ); + return( true ); + } + else + return( false ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Interface:: +Load( const std::string& folder, const std::string& name ) +{ + if( this->m_Pluma.load( folder, name ) ) + { + this->_LoadClasses( ); + return( true ); + } + else + return( false ); +} + +// ------------------------------------------------------------------------- +int cpPlugins::Interface::Interface:: +LoadFromFolder( const std::string& folder, bool r ) +{ + if( this->m_Pluma.loadFromFolder( folder, r ) ) + { + this->_LoadClasses( ); + return( true ); + } + else + return( false ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Interface:: +Unload( const std::string& name ) +{ + if( this->m_Pluma.unload( name ) ) + { + this->m_Providers.clear( ); + this->m_Classes.clear( ); + this->_LoadClasses( ); + return( true ); + } + else + return( false ); +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Interface:: +UnloadAll( ) +{ + this->m_Pluma.unloadAll( ); + this->m_Providers.clear( ); + this->m_Classes.clear( ); +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Interface:: +GetLoadedPlugins( std::vector< const std::string* >& names ) const +{ + this->m_Pluma.getLoadedPlugins( names ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Interface:: +IsLoaded( const std::string& name ) const +{ + return( this->m_Pluma.isLoaded( name ) ); +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Interface:: +_LoadClasses( ) +{ + this->m_Providers.clear( ); + this->m_Classes.clear( ); + this->m_Pluma.getProviders( this->m_Providers ); + + // Get reader provider + for( unsigned int i = 0; i < this->m_Providers.size( ); ++i ) + { + Object* dummy = this->m_Providers[ i ]->create( ); + this->m_Classes[ dummy->GetClassName( ) ] = i; + delete dummy; + + } // rof +} + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/Interface.h b/lib/cpPlugins/Interface/Interface.h new file mode 100644 index 0000000..1db73b9 --- /dev/null +++ b/lib/cpPlugins/Interface/Interface.h @@ -0,0 +1,59 @@ +#ifndef __CPPLUGINS__INTERFACE__INTERFACE__H__ +#define __CPPLUGINS__INTERFACE__INTERFACE__H__ + +#include +#include +#include +#include + +#include + +namespace cpPlugins +{ + namespace Interface + { + /** + */ + class Interface + { + public: + typedef std::vector< ObjectProvider* > TProviders; + typedef std::map< std::string, unsigned int > TClasses; + + typedef TProviders::const_iterator TProvidersIterator; + typedef TClasses::const_iterator TClassesIterator; + + public: + Interface( ); + virtual ~Interface( ); + + /// Plugin access + TClasses& GetClasses( ); + const TClasses& GetClasses( ) const; + Object* CreateObject( const std::string& name ) const; + + /// Interface to PLUMA + bool Load( const std::string& path ); + bool Load( const std::string& folder, const std::string& name ); + int LoadFromFolder( const std::string& folder, bool r = false ); + bool Unload( const std::string& name ); + void UnloadAll( ); + void GetLoadedPlugins( std::vector< const std::string* >& names ) const; + bool IsLoaded( const std::string& name ) const; + + protected: + void _LoadClasses( ); + + protected: + pluma::Pluma m_Pluma; + TProviders m_Providers; + TClasses m_Classes; + }; + + } // ecapseman + +} // ecapseman + +#endif // __CPPLUGINS__INTERFACE__INTERFACE__H__ + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/Mesh.h b/lib/cpPlugins/Interface/Mesh.h new file mode 100644 index 0000000..e69de29 diff --git a/lib/cpPlugins/Interface/MeshToImageFilter.h b/lib/cpPlugins/Interface/MeshToImageFilter.h new file mode 100644 index 0000000..e69de29 diff --git a/lib/cpPlugins/Interface/MeshToMeshFilter.h b/lib/cpPlugins/Interface/MeshToMeshFilter.h new file mode 100644 index 0000000..e69de29 diff --git a/lib/cpPlugins/Interface/Object.cxx b/lib/cpPlugins/Interface/Object.cxx new file mode 100644 index 0000000..c0418d3 --- /dev/null +++ b/lib/cpPlugins/Interface/Object.cxx @@ -0,0 +1,25 @@ +#include + +// ------------------------------------------------------------------------- +cpPlugins::Interface::Object:: +Object( ) +{ +} + +// ------------------------------------------------------------------------- +cpPlugins::Interface::Object:: +~Object( ) +{ +} + +// ------------------------------------------------------------------------- +std::string cpPlugins::Interface::Object:: +GetClassName( ) const +{ + return( "cpPlugins::Interface::Object" ); +} + +// ------------------------------------------------------------------------- +PLUMA_PROVIDER_SOURCE( cpPlugins::Interface::Object, 1, 1 ); + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/Object.h b/lib/cpPlugins/Interface/Object.h new file mode 100644 index 0000000..d64ece2 --- /dev/null +++ b/lib/cpPlugins/Interface/Object.h @@ -0,0 +1,31 @@ +#ifndef __CPPLUGINS__INTERFACE__OBJECT__H__ +#define __CPPLUGINS__INTERFACE__OBJECT__H__ + +#include +#include + +namespace cpPlugins +{ + namespace Interface + { + /** + */ + class Object + { + public: + Object( ); + virtual ~Object( ); + + virtual std::string GetClassName( ) const; + }; + + // TODO: doc + PLUMA_PROVIDER_HEADER( Object ); + + } // ecapseman + +} // ecapseman + +#endif // __CPPLUGINS__INTERFACE__OBJECT__H__ + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/ProcessObject.cxx b/lib/cpPlugins/Interface/ProcessObject.cxx new file mode 100644 index 0000000..cd88ea6 --- /dev/null +++ b/lib/cpPlugins/Interface/ProcessObject.cxx @@ -0,0 +1,91 @@ +#include + +// ------------------------------------------------------------------------- +cpPlugins::Interface::ProcessObject:: +ProcessObject( ) + : Superclass( ) +{ +} + +// ------------------------------------------------------------------------- +cpPlugins::Interface::ProcessObject:: +~ProcessObject( ) +{ +} + +// ------------------------------------------------------------------------- +std::string cpPlugins::Interface::ProcessObject:: +GetClassName( ) const +{ + return( "cpPlugins::Interface::ProcessObject" ); +} + +// ------------------------------------------------------------------------- +const cpPlugins::Interface::ProcessObject:: +TParameters& cpPlugins::Interface::ProcessObject:: +GetDefaultParameters( ) const +{ + return( this->m_DefaultParameters ); +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::ProcessObject:: +SetParameters( const TParameters& params ) +{ + this->m_Parameters = params; +} + +// ------------------------------------------------------------------------- +unsigned int cpPlugins::Interface::ProcessObject:: +GetNumberOfInputs( ) const +{ + return( this->m_Inputs.size( ) ); +} + +// ------------------------------------------------------------------------- +unsigned int cpPlugins::Interface::ProcessObject:: +GetNumberOfOutputs( ) const +{ + return( this->m_Outputs.size( ) ); +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::ProcessObject:: +SetInput( + unsigned int idx, const cpPlugins::Interface::DataObject* dobj + ) +{ + if( idx < this->m_Inputs.size( ) ) + this->m_Inputs[ idx ] = dobj; +} + +// ------------------------------------------------------------------------- +cpPlugins::Interface::DataObject* cpPlugins::Interface::ProcessObject:: +GetOutput( unsigned int idx ) const +{ + if( idx < this->m_Outputs.size( ) ) + return( this->m_Outputs[ idx ] ); + else + return( NULL ); +} + +// ------------------------------------------------------------------------- +std::string cpPlugins::Interface::ProcessObject:: +Update( ) +{ + // Force upstream updates + for( unsigned int idx = 0; idx < this->m_Inputs.size( ); ++idx ) + this->m_Inputs->GetSource( )->Update( ); + + // Current update + std::string ret = this->_GenerateData( ); + + // Sync outputs + for( unsigned int odx = 0; odx < this->m_Outputs.size( ); ++odx ) + this->m_Outputs->SetSource( this ); + + return( ret ); +} + + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/ProcessObject.h b/lib/cpPlugins/Interface/ProcessObject.h new file mode 100644 index 0000000..3137913 --- /dev/null +++ b/lib/cpPlugins/Interface/ProcessObject.h @@ -0,0 +1,59 @@ +#ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ +#define __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ + +#include +#include +#include + +namespace cpPlugins +{ + namespace Interface + { + class DataObject; + + /** + */ + class ProcessObject + : public Object + { + public: + typedef ProcessObject Self; + typedef Object Superclass; + + typedef std::pair< std::string, std::string > TParameter; + typedef std::map< std::string, TParameter > TParameters; + + public: + ProcessObject( ); + virtual ~ProcessObject( ); + + virtual std::string GetClassName( ) const; + virtual const TParameters& GetDefaultParameters( ) const; + virtual void SetParameters( const TParameters& params ); + + virtual unsigned int GetNumberOfInputs( ) const; + virtual unsigned int GetNumberOfOutputs( ) const; + + virtual void SetInput( unsigned int idx, const DataObject* dobj ); + virtual DataObject* GetOutput( unsigned int idx ) const; + + virtual std::string Update( ); + + protected: + virtual std::string _GenerateData( ) = 0; + + protected: + TParameters m_DefaultParameters; + TParameters m_Parameters; + + std::vector< const DataObject* > m_Inputs; + std::vector< DataObject* > m_Outputs; + }; + + } // ecapseman + +} // ecapseman + +#endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/SinkObject.h b/lib/cpPlugins/Interface/SinkObject.h new file mode 100644 index 0000000..e69de29 diff --git a/lib/cpPlugins/Interface/SourceObject.cxx b/lib/cpPlugins/Interface/SourceObject.cxx new file mode 100644 index 0000000..b798def --- /dev/null +++ b/lib/cpPlugins/Interface/SourceObject.cxx @@ -0,0 +1,23 @@ +#include + +// ------------------------------------------------------------------------- +cpPlugins::Interface::SourceObject:: +SourceObject( ) + : Superclass( ) +{ +} + +// ------------------------------------------------------------------------- +cpPlugins::Interface::SourceObject:: +~SourceObject( ) +{ +} + +// ------------------------------------------------------------------------- +std::string cpPlugins::Interface::SourceObject:: +GetClassName( ) const +{ + return( "cpPlugins::Interface::SourceObject" ); +} + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/SourceObject.h b/lib/cpPlugins/Interface/SourceObject.h new file mode 100644 index 0000000..89a5a6b --- /dev/null +++ b/lib/cpPlugins/Interface/SourceObject.h @@ -0,0 +1,35 @@ +#ifndef __CPPLUGINS__INTERFACE__SOURCEOBJECT__H__ +#define __CPPLUGINS__INTERFACE__SOURCEOBJECT__H__ + +#include + +namespace cpPlugins +{ + namespace Interface + { + /** + */ + class SourceObject + : public ProcessObject + { + public: + typedef SourceObject Self; + typedef ProcessObject Superclass; + + typedef Superclass::TParameter TParameter; + typedef Superclass::TParameters TParameters; + + public: + SourceObject( ); + virtual ~SourceObject( ); + + virtual std::string GetClassName( ) const; + }; + + } // ecapseman + +} // ecapseman + +#endif // __CPPLUGINS__INTERFACE__SOURCEOBJECT__H__ + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Plugins/CMakeLists.txt b/lib/cpPlugins/Plugins/CMakeLists.txt new file mode 100644 index 0000000..4ac902a --- /dev/null +++ b/lib/cpPlugins/Plugins/CMakeLists.txt @@ -0,0 +1,31 @@ +SET(LIBRARY_NAME cpPlugins) + +## =============== +## = Source code = +## =============== + +FILE(GLOB LIB_HEADERS_H "*.h") +FILE(GLOB LIB_HEADERS_HPP "*.hpp") +FILE(GLOB LIB_HEADERS_HXX "*.hxx") +FILE(GLOB LIB_SOURCES_C "*.c") +FILE(GLOB LIB_SOURCES_CPP "*.cpp") +FILE(GLOB LIB_SOURCES_CXX "*.cxx") + +## ===================== +## = Compilation rules = +## ===================== + +ADD_LIBRARY( + ${LIBRARY_NAME} + SHARED + ${LIB_SOURCES_C} + ${LIB_SOURCES_CPP} + ${LIB_SOURCES_CXX} + ) +TARGET_LINK_LIBRARIES( + ${LIBRARY_NAME} + cpPlugins_Interface + ${ITK_LIBRARIES} + ) + +## eof - $RCSfile$ diff --git a/lib/cpPlugins/Plugins/Host.cxx b/lib/cpPlugins/Plugins/Host.cxx new file mode 100644 index 0000000..b4cd940 --- /dev/null +++ b/lib/cpPlugins/Plugins/Host.cxx @@ -0,0 +1,14 @@ +#include +#include +#include + +/// TODO: doc +PLUMA_CONNECTOR +bool connect( pluma::Host& host ) +{ + host.add( new cpPlugins::Plugins::ImageReaderProvider( ) ); + host.add( new cpPlugins::Plugins::ImageWriterProvider( ) ); + return( true ); +} + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Plugins/ImageReader.cxx b/lib/cpPlugins/Plugins/ImageReader.cxx new file mode 100644 index 0000000..5bc182e --- /dev/null +++ b/lib/cpPlugins/Plugins/ImageReader.cxx @@ -0,0 +1,154 @@ +#include + +// TODO: interesting... #define ITK_MANUAL_INSTANTIATION +#include +#include +#include + +// ------------------------------------------------------------------------- +cpPlugins::Plugins::ImageReader:: +ImageReader( ) + : Superclass( ) +{ + this->m_DefaultParameters[ "FileName" ] = + TParameter( "string", "no_file_name" ); + this->m_DefaultParameters[ "PixelType" ] = TParameter( "type", "uchar" ); + this->m_DefaultParameters[ "ImageDimension" ] = TParameter( "int", "2" ); + this->m_DefaultParameters[ "IsColorImage" ] = TParameter( "bool", "0" ); +} + +// ------------------------------------------------------------------------- +cpPlugins::Plugins::ImageReader:: +~ImageReader( ) +{ +} + +// ------------------------------------------------------------------------- +std::string cpPlugins::Plugins::ImageReader:: +GetClassName( ) const +{ + return( "cpPlugins::Plugins::ImageReader" ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Plugins::ImageReader:: +Update( ) +{ + TParameters::const_iterator dIt; + + // Get image dimension + dIt = this->m_Parameters.find( "ImageDimension" ); + if( dIt == this->m_Parameters.end( ) ) + dIt = this->m_DefaultParameters.find( "ImageDimension" ); + + bool ret = false; + if ( dIt->second.second == "1" ) ret = this->_Update0< 1 >( ); + else if( dIt->second.second == "2" ) ret = this->_Update0< 2 >( ); + else if( dIt->second.second == "3" ) ret = this->_Update0< 3 >( ); + else if( dIt->second.second == "4" ) ret = this->_Update0< 4 >( ); + + return( ret ); +} + +// ------------------------------------------------------------------------- +template< unsigned int D > +bool cpPlugins::Plugins::ImageReader:: +_Update0( ) +{ + TParameters::const_iterator tIt, cIt; + + // Get image pixelType + tIt = this->m_Parameters.find( "PixelType" ); + if( tIt == this->m_Parameters.end( ) ) + tIt = this->m_DefaultParameters.find( "PixelType" ); + cIt = this->m_Parameters.find( "IsColorImage" ); + if( cIt == this->m_Parameters.end( ) ) + cIt = this->m_DefaultParameters.find( "IsColorImage" ); + + bool ret = false; + if( cIt->second.second == "0" ) + { + if( tIt->second.second == "char" ) + ret = this->_Update1< char, D >( ); + else if( tIt->second.second == "short" ) + ret = this->_Update1< short, D >( ); + else if( tIt->second.second == "int" ) + ret = this->_Update1< int, D >( ); + else if( tIt->second.second == "long" ) + ret = this->_Update1< long, D >( ); + else if( tIt->second.second == "uchar" ) + ret = this->_Update1< unsigned char, D >( ); + else if( tIt->second.second == "ushort" ) + ret = this->_Update1< unsigned short, D >( ); + else if( tIt->second.second == "uint" ) + ret = this->_Update1< unsigned int, D >( ); + else if( tIt->second.second == "ulong" ) + ret = this->_Update1< unsigned long, D >( ); + else if( tIt->second.second == "float" ) + ret = this->_Update1< float, D >( ); + else if( tIt->second.second == "double" ) + ret = this->_Update1< double, D >( ); + } + else if( cIt->second.second == "1" ) + { + if( tIt->second.second == "char" ) + ret = this->_Update1< itk::RGBPixel< char >, D >( ); + else if( tIt->second.second == "short" ) + ret = this->_Update1< itk::RGBPixel< short >, D >( ); + else if( tIt->second.second == "int" ) + ret = this->_Update1< itk::RGBPixel< int >, D >( ); + else if( tIt->second.second == "long" ) + ret = this->_Update1< itk::RGBPixel< long >, D >( ); + else if( tIt->second.second == "uchar" ) + ret = this->_Update1< itk::RGBPixel< unsigned char >, D >( ); + else if( tIt->second.second == "ushort" ) + ret = this->_Update1< itk::RGBPixel< unsigned short >, D >( ); + else if( tIt->second.second == "uint" ) + ret = this->_Update1< itk::RGBPixel< unsigned int >, D >( ); + else if( tIt->second.second == "ulong" ) + ret = this->_Update1< itk::RGBPixel< unsigned long >, D >( ); + else if( tIt->second.second == "float" ) + ret = this->_Update1< itk::RGBPixel< float >, D >( ); + else if( tIt->second.second == "double" ) + ret = this->_Update1< itk::RGBPixel< double >, D >( ); + } // fi + return( ret ); +} + +// ------------------------------------------------------------------------- +template< class P, unsigned int D > +bool cpPlugins::Plugins::ImageReader:: +_Update1( ) +{ + TParameters::const_iterator fIt; + + // Get image pixelType + fIt = this->m_Parameters.find( "FileName" ); + if( fIt == this->m_Parameters.end( ) ) + fIt = this->m_DefaultParameters.find( "FileName" ); + + typedef itk::Image< P, D > _TImage; + typedef itk::ImageFileReader< _TImage > _TImageReader; + + _TImageReader* reader = + dynamic_cast< _TImageReader* >( this->m_Reader.GetPointer( ) ); + if( reader == NULL ) + { + this->m_Reader = _TImageReader::New( ); + reader = dynamic_cast< _TImageReader* >( this->m_Reader.GetPointer( ) ); + + } // fi + reader->SetFileName( fIt->second.second ); + try + { + reader->Update( ); + } + catch( itk::ExceptionObject& err ) + { + return( false ); + + } // yrt + return( true ); +} + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Plugins/ImageReader.h b/lib/cpPlugins/Plugins/ImageReader.h new file mode 100644 index 0000000..6110c92 --- /dev/null +++ b/lib/cpPlugins/Plugins/ImageReader.h @@ -0,0 +1,52 @@ +#ifndef __CPPLUGINS__PLUGINS__IMAGEREADER__H__ +#define __CPPLUGINS__PLUGINS__IMAGEREADER__H__ + +#include +#include + +namespace cpPlugins +{ + namespace Plugins + { + /** + */ + class ImageReader + : public cpPlugins::Interface::SourceObject + { + public: + typedef ImageReader Self; + typedef cpPlugins::Interface::SourceObject Superclass; + + typedef Superclass::TParameter TParameter; + typedef Superclass::TParameters TParameters; + + public: + ImageReader( ); + virtual ~ImageReader( ); + + virtual std::string GetClassName( ) const; + + protected: + + virtual bool _GenerateData( ); + + template< unsigned int D > + bool _GenerateData0( ); + + template< class P, unsigned int D > + bool _GenerateData1( ); + + protected: + itk::ProcessObject::Pointer m_Reader; + }; + + // --------------------------------------------------------------------- + PLUMA_INHERIT_PROVIDER( ImageReader, cpPlugins::Interface::Object ); + + } // ecapseman + +} // ecapseman + +#endif // __CPPLUGINS__PLUGINS__IMAGEREADER__H__ + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Plugins/ImageWriter.cxx b/lib/cpPlugins/Plugins/ImageWriter.cxx new file mode 100644 index 0000000..3dd319a --- /dev/null +++ b/lib/cpPlugins/Plugins/ImageWriter.cxx @@ -0,0 +1,30 @@ +#include + +// ------------------------------------------------------------------------- +cpPlugins::Plugins::ImageWriter:: +ImageWriter( ) + : Superclass( ) +{ +} + +// ------------------------------------------------------------------------- +cpPlugins::Plugins::ImageWriter:: +~ImageWriter( ) +{ +} + +// ------------------------------------------------------------------------- +std::string cpPlugins::Plugins::ImageWriter:: +GetClassName( ) const +{ + return( "cpPlugins::Plugins::ImageWriter" ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Plugins::ImageWriter:: +Update( ) +{ + return( false ); +} + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Plugins/ImageWriter.h b/lib/cpPlugins/Plugins/ImageWriter.h new file mode 100644 index 0000000..af80058 --- /dev/null +++ b/lib/cpPlugins/Plugins/ImageWriter.h @@ -0,0 +1,39 @@ +#ifndef __CPPLUGINS__PLUGINS__IMAGEWRITER__H__ +#define __CPPLUGINS__PLUGINS__IMAGEWRITER__H__ + +#include + +namespace cpPlugins +{ + namespace Plugins + { + /** + */ + class ImageWriter + : public cpPlugins::Interface::SourceObject + { + public: + typedef ImageWriter Self; + typedef cpPlugins::Interface::SourceObject Superclass; + + typedef Superclass::TParameter TParameter; + typedef Superclass::TParameters TParameters; + + public: + ImageWriter( ); + virtual ~ImageWriter( ); + + virtual std::string GetClassName( ) const; + virtual bool Update( ); + }; + + // --------------------------------------------------------------------- + PLUMA_INHERIT_PROVIDER( ImageWriter, cpPlugins::Interface::Object ); + + } // ecapseman + +} // ecapseman + +#endif // __CPPLUGINS__PLUGINS__IMAGEWRITER__H__ + +// eof - $RCSfile$ diff --git a/lib/third_party/CMakeLists.txt b/lib/third_party/CMakeLists.txt new file mode 100644 index 0000000..1dd3f14 --- /dev/null +++ b/lib/third_party/CMakeLists.txt @@ -0,0 +1,5 @@ +SUBDIRS( + Pluma + ) + +## eof - $RCSfile$ diff --git a/lib/third_party/Pluma/CMakeLists.txt b/lib/third_party/Pluma/CMakeLists.txt new file mode 100644 index 0000000..9f936e1 --- /dev/null +++ b/lib/third_party/Pluma/CMakeLists.txt @@ -0,0 +1,30 @@ +SET(LIBRARY_NAME cpPlugins_Pluma) + +## =============== +## = Source code = +## =============== + +FILE(GLOB LIB_HEADERS_H "*.h") +FILE(GLOB LIB_HEADERS_HPP "*.hpp") +FILE(GLOB LIB_HEADERS_HXX "*.hxx") +FILE(GLOB LIB_SOURCES_C "*.c") +FILE(GLOB LIB_SOURCES_CPP "*.cpp") +FILE(GLOB LIB_SOURCES_CXX "*.cxx") + +## ===================== +## = Compilation rules = +## ===================== + +ADD_LIBRARY( + ${LIBRARY_NAME} + SHARED + ${LIB_SOURCES_C} + ${LIB_SOURCES_CPP} + ${LIB_SOURCES_CXX} + ) +TARGET_LINK_LIBRARIES( + ${LIBRARY_NAME} + dl + ) + +## eof - $RCSfile$ diff --git a/lib/third_party/Pluma/Config.hpp b/lib/third_party/Pluma/Config.hpp new file mode 100644 index 0000000..efd98c9 --- /dev/null +++ b/lib/third_party/Pluma/Config.hpp @@ -0,0 +1,141 @@ +//////////////////////////////////////////////////////////// +// +// Pluma - Plug-in Management Framework +// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +// +// Based on SFML configuration header +// SFML Config.hpp: +// http://www.sfml-dev.org/documentation/2.0/Config_8hpp-source.htm +// +// Acknowledgements to Simple and Fast Multimedia Library +// http://www.sfml-dev.org/ +// +//////////////////////////////////////////////////////////// + + +#ifndef PLUMA_CONFIG_HPP +#define PLUMA_CONFIG_HPP + + +//////////////////////////////////////////////////////////// +// Identify the operating system +//////////////////////////////////////////////////////////// +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) + + // Windows + #define PLUMA_SYS_WINDOWS + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #ifndef NOMINMAX + #define NOMINMAX + #endif + +#elif defined(linux) || defined(__linux) + + // Linux + #define PLUMA_SYS_LINUX + +#elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh) + + // MacOS + #define PLUMA_SYS_MACOS + +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + + // FreeBSD + #define PLUMA_SYS_FREEBSD + +#else + + // Unsupported system + #error This operating system is not supported by this library + +#endif + + + +//////////////////////////////////////////////////////////// +// Define library file extension based on OS +//////////////////////////////////////////////////////////// +#ifdef PLUMA_SYS_WINDOWS + #define PLUMA_LIB_EXTENSION "dll" +#elif defined(PLUMA_SYS_MACOS) + #define PLUMA_LIB_EXTENSION "dylib" +#elif defined(PLUMA_SYS_LINUX) || defined(PLUMA_SYS_FREEBSD) + #define PLUMA_LIB_EXTENSION "so" +#else + // unknown library file type + #error Unknown library file extension for this operating system +#endif + + +//////////////////////////////////////////////////////////// +// Define portable import / export macros +//////////////////////////////////////////////////////////// +#if defined(PLUMA_SYS_WINDOWS) + + #ifndef PLUMA_STATIC + + // Windows platforms + #ifdef PLUMA_EXPORTS + + // From DLL side, we must export + #define PLUMA_API __declspec(dllexport) + + #else + + // From client application side, we must import + #define PLUMA_API __declspec(dllimport) + + #endif + + // For Visual C++ compilers, we also need to turn off this annoying C4251 warning. + // You can read lots ot different things about it, but the point is the code will + // just work fine, and so the simplest way to get rid of this warning is to disable it + #ifdef _MSC_VER + + #pragma warning(disable : 4251) + + #endif + + #else + + // No specific directive needed for static build + #define PLUMA_API + + #endif + +#else + + // Other platforms don't need to define anything + #define PLUMA_API + +#endif + + + + +#endif // PLUMA_CONFIG_HPP diff --git a/lib/third_party/Pluma/Connector.hpp b/lib/third_party/Pluma/Connector.hpp new file mode 100644 index 0000000..3c227e7 --- /dev/null +++ b/lib/third_party/Pluma/Connector.hpp @@ -0,0 +1,86 @@ +//////////////////////////////////////////////////////////// +// +// Pluma - Plug-in Management Framework +// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef PLUMA_CONNECTOR_HPP +#define PLUMA_CONNECTOR_HPP + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include + + +///////////////////////////////////////////////////////////////// +// Define portable import/export macros for Plugin registration +///////////////////////////////////////////////////////////////// +#if defined(PLUMA_SYS_WINDOWS) + + #ifndef PLUMA_STATIC_PLUGIN + + // Windows platforms + #ifndef PLUGIN_IMPORTS + + // From DLL side, we must export + #ifdef __cplusplus + #define PLUMA_CONNECTOR extern "C" __declspec(dllexport) + #else + #define PLUMA_CONNECTOR __declspec(dllexport) + #endif + + #else + + // From client application side, we must import + #ifdef __cplusplus + #define PLUMA_CONNECTOR extern "C" __declspec(dllimport) + #else + #define PLUMA_CONNECTOR __declspec(dllimport) + #endif + + #endif + + #else + + // Only define the extern "C" for static build + #ifdef __cplusplus + #define PLUMA_CONNECTOR extern "C" + #else + #define PLUMA_CONNECTOR + #endif + + #endif + +#else + + // Only define the extern "C" for other platforms + #ifdef __cplusplus + #define PLUMA_CONNECTOR extern "C" + #else + #define PLUMA_CONNECTOR + #endif + +#endif + + +#endif // PLUMA_CONNECTOR_HPP diff --git a/lib/third_party/Pluma/DLibrary.cpp b/lib/third_party/Pluma/DLibrary.cpp new file mode 100644 index 0000000..9b617db --- /dev/null +++ b/lib/third_party/Pluma/DLibrary.cpp @@ -0,0 +1,106 @@ +//////////////////////////////////////////////////////////// +// +// Pluma - Plug-in Management Framework +// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include +#include + + +namespace pluma{ + +//////////////////////////////////////////////////////////// +DLibrary* DLibrary::load(const std::string& path){ + if ( path.empty() ){ + fprintf(stderr, "Failed to load library: Empty path\n"); + return NULL; + } + void* handle = NULL; + + // load library - OS dependent operation + #ifdef PLUMA_SYS_WINDOWS + handle = ::LoadLibraryA(path.c_str()); + if (!handle){ + fprintf(stderr, "Failed to load library \"%s\".\n", path.c_str()); + return NULL; + } + #else + handle = ::dlopen(path.c_str(), RTLD_NOW); + if (!handle){ + const char* errorString = ::dlerror(); + fprintf(stderr, "Failed to load library \"%s\".", path.c_str()); + if(errorString) fprintf(stderr, " OS returned error: \"%s\".", errorString); + fprintf(stderr, "\n"); + return NULL; + } + #endif + // return a DLibrary with the DLL handle + return new DLibrary(handle); +} + + +//////////////////////////////////////////////////////////// +DLibrary::~DLibrary(){ + if (handle){ + #ifdef PLUMA_SYS_WINDOWS + ::FreeLibrary( (HMODULE)handle ); + #else + ::dlclose(handle); + #endif + } +} + + +//////////////////////////////////////////////////////////// +void* DLibrary::getSymbol(const std::string& symbol){ + if (!handle){ + fprintf(stderr, "Cannot inspect library symbols, library isn't loaded.\n"); + return NULL; + } + void* res; + #ifdef PLUMA_SYS_WINDOWS + res = (void*)(::GetProcAddress((HMODULE)handle, symbol.c_str())); + #else + res = (void*)(::dlsym(handle, symbol.c_str())); + #endif + if (!res){ + fprintf(stderr, "Library symbol \"%s\" not found.\n", symbol.c_str()); + return NULL; + } + return res; +} + + +//////////////////////////////////////////////////////////// +DLibrary::DLibrary(void* handle): + handle(handle) +{ + // Nothing to do +} + +} // namespace pluma + diff --git a/lib/third_party/Pluma/DLibrary.hpp b/lib/third_party/Pluma/DLibrary.hpp new file mode 100644 index 0000000..1bb9bac --- /dev/null +++ b/lib/third_party/Pluma/DLibrary.hpp @@ -0,0 +1,123 @@ +//////////////////////////////////////////////////////////// +// +// Pluma - Plug-in Management Framework +// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef PLUMA_DYNAMIC_LIBRARY_HPP +#define PLUMA_DYNAMIC_LIBRARY_HPP + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include + +// include OS dependent support for DLL +#ifdef PLUMA_SYS_WINDOWS + #include +#else + #include +#endif + + + +namespace pluma{ + +//////////////////////////////////////////////////////////// +/// \brief Manages a Dynamic Linking Library. +/// +//////////////////////////////////////////////////////////// +class DLibrary{ + + +public: + + //////////////////////////////////////////////////////////// + /// \brief Load a library. + /// + /// \param path Path to the library. + /// + /// \return Pointer to the loaded library, or NULL if failed. + /// + //////////////////////////////////////////////////////////// + static DLibrary* load(const std::string& path); + + //////////////////////////////////////////////////////////// + /// \brief Destructor. + /// + /// Close and free the opened library (if any). + /// + //////////////////////////////////////////////////////////// + ~DLibrary(); + + //////////////////////////////////////////////////////////// + /// \brief Get a symbol from the library. + /// + /// \param symbol Symbol that we're looking for. + /// + /// \return Pointer to what the symbol refers to, or NULL if + /// the symbol is not found. + /// + //////////////////////////////////////////////////////////// + void* getSymbol(const std::string& symbol); + + +private: + + //////////////////////////////////////////////////////////// + /// \brief Default constructor. + /// + /// Library instances cannot be created, use load instead. + /// + /// \see load + /// + //////////////////////////////////////////////////////////// + DLibrary(); + + //////////////////////////////////////////////////////////// + /// \brief Constructor via library handle. + /// + /// Used on load function. + /// + /// \see load + /// + //////////////////////////////////////////////////////////// + DLibrary(void* handle); + + + +//////////////////////////////////////////////////////////// +// Member data +//////////////////////////////////////////////////////////// + + +private: + + void* handle; ///< Library handle. + +}; + + +} // namespace pluma + + +#endif // PLUMA_DYNAMIC_LIBRARY_HPP diff --git a/lib/third_party/Pluma/Dir.cpp b/lib/third_party/Pluma/Dir.cpp new file mode 100644 index 0000000..860220e --- /dev/null +++ b/lib/third_party/Pluma/Dir.cpp @@ -0,0 +1,103 @@ +//////////////////////////////////////////////////////////// +// +// Pluma - Plug-in Management Framework +// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include +#include +#include + + +namespace pluma{ + +namespace dir{ + + +//////////////////////////////////////////////////////////// +void listFiles(std::list& list, const std::string& folder, const std::string& extension, bool recursive){ + DIR* dir; + DIR* subDir; + struct dirent *ent; + // try to open top folder + dir = opendir(folder.c_str()); + if (dir == NULL){ + // could not open directory + fprintf(stderr, "Could not open \"%s\" directory.\n", folder.c_str()); + return; + }else{ + // close, we'll process it next + closedir(dir); + } + // enqueue top folder + std::queue folders; + folders.push(folder); + + // run while has queued folders + while (!folders.empty()){ + std::string currFolder = folders.front(); + folders.pop(); + dir = opendir(currFolder.c_str()); + if (dir == NULL) continue; + // iterate through all the files and directories + while ((ent = readdir (dir)) != NULL) { + std::string name(ent->d_name); + // ignore "." and ".." directories + if ( name.compare(".") == 0 || name.compare("..") == 0) continue; + // add path to the file name + std::string path = currFolder; + path.append("/"); + path.append(name); + // check if it's a folder by trying to open it + subDir = opendir(path.c_str()); + if (subDir != NULL){ + // it's a folder: close, we can process it later + closedir(subDir); + if (recursive) folders.push(path); + }else{ + // it's a file + if (extension.empty()){ + list.push_back(path); + }else{ + // check file extension + size_t lastDot = name.find_last_of('.'); + std::string ext = name.substr(lastDot+1); + if (ext.compare(extension) == 0){ + // match + list.push_back(path); + } + } // endif (extension test) + } // endif (folder test) + } // endwhile (nextFile) + closedir(dir); + } // endwhile (queued folders) + +} // end listFiles + + +} // namespace dir + +} // namespace pluma diff --git a/lib/third_party/Pluma/Dir.hpp b/lib/third_party/Pluma/Dir.hpp new file mode 100644 index 0000000..a94c477 --- /dev/null +++ b/lib/third_party/Pluma/Dir.hpp @@ -0,0 +1,64 @@ +//////////////////////////////////////////////////////////// +// +// Pluma - Plug-in Management Framework +// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef PLUMA_DIRECTORY_HPP +#define PLUMA_DIRECTORY_HPP + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include +#include + + +namespace pluma{ + +namespace dir{ + +//////////////////////////////////////////////////////////// +/// \brief List files of a directory. +/// +/// \param list The output files list. +/// \param folder The folder where to search in +/// \param extension A file extension filter, +/// empty extension will match all files. +/// \param recursive If true it will list files in +/// sub directories as well. +/// +//////////////////////////////////////////////////////////// +void listFiles( + std::list& list, + const std::string& folder, + const std::string& extension = "", + bool recursive = false +); + + +} // namespace dir + +} // namespace pluma + + +#endif // PLUMA_DIRECTORY_HPP diff --git a/lib/third_party/Pluma/Host.cpp b/lib/third_party/Pluma/Host.cpp new file mode 100644 index 0000000..eb37c33 --- /dev/null +++ b/lib/third_party/Pluma/Host.cpp @@ -0,0 +1,179 @@ +//////////////////////////////////////////////////////////// +// +// Pluma - Plug-in Management Framework +// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include + + +namespace pluma{ + +//////////////////////////////////////////////////////////// +Host::Host(){ + // Nothing to do +} + + +//////////////////////////////////////////////////////////// +bool Host::add(Provider* provider){ + if (provider == NULL){ + fprintf(stderr, "Trying to add a null provider.\n"); + return false; + } + if (!validateProvider(provider)){ + delete provider; + return false; + } + addRequests[ provider->plumaGetType() ].push_back(provider); + return true; +} + + +//////////////////////////////////////////////////////////// +Host::~Host(){ + clearProviders(); + // map frees itself +} + + +//////////////////////////////////////////////////////////// +void Host::clearProviders(){ + ProvidersMap::iterator it; + for (it = knownTypes.begin() ; it != knownTypes.end() ; ++it){ + std::list& providers = it->second.providers; + std::list::iterator provIt; + for (provIt = providers.begin() ; provIt != providers.end() ; ++provIt){ + delete *provIt; + } + std::list().swap(providers); + } +} + + +//////////////////////////////////////////////////////////// +bool Host::knows(const std::string& type) const{ + return knownTypes.find(type) != knownTypes.end(); +} + + +//////////////////////////////////////////////////////////// +unsigned int Host::getVersion(const std::string& type) const{ + ProvidersMap::const_iterator it = knownTypes.find(type); + if (it != knownTypes.end()) + return it->second.version; + return 0; +} + + +//////////////////////////////////////////////////////////// +unsigned int Host::getLowestVersion(const std::string& type) const{ + ProvidersMap::const_iterator it = knownTypes.find(type); + if (it != knownTypes.end()) + return it->second.lowestVersion; + return 0; +} + + +//////////////////////////////////////////////////////////// +void Host::registerType(const std::string& type, unsigned int version, unsigned int lowestVersion){ + if (!knows(type)){ + ProviderInfo pi; + pi.version = version; + pi.lowestVersion = lowestVersion; + knownTypes[type] = pi; + } +} + + +//////////////////////////////////////////////////////////// +const std::list* Host::getProviders(const std::string& type) const{ + ProvidersMap::const_iterator it = knownTypes.find(type); + if (it != knownTypes.end()) + return &it->second.providers; + return NULL; +} + + +//////////////////////////////////////////////////////////// +bool Host::validateProvider(Provider* provider) const{ + const std::string& type = provider->plumaGetType(); + if ( !knows(type) ){ + fprintf(stderr, "%s provider type isn't registered.\n", type.c_str()); + return false; + } + if (!provider->isCompatible(*this)){ + fprintf(stderr, "Incompatible %s provider version.\n", type.c_str()); + return false; + } + return true; +} + + +//////////////////////////////////////////////////////////// +bool Host::registerProvider(Provider* provider){ + if (!validateProvider(provider)){ + delete provider; + return false; + } + knownTypes[ provider->plumaGetType() ].providers.push_back(provider); + return true; +} + + +//////////////////////////////////////////////////////////// +void Host::cancelAddictions(){ + TempProvidersMap::iterator it; + for( it = addRequests.begin() ; it != addRequests.end() ; ++it){ + std::list lst = it->second; + std::list::iterator providerIt; + for (providerIt = lst.begin() ; providerIt != lst.end() ; ++providerIt){ + delete *providerIt; + } + } + // clear map + TempProvidersMap().swap(addRequests); +} + + +//////////////////////////////////////////////////////////// +bool Host::confirmAddictions(){ + if (addRequests.empty()) return false; + TempProvidersMap::iterator it; + for( it = addRequests.begin() ; it != addRequests.end() ; ++it){ + std::list lst = it->second; + std::list::iterator providerIt; + for (providerIt = lst.begin() ; providerIt != lst.end() ; ++providerIt){ + knownTypes[it->first].providers.push_back(*providerIt); + } + } + // clear map + TempProvidersMap().swap(addRequests); + return true; +} + + +} //namespace pluma diff --git a/lib/third_party/Pluma/Host.hpp b/lib/third_party/Pluma/Host.hpp new file mode 100644 index 0000000..cf049f5 --- /dev/null +++ b/lib/third_party/Pluma/Host.hpp @@ -0,0 +1,212 @@ +//////////////////////////////////////////////////////////// +// +// Pluma - Plug-in Management Framework +// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef PLUMA_HOST_HPP +#define PLUMA_HOST_HPP + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include + +#include +#include +#include + +namespace pluma{ + +//////////////////////////////////////////////////////////// +/// \brief Manages providers. +/// +//////////////////////////////////////////////////////////// +class PLUMA_API Host{ +friend class PluginManager; +friend class Provider; + + +public: + + //////////////////////////////////////////////////////////// + /// \brief Add provider. + /// + /// Provider type and version are checked. Only known and + /// valid provider types are accepted. + /// + /// \param provider Provider to be added. + /// + /// \return True if the provider is accepted. + /// + //////////////////////////////////////////////////////////// + bool add(Provider* provider); + + +private: + + //////////////////////////////////////////////////////////// + /// \brief Default constructor. + /// + /// New Host instances are not publicly allowed. + /// + //////////////////////////////////////////////////////////// + Host(); + + //////////////////////////////////////////////////////////// + /// \brief Destructor. + /// + /// Clears all hosted providers + /// + //////////////////////////////////////////////////////////// + ~Host(); + + //////////////////////////////////////////////////////////// + /// \brief Ckeck if a provider type is registered. + /// + /// \param type Provider type id. + /// + /// \return True if the type is registered + /// + //////////////////////////////////////////////////////////// + bool knows(const std::string& type) const; + + //////////////////////////////////////////////////////////// + /// \brief Get version of a type of providers. + /// + /// \param type Provider type. + /// + /// \return The version of the provider type. + /// + //////////////////////////////////////////////////////////// + unsigned int getVersion(const std::string& type) const; + + //////////////////////////////////////////////////////////// + /// \brief Get lowest compatible version of a type of providers. + /// + /// \param type Provider type. + /// + /// \return The lowest compatible version of the provider type. + /// + //////////////////////////////////////////////////////////// + unsigned int getLowestVersion(const std::string& type) const; + + //////////////////////////////////////////////////////////// + /// \brief Register a type of providers. + /// + /// \param type Provider type. + /// \param version Current version of that provider type. + /// \param lowestVersion Lowest compatible version of that provider type. + /// + //////////////////////////////////////////////////////////// + void registerType(const std::string& type, unsigned int version, unsigned int lowestVersion); + + //////////////////////////////////////////////////////////// + /// \brief Get providers of a certain type. + /// + /// \param type Provider type. + /// + /// \return Pointer to the list of providers of that \a type, + /// or NULL if \a type is not registered. + /// + //////////////////////////////////////////////////////////// + const std::list* getProviders(const std::string& type) const; + + //////////////////////////////////////////////////////////// + /// \brief Clears all hosted providers. + /// + //////////////////////////////////////////////////////////// + void clearProviders(); + + //////////////////////////////////////////////////////////// + /// \brief Validate provider type and version. + /// + /// \return True if the provider is acceptable. + /// + //////////////////////////////////////////////////////////// + bool validateProvider(Provider* provider) const; + + //////////////////////////////////////////////////////////// + /// \brief Clearly add a provider. + /// + /// Provider type and version are checked. Only known and + /// valid provider types are accepted. + /// If acepted, provider is directly stored. + /// + /// \param provider Provider to be added. + /// + /// \return True if the provider is accepted. + /// + //////////////////////////////////////////////////////////// + bool registerProvider(Provider* provider); + + //////////////////////////////////////////////////////////// + /// \brief Previous add calls are canceled. + /// + /// Added providers are not stored. + /// + /// \see add + /// + //////////////////////////////////////////////////////////// + void cancelAddictions(); + + //////////////////////////////////////////////////////////// + /// \brief Previous add calls are confirmed. + /// + /// Added providers are finally stored. + /// + /// \return True if something was stored. + /// + /// \see add + /// + //////////////////////////////////////////////////////////// + bool confirmAddictions(); + + + +//////////////////////////////////////////////////////////// +// Member data +//////////////////////////////////////////////////////////// + +private: + + //////////////////////////////////////////////////////////// + /// \brief Structure with information about a provider type. + /// + //////////////////////////////////////////////////////////// + struct ProviderInfo{ + unsigned int version; + unsigned int lowestVersion; + std::list providers; + }; + + typedef std::map ProvidersMap; + typedef std::map > TempProvidersMap; + + ProvidersMap knownTypes; ///< Map of registered types. + TempProvidersMap addRequests; ///< Temporarily added providers + +}; + +} // namespace pluma + +#endif // PLUMA_HOST_HPP diff --git a/lib/third_party/Pluma/PluginManager.cpp b/lib/third_party/Pluma/PluginManager.cpp new file mode 100644 index 0000000..1124505 --- /dev/null +++ b/lib/third_party/Pluma/PluginManager.cpp @@ -0,0 +1,201 @@ +//////////////////////////////////////////////////////////// +// +// Pluma - Plug-in Management Framework +// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include +#include +#include + +namespace pluma{ + +//////////////////////////////////////////////////////////// +PluginManager::PluginManager(){ + // Nothing to do +} + + +//////////////////////////////////////////////////////////// +PluginManager::~PluginManager(){ + unloadAll(); +} + + +//////////////////////////////////////////////////////////// +bool PluginManager::load(const std::string& path){ + std::string plugName = getPluginName(path); + std::string realPath = resolvePathExtension(path); + DLibrary* lib = DLibrary::load(realPath); + if (!lib) return false; + + fnRegisterPlugin* registerFunction; + registerFunction = reinterpret_cast(lib->getSymbol("connect")); + + if(!registerFunction){ + fprintf(stderr, "Failed to initialize plugin \"%s\": connect function not found\n", plugName.c_str()); + delete lib; + return false; + } + // try to initialize plugin: + if (!registerFunction(host)){ + // plugin decided to fail + fprintf(stderr, "Self registry failed on plugin \"%s\".\n", plugName.c_str()); + host.cancelAddictions(); + delete lib; + return false; + } + // Store the library if addictions are confirmed + if (host.confirmAddictions()) + libraries[plugName] = lib; + else{ + // otherwise nothing was registered + fprintf(stderr, "Nothing registered by plugin \"%s\".\n", plugName.c_str()); + delete lib; + return false; + } + return true; +} + + +//////////////////////////////////////////////////////////// +bool PluginManager::load(const std::string& folder, const std::string& pluginName){ + if (folder.empty()) + return load(pluginName); + else if (folder[folder.size()-1] == '/' || folder[folder.size()-1] == '\\') + return load(folder + pluginName); + return load(folder + '/' + pluginName); +} + + +//////////////////////////////////////////////////////////// +int PluginManager::loadFromFolder(const std::string& folder, bool recursive){ + std::list files; + dir::listFiles(files, folder, PLUMA_LIB_EXTENSION, recursive); + // try to load every library + int res = 0; + std::list::const_iterator it; + for (it = files.begin() ; it != files.end() ; ++it){ + if ( load(*it) ) ++res; + } + return res; +} + + +//////////////////////////////////////////////////////////// +bool PluginManager::unload(const std::string& pluginName){ + std::string plugName = getPluginName(pluginName); + LibMap::iterator it = libraries.find(plugName); + if( it != libraries.end() ) { + delete it->second; + libraries.erase(it); + return true; + } + return false; +} + + +//////////////////////////////////////////////////////////// +void PluginManager::unloadAll(){ + + host.clearProviders(); + LibMap::iterator it; + for (it = libraries.begin() ; it != libraries.end() ; ++it){ + delete it->second; + } + libraries.clear(); +} + + +//////////////////////////////////////////////////////////// +std::string PluginManager::getPluginName(const std::string& path){ + size_t lastDash = path.find_last_of("/\\"); + size_t lastDot = path.find_last_of('.'); + if (lastDash == std::string::npos) lastDash = 0; + else ++lastDash; + if (lastDot < lastDash || lastDot == std::string::npos){ + // path without extension + lastDot = path.length(); + } + return path.substr(lastDash, lastDot-lastDash); +} + + +//////////////////////////////////////////////////////////// +std::string PluginManager::resolvePathExtension(const std::string& path){ + size_t lastDash = path.find_last_of("/\\"); + size_t lastDot = path.find_last_of('.'); + if (lastDash == std::string::npos) lastDash = 0; + else ++lastDash; + if (lastDot < lastDash || lastDot == std::string::npos){ + // path without extension, add it + return path + "." + PLUMA_LIB_EXTENSION; + } + return path; +} + + +//////////////////////////////////////////////////////////// +void PluginManager::registerType(const std::string& type, unsigned int version, unsigned int lowestVersion){ + host.registerType(type, version, lowestVersion); +} + + +//////////////////////////////////////////////////////////// +bool PluginManager::addProvider(Provider* provider){ + if (provider == NULL){ + fprintf(stderr, "Trying to add null provider\n"); + return false; + } + return host.registerProvider(provider); +} + + +//////////////////////////////////////////////////////////// +void PluginManager::getLoadedPlugins(std::vector& pluginNames) const{ + pluginNames.reserve(pluginNames.size()+libraries.size()); + LibMap::const_iterator it; + for(it = libraries.begin() ; it != libraries.end() ; ++it){ + pluginNames.push_back(&(it->first)); + } +} + + +//////////////////////////////////////////////////////////// +bool PluginManager::isLoaded(const std::string& pluginName) const{ + return libraries.find(getPluginName(pluginName)) != libraries.end(); +} + + +//////////////////////////////////////////////////////////// +const std::list* PluginManager::getProviders(const std::string& type) const{ + return host.getProviders(type); +} + + + +} // namespace pluma + diff --git a/lib/third_party/Pluma/PluginManager.hpp b/lib/third_party/Pluma/PluginManager.hpp new file mode 100644 index 0000000..e5ddf06 --- /dev/null +++ b/lib/third_party/Pluma/PluginManager.hpp @@ -0,0 +1,245 @@ +//////////////////////////////////////////////////////////// +// +// Pluma - Plug-in Management Framework +// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef PLUMA_PLUGIN_MANAGER_HPP +#define PLUMA_PLUGIN_MANAGER_HPP + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include + +#include +#include + +namespace pluma{ +class DLibrary; + +//////////////////////////////////////////////////////////// +/// \brief Manages loaded plugins. +/// +//////////////////////////////////////////////////////////// +class PLUMA_API PluginManager{ + + +public: + + //////////////////////////////////////////////////////////// + /// \brief Destructor. + /// + //////////////////////////////////////////////////////////// + ~PluginManager(); + + //////////////////////////////////////////////////////////// + /// \brief Load a plugin given it's path + /// + /// \param path Path for the plugin, including plugin name. File extension + /// may be included, but is discouraged for better cross platform code. + /// If file extension isn't present on the path, Pluma will deduce it + /// from the operating system. + /// + /// \return True if the plugin is successfully loaded. + /// + /// \see load(const std::string&, const std::string&) + /// \see loadFromFolder + /// \see unload + /// \see unloadAll + /// + //////////////////////////////////////////////////////////// + bool load(const std::string& path); + + + //////////////////////////////////////////////////////////// + /// \brief Load a plugin from a given folder + /// + /// \param folder The folder path. + /// \param pluginName Name of the plugin. File extension + /// may be included, but is discouraged for better cross platform code. + /// If file extension is omitted, Pluma will deduce it + /// from the operating system. + /// + /// \return True if the plugin is successfully loaded. + /// + /// \see load(const std::string&) + /// \see loadFromFolder + /// \see unload + /// \see unloadAll + /// + //////////////////////////////////////////////////////////// + bool load(const std::string& folder, const std::string& pluginName); + + //////////////////////////////////////////////////////////// + /// \brief Load all plugins from a given folder + /// + /// \param folder Path for the folder where the plug-ins are. + /// \param recursive If true it will search on sub-folders as well + /// + /// \return Number of successfully loaded plug-ins. + /// + /// \see load(const std::string&, const std::string&) + /// \see load(const std::string&) + /// \see unload + /// \see unloadAll + /// + //////////////////////////////////////////////////////////// + int loadFromFolder(const std::string& folder, bool recursive = false); + + //////////////////////////////////////////////////////////// + /// \brief Unload a plugin. + /// + /// \param pluginName Name or path of the plugin. + /// + /// \return True if the plugin is successfully unloaded, + /// false if no such plugin exists on the manager. + /// + /// \see load(const std::string&, const std::string&) + /// \see load(const std::string&) + /// \see loadFromFolder + /// \see unloadAll + /// + //////////////////////////////////////////////////////////// + bool unload(const std::string& pluginName); + + //////////////////////////////////////////////////////////// + /// \brief Unload all loaded plugins. + /// + /// \see load(const std::string&, const std::string&) + /// \see load(const std::string&) + /// \see loadFromFolder + /// \see unload + /// + //////////////////////////////////////////////////////////// + void unloadAll(); + + //////////////////////////////////////////////////////////// + /// \brief Directly add a new provider. + /// + /// \param provider Provider. + /// + //////////////////////////////////////////////////////////// + bool addProvider(Provider* provider); + + //////////////////////////////////////////////////////////// + /// \brief Get the name of all loaded plugins. + /// + /// \param pluginNames A vector to fill with the plugins names. + /// + //////////////////////////////////////////////////////////// + void getLoadedPlugins(std::vector& pluginNames) const; + + //////////////////////////////////////////////////////////// + /// \brief Check if a plug-in is loaded. + /// + /// \param pluginName the plug-in tname o check. + /// + //////////////////////////////////////////////////////////// + bool isLoaded(const std::string& pluginName) const; + + +protected: + + //////////////////////////////////////////////////////////// + /// \brief Default constructor. + /// + /// PluginManager cannot be publicly instantiated. + /// + //////////////////////////////////////////////////////////// + PluginManager(); + + //////////////////////////////////////////////////////////// + /// \brief Register a provider type + /// + /// \param type Provider type. + /// \param version Current version of that provider type. + /// \param lowestVersion Lowest compatible version of that provider type. + /// + /// \see Host::registerType + /// + //////////////////////////////////////////////////////////// + void registerType(const std::string& type, unsigned int version, unsigned int lowestVersion); + + //////////////////////////////////////////////////////////// + /// \brief Get providers of a certain type. + /// + /// \param type Provider type. + /// + /// \return Pointer to the list of providers of that \a type, + /// or NULL if \a type is not registered. + /// + /// \see Host::getProviders + /// + //////////////////////////////////////////////////////////// + const std::list* getProviders(const std::string& type) const; + + +private: + + //////////////////////////////////////////////////////////// + /// \brief Get the plugin name (without extension) from its path + /// + /// \param path Plugin path. + /// + /// \return Name of the plugin. + /// + /// \see resolvePathExtension + /// \see load(const std::string&, const std::string&) + /// \see load(const std::string&) + /// \see unload + /// + //////////////////////////////////////////////////////////// + static std::string getPluginName(const std::string& path); + + //////////////////////////////////////////////////////////// + /// \brief If the plugin path omits it's extension, this method returns + /// the path plus the OS specific dll extension. + /// Return a copy of the path otherwise. + /// + /// \param path Plugin path. + /// + /// \return Path with extension. + /// + /// \see getPluginName + /// \see load(const std::string&, const std::string&) + /// \see load(const std::string&) + /// \see unload + /// + //////////////////////////////////////////////////////////// + static std::string resolvePathExtension(const std::string& path); + + +private: + + /// Signature for the plugin's registration function + typedef bool fnRegisterPlugin(Host&); + typedef std::map LibMap; + + LibMap libraries; ///< Map containing the loaded libraries + Host host; ///< Host app proxy, holding all providers + +}; + +} // namespace pluma + +#endif // PLUMA_PLUGIN_MANAGER_HPP diff --git a/lib/third_party/Pluma/Pluma.hpp b/lib/third_party/Pluma/Pluma.hpp new file mode 100644 index 0000000..a9d614e --- /dev/null +++ b/lib/third_party/Pluma/Pluma.hpp @@ -0,0 +1,171 @@ +//////////////////////////////////////////////////////////// +// +// Pluma - Plug-in Management Framework +// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef PLUMA_PLUMA_HPP +#define PLUMA_PLUMA_HPP + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include +#include + +//////////////////////////////////////////////////////////// +// Andy macro to convert parameter to string +//////////////////////////////////////////////////////////// +#define PLUMA_2STRING(X) #X + +//////////////////////////////////////////////////////////// +// Macro that helps host applications defining +// their provider classes +//////////////////////////////////////////////////////////// +#define PLUMA_PROVIDER_HEADER(TYPE)\ +PLUMA_PROVIDER_HEADER_BEGIN(TYPE)\ +virtual TYPE* create() const = 0;\ +PLUMA_PROVIDER_HEADER_END + +//////////////////////////////////////////////////////////// +// Macro that generate first part of the provider definition +//////////////////////////////////////////////////////////// +#define PLUMA_PROVIDER_HEADER_BEGIN(TYPE)\ +class TYPE##Provider: public pluma::Provider{\ +private:\ + friend class pluma::Pluma;\ + static const unsigned int PLUMA_INTERFACE_VERSION;\ + static const unsigned int PLUMA_INTERFACE_LOWEST_VERSION;\ + static const std::string PLUMA_PROVIDER_TYPE;\ + std::string plumaGetType() const{ return PLUMA_PROVIDER_TYPE; }\ +public:\ + unsigned int getVersion() const{ return PLUMA_INTERFACE_VERSION; } + +//////////////////////////////////////////////////////////// +// Macro that generate last part of the provider definition +//////////////////////////////////////////////////////////// +#define PLUMA_PROVIDER_HEADER_END }; + +//////////////////////////////////////////////////////////// +// Macro that generate the provider declaration +//////////////////////////////////////////////////////////// +#define PLUMA_PROVIDER_SOURCE(TYPE, Version, LowestVersion)\ +const std::string TYPE##Provider::PLUMA_PROVIDER_TYPE = PLUMA_2STRING( TYPE );\ +const unsigned int TYPE##Provider::PLUMA_INTERFACE_VERSION = Version;\ +const unsigned int TYPE##Provider::PLUMA_INTERFACE_LOWEST_VERSION = LowestVersion; + + +//////////////////////////////////////////////////////////// +// Macro that helps plugins generating their provider implementations +// PRE: SPECIALIZED_TYPE must inherit from BASE_TYPE +//////////////////////////////////////////////////////////// +#define PLUMA_INHERIT_PROVIDER(SPECIALIZED_TYPE, BASE_TYPE)\ +class SPECIALIZED_TYPE##Provider: public BASE_TYPE##Provider{\ +public:\ + BASE_TYPE * create() const{ return new SPECIALIZED_TYPE (); }\ +}; + + +namespace pluma{ + +//////////////////////////////////////////////////////////// +/// \brief Pluma plugins management +/// +//////////////////////////////////////////////////////////// +class Pluma: public PluginManager{ + +public: + //////////////////////////////////////////////////////////// + /// \brief Default Constructor + /// + //////////////////////////////////////////////////////////// + Pluma(); + + //////////////////////////////////////////////////////////// + /// \brief Tell Pluma to accept a certain type of providers + /// + /// A Pluma object is able to accept multiple types of providers. + /// When a plugin is loaded, it tries to register it's providers + /// implementations. Those are only accepted by the host + /// application if it's accepting providers of that kind. + /// + /// \tparam ProviderType type of provider. + /// + //////////////////////////////////////////////////////////// + template + void acceptProviderType(); + + //////////////////////////////////////////////////////////// + /// \brief Get the stored providers of a certain type. + /// + /// Providers are added at the end of the \a providers vector. + /// + /// \tparam ProviderType type of provider to be returned. + /// \param[out] providers Vector to fill with the existing + /// providers. + /// + //////////////////////////////////////////////////////////// + template + void getProviders(std::vector& providers); +}; + +#include + +} + + +#endif // PLUMA_PLUMA_HPP + + +//////////////////////////////////////////////////////////// +/// \class pluma::Pluma +/// +/// Pluma is the main class of Pluma library. Allows hosting +/// applications to load/unload dlls in runtime (plugins), and +/// to get providers of shared interface objects. +/// +/// Example: +/// \code +/// pluma::Pluma pluma; +/// // Tell it to accept providers of the type DeviceProvider +/// pluma.acceptProviderType(); +/// // Load some dll +/// pluma.load("plugins/standard_devices"); +/// // Get device providers into a vector +/// std::vector providers; +/// pluma.getProviders(providers); +/// // create a Device from the first provider +/// if (!providers.empty()){ +/// Device* myDevice = providers.first()->create(); +/// // do something with myDevice +/// std::cout << device->getDescription() << std::endl; +/// // (...) +/// delete myDevice; +/// } +/// \endcode +/// +/// It is also possible to add local providers, providers that +/// are defined directly on the host application. That can +/// be useful to provide and use default implementations of certain +/// interfaces, along with plugin implementations. +/// +//////////////////////////////////////////////////////////// diff --git a/lib/third_party/Pluma/Pluma.inl b/lib/third_party/Pluma/Pluma.inl new file mode 100644 index 0000000..c3b6ce7 --- /dev/null +++ b/lib/third_party/Pluma/Pluma.inl @@ -0,0 +1,52 @@ +//////////////////////////////////////////////////////////// +// +// Pluma - Plug-in Management Framework +// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +inline Pluma::Pluma(){ + // Nothing to do +} + + +//////////////////////////////////////////////////////////// +template +void Pluma::acceptProviderType(){ + PluginManager::registerType( + ProviderType::PLUMA_PROVIDER_TYPE, + ProviderType::PLUMA_INTERFACE_VERSION, + ProviderType::PLUMA_INTERFACE_LOWEST_VERSION + ); +} + + +//////////////////////////////////////////////////////////// +template +void Pluma::getProviders(std::vector& providers){ + const std::list* lst = PluginManager::getProviders(ProviderType::PLUMA_PROVIDER_TYPE); + if (!lst) return; + providers.reserve(providers.size() + lst->size()); + std::list::const_iterator it; + for (it = lst->begin() ; it != lst->end() ; ++it) + providers.push_back(static_cast(*it)); +} diff --git a/lib/third_party/Pluma/Provider.cpp b/lib/third_party/Pluma/Provider.cpp new file mode 100644 index 0000000..36d4da3 --- /dev/null +++ b/lib/third_party/Pluma/Provider.cpp @@ -0,0 +1,52 @@ +//////////////////////////////////////////////////////////// +// +// Pluma - Plug-in Management Framework +// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include + + +namespace pluma{ + +//////////////////////////////////////////////////////////// +Provider::~Provider(){ + // Nothing to do +} + + +//////////////////////////////////////////////////////////// +bool Provider::isCompatible(const Host& host) const{ + // check compatibility with host + const std::string& type = this->plumaGetType(); + if (!host.knows(type)) return false; + unsigned int lowest = host.getLowestVersion(type); + unsigned int current = host.getVersion(type); + unsigned int myVersion = this->getVersion(); + return lowest <= myVersion && myVersion <= current; +} + +} // namespace pluma diff --git a/lib/third_party/Pluma/Provider.hpp b/lib/third_party/Pluma/Provider.hpp new file mode 100644 index 0000000..ea06497 --- /dev/null +++ b/lib/third_party/Pluma/Provider.hpp @@ -0,0 +1,204 @@ +//////////////////////////////////////////////////////////// +// +// Pluma - Plug-in Management Framework +// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com) +// +// This software is provided 'as-is', without any express or implied warranty. +// In no event will the authors be held liable for any damages arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it freely, +// subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; +// you must not claim that you wrote the original software. +// If you use this software in a product, an acknowledgment +// in the product documentation would be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, +// and must not be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source distribution. +// +//////////////////////////////////////////////////////////// + +#ifndef PLUMA_PROVIDER_HPP +#define PLUMA_PROVIDER_HPP + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include + + +namespace pluma{ +class Host; + +//////////////////////////////////////////////////////////// +/// \brief Interface to provide applications with objects from plugins. +/// +//////////////////////////////////////////////////////////// +class PLUMA_API Provider{ +friend class Host; + + +public: + + //////////////////////////////////////////////////////////// + /// \brief Destructor. + /// + //////////////////////////////////////////////////////////// + virtual ~Provider(); + + //////////////////////////////////////////////////////////// + /// \brief Get provider version. + /// + /// \return Version number. + /// + //////////////////////////////////////////////////////////// + virtual unsigned int getVersion() const = 0; + + //////////////////////////////////////////////////////////// + /// \brief Check compatibility with host. + /// + /// The same provider may be compiled with different versions + /// on host side and on plugins side. This function checks if + /// a plugin provider is compatible with the current version of + /// the same provider type on the host side. + /// + /// \param host Host, proxy of host application. + /// + /// \return True if it's compatible with \a host. + /// + //////////////////////////////////////////////////////////// + bool isCompatible(const Host& host) const; + + +private: + + //////////////////////////////////////////////////////////// + /// \brief Get provider type. + /// + /// Each provider defined on the host application is identified by + /// a unique type. Those types are automatically managed internally by + /// pluma. + /// + /// \return Provider type id. + /// + //////////////////////////////////////////////////////////// + virtual std::string plumaGetType() const = 0; + +}; + +} // namespace pluma + + +#endif // PLUMA_PROVIDER_HPP + + +//////////////////////////////////////////////////////////// +/// \class pluma::Provider +/// The plugin specific implementations are unknown at the host side, +/// only their shared interfaces are known. Then, host app needs a generic +/// way of create interface objects. That's what provider classes are for. +/// It is the factory design pattern +/// (http://www.oodesign.com/factory-pattern.html) +/// +/// Shared interfaces define their provider types (by inheriting from +/// pluma::Provider). Hosts then use those tipes to get objects from the +/// plugins. +/// Plugins derive the shared interface providers so that they can provide +/// host with specific implementations of the shared interface. +/// Those specific providers are given to the host through a connect function. +/// +/// +/// Example: A host app uses objects of type Device. A certain plugin +/// defines a Keyboard, witch is a Device. +/// The Host will use DeviceProviders to create objects of type Device. +/// The plugin will provide host specifically with a KeyboardProvider. +/// Other plugins may provide host with other derived DeviceProvider types. +/// +/// Device hpp (shared): +/// \code +/// #include +/// class Device{ +/// public: +/// virtual std::string getDescription() const = 0; +/// }; +/// // create DevicedProvider class +/// PLUMA_PROVIDER_HEADER(Device); +/// \endcode +/// +/// Device cpp (shared): +/// \code +/// #include "Device.hpp" +/// generate DevicedProvider with version 6, and compatible with at least v.3 +/// PLUMA_PROVIDER_SOURCE(Device, 6, 3); +/// \endcode +/// +/// +///
+/// Keyboard code on the plugin side: +/// \code +/// #include +/// #include "Device.hpp" +/// +/// class Keyboard: public Device{ +/// public: +/// std::string getDescription() const{ +/// return "keyboard"; +/// } +/// }; +/// +/// // create KeyboardProvider, it implements DeviceProvider +/// PLUMA_INHERIT_PROVIDER(Keyboard, Device); +/// \endcode +/// +/// plugin connector: +/// \code +/// #include +/// #include "Keyboard.hpp" +/// +/// PLUMA_CONNECTOR +/// bool connect(pluma::Host& host){ +/// // add a keyboard provider to host +/// host.add( new KeyboardProvider() ); +/// return true; +/// } +/// \endcode +/// +/// +/// Host application code: +/// \code +/// #include +/// +/// #include "Device.hpp" +/// #include +/// #include +/// +/// int main(){ +/// +/// pluma::Pluma plugins; +/// // Tell plugins manager to accept providers of the type DeviceProvider +/// plugins.acceptProviderType(); +/// // Load library "standard_devices" from folder "plugins" +/// plugins.load("plugins", "standard_devices"); +/// +/// // Get device providers into a vector +/// std::vector providers; +/// plugins.getProviders(providers); +/// +/// // create a Device from the first provider +/// if (!providers.empty()){ +/// Device* myDevice = providers.first()->create(); +/// // do something with myDevice +/// std::cout << device->getDescription() << std::endl; +/// // and delete it in the end +/// delete myDevice; +/// } +/// return 0; +/// } +/// \endcode +/// +//////////////////////////////////////////////////////////// diff --git a/lib/third_party/Pluma/readme b/lib/third_party/Pluma/readme new file mode 100644 index 0000000..eee7f36 --- /dev/null +++ b/lib/third_party/Pluma/readme @@ -0,0 +1,33 @@ +Pluma - Plug-in Management Framework + +1. About + + Pluma stands for PLUg-in MAnagement framework, and also for PLUg-in Minimal Architecture. + It's small, cross-platform and simple to use. Support and more information at http://pluma-framework.sourceforge.net + + + +2. Licence + + Source code is provided under the terms of the zlib/libpng License (http://www.opensource.org/licenses/zlib-license.php): + + Pluma - Plug-in Management Framework + Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com) + + This software is provided 'as-is', without any express or implied warranty. + In no event will the authors be held liable for any damages arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it freely, + subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; + you must not claim that you wrote the original software. + If you use this software in a product, an acknowledgment + in the product documentation would be appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, + and must not be misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. + diff --git a/lib/third_party/Pluma/uce-dirent.h b/lib/third_party/Pluma/uce-dirent.h new file mode 100644 index 0000000..ecf78eb --- /dev/null +++ b/lib/third_party/Pluma/uce-dirent.h @@ -0,0 +1,679 @@ +/* + * uce-dirent.h - operating system independent dirent implementation + * + * Copyright (C) 1998-2002 Toni Ronkko + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * ``Software''), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL TONI RONKKO BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * + * May 28 1998, Toni Ronkko + * + * $Id: uce-dirent.h,v 1.7 2002/05/13 10:48:35 tr Exp $ + * + * $Log: uce-dirent.h,v $ + * Revision 1.7 2002/05/13 10:48:35 tr + * embedded some source code directly to the header so that no source + * modules need to be included in the MS Visual C project using the + * interface, removed all the dependencies to other headers of the `uce' + * library so that the header can be made public + * + * Revision 1.6 2002/04/12 16:22:04 tr + * Unified Compiling Environment (UCE) replaced `std' library + * + * Revision 1.5 2001/07/20 16:33:40 tr + * moved to `std' library and re-named defines accordingly + * + * Revision 1.4 2001/07/10 16:47:18 tronkko + * revised comments + * + * Revision 1.3 2001/01/11 13:16:43 tr + * using ``uce-machine.h'' for finding out defines such as `FREEBSD' + * + * Revision 1.2 2000/10/08 16:00:41 tr + * copy of FreeBSD man page + * + * Revision 1.1 2000/07/10 05:53:16 tr + * Initial revision + * + * Revision 1.2 1998/07/19 18:29:14 tr + * Added error reporting capabilities and some asserts. + * + * Revision 1.1 1998/07/04 16:27:51 tr + * Initial revision + * + * + * MSVC 1.0 scans automatic dependencies incorrectly when your project + * contains this very header. The problem is that MSVC cannot handle + * include directives inside #if..#endif block those are never entered. + * Since this header ought to compile in many different operating systems, + * there had to be several conditional blocks that are compiled only in + * operating systems for what they were designed for. MSVC 1.0 cannot + * handle inclusion of sys/dir.h in a part that is compiled only in Apollo + * operating system. To fix the problem you need to insert DIR.H into + * SYSINCL.DAT located in MSVC\BIN directory and restart visual C++. + * Consult manuals for more informaton about the problem. + * + * Since many UNIX systems have dirent.h we assume to have one also. + * However, if your UNIX system does not have dirent.h you can download one + * for example at: http://ftp.uni-mannheim.de/ftp/GNU/dirent/dirent.tar.gz. + * You can also see if you have one of dirent.h, direct.h, dir.h, ndir.h, + * sys/dir.h and sys/ndir.h somewhere. Try defining HAVE_DIRENT_H, + * HAVE_DIRECT_H, HAVE_DIR_H, HAVE_NDIR_H, HAVE_SYS_DIR_H and + * HAVE_SYS_NDIR_H according to the files found. + */ +#ifndef DIRENT_H +#define DIRENT_H +#define DIRENT_H_INCLUDED + +/* find out platform */ +#if defined(MSDOS) /* MS-DOS */ +#elif defined(__MSDOS__) /* Turbo C/Borland */ +# define MSDOS +#elif defined(__DOS__) /* Watcom */ +# define MSDOS +#endif + +#if defined(WIN32) /* MS-Windows */ +#elif defined(__NT__) /* Watcom */ +# define WIN32 +#elif defined(_WIN32) /* Microsoft */ +# define WIN32 +#elif defined(__WIN32__) /* Borland */ +# define WIN32 +#endif + +/* + * See what kind of dirent interface we have unless autoconf has already + * determinated that. + */ +#if !defined(HAVE_DIRENT_H) && !defined(HAVE_DIRECT_H) && !defined(HAVE_SYS_DIR_H) && !defined(HAVE_NDIR_H) && !defined(HAVE_SYS_NDIR_H) && !defined(HAVE_DIR_H) +# if defined(_MSC_VER) /* Microsoft C/C++ */ + /* no dirent.h */ +# elif defined(__BORLANDC__) /* Borland C/C++ */ +# define HAVE_DIRENT_H +# define VOID_CLOSEDIR +# elif defined(__TURBOC__) /* Borland Turbo C */ + /* no dirent.h */ +# elif defined(__WATCOMC__) /* Watcom C/C++ */ +# define HAVE_DIRECT_H +# elif defined(__apollo) /* Apollo */ +# define HAVE_SYS_DIR_H +# elif defined(__hpux) /* HP-UX */ +# define HAVE_DIRENT_H +# elif defined(__alpha) || defined(__alpha__) /* Alpha OSF1 */ +# error "not implemented" +# elif defined(__sgi) /* Silicon Graphics */ +# define HAVE_DIRENT_H +# elif defined(sun) || defined(_sun) /* Sun Solaris */ +# define HAVE_DIRENT_H +# elif defined(__FreeBSD__) /* FreeBSD */ +# define HAVE_DIRENT_H +# elif defined(__linux__) /* Linux */ +# define HAVE_DIRENT_H +# elif defined(__GNUC__) /* GNU C/C++ */ +# define HAVE_DIRENT_H +# else +# error "not implemented" +# endif +#endif + +/* include proper interface headers */ +#if defined(HAVE_DIRENT_H) +# include +# ifdef FREEBSD +# define NAMLEN(dp) ((int)((dp)->d_namlen)) +# else +# define NAMLEN(dp) ((int)(strlen((dp)->d_name))) +# endif + +#elif defined(HAVE_NDIR_H) +# include +# define NAMLEN(dp) ((int)((dp)->d_namlen)) + +#elif defined(HAVE_SYS_NDIR_H) +# include +# define NAMLEN(dp) ((int)((dp)->d_namlen)) + +#elif defined(HAVE_DIRECT_H) +# include +# define NAMLEN(dp) ((int)((dp)->d_namlen)) + +#elif defined(HAVE_DIR_H) +# include +# define NAMLEN(dp) ((int)((dp)->d_namlen)) + +#elif defined(HAVE_SYS_DIR_H) +# include +# include +# ifndef dirent +# define dirent direct +# endif +# define NAMLEN(dp) ((int)((dp)->d_namlen)) + +#elif defined(MSDOS) || defined(WIN32) + + /* figure out type of underlaying directory interface to be used */ +# if defined(WIN32) +# define DIRENT_WIN32_INTERFACE +# elif defined(MSDOS) +# define DIRENT_MSDOS_INTERFACE +# else +# error "missing native dirent interface" +# endif + + /*** WIN32 specifics ***/ +# if defined(DIRENT_WIN32_INTERFACE) +# include +# if !defined(DIRENT_MAXNAMLEN) +# define DIRENT_MAXNAMLEN (MAX_PATH) +# endif + + + /*** MS-DOS specifics ***/ +# elif defined(DIRENT_MSDOS_INTERFACE) +# include + + /* Borland defines file length macros in dir.h */ +# if defined(__BORLANDC__) +# include +# if !defined(DIRENT_MAXNAMLEN) +# define DIRENT_MAXNAMLEN ((MAXFILE)+(MAXEXT)) +# endif +# if !defined(_find_t) +# define _find_t find_t +# endif + + /* Turbo C defines ffblk structure in dir.h */ +# elif defined(__TURBOC__) +# include +# if !defined(DIRENT_MAXNAMLEN) +# define DIRENT_MAXNAMLEN ((MAXFILE)+(MAXEXT)) +# endif +# define DIRENT_USE_FFBLK + + /* MSVC */ +# elif defined(_MSC_VER) +# if !defined(DIRENT_MAXNAMLEN) +# define DIRENT_MAXNAMLEN (12) +# endif + + /* Watcom */ +# elif defined(__WATCOMC__) +# if !defined(DIRENT_MAXNAMLEN) +# if defined(__OS2__) || defined(__NT__) +# define DIRENT_MAXNAMLEN (255) +# else +# define DIRENT_MAXNAMLEN (12) +# endif +# endif + +# endif +# endif + + /*** generic MS-DOS and MS-Windows stuff ***/ +# if !defined(NAME_MAX) && defined(DIRENT_MAXNAMLEN) +# define NAME_MAX DIRENT_MAXNAMLEN +# endif +# if NAME_MAX < DIRENT_MAXNAMLEN +# error "assertion failed: NAME_MAX >= DIRENT_MAXNAMLEN" +# endif + + + /* + * Substitute for real dirent structure. Note that `d_name' field is a + * true character array although we have it copied in the implementation + * dependent data. We could save some memory if we had declared `d_name' + * as a pointer refering the name within implementation dependent data. + * We have not done that since some code may rely on sizeof(d_name) to be + * something other than four. Besides, directory entries are typically so + * small that it takes virtually no time to copy them from place to place. + */ + typedef struct dirent { + char d_name[NAME_MAX + 1]; + + /*** Operating system specific part ***/ +# if defined(DIRENT_WIN32_INTERFACE) /*WIN32*/ + WIN32_FIND_DATA data; +# elif defined(DIRENT_MSDOS_INTERFACE) /*MSDOS*/ +# if defined(DIRENT_USE_FFBLK) + struct ffblk data; +# else + struct _find_t data; +# endif +# endif + } dirent; + + /* DIR substitute structure containing directory name. The name is + * essential for the operation of ``rewinndir'' function. */ + typedef struct DIR { + char *dirname; /* directory being scanned */ + dirent current; /* current entry */ + int dirent_filled; /* is current un-processed? */ + + /*** Operating system specific part ***/ +# if defined(DIRENT_WIN32_INTERFACE) + HANDLE search_handle; +# elif defined(DIRENT_MSDOS_INTERFACE) +# endif + } DIR; + +# ifdef __cplusplus +extern "C" { +# endif + +/* supply prototypes for dirent functions */ +static DIR *opendir (const char *dirname); +static struct dirent *readdir (DIR *dirp); +static int closedir (DIR *dirp); +static void rewinddir (DIR *dirp); + +/* + * Implement dirent interface as static functions so that the user does not + * need to change his project in any way to use dirent function. With this + * it is sufficient to include this very header from source modules using + * dirent functions and the functions will be pulled in automatically. + */ +#include +#include +#include +#include +#include + +/* use ffblk instead of _find_t if requested */ +#if defined(DIRENT_USE_FFBLK) +# define _A_ARCH (FA_ARCH) +# define _A_HIDDEN (FA_HIDDEN) +# define _A_NORMAL (0) +# define _A_RDONLY (FA_RDONLY) +# define _A_SUBDIR (FA_DIREC) +# define _A_SYSTEM (FA_SYSTEM) +# define _A_VOLID (FA_LABEL) +# define _dos_findnext(dest) findnext(dest) +# define _dos_findfirst(name,flags,dest) findfirst(name,dest,flags) +#endif + +static int _initdir (DIR *p); +static const char *_getdirname (const struct dirent *dp); +static void _setdirname (struct DIR *dirp); + +/* + * + * open directory stream for reading + * DIR *opendir (const char *dirname); + * + * Open named directory stream for read and return pointer to the + * internal working area that is used for retrieving individual directory + * entries. The internal working area has no fields of your interest. + * + * Returns a pointer to the internal working area or NULL in case the + * directory stream could not be opened. Global `errno' variable will set + * in case of error as follows: + * + * + * [EACESS |Permission denied. + * [EMFILE |Too many open files used by the process. + * [ENFILE |Too many open files in system. + * [ENOENT |Directory does not exist. + * [ENOMEM |Insufficient memory. + * [ENOTDIR |dirname does not refer to directory. This value is not + * reliable on MS-DOS and MS-Windows platforms. Many + * implementations return ENOENT even when the name refers to a + * file.] + *
+ *
+ */ +static DIR * +opendir( + const char *dirname) +{ + DIR *dirp; + assert (dirname != NULL); + + dirp = (DIR*)malloc (sizeof (struct DIR)); + if (dirp != NULL) { + char *p; + + /* allocate room for directory name */ + dirp->dirname = (char*) malloc (strlen (dirname) + 1 + strlen ("\\*.*")); + if (dirp->dirname == NULL) { + /* failed to duplicate directory name. errno set by malloc() */ + free (dirp); + return NULL; + } + /* Copy directory name while appending directory separator and "*.*". + * Directory separator is not appended if the name already ends with + * drive or directory separator. Directory separator is assumed to be + * '/' or '\' and drive separator is assumed to be ':'. */ + strcpy (dirp->dirname, dirname); + p = strchr (dirp->dirname, '\0'); + if (dirp->dirname < p && + *(p - 1) != '\\' && *(p - 1) != '/' && *(p - 1) != ':') + { + strcpy (p++, "/"); + } +# ifdef DIRENT_WIN32_INTERFACE + strcpy (p, "*"); /*scan files with and without extension in win32*/ +# else + strcpy (p, "*.*"); /*scan files with and without extension in DOS*/ +# endif + + /* open stream */ + if (_initdir (dirp) == 0) { + /* initialization failed */ + free (dirp->dirname); + free (dirp); + return NULL; + } + } + return dirp; +} + + +/* + * + * read a directory entry + * struct dirent *readdir (DIR *dirp); + * + * Read individual directory entry and return pointer to a structure + * containing the name of the entry. Individual directory entries returned + * include normal files, sub-directories, pseudo-directories "." and ".." + * and also volume labels, hidden files and system files in MS-DOS and + * MS-Windows. You might want to use stat(2) function to determinate which + * one are you dealing with. Many dirent implementations already contain + * equivalent information in dirent structure but you cannot depend on + * this. + * + * The dirent structure contains several system dependent fields that + * generally have no interest to you. The only interesting one is char + * d_name[] that is also portable across different systems. The d_name + * field contains the name of the directory entry without leading path. + * While d_name is portable across different systems the actual storage + * capacity of d_name varies from system to system and there is no portable + * way to find out it at compile time as different systems define the + * capacity of d_name with different macros and some systems do not define + * capacity at all (besides actual declaration of the field). If you really + * need to find out storage capacity of d_name then you might want to try + * NAME_MAX macro. The NAME_MAX is defined in POSIX standard althought + * there are many MS-DOS and MS-Windows implementations those do not define + * it. There are also systems that declare d_name as "char d_name[1]" and + * then allocate suitable amount of memory at run-time. Thanks to Alain + * Decamps (Alain.Decamps@advalvas.be) for pointing it out to me. + * + * This all leads to the fact that it is difficult to allocate space + * for the directory names when the very same program is being compiled on + * number of operating systems. Therefore I suggest that you always + * allocate space for directory names dynamically. + * + * + * Returns a pointer to a structure containing name of the directory entry + * in `d_name' field or NULL if there was an error. In case of an error the + * global `errno' variable will set as follows: + * + * + * [EBADF |dir parameter refers to an invalid directory stream. This value + * is not set reliably on all implementations.] + *
+ *
+ */ +static struct dirent * +readdir (DIR *dirp) +{ + assert (dirp != NULL); + if (dirp == NULL) { + errno = EBADF; + return NULL; + } + +#if defined(DIRENT_WIN32_INTERFACE) + if (dirp->search_handle == INVALID_HANDLE_VALUE) { + /* directory stream was opened/rewound incorrectly or it ended normally */ + errno = EBADF; + return NULL; + } +#endif + + if (dirp->dirent_filled != 0) { + /* + * Directory entry has already been retrieved and there is no need to + * retrieve a new one. Directory entry will be retrieved in advance + * when the user calls readdir function for the first time. This is so + * because real dirent has separate functions for opening and reading + * the stream whereas Win32 and DOS dirents open the stream + * automatically when we retrieve the first file. Therefore, we have to + * save the first file when opening the stream and later we have to + * return the saved entry when the user tries to read the first entry. + */ + dirp->dirent_filled = 0; + } else { + /* fill in entry and return that */ +#if defined(DIRENT_WIN32_INTERFACE) + if (FindNextFile (dirp->search_handle, &dirp->current.data) == FALSE) { + /* Last file has been processed or an error occured */ + FindClose (dirp->search_handle); + dirp->search_handle = INVALID_HANDLE_VALUE; + errno = ENOENT; + return NULL; + } + +# elif defined(DIRENT_MSDOS_INTERFACE) + if (_dos_findnext (&dirp->current.data) != 0) { + /* _dos_findnext and findnext will set errno to ENOENT when no + * more entries could be retrieved. */ + return NULL; + } +# endif + + _setdirname (dirp); + assert (dirp->dirent_filled == 0); + } + return &dirp->current; +} + + +/* + * + * close directory stream. + * int closedir (DIR *dirp); + * + * Close directory stream opened by the `opendir' function. Close of + * directory stream invalidates the DIR structure as well as previously read + * dirent entry. + * + * The function typically returns 0 on success and -1 on failure but + * the function may be declared to return void on same systems. At least + * Borland C/C++ and some UNIX implementations use void as a return type. + * The dirent wrapper tries to define VOID_CLOSEDIR whenever closedir is + * known to return nothing. The very same definition is made by the GNU + * autoconf if you happen to use it. + * + * The global `errno' variable will set to EBADF in case of error. + * + */ +static int +closedir (DIR *dirp) +{ + int retcode = 0; + + /* make sure that dirp points to legal structure */ + assert (dirp != NULL); + if (dirp == NULL) { + errno = EBADF; + return -1; + } + + /* free directory name and search handles */ + if (dirp->dirname != NULL) free (dirp->dirname); + +#if defined(DIRENT_WIN32_INTERFACE) + if (dirp->search_handle != INVALID_HANDLE_VALUE) { + if (FindClose (dirp->search_handle) == FALSE) { + /* Unknown error */ + retcode = -1; + errno = EBADF; + } + } +#endif + + /* clear dirp structure to make sure that it cannot be used anymore*/ + memset (dirp, 0, sizeof (*dirp)); +# if defined(DIRENT_WIN32_INTERFACE) + dirp->search_handle = INVALID_HANDLE_VALUE; +# endif + + free (dirp); + return retcode; +} + + +/* + * + * rewind directory stream to the beginning + * void rewinddir (DIR *dirp); + * + * Rewind directory stream to the beginning so that the next call of + * readdir() returns the very first directory entry again. However, note + * that next call of readdir() may not return the same directory entry as it + * did in first time. The directory stream may have been affected by newly + * created files. + * + * Almost every dirent implementation ensure that rewinddir will update + * the directory stream to reflect any changes made to the directory entries + * since the previous ``opendir'' or ``rewinddir'' call. Keep an eye on + * this if your program depends on the feature. I know at least one dirent + * implementation where you are required to close and re-open the stream to + * see the changes. + * + * Returns nothing. If something went wrong while rewinding, you will + * notice it later when you try to retrieve the first directory entry. + */ +static void +rewinddir (DIR *dirp) +{ + /* make sure that dirp is legal */ + assert (dirp != NULL); + if (dirp == NULL) { + errno = EBADF; + return; + } + assert (dirp->dirname != NULL); + + /* close previous stream */ +#if defined(DIRENT_WIN32_INTERFACE) + if (dirp->search_handle != INVALID_HANDLE_VALUE) { + if (FindClose (dirp->search_handle) == FALSE) { + /* Unknown error */ + errno = EBADF; + } + } +#endif + + /* re-open previous stream */ + if (_initdir (dirp) == 0) { + /* initialization failed but we cannot deal with error. User will notice + * error later when she tries to retrieve first directory enty. */ + /*EMPTY*/; + } +} + + +/* + * Open native directory stream object and retrieve first file. + * Be sure to close previous stream before opening new one. + */ +static int +_initdir (DIR *dirp) +{ + assert (dirp != NULL); + assert (dirp->dirname != NULL); + dirp->dirent_filled = 0; + +# if defined(DIRENT_WIN32_INTERFACE) + /* Open stream and retrieve first file */ + dirp->search_handle = FindFirstFile (dirp->dirname, &dirp->current.data); + if (dirp->search_handle == INVALID_HANDLE_VALUE) { + /* something went wrong but we don't know what. GetLastError() could + * give us more information about the error, but then we should map + * the error code into errno. */ + errno = ENOENT; + return 0; + } + +# elif defined(DIRENT_MSDOS_INTERFACE) + if (_dos_findfirst (dirp->dirname, + _A_SUBDIR | _A_RDONLY | _A_ARCH | _A_SYSTEM | _A_HIDDEN, + &dirp->current.data) != 0) + { + /* _dos_findfirst and findfirst will set errno to ENOENT when no + * more entries could be retrieved. */ + return 0; + } +# endif + + /* initialize DIR and it's first entry */ + _setdirname (dirp); + dirp->dirent_filled = 1; + return 1; +} + + +/* + * Return implementation dependent name of the current directory entry. + */ +static const char * +_getdirname (const struct dirent *dp) +{ +#if defined(DIRENT_WIN32_INTERFACE) + return dp->data.cFileName; + +#elif defined(DIRENT_USE_FFBLK) + return dp->data.ff_name; + +#else + return dp->data.name; +#endif +} + + +/* + * Copy name of implementation dependent directory entry to the d_name field. + */ +static void +_setdirname (struct DIR *dirp) { + /* make sure that d_name is long enough */ + assert (strlen (_getdirname (&dirp->current)) <= NAME_MAX); + + strncpy (dirp->current.d_name, + _getdirname (&dirp->current), + NAME_MAX); + dirp->current.d_name[NAME_MAX] = '\0'; /*char d_name[NAME_MAX+1]*/ +} + +# ifdef __cplusplus +} +# endif +# define NAMLEN(dp) ((int)(strlen((dp)->d_name))) + +#else +# error "missing dirent interface" +#endif + + +#endif /*DIRENT_H*/ +