Skip to content

Plugins And Interfaces

Scott Shillcock edited this page Aug 27, 2010 · 1 revision

Creating a new plugin

Create a new directory for the plugin.

% cd ~/cm/src/dmz/examples/
% mkdir hello

Create the plugin shell

In the new directory, call the plugingen script and pass the name of the plugin to create. The dmz namespace will automatically be added.

% cd ~/cm/src/dmz/examples/hello
% ~/cm/src/lmk/plugingen PluginHelloWorld –t –o

Other plugingen options are:

   -i (InputObserverUtil) : Defines an interface for receiving input events (dmzInputObserverUtil.h)
   -o (ObjectObserverUtil) : Defines an interface for object observing (dmzObjectObserverUtil.h)
   -t (TimeSlice) : Defines an interface for receiving time slices. (dmzRuntimeTimeSlice.h)
   -m (Messaging) : Defines an interface for receiving messages (dmzRuntimeMessaging.h)
   -e (EventObserverUtil) : Defines an interface for event observing (dmzEventObserverUtil.h)

Create A Config File

Create a XML configuration file called config.xml with the following content.

<?xml version="1.0" encoding="UTF-8"?>
<dmz>
   <plugin-list>
      <plugin name="dmzPluginHelloWorld" scope="hello"/>
   </plugin-list>
   <hello>
      <!-- Initialization data for dmzPluginHelloWorld goes here. -->
   </hello>
</dmz>

Compile the plugin.

% cd cd ~/cm/src/dmz/examples/hello
% lmk –u -b

Add the plugin to an application

% cd ~/cm/src/io
% ./run.sh config/color/red.xml ~/cm/src/dmz/examples/hello/config.xml

Creating a new interface

Call the interfacegen utility from inside the directory you want the interface to be generated.

% cd ~/cm/src/dmz/framework/foo/interfaces
% $HOME/cm/src/lmk/interfacegen FooModule

Clone this wiki locally