From b3af9d52dcc487da95410a0db4f90851b526621a Mon Sep 17 00:00:00 2001 From: Peter Hofmann Date: Sat, 14 Jun 2014 12:23:57 +0200 Subject: [PATCH] Support XEMBED --- README | 14 +++++++++++++- sn.c | 17 +++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/README b/README index 243f57e..d8a4cb9 100644 --- a/README +++ b/README @@ -9,13 +9,25 @@ Features: - A WebKit viewport - Global content zoom + - Pluggability into suckless' tabbed Planned features: - An input box to change the current URL - vi-like shortcuts - Adblock - - Pluggability into suckless' tabbed (preferred) or native tabs + + +Using sn with tabbed +==================== + +The order of arguments for sn doesn't matter. This means you can run it +like this: + + $ tabbed -c ./sn file:///home/hans/bookmarks.html -z 0.8 -e + +Each new tab will then show your bookmarks and is scaled by a factor of +0.8. Literature diff --git a/sn.c b/sn.c index fa93beb..c6d6e2b 100644 --- a/sn.c +++ b/sn.c @@ -2,6 +2,7 @@ #include #include +#include #include @@ -21,6 +22,7 @@ static gboolean sn_new_client_request(WebKitWebView *, WebKitWebFrame *, static void sn_title_changed(GObject *, GParamSpec *, gpointer); +static Window embed = 0; static int clients = 0; static double global_zoom = 1.0; @@ -102,7 +104,15 @@ sn_new_client(const gchar *uri) exit(EXIT_FAILURE); } - c->win = gtk_window_new(GTK_WINDOW_TOPLEVEL); + if (embed == 0) + { + c->win = gtk_window_new(GTK_WINDOW_TOPLEVEL); + } + else + { + c->win = gtk_plug_new(embed); + } + g_signal_connect(G_OBJECT(c->win), "destroy", G_CALLBACK(sn_destroy_client), c); gtk_window_set_has_resize_grip(GTK_WINDOW(c->win), FALSE); @@ -171,13 +181,16 @@ main(int argc, char **argv) gtk_init(&argc, &argv); - while ((opt = getopt(argc, argv, "z:")) != -1) + while ((opt = getopt(argc, argv, "z:e:")) != -1) { switch (opt) { case 'z': global_zoom = atof(optarg); break; + case 'e': + embed = atol(optarg); + break; } } -- 2.39.2