Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/402de7572d76686dd65a5ee71274a690a421cc8f
...commit
http://git.netsurf-browser.org/netsurf.git/commit/402de7572d76686dd65a5ee71274a690a421cc8f
...tree
http://git.netsurf-browser.org/netsurf.git/tree/402de7572d76686dd65a5ee71274a690a421cc8f
The branch, master has been updated
via 402de7572d76686dd65a5ee71274a690a421cc8f (commit)
from a548275fa238870075fc3c9a5076a731d3d11a9e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commitdiff/402de7572d76686dd65a5ee71274a690a421cc8f
commit 402de7572d76686dd65a5ee71274a690a421cc8f
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Use new content message for saving of hyperlink target URL.
diff --git a/content/content.h b/content/content.h
index 5ff40d0..f3a4438 100644
--- a/content/content.h
+++ b/content/content.h
@@ -75,7 +75,8 @@ typedef enum {
CONTENT_MSG_LINK, /**< RFC5988 link */
CONTENT_MSG_GETCTX, /**< Javascript context */
CONTENT_MSG_SCROLL, /**< Request to scroll content */
- CONTENT_MSG_DRAGSAVE /**< Allow drag saving of content */
+ CONTENT_MSG_DRAGSAVE, /**< Allow drag saving of content */
+ CONTENT_MSG_SAVELINK /**< Allow URL to be saved */
} content_msg;
/** RFC5988 metadata link */
@@ -139,6 +140,11 @@ union content_msg_data {
} type;
struct hlcache_handle *content;
} dragsave;
+ /** CONTENT_MSG_SAVELINK - Save a URL */
+ struct {
+ const char *url;
+ const char *title;
+ } savelink;
};
/** parameters to content redraw */
diff --git a/desktop/browser.c b/desktop/browser.c
index 17e3561..3c99c5f 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -1473,6 +1473,16 @@ nserror browser_window_callback(hlcache_handle *c,
}
break;
+ case CONTENT_MSG_SAVELINK:
+ {
+ /* Content wants a link to be saved */
+ struct browser_window *root = browser_window_get_root(bw);
+ gui_window_save_link(root->window,
+ event->data.savelink.url,
+ event->data.savelink.title);
+ }
+ break;
+
default:
assert(0);
}
diff --git a/render/html.c b/render/html.c
index 62b3d1d..7c7b797 100644
--- a/render/html.c
+++ b/render/html.c
@@ -1247,6 +1247,11 @@ html_object_callback(hlcache_handle *object,
content_broadcast(&c->base, CONTENT_MSG_DRAGSAVE, event->data);
break;
+ case CONTENT_MSG_SAVELINK:
+ /* Pass it on */
+ content_broadcast(&c->base, CONTENT_MSG_SAVELINK, event->data);
+ break;
+
default:
assert(0);
}
diff --git a/render/html_interaction.c b/render/html_interaction.c
index a74e99d..a3cfaa9 100644
--- a/render/html_interaction.c
+++ b/render/html_interaction.c
@@ -696,16 +696,19 @@ void html_mouse_action(struct content *c, struct
browser_window *bw,
mouse & BROWSER_MOUSE_MOD_1) {
/* force download of link */
browser_window_go_post(bw, nsurl_access(url), 0, 0,
- false,
nsurl_access(hlcache_handle_get_url(h)),
+ false,
+ nsurl_access(hlcache_handle_get_url(h)),
true, true, 0);
+
} else if (mouse & BROWSER_MOUSE_CLICK_2 &&
mouse & BROWSER_MOUSE_MOD_1) {
- gui_window_save_link(bw->window,
- nsurl_access(url), title);
+ msg_data.savelink.url = nsurl_access(url);
+ msg_data.savelink.title = title;
+ content_broadcast(c, CONTENT_MSG_SAVELINK, msg_data);
+
} else if (mouse & (BROWSER_MOUSE_CLICK_1 |
BROWSER_MOUSE_CLICK_2))
action = ACTION_GO;
-
} else {
bool done = false;
-----------------------------------------------------------------------
Summary of changes:
content/content.h | 8 +++++++-
desktop/browser.c | 10 ++++++++++
render/html.c | 5 +++++
render/html_interaction.c | 11 +++++++----
4 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/content/content.h b/content/content.h
index 5ff40d0..f3a4438 100644
--- a/content/content.h
+++ b/content/content.h
@@ -75,7 +75,8 @@ typedef enum {
CONTENT_MSG_LINK, /**< RFC5988 link */
CONTENT_MSG_GETCTX, /**< Javascript context */
CONTENT_MSG_SCROLL, /**< Request to scroll content */
- CONTENT_MSG_DRAGSAVE /**< Allow drag saving of content */
+ CONTENT_MSG_DRAGSAVE, /**< Allow drag saving of content */
+ CONTENT_MSG_SAVELINK /**< Allow URL to be saved */
} content_msg;
/** RFC5988 metadata link */
@@ -139,6 +140,11 @@ union content_msg_data {
} type;
struct hlcache_handle *content;
} dragsave;
+ /** CONTENT_MSG_SAVELINK - Save a URL */
+ struct {
+ const char *url;
+ const char *title;
+ } savelink;
};
/** parameters to content redraw */
diff --git a/desktop/browser.c b/desktop/browser.c
index 17e3561..3c99c5f 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -1473,6 +1473,16 @@ nserror browser_window_callback(hlcache_handle *c,
}
break;
+ case CONTENT_MSG_SAVELINK:
+ {
+ /* Content wants a link to be saved */
+ struct browser_window *root = browser_window_get_root(bw);
+ gui_window_save_link(root->window,
+ event->data.savelink.url,
+ event->data.savelink.title);
+ }
+ break;
+
default:
assert(0);
}
diff --git a/render/html.c b/render/html.c
index 62b3d1d..7c7b797 100644
--- a/render/html.c
+++ b/render/html.c
@@ -1247,6 +1247,11 @@ html_object_callback(hlcache_handle *object,
content_broadcast(&c->base, CONTENT_MSG_DRAGSAVE, event->data);
break;
+ case CONTENT_MSG_SAVELINK:
+ /* Pass it on */
+ content_broadcast(&c->base, CONTENT_MSG_SAVELINK, event->data);
+ break;
+
default:
assert(0);
}
diff --git a/render/html_interaction.c b/render/html_interaction.c
index a74e99d..a3cfaa9 100644
--- a/render/html_interaction.c
+++ b/render/html_interaction.c
@@ -696,16 +696,19 @@ void html_mouse_action(struct content *c, struct
browser_window *bw,
mouse & BROWSER_MOUSE_MOD_1) {
/* force download of link */
browser_window_go_post(bw, nsurl_access(url), 0, 0,
- false,
nsurl_access(hlcache_handle_get_url(h)),
+ false,
+ nsurl_access(hlcache_handle_get_url(h)),
true, true, 0);
+
} else if (mouse & BROWSER_MOUSE_CLICK_2 &&
mouse & BROWSER_MOUSE_MOD_1) {
- gui_window_save_link(bw->window,
- nsurl_access(url), title);
+ msg_data.savelink.url = nsurl_access(url);
+ msg_data.savelink.title = title;
+ content_broadcast(c, CONTENT_MSG_SAVELINK, msg_data);
+
} else if (mouse & (BROWSER_MOUSE_CLICK_1 |
BROWSER_MOUSE_CLICK_2))
action = ACTION_GO;
-
} else {
bool done = false;
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org