]> git.armaanb.net Git - chorizo.git/commitdiff
Support XEMBED
authorPeter Hofmann <scm@uninformativ.de>
Sat, 14 Jun 2014 10:23:57 +0000 (12:23 +0200)
committerPeter Hofmann <scm@uninformativ.de>
Sat, 14 Jun 2014 10:26:23 +0000 (12:26 +0200)
README
sn.c

diff --git a/README b/README
index 243f57e827197bbb95baf5333c21dac756fd8479..d8a4cb9d99b7b2c4f3ea4ea1ab35b7da856348a5 100644 (file)
--- 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 fa93beb843300a9fc028741381e80bba2bd97f77..c6d6e2b6ff8ea314a22734f0effd2dce9e761e63 100644 (file)
--- a/sn.c
+++ b/sn.c
@@ -2,6 +2,7 @@
 #include <stdlib.h>
 
 #include <gtk/gtk.h>
+#include <gtk/gtkx.h>
 #include <webkit/webkit.h>
 
 
@@ -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;
                }
        }