Skip to content

Commit

Permalink
Add load_start_handler
Browse files Browse the repository at this point in the history
  • Loading branch information
hmkemppainen committed May 18, 2009
1 parent 4636b09 commit c445d93
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions uzbl.c
Expand Up @@ -76,6 +76,7 @@ const struct {
{ "reset_command_mode", (void *)&uzbl.behave.reset_command_mode },
{ "modkey" , (void *)&uzbl.behave.modkey },
{ "load_finish_handler",(void *)&uzbl.behave.load_finish_handler},
{ "load_start_handler", (void *)&uzbl.behave.load_start_handler },
{ "load_commit_handler",(void *)&uzbl.behave.load_commit_handler},
{ "history_handler", (void *)&uzbl.behave.history_handler },
{ "download_handler", (void *)&uzbl.behave.download_handler },
Expand Down Expand Up @@ -341,6 +342,15 @@ load_finish_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data) {
run_handler(uzbl.behave.load_finish_handler, "");
}

static void
load_start_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data) {
(void) page;
(void) frame;
(void) data;
if (uzbl.behave.load_start_handler)
run_handler(uzbl.behave.load_start_handler, "");
}

static void
load_commit_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data) {
(void) page;
Expand Down Expand Up @@ -894,6 +904,7 @@ get_var_value(gchar *name) {
|| var_is("title_format_long", name)
|| var_is("modkey", name)
|| var_is("load_finish_handler", name)
|| var_is("load_start_handler", name)
|| var_is("load_commit_handler", name)
|| var_is("history_handler", name)
|| var_is("download_handler", name)
Expand Down Expand Up @@ -967,6 +978,7 @@ set_var_value(gchar *name, gchar *val) {
|| var_is("title_format_long", name)
|| var_is("title_format_short", name)
|| var_is("load_finish_handler", name)
|| var_is("load_start_handler", name)
|| var_is("load_commit_handler", name)
|| var_is("history_handler", name)
|| var_is("download_handler", name)
Expand Down Expand Up @@ -1518,6 +1530,7 @@ create_browser () {
g_signal_connect (G_OBJECT (g->web_view), "title-changed", G_CALLBACK (title_change_cb), g->web_view);
g_signal_connect (G_OBJECT (g->web_view), "load-progress-changed", G_CALLBACK (progress_change_cb), g->web_view);
g_signal_connect (G_OBJECT (g->web_view), "load-committed", G_CALLBACK (load_commit_cb), g->web_view);
g_signal_connect (G_OBJECT (g->web_view), "load-started", G_CALLBACK (load_start_cb), g->web_view);
g_signal_connect (G_OBJECT (g->web_view), "load-finished", G_CALLBACK (log_history_cb), g->web_view);
g_signal_connect (G_OBJECT (g->web_view), "load-finished", G_CALLBACK (load_finish_cb), g->web_view);
g_signal_connect (G_OBJECT (g->web_view), "hovering-over-link", G_CALLBACK (link_hover_cb), g->web_view);
Expand Down
4 changes: 4 additions & 0 deletions uzbl.h
Expand Up @@ -128,6 +128,7 @@ typedef struct {
/* behaviour */
typedef struct {
gchar* load_finish_handler;
gchar* load_start_handler;
gchar* load_commit_handler;
gchar* status_format;
gchar* title_format_short;
Expand Down Expand Up @@ -237,6 +238,9 @@ progress_change_cb (WebKitWebView* page, gint progress, gpointer data);
static void
load_commit_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data);

static void
load_start_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data);

static void
load_finish_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data);

Expand Down

0 comments on commit c445d93

Please sign in to comment.