Even if there's data available on the clipboard, and text selected in a window, only one button appears (so you can't select text and replace it with the clipboard contents). This seems to be an arbitrary UI decision.
GtkEntry *entry = gtk_entry_new();
g_object_set_data (G_OBJECT (entry), "meego-im-content-type",
GINT_TO_POINTER (MEEGO_IM_CONTENT_NUMBER));
Hildon used a new property ("hildon-input-mode") which was defined in GtkEntry, GtkTextView, etc. Of course, when building with the patched Gtk+ you can still use it.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE MEEGO_IM_TOOLBAR_WIDGET SYSTEM 'VirtualKeyboardToolbarDTD.dtd'>
<toolbar>
<button name="buttonsmile" group="buttonsmile" priority="1" showon="always"
alignment="left" icon="/usr/share/widgetsgallery/imtoolbar/icons/icon-m-messaging-smiley-happy.svg"
size="80%" text="" text_id="" toggle="false" pressed="false">
<actions>
<sendstring string=":)"> </sendstring>
</actions>
</button>
Each widget can be associated to a different toolbar -- for example, the way I decided for now to allow to do this in Gtk+ is:
GtkEntry *entry = gtk_entry_new();
g_object_set_data (G_OBJECT (entry), "meego-im-toolbar",
"/usr/share/widgetsgallery/imtoolbar/exampletoolbar1.xml");
When the widget gets focus for the first time, the filename is sent to the input server, which parses it and creates the Qt widgets for you -- afterwards, you can still modify certain attributes of the toolbar, like whether buttons are pressed down or not. Unfortunately, I couldn't find a nice way to design a equivalent API for this in Gtk+, so for now you can only attach toolbars but not modify them. A sane API should implement at least a new class for this and so far I'm don't think defining new classes in a IM Context Plugin is the right way.