+void
+reload(Client *c, const Arg *arg) {
+ gboolean nocache = *(gboolean *)arg;
+ if(nocache)
+ webkit_web_view_reload_bypass_cache(c->view);
+ else
+ webkit_web_view_reload(c->view);
+}
+
+void
+resize(GtkWidget *w, GtkAllocation *a, Client *c) {
+ double zoom;
+
+ if(c->zoomed)
+ return;
+ zoom = webkit_web_view_get_zoom_level(c->view);
+ if(a->width * a->height < 300 * 400 && zoom != 0.2)
+ webkit_web_view_set_zoom_level(c->view, 0.2);
+ else if(zoom != 1.0)
+ webkit_web_view_set_zoom_level(c->view, 1.0);
+}
+
+void
+scroll(Client *c, const Arg *arg) {
+ gdouble v;
+ GtkAdjustment *a;
+
+ a = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(c->scroll));
+ v = gtk_adjustment_get_value(a);
+ v += gtk_adjustment_get_step_increment(a) * arg->i;
+ v = MAX(v, 0.0);
+ v = MIN(v, gtk_adjustment_get_upper(a) - gtk_adjustment_get_page_size(a));
+ gtk_adjustment_set_value(a, v);
+}
+
+void
+setcookie(SoupCookie *c) {
+ SoupDate *e;
+ SoupCookieJar *j = soup_cookie_jar_text_new(cookiefile, FALSE);
+ c = soup_cookie_copy(c);
+ if(c->expires == NULL) {
+ e = soup_date_new_from_time_t(time(NULL) + sessiontime);
+ soup_cookie_set_expires(c, e);
+ }
+ soup_cookie_jar_add_cookie(j, c);
+ g_object_unref(j);
+}
+
+void
+setatom(Client *c, Atom a, const char *v) {
+ XSync(dpy, False);
+ ignorexprop++;
+ XChangeProperty(dpy, GDK_WINDOW_XID(GTK_WIDGET(c->win)->window), a,
+ XA_STRING, 8, PropModeReplace, (unsigned char *)v,
+ strlen(v) + 1);
+}
+
+void
+setup(void) {
+ char *proxy;
+ char *new_proxy;
+ SoupURI *puri;
+ SoupSession *s;
+
+ /* clean up any zombies immediately */
+ sigchld(0);
+ gtk_init(NULL, NULL);
+ if (!g_thread_supported())
+ g_thread_init(NULL);
+