summaryrefslogtreecommitdiff
path: root/examples/opiecore/oplugins
authormickeyl <mickeyl>2005-01-29 14:18:51 (UTC)
committer mickeyl <mickeyl>2005-01-29 14:18:51 (UTC)
commit555b999359a5aad999eaaf48632ce85f25125b85 (patch) (side-by-side diff)
tree7414362241e49e06f49486e93a8f504113961b1c /examples/opiecore/oplugins
parent7b06e36fe27adc6a4fde2004eac13aaf8c0f0f02 (diff)
downloadopie-555b999359a5aad999eaaf48632ce85f25125b85.zip
opie-555b999359a5aad999eaaf48632ce85f25125b85.tar.gz
opie-555b999359a5aad999eaaf48632ce85f25125b85.tar.bz2
examples appear here
Diffstat (limited to 'examples/opiecore/oplugins') (more/less context) (ignore whitespace changes)
-rw-r--r--examples/opiecore/oplugins/.cvsignore3
-rw-r--r--examples/opiecore/oplugins/oplugins.cpp47
-rw-r--r--examples/opiecore/oplugins/oplugins.pro11
3 files changed, 61 insertions, 0 deletions
diff --git a/examples/opiecore/oplugins/.cvsignore b/examples/opiecore/oplugins/.cvsignore
new file mode 100644
index 0000000..514e011
--- a/dev/null
+++ b/examples/opiecore/oplugins/.cvsignore
@@ -0,0 +1,3 @@
+oplugins
+Makefile
+.moc
diff --git a/examples/opiecore/oplugins/oplugins.cpp b/examples/opiecore/oplugins/oplugins.cpp
new file mode 100644
index 0000000..26623be
--- a/dev/null
+++ b/examples/opiecore/oplugins/oplugins.cpp
@@ -0,0 +1,47 @@
+/*
+ * You may copy, modify and or distribute without any limitation
+ */
+#include <opie2/odebug.h>
+#include <opie2/opluginloader.h>
+
+#include <opie2/todayplugininterface.h>
+
+using Opie::Core::OPluginItem;
+using Opie::Core::OGenericPluginLoader;
+using Opie::Core::OPluginLoader;
+
+void debugLst( const OPluginItem::List& lst ) {
+ for ( OPluginItem::List::ConstIterator it = lst.begin(); it != lst.end(); ++it )
+ odebug << "Name " << (*it).name() << " " << (*it).path() << " " << (*it).position() << oendl;
+}
+
+
+int main( void ) {
+ OGenericPluginLoader loader( "today", true );
+ loader.setAutoDelete( true );
+
+ odebug << "IS in Safe Mode" << loader.isInSafeMode() << oendl;
+
+ OPluginItem::List lst = loader.allAvailable( true );
+ debugLst( lst );
+
+ lst = loader.filtered( true );
+ debugLst( lst );
+
+ for ( OPluginItem::List::Iterator it = lst.begin(); it != lst.end(); ++it ) {
+ QUnknownInterface* iface = loader.load( *it, IID_TodayPluginInterface );
+ }
+
+ OPluginLoader loader2("today",true);
+ OPluginItem::List lst2 = loader2.allAvailable( true );
+ debugLst( lst2 );
+
+ for( OPluginItem::List::Iterator it = lst.begin(); it != lst.end(); ++it ){
+ TodayPluginInterface* iface = loader2.load<TodayPluginInterface>( *it, IID_TodayPluginInterface );
+ }
+
+
+ /*
+ * now it's autodelete so cleaned up for us
+ */
+}
diff --git a/examples/opiecore/oplugins/oplugins.pro b/examples/opiecore/oplugins/oplugins.pro
new file mode 100644
index 0000000..03f8e4d
--- a/dev/null
+++ b/examples/opiecore/oplugins/oplugins.pro
@@ -0,0 +1,11 @@
+TEMPLATE = app
+CONFIG += qt warn_on
+
+SOURCES = oplugins.cpp
+
+INCLUDEPATH += $(OPIEDIR)/include
+DEPENDSPATH += $(OPIEDIR)/include
+
+LIBS += -lopiecore2
+
+include( $(OPIEDIR)/include.pro )