Index: src/commands.c =================================================================== RCS file: /cvsroot/dillo/dillo/src/commands.c,v retrieving revision 1.34 diff -p -u -r1.34 commands.c --- src/commands.c 26 Mar 2002 23:29:06 -0000 1.34 +++ src/commands.c 18 May 2002 22:17:56 -0000 @@ -42,7 +42,7 @@ void a_Commands_new_callback(GtkWidget * BrowserWindow *bw = (BrowserWindow *)client_data; a_Interface_browser_window_new(bw->main_window->allocation.width, - bw->main_window->allocation.height); + bw->main_window->allocation.height, 0); } /* @@ -386,7 +386,7 @@ void a_Commands_open_link_nw_callback(Gt BrowserWindow *newbw; gdk_window_get_size (bw->main_window->window, &width, &height); - newbw = a_Interface_browser_window_new(width, height); + newbw = a_Interface_browser_window_new(width, height, 0); a_Nav_push(newbw, a_Menu_popup_get_url(bw)); } Index: src/dillo.c =================================================================== RCS file: /cvsroot/dillo/dillo/src/dillo.c,v retrieving revision 1.38 diff -p -u -r1.38 dillo.c --- src/dillo.c 18 Mar 2002 15:04:45 -0000 1.38 +++ src/dillo.c 18 May 2002 22:17:56 -0000 @@ -63,6 +63,8 @@ gint main(int argc, char *argv[]) gchar *file; DilloUrl *start_url; BrowserWindow *bw; + guint32 xid = 0; + guint32 cmd_line = 0; /* This lets threads in the file module end peacefully when aborted * todo: implement a cleaner mechanism (in file.c) */ @@ -77,6 +79,16 @@ gint main(int argc, char *argv[]) Dillo_check_home_dir(file); g_free(file); + /* -xid option allows to embed the first dillo window in + * an exisiting gtk_socket */ + if (argc >= 2) { + gint i; + for (i = 1; i < argc; i++) { + if (!strcmp(argv[i], "-xid") && i < argc - 1 ) + xid = atoi(argv[++i]); + } + } + a_Prefs_init(); a_Dns_init(); a_Http_init(); @@ -89,7 +101,7 @@ gint main(int argc, char *argv[]) /* a_Nav_init() has been moved into this call because it needs to be * initialized with the new browser_window structure */ - bw = a_Interface_browser_window_new(prefs.width, prefs.height); + bw = a_Interface_browser_window_new(prefs.width, prefs.height, xid); a_Bookmarks_init(); @@ -98,7 +110,7 @@ gint main(int argc, char *argv[]) a_Nav_push(bw, start_url); a_Url_free(start_url); - if (argc == 2) { + if (argc >= 2 && argv[1][0] != '-') { if (access(argv[1], F_OK) == 0) { GString *UrlStr = g_string_sized_new(128); Index: src/interface.c =================================================================== RCS file: /cvsroot/dillo/dillo/src/interface.c,v retrieving revision 1.58 diff -p -u -r1.58 interface.c --- src/interface.c 11 Apr 2002 20:57:24 -0000 1.58 +++ src/interface.c 18 May 2002 22:17:56 -0000 @@ -565,7 +565,8 @@ static int Interface_click_callback(Brow * Create a new browser window and return it. * (the new window is stored in browser_window[]) */ -BrowserWindow *a_Interface_browser_window_new(gint width, gint height) +BrowserWindow *a_Interface_browser_window_new(gint width, gint height, + guint32 xid) { GtkWidget *box1, *box2, *hbox, *progbox, *toolbar, *handlebox, *menubar, *locbox; @@ -574,14 +575,16 @@ BrowserWindow *a_Interface_browser_windo /* We use g_new0() to zero the memory */ bw = g_new0(BrowserWindow, 1); - a_List_add(browser_window, num_bw, num_bw_max); browser_window[num_bw++] = bw; /* initialize nav_stack struct in browser_window struct */ a_Nav_init(bw); - bw->main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + if (!xid) + bw->main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + else + bw->main_window = gtk_plug_new(xid); gtk_window_set_policy(GTK_WINDOW(bw->main_window), TRUE, TRUE, FALSE); gtk_signal_connect(GTK_OBJECT(bw->main_window), "delete_event", Index: src/interface.h =================================================================== RCS file: /cvsroot/dillo/dillo/src/interface.h,v retrieving revision 1.25 diff -p -u -r1.25 interface.h --- src/interface.h 10 Jan 2002 19:00:47 -0000 1.25 +++ src/interface.h 18 May 2002 22:17:57 -0000 @@ -28,7 +28,8 @@ gchar *a_Interface_get_location_text(Bro void a_Interface_reset_progress_bars(BrowserWindow *bw); void a_Interface_entry_open_url(GtkWidget *widget, BrowserWindow *bw); void a_Interface_set_cursor(BrowserWindow *bw, GdkCursorType CursorType); -BrowserWindow *a_Interface_browser_window_new(gint width, gint height); +BrowserWindow *a_Interface_browser_window_new(gint width, gint height, + guint32 xid); void a_Interface_set_button_sens(BrowserWindow *bw);