Bookshelf Contents Previous Next Glossary Index Search

Plugin Developers Library

A plugin is a self-contained piece of software that adds a function to an application without recompiling the application.

Until recently, most software applications consisted of a single executable program file. When the application was compiled, all its features, limitations, and bugs were sealed with it and remained unchanged until the next version of the software was released.

With the new plugin architecture, portions of an application's functionality are encapsulated in separable code modules. These code modules, called plugins, are linked to the main application when you start it up. With plugins, an application's capabilities can be improved and extended after being released. More importantly, if the plug interface is open, you can customize the application yourself or with third party developers.

MotionSampler has a plugin architecture. It uses Irix Dynamic Shared Objects (DSOs) to link to plugin modules that are separately compiled for its motion sampling capabilities. Without plugins, MotionSampler can only load Alias wire models and preview animation with sound. Plugins give MotionSampler the ability to sample and filter motion data.

In MotionSampler, plugins are used with the dataflow pipeline. Each module (source, filter, or sink) is implemented as a plugin. In MotionSampler, plugins are packages of compiled C++ code and are dynamically loaded when you start MotionSampler.

Much of MotionSampler's functionality comes from plugins which you can add, modify, and remove. You can develop new plugin modules using the Plugin Developers Library (PDL).

The plugins you program for MotionSampler are called Dynamic Shared Objects and are written in C++. You can learn more about Dynamic Shared Objects, often called DSOs, by looking at the Irix manual pages DSO(5), dlopen(3), and dlsym(3).

Basically, DSOs are modules of compiled code that become linked to a main program when it runs. Of course, MotionSampler cannot load and use just any compiled DSO. It will only use DSOs that are written specifically for MotionSampler that follow certain conventions.

To program DSO plugins that work with MotionSampler, you need the PDL header files, a C++ compiler, and an understanding of how MotionSampler uses plugins.

Although it is called a library, PDL is really just a set of C++ header files which define C++ classes understood by the MotionSampler application. Writing a C++ plugin is a little different from writing normal C++ programs. Usually you write a program that consists of, at least, a function called main() which, when compiled, becomes linked to several external libraries such as /usr/lib/libm.so, the standard math library. In contrast, plugins have no main() function and are not required to link to any libraries that MotionSampler already links to. By themselves, plugins are not very useful. They don't come alive until an external program dynamically links with them. Plugin programming is actually similar to writing libraries. Shared libraries are a special case of plugins, and are linked to a running program in much the same way as a DSO plugin.



Bookshelf Contents Previous Next Glossary Index Search

[email protected]
Copyright © 1998, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved.