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) (unidiff)
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) (show 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 @@
1oplugins
2Makefile
3.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 @@
1/*
2 * You may copy, modify and or distribute without any limitation
3 */
4#include <opie2/odebug.h>
5#include <opie2/opluginloader.h>
6
7#include <opie2/todayplugininterface.h>
8
9using Opie::Core::OPluginItem;
10using Opie::Core::OGenericPluginLoader;
11using Opie::Core::OPluginLoader;
12
13void debugLst( const OPluginItem::List& lst ) {
14 for ( OPluginItem::List::ConstIterator it = lst.begin(); it != lst.end(); ++it )
15 odebug << "Name " << (*it).name() << " " << (*it).path() << " " << (*it).position() << oendl;
16}
17
18
19int main( void ) {
20 OGenericPluginLoader loader( "today", true );
21 loader.setAutoDelete( true );
22
23 odebug << "IS in Safe Mode" << loader.isInSafeMode() << oendl;
24
25 OPluginItem::List lst = loader.allAvailable( true );
26 debugLst( lst );
27
28 lst = loader.filtered( true );
29 debugLst( lst );
30
31 for ( OPluginItem::List::Iterator it = lst.begin(); it != lst.end(); ++it ) {
32 QUnknownInterface* iface = loader.load( *it, IID_TodayPluginInterface );
33 }
34
35 OPluginLoader loader2("today",true);
36 OPluginItem::List lst2 = loader2.allAvailable( true );
37 debugLst( lst2 );
38
39 for( OPluginItem::List::Iterator it = lst.begin(); it != lst.end(); ++it ){
40 TodayPluginInterface* iface = loader2.load<TodayPluginInterface>( *it, IID_TodayPluginInterface );
41 }
42
43
44 /*
45 * now it's autodelete so cleaned up for us
46 */
47}
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 @@
1TEMPLATE = app
2CONFIG += qt warn_on
3
4SOURCES = oplugins.cpp
5
6INCLUDEPATH += $(OPIEDIR)/include
7DEPENDSPATH += $(OPIEDIR)/include
8
9LIBS += -lopiecore2
10
11include( $(OPIEDIR)/include.pro )