[Hdrflow-svn] SF.net SVN: hdrflow: [85] lib/openlibraries/src/openpluginlib
Status: Pre-Alpha
Brought to you by:
glslang
|
From: <gl...@us...> - 2007-04-20 13:50:12
|
Revision: 85
http://hdrflow.svn.sourceforge.net/hdrflow/?rev=85&view=rev
Author: glslang
Date: 2007-04-20 06:50:09 -0700 (Fri, 20 Apr 2007)
Log Message:
-----------
+ allow for more fine grained control of which "kind" of plugins are to be initialised.
+ make python aware of pl::init default arguments
Modified Paths:
--------------
lib/openlibraries/src/openpluginlib/pl/openpluginlib.cpp
lib/openlibraries/src/openpluginlib/pl/openpluginlib.hpp
lib/openlibraries/src/openpluginlib/py/openpluginlib.cpp
Modified: lib/openlibraries/src/openpluginlib/pl/openpluginlib.cpp
===================================================================
--- lib/openlibraries/src/openpluginlib/pl/openpluginlib.cpp 2007-04-20 10:47:54 UTC (rev 84)
+++ lib/openlibraries/src/openpluginlib/pl/openpluginlib.cpp 2007-04-20 13:50:09 UTC (rev 85)
@@ -132,7 +132,7 @@
return paths;
}
- void reflib( int init, const string& lookup_path = "" )
+ void reflib( int init, const string& lookup_path = "", int mode = 0 )
{
static long refs = 0;
@@ -144,21 +144,28 @@
{
if( refs == 1 )
{
-# ifdef WIN32
- el_reg.insert( plugins_path( ) );
-# else
- el_reg.insert( OPENIMAGELIB_PLUGINS );
- el_reg.insert( OPENMEDIALIB_PLUGINS );
- el_reg.insert( OPENOBJECTLIB_PLUGINS );
- el_reg.insert( OPENASSETLIB_PLUGINS );
- el_reg.insert( OPENEFFECTSLIB_PLUGINS );
-# endif
- string_list ofx_paths = get_ofx_plugin_path( );
- std::for_each( ofx_paths.begin( ), ofx_paths.end( ), boost::bind( &detail::registry::insert, boost::ref( el_reg ), _1 ) );
+ if( ( mode & STD_PLUGINS ) != 0 )
+ {
+# ifdef WIN32
+ el_reg.insert( plugins_path( ) );
+# else
+ el_reg.insert( OPENIMAGELIB_PLUGINS );
+ el_reg.insert( OPENMEDIALIB_PLUGINS );
+ el_reg.insert( OPENOBJECTLIB_PLUGINS );
+ el_reg.insert( OPENASSETLIB_PLUGINS );
+ el_reg.insert( OPENEFFECTSLIB_PLUGINS );
+# endif
+ }
+
+ if( ( mode & OFX_PLUGINS ) != 0 )
+ {
+ string_list ofx_paths = get_ofx_plugin_path( );
+ std::for_each( ofx_paths.begin( ), ofx_paths.end( ), boost::bind( &detail::registry::insert, boost::ref( el_reg ), _1 ) );
+ }
-# ifdef HAVE_CG_RUNTIME
+# ifdef HAVE_CG_RUNTIME
shader_manager_instance( ).create_Cg_context( );
-# endif
+# endif
}
if( !lookup_path.empty( ) )
@@ -287,11 +294,11 @@
}
#endif
-bool init( const string& lookup_path )
+bool init( const string& lookup_path, int mode )
{
boost::recursive_mutex::scoped_lock lock( mutex );
- reflib( 1, lookup_path );
+ reflib( 1, lookup_path, mode );
return true;
}
Modified: lib/openlibraries/src/openpluginlib/pl/openpluginlib.hpp
===================================================================
--- lib/openlibraries/src/openpluginlib/pl/openpluginlib.hpp 2007-04-20 10:47:54 UTC (rev 84)
+++ lib/openlibraries/src/openpluginlib/pl/openpluginlib.hpp 2007-04-20 13:50:09 UTC (rev 85)
@@ -24,7 +24,9 @@
namespace olib { namespace openpluginlib {
-OPENPLUGINLIB_DECLSPEC bool init( const string& lookup_path = "" );
+enum { STD_PLUGINS = 1, OFX_PLUGINS };
+
+OPENPLUGINLIB_DECLSPEC bool init( const string& lookup_path = "", int mode = STD_PLUGINS | OFX_PLUGINS );
OPENPLUGINLIB_DECLSPEC bool uninit( );
// UI construction motivated
Modified: lib/openlibraries/src/openpluginlib/py/openpluginlib.cpp
===================================================================
--- lib/openlibraries/src/openpluginlib/py/openpluginlib.cpp 2007-04-20 10:47:54 UTC (rev 84)
+++ lib/openlibraries/src/openpluginlib/py/openpluginlib.cpp 2007-04-20 13:50:09 UTC (rev 85)
@@ -36,9 +36,11 @@
int merit_;
};
+BOOST_PYTHON_FUNCTION_OVERLOADS( init_overloads, init, 0, 2 )
+
void py_openpluginlib( )
{
- py::def( "init", &init );
+ py::def( "init", &init, init_overloads( py::args( "lookup_path", "mode" ), "openpluginlib init" ) );
py::def( "uninit", &uninit );
py::def( "registered_filters", ®istered_filters );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|