X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=surf.c;h=29bf8c67b6efb8019f79330234c4d698cdaee717;hb=7822a6e829638c83bc8743b593144145cb531f5c;hp=2778beeb21ed36835b996b63e017822344a3dd1f;hpb=80d33d696d73c14c81da6e35ab06ee97517c9852;p=surf.git diff --git a/surf.c b/surf.c index 2778bee..29bf8c6 100644 --- a/surf.c +++ b/surf.c @@ -98,11 +98,12 @@ static Client *newclient(); static WebKitWebView *newwindow(WebKitWebView *v, WebKitWebFrame *f, Client *c); static void pasteurl(GtkClipboard *clipboard, const gchar *text, gpointer d); static GdkFilterReturn processx(GdkXEvent *xevent, GdkEvent *event, gpointer d); +static void print(Client *c, const Arg *arg); static void progresschange(WebKitWebView *view, gint p, Client *c); static void request(SoupSession *s, SoupMessage *m, Client *c); static void setcookie(char *name, char *val, char *dom, char *path, long exp); static void reload(Client *c, const Arg *arg); -static void setup(void); +static void setup(); static void titlechange(WebKitWebView* view, WebKitWebFrame* frame, const gchar* title, Client *c); static void searchtext(Client *c, const Arg *arg); @@ -347,11 +348,8 @@ loaduri(Client *c, const Arg *arg) { void navigate(Client *c, const Arg *arg) { - gboolean forward = *(gboolean *)arg; - if(forward) - webkit_web_view_go_forward(c->view); - else - webkit_web_view_go_back(c->view); + gint steps = *(gint *)arg; + webkit_web_view_can_go_back_or_forward(c->view, steps); } Client * @@ -472,6 +470,11 @@ processx(GdkXEvent *e, GdkEvent *event, gpointer d) { return GDK_FILTER_CONTINUE; } +void +print(Client *c, const Arg *arg) { + webkit_web_frame_print(webkit_web_view_get_main_frame(c->view)); +} + void progresschange(WebKitWebView* view, gint p, Client *c) { c->progress = p;