[Rezilla-commits] RezillaSource/Rezilla_Src/Architecture CRezillaPlugin.cp, 1.19, 1.20 CRezillaPlug
Brought to you by:
bdesgraupes
From: Bernard D. <bde...@us...> - 2006-11-25 11:58:50
|
Update of /cvsroot/rezilla/RezillaSource/Rezilla_Src/Architecture In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28949 Modified Files: CRezillaPlugin.cp CRezillaPlugin.h Log Message: Plugin role Index: CRezillaPlugin.cp =================================================================== RCS file: /cvsroot/rezilla/RezillaSource/Rezilla_Src/Architecture/CRezillaPlugin.cp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- CRezillaPlugin.cp 18 Nov 2006 06:50:31 -0000 1.19 +++ CRezillaPlugin.cp 25 Nov 2006 11:58:46 -0000 1.20 @@ -2,7 +2,7 @@ // CRezillaPlugin.cp // // Created: 2005-09-26 09:48:26 -// Last modification: 2006-09-26 12:55:42 +// Last modification: 2006-11-25 07:49:39 // Author: Bernard Desgraupes // e-mail: <bde...@so...> // www: <http://rezilla.sourceforge.net/> @@ -36,6 +36,9 @@ mIsLoaded = false; mMenusBuilt = false; mName = NULL; + mPluginType = 0; + mPluginCreator = 0; + mPluginRole = plugin_roleUnknown; mIconRef = 0; mPluginRef = NULL; mInterface = NULL; @@ -72,14 +75,13 @@ CFURLRef plugURL = nil; ResType theType; Str255 theString; - CFStringRef iconFilenameRef; + CFStringRef iconFilenameRef, roleRef; // Get an instance of the non-localized keys bundleInfoDict = ::CFBundleGetInfoDictionary(inBundleRef); // If successful, look for some properties if ( bundleInfoDict != NULL ) { -// propRef = ::CFDictionaryGetValue( bundleInfoDict, CFSTR("RezillaPluginRole") ); typesArray = (CFArrayRef) ::CFDictionaryGetValue( bundleInfoDict, CFSTR("RezillaPluginEditTypes") ); if (typesArray != nil) { @@ -104,10 +106,7 @@ mName = ::CFURLCopyLastPathComponent(plugURL); ::CFRelease(plugURL); ::CFRetain(mName); - } else { - mPluginType = 0; - mPluginCreator = 0; - } + } // Look for an icon file iconFilenameRef = (CFStringRef) ::CFDictionaryGetValue( bundleInfoDict, CFSTR("CFBundleIconFile") ); @@ -123,6 +122,18 @@ } } + // Look for the plugin role + roleRef = (CFStringRef) ::CFDictionaryGetValue( bundleInfoDict, CFSTR("RezillaPluginRole") ); + if (roleRef) { + if ( ::CFStringCompare( roleRef, CFSTR("none"), kCFCompareCaseInsensitive ) == kCFCompareEqualTo ) { + mPluginRole = plugin_roleNone; + } else if ( ::CFStringCompare( roleRef, CFSTR("editor"), kCFCompareCaseInsensitive ) == kCFCompareEqualTo ) { + mPluginRole = plugin_roleEditor; + } else if ( ::CFStringCompare( roleRef, CFSTR("viewer"), kCFCompareCaseInsensitive ) == kCFCompareEqualTo ) { + mPluginRole = plugin_roleViewer; + } + } + // Get version number mPluginVersion = ::CFBundleGetVersionNumber(inBundleRef); } Index: CRezillaPlugin.h =================================================================== RCS file: /cvsroot/rezilla/RezillaSource/Rezilla_Src/Architecture/CRezillaPlugin.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- CRezillaPlugin.h 28 Sep 2006 19:37:10 -0000 1.15 +++ CRezillaPlugin.h 25 Nov 2006 11:58:46 -0000 1.16 @@ -2,7 +2,7 @@ // CRezillaPlugin.h // // Created: 2005-09-26 09:48:26 -// Last modification: 2006-09-28 08:46:55 +// Last modification: 2006-11-25 07:31:00 // Author: Bernard Desgraupes // e-mail: <bde...@so...> // www: <http://rezilla.sourceforge.net/> @@ -67,6 +67,7 @@ UInt32 GetPluginType() { return mPluginType;} UInt32 GetPluginCreator() { return mPluginCreator;} UInt32 GetPluginVersion() { return mPluginVersion;} + UInt32 GetPluginRole() { return mPluginRole;} Boolean IsLoaded() { return mIsLoaded;} IconRef GetIconRef() { return mIconRef;} @@ -80,7 +81,8 @@ Boolean mIsLoaded; // differed loading UInt32 mPluginType, mPluginCreator, - mPluginVersion; + mPluginVersion, + mPluginRole; CFStringRef mName; IconRef mIconRef; |