I decided that some must-have functionality for Parcellite is the ability to drop text onto it as an alternative to the usual copy shortcut.
Here is the important part, in main.c (see last two lines)...
However, I get this error:
/* Create status icon */
status_icon = gtk_status_icon_new_from_stock(GTK_STOCK_PASTE);
gtk_status_icon_set_tooltip(GTK_STATUS_ICON(status_icon), _("Clipboard Manager"));
g_signal_connect(G_OBJECT(status_icon), "activate", G_CALLBACK(check_click), NULL);
g_signal_connect(G_OBJECT(status_icon), "popup-menu", G_CALLBACK(show_parcellite_menu), NULL);
gtk_drag_dest_set(GTK_STATUS_ICON(status_icon), GTK_DEST_DEFAULT_ALL, dnd_target_table, G_N_ELEMENTS (dnd_target_table), GDK_ACTION_COPY);
g_signal_connect(G_OBJECT(status_icon), "drag-data-received", G_CALLBACK(dnd_receive_data), NULL);
Some poking in documentation tells me that GTK_STATUS_ICON is descended straight from G_OBJECT, rather than any GTK widgets.
(parcellite:15560): Gtk-CRITICAL **: gtk_drag_dest_set: assertion `GTK_IS_WIDGET (widget)' failed
(parcellite:15560): GLib-GObject-WARNING **: /build/buildd/glib2.0-2.16.4/gobject/gsignal.c:1669: signal `drag-data-received' is invalid for instance `0x65e640'
However, some more poking with wininfo reminded me that each status icon is indeed its own X window. Thus, in theory, this could work if I only knew which widget to use!
I can think of no examples for this functionality off hand, but I really really want it!
Will I have to implement the drag and drop stuff with a lower level API, or is there a really obvious solution? :)