mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 12:12:35 +03:00
Add message for content wanting wanting drag save to start.
This commit is contained in:
parent
049d5097b8
commit
1919c8e071
@ -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 */
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user