Extend iStumbler by writing plugins!
iStumbler now allows you to create plugins to enable other network
discovery and management functions. Plugins for GPS, Mapping and Bluetooth
are under development, download the
iStumbler Source and get started today!
/* The ISPlugin protocol supports additions to the source list in iStumbler. Plugins should use the default NSNotificationCenter for inter-plugin communications. iStumbler provides a global slider notification and will listen for notifications to update the status or user interface. The lifecycle of a plugin. When iStumbler is launched the ISPluginManager scans for plugins bundles in all the usual places. As it finds the bundles it loads their primary classes and caches them in an array. Each class has it's initPlugin method called with the bundle it was loaded from for convenience. The plugin may start a thread or perform any other initialization at this stage. Once the init has completed an instance of the plugin is created. That instance is used by iStumbler for the duration of it's run. The plugin instance provides the application with the following information: plugin icon 16x16 icon for the list plugin name the name to display in the list plugin toolbar toolbar to display plugin view view for the main window plugin status status to display in the main window preferences view view for the preferences widow preferences icon 32x32 icon for the preferences inspector view view for the inspector window inspector icon 24x24 icon for the inspector These methods will be called every time the application needs them, in whatever order we want. Once the application is ready to get rid of the plugin, typically it is about to quit it will release the plugin instances and then call the stopPlugin method on the class so that it can stop whatever threads it is running, close files and release memory. */ @protocol ISPlugin /* Called by the IStumberController when the plugin is loaded, the plugins bundle object is passed for convenance. The plugin should return true if it's ready to have an instance created and false if it cannot. */ + (BOOL)initPlugin:(NSBundle*) bundle; /* Create a new instance of this plugin with the object as a parameter. May be called multiple times for multiple instances of a plugin object. */ + (NSObject<ISPlugin>*)createPlugin:(id) environment; /* Called by the ISPluginManager when the plugin is unloaded. Close your files, stop your threads and let those objects go free. */ + (void)stopPlugin; /* Returns a string which we can display in the window title and in the plugin list and menu. */ - (NSString*) pluginName; /* Returns a string which has the plugin's info, such as copy right and legal notices for or display in the info window. */ - (NSString*) pluginInfo; /* Returns a string with the plugin's current status */ - (NSString*) pluginStatus; /* Returns the entire scroll view for the plugin, this view is placed in the main window of iStumbler. */ - (NSView*) pluginView; /* Returns an icon for the plugin. The image may be any size but will be scaled to 16X16 for the outline view, so be ready for that. */ - (NSImage*) pluginIcon; /* Returns the NSToolbar to display while the plugin is selected. */ - (NSToolbar*) pluginToolbar; /* Returns an NSMenu for the plugin to be grafted into the applications menu when the plugin is selected and a sub-menu of the dock menu while it's loaded*/ - (NSMenu*) pluginMenu; /* Returns the NSView to show in the prefrences window. */ - (NSView*) pluginPrefrences; /* Returns an icon for the preferences toolbar */ - (NSImage*) pluginPrefrencesIcon; /* Returns the NSView to show in the inspector panel */ - (NSView*) pluginInspector; /* Returns an icon for the inspector toolbar */ - (NSImage*) pluginInspectorIcon; @end