[sldev] Plugin system - first code drop

Soft Noel soft at softnoel.org
Mon Feb 26 09:59:30 PST 2007


I've started creating accessors and hooks for the UI system, which is
turning into a heck of a lot of calls as I'd predicted. Some other ideas
were floated for the interface, such as overriding existing classes
instead of using callback hooks. Here's a drop of the plugin system before
I added callback hooks and started on my UI stuff. If someone wants to
write some test code for another approach, please feel free. Otherwise,
I'll drop my UI stuff on the list with callback hooks once I've got Dale's
scanner working as a plugin.

Right now, the system works with Mac and probably Linux. Linux needs the
contents of indra/lljack added to the viewer project, plus a build project
for the SDK and the plugin sample. For Windows, you'd need to do a wide
string conversion in LLPlugin::loadSys() and double-check that host-side
PLUGIN_CALLSPEC define. If nobody else does this, I'll fix it myself next
time I'm near a Windows machine. My Parallels install gave up the ghost
when I tried upgrading to the Parallels beta, and the release version
couldn't actually run the client anyway.

Build & run instructions:

apply plugin system patch:
http://softnoel.org/pluginsystem.patch

copy select headers from viewer source:
cd to plugin/PluginSDK/utils
./comhead_cp.sh

put your plugin path in temporary plugin manager:
LLPluginManager::pluginsEnumerate
(LLPluginManager is placeholder until we have a nice GUI for the plugins.)

Build DEBUG plugin/PluginSDK project

Build DEBUG plugin/HelloWorldPlugin project

Build any target macview project

Activate plugins via the edit menu

If you see "Hello World" on the ctrl-shift-4 debug console, you're
properly loading and running the HelloWorldPlugin plugin. You're ready to
create your own plugin interfaces by editing lljackio, lljacksystem, and
lljackui. Use the single function in lljacksystem as a reference example.
All you need to do to expose a feature to a plugin is add to these
interfaces.

If anyone wants to hang around in-world and talk plugins after Rob's
office hours today, I'd be eager to do so.




More information about the SLDev mailing list