Embeddable Dillo

Main
Status | About | Download

Status

Dillo version 0.7.0 integrated this patch, so it is not needed anymore. The C code below given as an example is still valid.

About

This patch allows to embed Dillo in another GTK+ application via the GtkPlug and GtkSocket mechanism. This permits to use Dillo as an integrated HTML browser or viewer. For example, an application should typically create a GtkSocket, then it should get the XID of the created widget and run dillo with dillo -xid XID URL, where URL is the URL to browse, and XID is the decimal X window ID. For example:


#include <stdlib.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
int main(int argc, char **argv)
{
GtkWidget *main_window, *dillo_socket;
guint32 xid;
gchar *dillo_cmd;

gtk_init(&argc, &argv);

main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(main_window), "This window contains an embedded Dillo window");
dillo_socket = gtk_socket_new();
gtk_container_add(GTK_CONTAINER(main_window), dillo_socket);
gtk_widget_realize(dillo_socket);

xid = GDK_WINDOW_XWINDOW(dillo_socket->window);

gtk_widget_show(dillo_socket);
gtk_widget_show(main_window);

dillo_cmd = g_strdup_printf("dillo --xid %d http://www.w3.org&", xid);

system(dillo_cmd);

free(dillo_cmd);

gtk_main();
}

At the Dillo & Sylpheed page, there is a real-life example on how a mail client can make use of this.

Download

2002-11-01

The patch for Dillo v0.7.0pre-v1 is here: dillo-0.7.0-pre-v1-cli-xid.patch. It already contains the command line patch.

2002-08-13

Get the patch from here: dillo-cvs-2002-08-13-xid.patch.

This patch is to be applied after applying the command line patch.

2002-08-06

Get the patch from here: dillo-cvs-2002-08-06-cli-xid.patch

This patch is to be applied after applying the command line patch. In contrast to the older patch below, the URL/FILE must be given after the command line options and the command line option is now -x XID.

2002-05-18

Get the patch from here: dillo-cvs-2002-05-18-xid.patch

From within dillo directory, apply with patch -p0 < dillo-cvs-2002-05-18-xid.patch. Then build dillo as usual. The new option is -xid XID where XID is the afore mentioned X window ID. If relevant, the URL to browse must be given as the first argument.

Valid HTML 4.01!