Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/f04845b2cf3aaa6b15dbaa2acaa20197075d3234
...commit
http://git.netsurf-browser.org/netsurf.git/commit/f04845b2cf3aaa6b15dbaa2acaa20197075d3234
...tree
http://git.netsurf-browser.org/netsurf.git/tree/f04845b2cf3aaa6b15dbaa2acaa20197075d3234
The branch, master has been updated
via f04845b2cf3aaa6b15dbaa2acaa20197075d3234 (commit)
via 1919c8e07168859cc6362c5283d47d0ced3a9bc2 (commit)
from 049d5097b8d625fc19f86cb9fb836de9a164b56b (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/f04845b2cf3aaa6b15dbaa2acaa20197075d3234
commit f04845b2cf3aaa6b15dbaa2acaa20197075d3234
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Broadcast message for drag save start and avoid messing inside bw.
diff --git a/render/html_interaction.c b/render/html_interaction.c
index 4cdff76..e013b54 100644
--- a/render/html_interaction.c
+++ b/render/html_interaction.c
@@ -526,12 +526,16 @@ void html_mouse_action(struct content *c, struct
browser_window *bw,
} else if (object && (mouse & BROWSER_MOUSE_MOD_2)) {
- if (mouse & BROWSER_MOUSE_DRAG_2)
- gui_drag_save_object(GUI_SAVE_OBJECT_NATIVE, object,
- bw->window);
- else if (mouse & BROWSER_MOUSE_DRAG_1)
- gui_drag_save_object(GUI_SAVE_OBJECT_ORIG, object,
- bw->window);
+ if (mouse & BROWSER_MOUSE_DRAG_2) {
+ msg_data.dragsave.type = CONTENT_SAVE_NATIVE;
+ msg_data.dragsave.content = object;
+ content_broadcast(c, CONTENT_MSG_DRAGSAVE, msg_data);
+
+ } else if (mouse & BROWSER_MOUSE_DRAG_1) {
+ msg_data.dragsave.type = CONTENT_SAVE_ORIG;
+ msg_data.dragsave.content = object;
+ content_broadcast(c, CONTENT_MSG_DRAGSAVE, msg_data);
+ }
/* \todo should have a drag-saving object msg */
status = content_get_status_message(h);
@@ -647,8 +651,12 @@ void html_mouse_action(struct content *c, struct
browser_window *bw,
if (mouse & BROWSER_MOUSE_DRAG_1) {
if (mouse & BROWSER_MOUSE_MOD_2) {
- gui_drag_save_object(GUI_SAVE_COMPLETE,
- h, bw->window);
+ msg_data.dragsave.type =
+ CONTENT_SAVE_COMPLETE;
+ msg_data.dragsave.content = h;
+ content_broadcast(c,
+ CONTENT_MSG_DRAGSAVE,
+ msg_data);
} else {
if (drag_candidate == NULL)
browser_window_page_drag_start(
@@ -663,8 +671,12 @@ void html_mouse_action(struct content *c, struct
browser_window *bw,
}
else if (mouse & BROWSER_MOUSE_DRAG_2) {
if (mouse & BROWSER_MOUSE_MOD_2) {
- gui_drag_save_object(GUI_SAVE_SOURCE,
- h, bw->window);
+ msg_data.dragsave.type =
+ CONTENT_SAVE_SOURCE;
+ msg_data.dragsave.content = h;
+ content_broadcast(c,
+ CONTENT_MSG_DRAGSAVE,
+ msg_data);
} else {
if (drag_candidate == NULL)
browser_window_page_drag_start(
commitdiff
http://git.netsurf-browser.org/netsurf.git/commitdiff/1919c8e07168859cc6362c5283d47d0ced3a9bc2
commit 1919c8e07168859cc6362c5283d47d0ced3a9bc2
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Add message for content wanting wanting drag save to start.
diff --git a/content/content.h b/content/content.h
index f1ff2a2..5ff40d0 100644
--- a/content/content.h
+++ b/content/content.h
@@ -74,7 +74,8 @@ typedef enum {
CONTENT_MSG_DOWNLOAD, /**< download, not for display */
CONTENT_MSG_LINK, /**< RFC5988 link */
CONTENT_MSG_GETCTX, /**< Javascript context */
- CONTENT_MSG_SCROLL /**< Request to scroll content */
+ CONTENT_MSG_SCROLL, /**< Request to scroll content */
+ CONTENT_MSG_DRAGSAVE /**< Allow drag saving of content */
} content_msg;
/** RFC5988 metadata link */
@@ -128,6 +129,16 @@ union content_msg_data {
int x0, y0;
int x1, y1;
} scroll;
+ /** CONTENT_MSG_DRAGSAVE - Drag save a content */
+ struct {
+ enum {
+ CONTENT_SAVE_ORIG,
+ CONTENT_SAVE_NATIVE,
+ CONTENT_SAVE_COMPLETE,
+ CONTENT_SAVE_SOURCE
+ } type;
+ struct hlcache_handle *content;
+ } dragsave;
};
/** parameters to content redraw */
diff --git a/desktop/browser.c b/desktop/browser.c
index 136557a..95edf1d 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -1440,6 +1440,36 @@ nserror browser_window_callback(hlcache_handle *c,
break;
+ case CONTENT_MSG_DRAGSAVE:
+ {
+ /* Content wants drag save of a content */
+ struct browser_window *root = browser_window_get_root(bw);
+
+ switch(event->data.dragsave.type) {
+ case CONTENT_SAVE_ORIG:
+ gui_drag_save_object(GUI_SAVE_OBJECT_ORIG,
+ event->data.dragsave.content,
+ root->window);
+ break;
+ case CONTENT_SAVE_NATIVE:
+ gui_drag_save_object(GUI_SAVE_OBJECT_NATIVE,
+ event->data.dragsave.content,
+ root->window);
+ break;
+ case CONTENT_SAVE_COMPLETE:
+ gui_drag_save_object(GUI_SAVE_COMPLETE,
+ event->data.dragsave.content,
+ root->window);
+ break;
+ case CONTENT_SAVE_SOURCE:
+ gui_drag_save_object(GUI_SAVE_SOURCE,
+ event->data.dragsave.content,
+ root->window);
+ break;
+ }
+ }
+ break;
+
default:
assert(0);
}
diff --git a/render/html.c b/render/html.c
index 22fa80f..62b3d1d 100644
--- a/render/html.c
+++ b/render/html.c
@@ -1242,6 +1242,11 @@ html_object_callback(hlcache_handle *object,
false);
break;
+ case CONTENT_MSG_DRAGSAVE:
+ /* Pass it on */
+ content_broadcast(&c->base, CONTENT_MSG_DRAGSAVE, event->data);
+ break;
+
default:
assert(0);
}
-----------------------------------------------------------------------
Summary of changes:
content/content.h | 13 ++++++++++++-
desktop/browser.c | 30 ++++++++++++++++++++++++++++++
render/html.c | 5 +++++
render/html_interaction.c | 32 ++++++++++++++++++++++----------
4 files changed, 69 insertions(+), 11 deletions(-)
diff --git a/content/content.h b/content/content.h
index f1ff2a2..5ff40d0 100644
--- a/content/content.h
+++ b/content/content.h
@@ -74,7 +74,8 @@ typedef enum {
CONTENT_MSG_DOWNLOAD, /**< download, not for display */
CONTENT_MSG_LINK, /**< RFC5988 link */
CONTENT_MSG_GETCTX, /**< Javascript context */
- CONTENT_MSG_SCROLL /**< Request to scroll content */
+ CONTENT_MSG_SCROLL, /**< Request to scroll content */
+ CONTENT_MSG_DRAGSAVE /**< Allow drag saving of content */
} content_msg;
/** RFC5988 metadata link */
@@ -128,6 +129,16 @@ union content_msg_data {
int x0, y0;
int x1, y1;
} scroll;
+ /** CONTENT_MSG_DRAGSAVE - Drag save a content */
+ struct {
+ enum {
+ CONTENT_SAVE_ORIG,
+ CONTENT_SAVE_NATIVE,
+ CONTENT_SAVE_COMPLETE,
+ CONTENT_SAVE_SOURCE
+ } type;
+ struct hlcache_handle *content;
+ } dragsave;
};
/** parameters to content redraw */
diff --git a/desktop/browser.c b/desktop/browser.c
index 136557a..95edf1d 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -1440,6 +1440,36 @@ nserror browser_window_callback(hlcache_handle *c,
break;
+ case CONTENT_MSG_DRAGSAVE:
+ {
+ /* Content wants drag save of a content */
+ struct browser_window *root = browser_window_get_root(bw);
+
+ switch(event->data.dragsave.type) {
+ case CONTENT_SAVE_ORIG:
+ gui_drag_save_object(GUI_SAVE_OBJECT_ORIG,
+ event->data.dragsave.content,
+ root->window);
+ break;
+ case CONTENT_SAVE_NATIVE:
+ gui_drag_save_object(GUI_SAVE_OBJECT_NATIVE,
+ event->data.dragsave.content,
+ root->window);
+ break;
+ case CONTENT_SAVE_COMPLETE:
+ gui_drag_save_object(GUI_SAVE_COMPLETE,
+ event->data.dragsave.content,
+ root->window);
+ break;
+ case CONTENT_SAVE_SOURCE:
+ gui_drag_save_object(GUI_SAVE_SOURCE,
+ event->data.dragsave.content,
+ root->window);
+ break;
+ }
+ }
+ break;
+
default:
assert(0);
}
diff --git a/render/html.c b/render/html.c
index 22fa80f..62b3d1d 100644
--- a/render/html.c
+++ b/render/html.c
@@ -1242,6 +1242,11 @@ html_object_callback(hlcache_handle *object,
false);
break;
+ case CONTENT_MSG_DRAGSAVE:
+ /* Pass it on */
+ content_broadcast(&c->base, CONTENT_MSG_DRAGSAVE, event->data);
+ break;
+
default:
assert(0);
}
diff --git a/render/html_interaction.c b/render/html_interaction.c
index 4cdff76..e013b54 100644
--- a/render/html_interaction.c
+++ b/render/html_interaction.c
@@ -526,12 +526,16 @@ void html_mouse_action(struct content *c, struct
browser_window *bw,
} else if (object && (mouse & BROWSER_MOUSE_MOD_2)) {
- if (mouse & BROWSER_MOUSE_DRAG_2)
- gui_drag_save_object(GUI_SAVE_OBJECT_NATIVE, object,
- bw->window);
- else if (mouse & BROWSER_MOUSE_DRAG_1)
- gui_drag_save_object(GUI_SAVE_OBJECT_ORIG, object,
- bw->window);
+ if (mouse & BROWSER_MOUSE_DRAG_2) {
+ msg_data.dragsave.type = CONTENT_SAVE_NATIVE;
+ msg_data.dragsave.content = object;
+ content_broadcast(c, CONTENT_MSG_DRAGSAVE, msg_data);
+
+ } else if (mouse & BROWSER_MOUSE_DRAG_1) {
+ msg_data.dragsave.type = CONTENT_SAVE_ORIG;
+ msg_data.dragsave.content = object;
+ content_broadcast(c, CONTENT_MSG_DRAGSAVE, msg_data);
+ }
/* \todo should have a drag-saving object msg */
status = content_get_status_message(h);
@@ -647,8 +651,12 @@ void html_mouse_action(struct content *c, struct
browser_window *bw,
if (mouse & BROWSER_MOUSE_DRAG_1) {
if (mouse & BROWSER_MOUSE_MOD_2) {
- gui_drag_save_object(GUI_SAVE_COMPLETE,
- h, bw->window);
+ msg_data.dragsave.type =
+ CONTENT_SAVE_COMPLETE;
+ msg_data.dragsave.content = h;
+ content_broadcast(c,
+ CONTENT_MSG_DRAGSAVE,
+ msg_data);
} else {
if (drag_candidate == NULL)
browser_window_page_drag_start(
@@ -663,8 +671,12 @@ void html_mouse_action(struct content *c, struct
browser_window *bw,
}
else if (mouse & BROWSER_MOUSE_DRAG_2) {
if (mouse & BROWSER_MOUSE_MOD_2) {
- gui_drag_save_object(GUI_SAVE_SOURCE,
- h, bw->window);
+ msg_data.dragsave.type =
+ CONTENT_SAVE_SOURCE;
+ msg_data.dragsave.content = h;
+ content_broadcast(c,
+ CONTENT_MSG_DRAGSAVE,
+ msg_data);
} else {
if (drag_candidate == NULL)
browser_window_page_drag_start(
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org