Diffstat (limited to 'noncore/settings/networksettings2/networksettings2/resources.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/networksettings2/resources.h | 53 |
1 files changed, 46 insertions, 7 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/resources.h b/noncore/settings/networksettings2/networksettings2/resources.h index 5d90286..421a433 100644 --- a/noncore/settings/networksettings2/networksettings2/resources.h +++ b/noncore/settings/networksettings2/networksettings2/resources.h @@ -16,9 +16,10 @@ class ANetNodeInstance; -typedef void (*GetNetNodeListFt_t)(QList<ANetNode>& PNN ); +namespace Opie { + namespace Core { + class OPluginLoader; + class OPluginManager; + } +} -typedef struct NetNode_S { - ANetNode * NetNode; - QLibrary * TheLibrary; - long NodeCountInLib; -} NetNode_t; +typedef void (*GetNetNodeListFt_t)(QList<ANetNode>& PNN ); @@ -39,3 +40,17 @@ public : +#ifdef MYPLUGIN + +typedef struct NetNode_S { + ANetNode * NetNode; + QLibrary * TheLibrary; + long NodeCountInLib; +} NetNode_t; typedef QDict<NetNode_t> Name2NetNode_t; + +#else + +typedef QDict<ANetNode> Name2NetNode_t; + +#endif + typedef QDict<ANetNodeInstance > Name2Instance_t; @@ -64,2 +79,3 @@ public : { return AllNodeTypes.find(X)!=0; } +#ifdef MYPLUGIN ANetNode * findNetNode( const QString & N ) @@ -68,3 +84,7 @@ public : } - +#else + ANetNode * findNetNode( const QString & N ) + { return AllNodeTypes.find(N); + } +#endif // define new plugin (=node) @@ -83,2 +103,3 @@ public : printf( "Find node type %s\n", S.latin1() ); +#ifdef MYPLUGIN NetNode_t * NNT = AllNodeTypes[S]; @@ -88,2 +109,9 @@ public : NNI = NNT->NetNode->createInstance(); +#else + ANetNode * NNT = AllNodeTypes[S]; + if( ! NNT ) { + return 0; + } + NNI = NNT->createInstance(); +#endif NNI->initialize(); @@ -120,2 +148,4 @@ private : QString tr( const char * path ); + +#ifdef MYPLUGIN void findAvailableNetNodes( const QString &path ); @@ -124,2 +154,5 @@ private : const QString &resolveString = "create_plugin"); +#else + void findAvailableNetNodes( void ); +#endif @@ -138,2 +171,8 @@ private : CurrentQPEUser CurrentUser; + +#ifndef MYPLUGIN + Opie::Core::OPluginLoader * Plugins; + Opie::Core::OPluginManager * PluginManager; +#endif + }; |