
| Sample Code |
What is a Marquee?
The marquee is the top panel on the Hildon desktop and it may contain multiple components (plug-ins), including buttons to navigate, and system status indicators.

Figure 1-1: The marquee and status bar.
The status bar contains four buttons: the battery status, brightness, volume, and soft keyboard control, which are all implemented as status bar plug-ins. The other plug-ins are the Home Button, Application Menu, Clock, Network Status, and Close Button. They are implemented as marquee plug-ins. The empty space, between the soft keyboard control button and the close button, belongs to the status bar and can accommodate one extra status bar plug-in. This is where we will later place our new status bar plug-in.
Developing a Marquee Plug-in
To create a plug-in for the marquee panel, there are a few things that you must do:
This guide will start by creating a simple marquee plug-in that displays GtkVolumeButton, a button which pops up a volume control. The plug-in will try to close an active app (if any) if you slide the volume control below the center line.
Chroot into the target environment, and make sure you have installed the libhildonwm-dev library, by typing this command:
You can download all of our completed hello-marquee files from here. To compile and install the files type:
Once this successfully finishes, you can start the Xephyr window by typing:

Figure 1-2: The Moblin screen running in the Xephyr window.
Figure 2 is a screenshot of You should see a new speaker icon after the close icon in the marquee pane. Launch any application (Galculator for example), select the speaker icon, and slide the volume control below the center line. See what happens.

Figure 1-3: The selected hello-marquee plug-in.
It should work like selecting the close button, sliding the volume control below the center line will close Galculator application.
Close the Xephyr window. Uninstall and clean by typing:
Now, let take the step-by-step approach.
Create autogen.sh, configure.ac, and Makefile.am
Create a file called configure.ac and add this code:
Create a file called autogen.sh and add this code:
Create a file called Makefile.am and add this code:
Create a Desktop File for Your New Plug-in
The marquee plug-in shared object library file libhellomarquee.so should be installed to /usr/lib/hildon-desktop/ by default.
Create C/C++ Code for Your New Plug-in
Create a file called hello-marquee.c and add this code:
typedef struct
{
TaskNavigatorItem tnitem;
GtkWidget *button;
} HelloPlugin;
typedef struct
{
TaskNavigatorItemClass parent_class;
} HelloPluginClass;
HD_DEFINE_PLUGIN(HelloPlugin, hello_plugin, TASKNAVIGATOR_TYPE_ITEM);
static void changed(GtkWidget *button, gdouble value, HelloPlugin *plug-in)
{
if (value < 0.5)
{
HDWMWindow *wnd = hd_wm_get_active_window();
if (wnd != NULL)
{
hd_wm_window_close(wnd);
}
}
}
static void hello_plugin_init(HelloPlugin *p)
{
GtkWidget *b = gtk_volume_button_new();
g_signal_connect(b, "value-changed", G_CALLBACK(changed), (gpointer) p);
gtk_container_add(GTK_CONTAINER(p), b);
gtk_widget_show_all(b);
}
static void finalize(GObject *object)
{
HelloPlugin *plug-in = (HelloPlugin *) HELLO_PLUGIN(object);
/* Do your finalization here ... */
G_OBJECT_CLASS(hello_plugin_parent_class)->finalize(object);
}
static void hello_plugin_class_init(HelloPluginClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS(class);
object_class->finalize = finalize;
}
The marquee is based on the Hildon task navigator, and plug-ins have the same interface as the Hildon task navigator items. To create a new marquee plug-in, we must first define a shared object, which is used to insert the plug-in into the marquee panel. To do that, we must place the "TaskNavigatorItem tnitem" as the first member of the plug-in data structure HelloPlugin, and also inherit the plug-in class from TaskNavigatorItemClass in HelloPluginClass.
The HD_DEFINE_PLUGIN macro takes HelloPlugin as the first parameter, our hello_plugin as the second parameter for base_name, and interface name TASKNAVIGATOR_TYPE_ITEM as the third parameter. After that, we should implement base_name##_ini and type_name##_class_init functions: hello_plugin_init and hello_plugin_class_init.
The marquee plug-ins can have any GTK+ widget as their representation on the marquee panel. The marquee loads the library and displays the main widget of the plug-in.
The marquee provides a container for the plug-ins, but the plug-ins are responsible for implementing their own UI, signals, and implementing the callback functions for them.
Compile, Install and Test Your New Plug-in